/* Files Portal — shadcn/ui (zinc) design tokens and components in plain CSS. */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;
  --background: oklch(0.985 0.002 286);
  --foreground: oklch(0.141 0.005 285.823);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.141 0.005 285.823);
  --primary: oklch(0.21 0.006 285.885);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.967 0.001 286.375);
  --secondary-foreground: oklch(0.21 0.006 285.885);
  --muted: oklch(0.967 0.001 286.375);
  --muted-foreground: oklch(0.552 0.016 285.938);
  --accent: oklch(0.967 0.001 286.375);
  --accent-foreground: oklch(0.21 0.006 285.885);
  --destructive: oklch(0.577 0.245 27.325);
  --success: oklch(0.6 0.15 155);
  --warning: oklch(0.62 0.14 70);
  --border: oklch(0.92 0.004 286.32);
  --input: oklch(0.92 0.004 286.32);
  --ring: oklch(0.705 0.015 286.067);
  --brand: oklch(0.58 0.2 262);
  --brand-soft: oklch(0.58 0.2 262 / 0.1);
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.05);
  --shadow-md: 0 1px 3px oklch(0 0 0 / 0.06), 0 8px 24px -8px oklch(0 0 0 / 0.1);
  --shadow-lg: 0 2px 6px oklch(0 0 0 / 0.05), 0 24px 64px -16px oklch(0 0 0 / 0.2);
  --overlay: oklch(0.985 0.002 286 / 0.72);

  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Gemeente Utrecht status colours: Rood, Geel, Groen. */
  --status-negative: #cc0000;
  --status-neutral: #ffcc00;
  --status-positive: #32ab27;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease-spring-soft: cubic-bezier(0.34, 1.2, 0.64, 1);
}

@supports (animation-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121,
      1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%,
      0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);
    --ease-spring-soft: linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%, 0.849 31.5%,
      0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.9%, 1);
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: oklch(0.141 0.005 285.823);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.175 0.006 285.885);
    --card-foreground: oklch(0.985 0 0);
    --primary: oklch(0.92 0.004 286.32);
    --primary-foreground: oklch(0.21 0.006 285.885);
    --secondary: oklch(0.274 0.006 286.033);
    --secondary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.274 0.006 286.033);
    --muted-foreground: oklch(0.705 0.015 286.067);
    --accent: oklch(0.274 0.006 286.033);
    --accent-foreground: oklch(0.985 0 0);
    --destructive: oklch(0.704 0.191 22.216);
    --success: oklch(0.72 0.15 155);
    --warning: oklch(0.82 0.15 85);
    --border: oklch(1 0 0 / 10%);
    --input: oklch(1 0 0 / 15%);
    --ring: oklch(0.552 0.016 285.938);
    --brand: oklch(0.7 0.16 262);
    --brand-soft: oklch(0.7 0.16 262 / 0.14);
    --shadow-md: 0 1px 3px oklch(0 0 0 / 0.3), 0 8px 24px -8px oklch(0 0 0 / 0.5);
    --shadow-lg: 0 2px 6px oklch(0 0 0 / 0.3), 0 24px 64px -16px oklch(0 0 0 / 0.7);
    --overlay: oklch(0.141 0.005 285.823 / 0.72);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: oklch(0.141 0.005 285.823);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.175 0.006 285.885);
  --card-foreground: oklch(0.985 0 0);
  --primary: oklch(0.92 0.004 286.32);
  --primary-foreground: oklch(0.21 0.006 285.885);
  --secondary: oklch(0.274 0.006 286.033);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.274 0.006 286.033);
  --muted-foreground: oklch(0.705 0.015 286.067);
  --accent: oklch(0.274 0.006 286.033);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --success: oklch(0.72 0.15 155);
  --warning: oklch(0.82 0.15 85);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.552 0.016 285.938);
  --brand: oklch(0.7 0.16 262);
  --brand-soft: oklch(0.7 0.16 262 / 0.14);
  --shadow-md: 0 1px 3px oklch(0 0 0 / 0.3), 0 8px 24px -8px oklch(0 0 0 / 0.5);
  --shadow-lg: 0 2px 6px oklch(0 0 0 / 0.3), 0 24px 64px -16px oklch(0 0 0 / 0.7);
  --overlay: oklch(0.141 0.005 285.823 / 0.72);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}
h1, h2, p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
.inline-form { display: contents; }
::selection { background: var(--brand-soft); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1rem; height: 1rem; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.tabular { font-variant-numeric: tabular-nums; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Entrance: elements with .reveal rise in, staggered by --i. */
.reveal {
  animation: reveal 0.7s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 70ms + 40ms);
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(10px) scale(0.99); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* Theme switch uses a circular View Transition driven from ui.js. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 2.25rem; padding: 0 1rem;
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500; white-space: nowrap;
  text-decoration: none; cursor: pointer; user-select: none;
  outline: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s,
    transform 0.25s var(--ease-spring), opacity 0.15s;
}
.btn:focus-visible { box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); border-color: var(--ring); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: color-mix(in oklch, var(--primary) 90%, var(--background)); }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover:not(:disabled) { background: var(--accent); color: var(--accent-foreground); }
.btn-outline { background: var(--card); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-outline:hover:not(:disabled) { background: var(--accent); }
.btn-destructive { background: var(--status-negative); color: #ffffff; box-shadow: var(--shadow-sm); }
.btn-destructive:hover:not(:disabled) { background: color-mix(in oklch, var(--status-negative) 88%, #000000); }
.btn-sm { height: 2rem; padding: 0 0.75rem; gap: 0.375rem; }
.btn-lg { height: 2.5rem; padding: 0 1.5rem; }
.btn-icon { width: 2.25rem; padding: 0; }
.btn-block { width: 100%; }

/* Buttons with an idle/busy state crossfade. */
.btn-state {
  display: inline-flex; align-items: center; gap: 0.5rem;
  transition: opacity 0.2s, transform 0.35s var(--ease-spring), filter 0.2s;
}
.btn-state[data-state="busy"] { position: absolute; inset: 0; justify-content: center; opacity: 0; transform: translateY(8px); filter: blur(2px); pointer-events: none; }
.btn.is-busy .btn-state[data-state="idle"] { opacity: 0; transform: translateY(-8px); filter: blur(2px); }
.btn.is-busy .btn-state[data-state="busy"] { opacity: 1; transform: none; filter: none; }
.nudge { transition: transform 0.35s var(--ease-spring); }
.btn:hover .nudge { transform: translateX(3px); }

/* ---------- Inputs ---------- */

.input {
  width: 100%; height: 2.25rem; padding: 0 0.75rem;
  background: transparent; border: 1px solid var(--input); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); font-size: 0.875rem; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
:root[data-theme="dark"] .input { background: oklch(1 0 0 / 0.04); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .input { background: oklch(1 0 0 / 0.04); } }
.input::placeholder { color: var(--muted-foreground); }
.input:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }
.input[aria-invalid="true"] { border-color: var(--destructive); box-shadow: 0 0 0 3px color-mix(in oklch, var(--destructive) 20%, transparent); }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.field { display: grid; gap: 0.5rem; }
.field label { font-size: 0.875rem; font-weight: 500; }
.input-group { position: relative; }
.input-group > .icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  color: var(--muted-foreground); pointer-events: none; transition: color 0.15s;
}
.input-group:focus-within > .icon { color: var(--foreground); }
.input-group .input { padding-left: 2.25rem; }
.input-group .input:has(+ .input-action) { padding-right: 2.5rem; }
.input-action {
  position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--muted-foreground); cursor: pointer; outline: none;
}
.input-action:hover { color: var(--foreground); background: var(--accent); }
.input-action:focus-visible { box-shadow: 0 0 0 2px var(--ring); }
.input-action .icon { grid-area: 1 / 1; transition: opacity 0.2s, transform 0.3s var(--ease-spring); }
.input-action .pw-hide { opacity: 0; transform: scale(0.5) rotate(-45deg); }
.input-action[aria-pressed="true"] .pw-show { opacity: 0; transform: scale(0.5) rotate(45deg); }
.input-action[aria-pressed="true"] .pw-hide { opacity: 1; transform: none; }

/* ---------- Card / alert ---------- */

.card {
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
}
.card-header h2 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.card-description { color: var(--muted-foreground); font-size: 0.875rem; }

.alert {
  display: flex; align-items: flex-start; gap: 0.625rem;
  padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
  font-size: 0.875rem;
}
.alert .icon { margin-top: 0.125rem; }
.alert-error { color: var(--destructive); border-color: color-mix(in oklch, var(--destructive) 30%, transparent); background: color-mix(in oklch, var(--destructive) 6%, transparent); }
.alert-success { color: var(--success); }
.alert-warning { color: var(--warning); border-color: color-mix(in oklch, var(--warning) 35%, transparent); background: color-mix(in oklch, var(--warning) 8%, transparent); }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in oklch, var(--background) 75%, transparent);
  backdrop-filter: saturate(1.8) blur(12px);
  -webkit-backdrop-filter: saturate(1.8) blur(12px);
  border-bottom: 1px solid var(--border);
  animation: fade-down 0.6s var(--ease-out) both;
}
@keyframes fade-down { from { opacity: 0; transform: translateY(-100%); } }
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 48rem; height: 3.5rem; margin: 0 auto; padding: 0 1.25rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.625rem; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem;
  border-radius: var(--radius-md); background: var(--primary); color: var(--primary-foreground);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.15), var(--shadow-sm);
}
.brand-mark .icon { width: 1rem; height: 1rem; }
.brand:hover .brand-mark .icon { animation: bob 0.6s var(--ease-spring); }
@keyframes bob { 40% { transform: translateY(-3px); } }
.brand-mark-lg { width: 2.75rem; height: 2.75rem; border-radius: var(--radius-lg); }
.brand-mark-lg .icon { width: 1.375rem; height: 1.375rem; }
.topbar-actions { display: flex; align-items: center; gap: 0.25rem; }
.separator { width: 1px; height: 1.25rem; margin: 0 0.375rem; background: var(--border); }
.user-chip {
  display: inline-flex; align-items: center; gap: 0.5rem; height: 2.25rem; padding: 0 0.5rem;
  border-radius: var(--radius-md); font-weight: 500; text-decoration: none; color: inherit;
  transition: background-color 0.15s, box-shadow 0.15s;
}
a.user-chip:hover { background: var(--accent); }
a.user-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }
.user-chip-key { width: 0; opacity: 0; margin-left: -0.5rem; color: var(--muted-foreground); transform: rotate(-45deg) scale(0.6); transition: width 0.3s var(--ease-out), margin 0.3s var(--ease-out), opacity 0.2s, transform 0.45s var(--ease-spring); }
a.user-chip:hover .user-chip-key, a.user-chip:focus-visible .user-chip-key { width: 1rem; opacity: 1; margin-left: 0; transform: none; }
.avatar {
  display: grid; place-items: center; width: 1.625rem; height: 1.625rem; border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), color-mix(in oklch, var(--brand) 40%, oklch(0.7 0.18 320)));
  color: white; font-size: 0.75rem; font-weight: 600;
}

.theme-toggle .icon { position: absolute; transition: transform 0.5s var(--ease-spring), opacity 0.25s; }
.theme-toggle .theme-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
:root[data-theme="dark"] .theme-toggle .theme-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
:root[data-theme="dark"] .theme-toggle .theme-moon { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .theme-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
  :root:not([data-theme="light"]) .theme-toggle .theme-moon { opacity: 1; transform: none; }
}

/* ---------- Page ---------- */

.page-app {
  background:
    radial-gradient(60rem 30rem at 50% -10rem, var(--brand-soft), transparent 70%),
    var(--background);
  background-repeat: no-repeat;
}
.container {
  max-width: 48rem; margin: 0 auto;
  padding: 2.5rem 1.25rem calc(4rem + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 1.25rem;
}
.page-head { padding: 0 0.25rem 0.5rem; }
.page-head h1 { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; }
.page-head p { margin-top: 0.375rem; color: var(--muted-foreground); font-size: 0.9375rem; }

/* ---------- Drop zone ---------- */

.upload-card { padding: 0.5rem; }
.dropzone {
  --x: 50%; --y: 50%;
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  min-height: 15rem; padding: 2rem 1.5rem; text-align: center;
  border-radius: calc(var(--radius-xl) - 0.25rem);
  background: var(--muted);
  background: color-mix(in oklch, var(--muted) 55%, transparent);
  cursor: pointer;
  transition: background-color 0.3s, transform 0.5s var(--ease-spring-soft);
}
/* Dashed border drawn with SVG so the dashes can march while dragging. */
.dropzone::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect width='100%25' height='100%25' rx='10' fill='none' stroke='%2371717a' stroke-opacity='.5' stroke-width='3' stroke-dasharray='7 7'/%3E%3C/svg%3E");
  transition: opacity 0.3s;
}
.dropzone::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  border: 1.5px solid var(--brand); opacity: 0;
  box-shadow: inset 0 0 0 4px var(--brand-soft);
  transition: opacity 0.3s;
}
.dz-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(18rem circle at var(--x) var(--y), var(--brand-soft), transparent 70%);
  transition: opacity 0.4s;
}
.dropzone:hover .dz-glow, .dropzone.is-over .dz-glow { opacity: 1; }
.dropzone:hover { background: color-mix(in oklch, var(--muted) 85%, transparent); }
.dropzone:focus-within:has(:focus-visible)::after { opacity: 1; border-color: var(--ring); box-shadow: inset 0 0 0 4px color-mix(in oklch, var(--ring) 25%, transparent); }
.dropzone.is-over { background: var(--brand-soft); transform: scale(1.01); }
.dropzone.is-over::before { opacity: 0; }
.dropzone.is-over::after { opacity: 1; }
.dropzone.is-busy { pointer-events: none; }
.dropzone.is-busy > :not(.dz-glow) { opacity: 0.55; transition: opacity 0.3s; }

.dz-visual {
  --tx: 0px; --ty: 0px;
  position: relative; display: grid; place-items: center;
  width: 4rem; height: 4rem; margin-bottom: 0.875rem;
  transform: translate(var(--tx), var(--ty));
  transition: transform 0.6s var(--ease-spring-soft);
}
.dz-sheet {
  position: absolute; width: 2.5rem; height: 3.125rem;
  border-radius: 0.375rem; border: 1px solid var(--border);
  background: var(--card); box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(8px) scale(0.8);
  transition: transform 0.6s var(--ease-spring), opacity 0.3s;
}
.dz-sheet::before, .dz-sheet::after {
  content: ""; position: absolute; left: 0.4rem; right: 0.4rem; height: 0.2rem; border-radius: 1rem;
  background: var(--border);
}
.dz-sheet::before { top: 0.6rem; right: 1rem; }
.dz-sheet::after { top: 1.1rem; }
.dz-icon {
  position: relative; display: grid; place-items: center;
  width: 3.5rem; height: 3.5rem; border-radius: 1rem;
  background: var(--card); color: var(--foreground);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md), inset 0 1px 0 oklch(1 0 0 / 0.08);
  transition: transform 0.6s var(--ease-spring), background-color 0.3s, color 0.3s, border-color 0.3s;
}
.dz-icon .icon { grid-area: 1 / 1; width: 1.5rem; height: 1.5rem; transition: transform 0.5s var(--ease-spring), opacity 0.25s; }
.dz-icon-check { opacity: 0; transform: scale(0.3); }
.dropzone:hover .dz-icon { transform: translateY(-4px); }
.dropzone:hover .dz-icon-upload { animation: lift 1.2s var(--ease-in-out) infinite; }
@keyframes lift { 50% { transform: translateY(-3px); } }

.dz-title { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; transition: transform 0.4s var(--ease-spring); }
.dz-sub { color: var(--muted-foreground); font-size: 0.875rem; }
.dz-link { color: var(--foreground); font-weight: 500; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.dropzone:hover .dz-link { text-decoration-color: currentColor; }

/* Fanned "paper" sheets appear behind the icon while files hover. */
.is-dragging .dz-sheet, .dropzone.is-over .dz-sheet { opacity: 1; }
.is-dragging .dz-sheet:nth-child(1) { transform: translate(-1.4rem, -0.4rem) rotate(-14deg); }
.is-dragging .dz-sheet:nth-child(2) { transform: translate(0, -1.2rem) rotate(0deg); transition-delay: 40ms; }
.is-dragging .dz-sheet:nth-child(3) { transform: translate(1.4rem, -0.4rem) rotate(14deg); transition-delay: 80ms; }
.is-dragging .dz-icon { transform: translateY(0.9rem) scale(1.04); background: var(--primary); color: var(--primary-foreground); border-color: transparent; }
.is-dragging .dropzone .dz-icon-upload { animation: arrow-bounce 0.9s var(--ease-in-out) infinite; }
@keyframes arrow-bounce { 50% { transform: translateY(-4px); } }

.dropzone.is-success .dz-icon { background: var(--success); color: white; border-color: transparent; transform: scale(1.06); }
.dropzone.is-success .dz-icon-upload { opacity: 0; transform: scale(0.3); }
.dropzone.is-success .dz-icon-check { opacity: 1; transform: none; }

/* ---------- Full-page drop overlay ---------- */

.drop-overlay {
  --x: 50%; --y: 50%;
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) 1rem max(1rem, env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(28rem circle at var(--x) var(--y), var(--brand-soft), transparent 70%),
    var(--overlay);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.3s var(--ease-out), visibility 0s linear 0.3s;
}
.is-dragging .drop-overlay { opacity: 1; visibility: visible; transition: opacity 0.25s var(--ease-out), visibility 0s; }
.drop-frame {
  position: absolute; inset: 1rem; border-radius: 1.25rem;
  border: 2px dashed color-mix(in oklch, var(--brand) 55%, transparent);
  transform: scale(1.03); opacity: 0;
  transition: transform 0.5s var(--ease-spring-soft), opacity 0.3s;
}
.is-dragging .drop-frame { transform: none; opacity: 1; }
.drop-content {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transform: translateY(12px) scale(0.94); opacity: 0;
  transition: transform 0.55s var(--ease-spring), opacity 0.25s;
}
.is-dragging .drop-content { transform: none; opacity: 1; }
.dz-visual-lg { width: 7rem; height: 7rem; margin-bottom: 1.5rem; }
.dz-visual-lg .dz-sheet { width: 4rem; height: 5rem; border-radius: 0.5rem; }
.dz-visual-lg .dz-sheet::before { top: 0.9rem; right: 1.6rem; left: 0.6rem; height: 0.3rem; }
.dz-visual-lg .dz-sheet::after { top: 1.7rem; left: 0.6rem; right: 0.6rem; height: 0.3rem; }
.is-dragging .dz-visual-lg .dz-sheet:nth-child(1) { transform: translate(-2.4rem, -0.6rem) rotate(-16deg); }
.is-dragging .dz-visual-lg .dz-sheet:nth-child(2) { transform: translate(0, -2rem); }
.is-dragging .dz-visual-lg .dz-sheet:nth-child(3) { transform: translate(2.4rem, -0.6rem) rotate(16deg); }
.dz-visual-lg .dz-icon { width: 4.5rem; height: 4.5rem; border-radius: 1.25rem; }
.dz-visual-lg .dz-icon .icon { width: 2rem; height: 2rem; }
.is-dragging .dz-visual-lg .dz-icon { transform: translateY(1.4rem); box-shadow: var(--shadow-lg); }
.drop-arrow { transform: rotate(90deg); }
.is-dragging .drop-arrow { animation: drop-arrow 1s var(--ease-in-out) infinite; }
@keyframes drop-arrow { 0%, 100% { transform: rotate(90deg) translateX(-2px); } 50% { transform: rotate(90deg) translateX(4px); } }
.drop-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; }
.drop-sub { margin-top: 0.25rem; color: var(--muted-foreground); }
.drop-count { display: inline-block; min-width: 1ch; }
.drop-count.bump { animation: bump 0.4s var(--ease-spring); }
@keyframes bump { 40% { transform: scale(1.25); } }

/* The overlay absorbs into the page on drop. */
.drop-overlay.is-dropped { opacity: 0; visibility: visible; transition: opacity 0.45s var(--ease-out); }
.drop-overlay.is-dropped .drop-content { opacity: 0; transform: translateY(40px) scale(0.6); transition: transform 0.45s var(--ease-in-out), opacity 0.35s; }
.drop-overlay.is-dropped .drop-frame { opacity: 0; transform: scale(0.97); }

/* ---------- Queue ---------- */

.queue-wrap { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.45s var(--ease-out); }
.queue-wrap.is-collapsed { grid-template-rows: 0fr; }
.queue-inner { min-height: 0; overflow: hidden; }
.queue-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.875rem 0.75rem 0.375rem;
}
.queue-summary { color: var(--muted-foreground); font-size: 0.8125rem; font-weight: 500; }
.queue-summary strong { color: var(--foreground); font-weight: 600; }
.queue {
  list-style: none; margin: 0; padding: 0 0.25rem 0.25rem;
  max-height: 20rem; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.q-item {
  --p: 0;
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.5rem; border-radius: var(--radius-lg);
  transition: background-color 0.15s;
}
.q-item:hover { background: var(--muted); background: color-mix(in oklch, var(--muted) 70%, transparent); }
.q-item::after {
  content: ""; position: absolute; left: 0.5rem; right: 0.5rem; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--brand); transform-origin: left; transform: scaleX(var(--p)); opacity: 0;
  transition: opacity 0.3s, background-color 0.3s;
}
.is-uploading .q-item::after { opacity: 1; }
.q-item.is-done::after { background: var(--success); opacity: 0; transition-delay: 0.4s; }
.q-main { flex: 1; min-width: 0; display: grid; }
.q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.q-meta { color: var(--muted-foreground); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.q-side { position: relative; display: grid; place-items: center; width: 2rem; height: 2rem; flex-shrink: 0; }
.q-side > * { grid-area: 1 / 1; transition: opacity 0.25s, transform 0.4s var(--ease-spring); }
.q-remove { width: 2rem; height: 2rem; color: var(--muted-foreground); }
.q-remove:hover:not(:disabled) { color: var(--destructive); }
.q-pct { font-size: 0.6875rem; font-weight: 500; font-family: var(--font-mono); color: var(--muted-foreground); opacity: 0; transform: scale(0.6); }
.q-check {
  display: grid; place-items: center; width: 1.375rem; height: 1.375rem; border-radius: 999px;
  background: var(--success); color: white; opacity: 0; transform: scale(0.3) rotate(-45deg);
}
.q-check .icon { width: 0.875rem; height: 0.875rem; stroke-width: 3; }
.is-uploading .q-remove { opacity: 0; transform: scale(0.6); pointer-events: none; }
.is-uploading .q-item:not(.is-done) .q-pct { opacity: 1; transform: none; }
.q-item.is-done .q-check { opacity: 1; transform: none; }

.q-enter { animation: q-enter 0.55s var(--ease-spring-soft) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes q-enter {
  from { opacity: 0; transform: translateY(-14px) scale(0.96); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* File-type icon tiles (shared by queue and list). */
.file-icon {
  --tint: var(--muted-foreground);
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem; flex-shrink: 0;
  border-radius: var(--radius-md);
  color: var(--tint);
  background: color-mix(in oklch, var(--tint) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--tint) 18%, transparent);
}
.file-icon .icon { width: 1.125rem; height: 1.125rem; }
.file-icon[data-kind="image"] { --tint: oklch(0.6 0.19 300); }
.file-icon[data-kind="video"] { --tint: oklch(0.62 0.2 350); }
.file-icon[data-kind="audio"] { --tint: oklch(0.68 0.16 60); }
.file-icon[data-kind="archive"] { --tint: oklch(0.66 0.17 40); }
.file-icon[data-kind="sheet"] { --tint: oklch(0.6 0.15 150); }
.file-icon[data-kind="doc"] { --tint: oklch(0.58 0.18 262); }
.file-icon[data-kind="code"] { --tint: oklch(0.62 0.12 220); }

/* ---------- Upload footer ---------- */

.upload-footer {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 0.5rem 0.25rem 0.75rem;
}
.upload-status { flex: 1; min-width: 0; display: grid; gap: 0.5rem; }
.status-text { color: var(--muted-foreground); font-size: 0.8125rem; font-variant-numeric: tabular-nums; min-height: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-text.is-error { color: var(--destructive); }
.status-text.swap { animation: swap 0.35s var(--ease-out); }
@keyframes swap { from { opacity: 0; transform: translateY(4px); } }
.progress { position: relative; height: 0.375rem; border-radius: 999px; background: var(--muted); overflow: hidden; animation: reveal 0.4s var(--ease-out) both; }
.progress-bar {
  position: absolute; inset: 0; border-radius: inherit;
  background: var(--brand);
  transform-origin: left; transform: scaleX(0);
  transition: transform 0.25s var(--ease-out), background-color 0.3s;
}
.progress-bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, oklch(1 0 0 / 0.45), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s var(--ease-in-out) infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.progress.is-done .progress-bar { background: var(--success); }
.progress.is-done .progress-bar::after { animation: none; }
.btn-upload { min-width: 7.5rem; }
.btn-upload.is-busy, .btn-upload.is-busy:hover:not(:disabled) { background: var(--secondary); color: var(--secondary-foreground); box-shadow: inset 0 0 0 1px var(--border); }
.btn-upload.is-busy:hover:not(:disabled) { color: var(--destructive); }

/* ---------- File list ---------- */

.files-card { overflow: hidden; }
.files-card .card-header { border-bottom: 1px solid var(--border); }
.search { position: relative; width: 14rem; max-width: 100%; }
.search > .icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.search .input { padding-left: 2.25rem; height: 2rem; }
.file-list { list-style: none; margin: 0; padding: 0.375rem; }
.file-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.5rem 0.625rem; border-radius: var(--radius-lg);
  transition: background-color 0.15s;
  animation: reveal 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 35ms + 180ms);
}
.file-row:hover { background: var(--muted); background: color-mix(in oklch, var(--muted) 70%, transparent); }
.file-main { flex: 1; min-width: 0; display: grid; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-meta { display: flex; align-items: center; gap: 0.375rem; color: var(--muted-foreground); font-size: 0.75rem; }
.dot { width: 3px; height: 3px; border-radius: 999px; background: currentColor; opacity: 0.6; }
.file-download { color: var(--muted-foreground); opacity: 0.6; transition: opacity 0.2s, color 0.15s, background-color 0.15s, transform 0.3s var(--ease-spring); }
.file-row:hover .file-download, .file-download:focus-visible { opacity: 1; color: var(--foreground); }
.file-download:hover .icon { animation: dl 0.5s var(--ease-spring); }
@keyframes dl { 40% { transform: translateY(2px); } }
.file-row.is-new { animation: row-new 1.6s var(--ease-out) both; }
@keyframes row-new {
  0% { opacity: 0; transform: translateY(-8px) scale(0.98); background: var(--brand-soft); }
  25% { opacity: 1; transform: none; background: var(--brand-soft); }
  100% { background: transparent; }
}
.list-swap { animation: reveal 0.35s var(--ease-out) both; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 3rem 1.5rem; }
.empty-icon {
  display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: 0.875rem;
  border-radius: var(--radius-xl); border: 1px solid var(--border); background: var(--card);
  color: var(--muted-foreground); box-shadow: var(--shadow-md);
  animation: float 4s var(--ease-in-out) infinite;
}
.empty-icon .icon { width: 1.25rem; height: 1.25rem; }
@keyframes float { 50% { transform: translateY(-4px); } }
.empty-title { font-weight: 600; }
.empty-text { color: var(--muted-foreground); font-size: 0.875rem; }

/* ---------- Toasts (Sonner-style) ---------- */

.toaster {
  position: fixed; z-index: 60; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column-reverse; gap: 0.5rem;
  width: min(22rem, calc(100vw - 2rem)); pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 0.625rem;
  padding: 0.875rem 1rem; border-radius: var(--radius-lg);
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: 0.875rem; pointer-events: auto;
  animation: toast-in 0.5s var(--ease-spring-soft) both;
}
.toast .icon { margin-top: 0.125rem; }
.toast-success .icon { color: var(--success); }
.toast-error .icon { color: var(--destructive); }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 500; }
.toast-desc { color: var(--muted-foreground); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast.is-leaving { animation: toast-out 0.3s var(--ease-in-out) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px) scale(0.98); } }

/* ---------- Login ---------- */

.page-login { display: grid; place-items: center; overflow-x: hidden; }
.login-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.login-grid {
  position: absolute; inset: -1px;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, black 20%, transparent 75%);
  animation: grid-pan 30s linear infinite;
}
@keyframes grid-pan { to { background-position: 44px 44px; } }
.blob { position: absolute; width: 34rem; height: 34rem; border-radius: 999px; filter: blur(90px); opacity: 0.35; }
.blob-a { background: var(--brand); top: -14rem; left: 50%; margin-left: -26rem; animation: drift-a 18s var(--ease-in-out) infinite alternate; }
.blob-b { background: oklch(0.7 0.18 320); bottom: -18rem; left: 50%; margin-left: -4rem; opacity: 0.22; animation: drift-b 22s var(--ease-in-out) infinite alternate; }
@keyframes drift-a { to { transform: translate(8rem, 4rem) scale(1.1); } }
@keyframes drift-b { to { transform: translate(-10rem, -3rem) scale(0.9); } }
.login-corner { position: fixed; z-index: 2; top: calc(1rem + env(safe-area-inset-top, 0px)); right: 1rem; }
.login-main { position: relative; z-index: 1; width: 100%; max-width: 24rem; padding: 2rem 1rem; }
.login-card {
  padding: 2rem 1.75rem 1.75rem; display: grid; gap: 1.5rem;
  box-shadow: var(--shadow-lg);
  background: color-mix(in oklch, var(--card) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  animation: card-in 0.8s var(--ease-spring-soft) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.login-card.shake { animation: card-in 0.8s var(--ease-spring-soft) both, shake 0.5s var(--ease-out) 0.25s; }
@keyframes shake { 15%, 55% { transform: translateX(-6px); } 35%, 75% { transform: translateX(6px); } }
.login-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.25rem; }
.login-head .brand-mark { margin-bottom: 0.75rem; }
.login-head h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; }
.login-head p { color: var(--muted-foreground); }
.login-form { display: grid; gap: 1rem; }
.login-form .btn { margin-top: 0.5rem; }

/* ---------- Account ---------- */

.container-narrow { max-width: 32rem; }
.container-account { max-width: 40rem; }
.back-link {
  display: inline-flex; align-items: center; gap: 0.375rem; margin-bottom: 0.75rem;
  color: var(--muted-foreground); font-size: 0.875rem; font-weight: 500; text-decoration: none; transition: color 0.15s;
}
.back-link:hover { color: var(--foreground); }
.nudge-back { transition: transform 0.35s var(--ease-spring); }
.back-link:hover .nudge-back { transform: translateX(-3px); }
.account-card.shake { animation: reveal 0.7s var(--ease-out) both, shake 0.5s var(--ease-out) 0.3s; }
.account-card .card-header { border-bottom: 1px solid var(--border); }
.account-title { display: flex; align-items: center; gap: 0.75rem; }
.account-title .brand-mark { width: 2.25rem; height: 2.25rem; border-radius: var(--radius-lg); }
.account-card:hover .account-title .brand-mark .icon { animation: bob 0.6s var(--ease-spring); }
.account-body { display: grid; gap: 1rem; padding: 1.5rem; }
.account-footer {
  display: flex; justify-content: flex-end; gap: 0.5rem; padding: 1rem 1.5rem;
  border-top: 1px solid var(--border); background: color-mix(in oklch, var(--muted) 50%, transparent);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.account-footer .btn[type="submit"] { min-width: 10rem; }
.field-error { color: var(--destructive); font-size: 0.8125rem; animation: swap 0.35s var(--ease-out); }

.requirements { display: grid; gap: 0.375rem; margin: 0.25rem 0 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--muted-foreground); }
.requirements li { display: grid; grid-template-columns: 0.875rem 1fr; align-items: center; gap: 0.5rem; transition: color 0.3s; }
.requirements .icon { grid-area: 1 / 1; width: 0.875rem; height: 0.875rem; flex: none; transition: opacity 0.2s, transform 0.45s var(--ease-spring); }
.requirements li > span { grid-column: 2; grid-row: 1; }
.requirements .req-done { opacity: 0; transform: scale(0.4) rotate(-90deg); color: var(--success); }
.requirements li.is-met { color: var(--foreground); }
.requirements li.is-met .req-todo { opacity: 0; transform: scale(0.4); }
.requirements li.is-met .req-done { opacity: 1; transform: none; }

/* ---------- Login: passkeys and throttling ---------- */

.passkey-area { display: grid; gap: 1rem; margin-top: -0.5rem; }
.divider {
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--muted-foreground); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.passkey-icon { transition: transform 0.45s var(--ease-spring); }
#passkey-btn:hover .passkey-icon { transform: scale(1.15) rotate(-6deg); }
#passkey-btn.is-busy .btn-state[data-state="busy"] .icon { color: var(--brand); }
.countdown { display: inline-block; font-weight: 600; }
.alert .countdown { color: var(--foreground); }

/* ---------- Account ---------- */

.section-title { display: flex; align-items: center; gap: 0.75rem; min-width: 0; flex: 1 1 16rem; }
.section-icon {
  display: grid; place-items: center; flex-shrink: 0; width: 2.25rem; height: 2.25rem;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm);
  transition: transform 0.45s var(--ease-spring);
}
.card:hover .section-icon { transform: rotate(-6deg) scale(1.05); }
.section-icon-negative { color: var(--status-negative); border-color: color-mix(in oklch, var(--status-negative) 30%, var(--border)); }
.list-card { overflow: hidden; }
.list-card .card-header { border-bottom: 1px solid var(--border); }
.plus-icon { transition: transform 0.45s var(--ease-spring); }
.btn:hover .plus-icon { transform: rotate(90deg); }

.item-list { list-style: none; margin: 0; padding: 0.375rem; }
.item-list:empty { display: none; }
.item-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0.5rem 0.625rem 0.625rem; border-radius: var(--radius-lg);
  transition: background-color 0.15s;
  animation: reveal 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms + 260ms);
}
.item-row:hover { background: color-mix(in oklch, var(--muted) 70%, transparent); }
.item-row.is-new { animation: row-new 1.6s var(--ease-out) both; }
.item-icon {
  display: grid; place-items: center; flex-shrink: 0; width: 2.25rem; height: 2.25rem;
  border-radius: var(--radius-md); background: var(--muted); color: var(--muted-foreground);
}
.item-main { flex: 1; min-width: 0; display: grid; gap: 0.125rem; }
.item-name { display: flex; align-items: center; gap: 0.5rem; min-width: 0; font-weight: 500; }
.item-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { display: flex; align-items: center; flex-wrap: wrap; column-gap: 0.375rem; color: var(--muted-foreground); font-size: 0.75rem; }
.item-action { color: var(--muted-foreground); opacity: 0.6; transition: opacity 0.2s, color 0.15s, background-color 0.15s, transform 0.3s var(--ease-spring); }
.item-row:hover .item-action, .item-action:focus-visible { opacity: 1; color: var(--foreground); }
.item-row:hover [data-remove-passkey]:hover { color: var(--status-negative); }
.item-action:hover .icon { animation: bob 0.5s var(--ease-spring); }
.empty-sm { padding: 1.75rem 1.5rem 2rem; }

.badge {
  display: inline-flex; align-items: center; gap: 0.375rem; flex-shrink: 0;
  height: 1.25rem; padding: 0 0.5rem; border-radius: 999px;
  font-size: 0.6875rem; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border); color: var(--foreground);
  animation: badge-in 0.5s var(--ease-spring) 0.5s both;
}
@keyframes badge-in { from { opacity: 0; transform: scale(0.6); } }
.badge-positive { border-color: color-mix(in oklch, var(--status-positive) 40%, transparent); background: color-mix(in oklch, var(--status-positive) 10%, transparent); }
.badge-dot { width: 0.375rem; height: 0.375rem; border-radius: 999px; background: var(--status-positive); box-shadow: 0 0 0 0 color-mix(in oklch, var(--status-positive) 60%, transparent); animation: pulse 2.4s var(--ease-out) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--status-positive) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 0.375rem transparent; } }

.label-hint { color: var(--muted-foreground); font-weight: 400; }

/* Password strength: four bars in the status colours. */
.meter { display: grid; gap: 0.375rem; margin-top: -0.25rem; }
.meter-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.25rem; }
.meter-bars span { position: relative; height: 0.25rem; border-radius: 999px; background: var(--muted); overflow: hidden; }
.meter-bars span::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--meter-color, transparent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s var(--ease-spring-soft), background-color 0.3s;
}
.meter-bars span:nth-child(2)::after { transition-delay: 40ms; }
.meter-bars span:nth-child(3)::after { transition-delay: 80ms; }
.meter-bars span:nth-child(4)::after { transition-delay: 120ms; }
.meter[data-score="0"], .meter[data-score="1"] { --meter-color: var(--status-negative); }
.meter[data-score="2"] { --meter-color: var(--status-neutral); }
.meter[data-score="3"], .meter[data-score="4"] { --meter-color: var(--status-positive); }
.meter[data-score="0"] span:nth-child(-n+1)::after,
.meter[data-score="1"] span:nth-child(-n+1)::after,
.meter[data-score="2"] span:nth-child(-n+2)::after,
.meter[data-score="3"] span:nth-child(-n+3)::after,
.meter[data-score="4"] span::after { transform: scaleX(1); }
.meter-text { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.75rem; color: var(--muted-foreground); }
.meter-label { font-weight: 500; white-space: nowrap; }
.meter:not([data-score="-1"]) .meter-label { color: var(--foreground); }
.meter-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }

/* ---------- Dialog ---------- */

.dialog {
  width: min(28rem, calc(100vw - 2rem)); max-width: none; padding: 0; margin: auto;
  border: 0; background: transparent; color: var(--card-foreground); overflow: visible;
}
.dialog::backdrop {
  background: oklch(0 0 0 / 0.45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: backdrop-in 0.3s var(--ease-out) both;
}
.dialog.is-closing::backdrop { animation: backdrop-out 0.25s var(--ease-in-out) both; }
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes backdrop-out { to { opacity: 0; } }
.dialog-panel {
  display: grid; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  animation: dialog-in 0.5s var(--ease-spring-soft) both;
}
.dialog.is-closing .dialog-panel { animation: dialog-out 0.22s var(--ease-in-out) both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.96); filter: blur(4px); } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(6px) scale(0.98); filter: blur(2px); } }
.dialog-head { display: flex; align-items: flex-start; gap: 0.75rem; padding: 1.25rem 1.5rem 0; }
.dialog-head h2 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.dialog-body { display: grid; gap: 1rem; padding: 1.25rem 1.5rem 0.25rem; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 1.25rem 1.5rem; }
.dialog-footer .btn[type="submit"] { min-width: 8.5rem; }

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

@media (max-width: 560px) {
  .hide-sm, .user-name, .separator { display: none; }
  .container { padding-top: 1.5rem; }
  .page-head h1 { font-size: 1.5rem; }
  .dropzone { min-height: 12rem; }
  .card-header { padding: 1rem; }
  .search { width: 100%; }
  .file-download { opacity: 1; }
  .upload-footer { flex-wrap: wrap; }
  .upload-status { flex-basis: 100%; }
  .upload-footer .btn-upload { flex: 1 1 100%; }
  .toaster { left: 1rem; right: 1rem; width: auto; }
  .drop-title { font-size: 1.25rem; }
  .item-action { opacity: 1; }
  .dialog-footer { flex-direction: column-reverse; }
  .dialog-footer .btn { width: 100%; }
}
@media (hover: none) { .file-download, .item-action { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .spin { animation: spin 0.8s linear infinite !important; }
}
