/*
 * WTF Upload website: the Android app's "sky" look (android/.../ui/Theme.kt),
 * light and dark. Colours are the app's tokens; sizes follow the owner's
 * desktop mocks (1586x992) and shrink for phones.
 */

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Adwaita Sans", Cantarell, "Noto Sans", system-ui,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Adwaita Mono", monospace;

  --text: #0b1b4d;
  --text-2: #56698c;
  --text-3: #3a4a66;
  --halo: transparent;
  --accent: #1a4f91;
  --accent-glow: transparent;
  --link: #115fdf;
  --link-strong: #115fdf;
  --icon: #2a3f66;
  --icon-blue: #1d4fbf;
  --tab: #3a4a66;
  --tab-active: #1a5cf5;

  --banner-fill: #fdfaf3;
  --banner-border: rgba(243, 214, 160, 0.95);
  --banner-inner: transparent;
  --banner-text: #0d1b47;
  --banner-icon: #f5a623;
  --banner-action: #115fdf;
  --banner-glow: rgba(138, 106, 42, 0.1);

  --card-fill: rgba(255, 255, 255, 0.8);
  --card-border-top: rgba(255, 255, 255, 0.95);
  --card-border-bottom: rgba(255, 255, 255, 0.65);
  --card-shadow: 0 4px 18px rgba(26, 79, 145, 0.14);
  /* The queue's newest group (the app's cardFillNew and the rest): by day the fill
     stays the plain card's, so dark text keeps its contrast; a bar at the leading
     edge, its wash and a bluer border say "new". */
  --card-fill-new: transparent;
  --card-border-top-new: rgba(47, 120, 239, 0.6);
  --card-border-bottom-new: rgba(47, 120, 239, 0.45);
  --card-edge-new: #2f78ef;
  --card-wash-new: rgba(47, 120, 239, 0.16);
  --divider: #cfdff1;

  --seg-sel-fill: linear-gradient(#e9f5fe, #cee6fd);
  --seg-sel-edge: linear-gradient(#fff 0, rgba(255, 255, 255, 0) 22%);
  --seg-sel-solid: #ddeffd;
  --seg-sel-content: #1a56db;
  --seg-sel-border: #9ec9f3;
  --seg-unsel-fill: rgba(245, 248, 251, 0.7);
  --seg-unsel-content: #3a4a66;
  --seg-outline: #c6dff4;

  --bar-fill: linear-gradient(rgba(248, 252, 255, 0.92), rgba(238, 247, 255, 0.9));
  --bar-border: rgba(255, 255, 255, 0.95);
  --bar-shadow: 0 6px 24px rgba(26, 79, 145, 0.12);
  --header-fill: linear-gradient(rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.3));
  --header-border: rgba(255, 255, 255, 0.9);

  --secondary-fill: rgba(247, 251, 255, 0.92);
  --secondary-border: #d3e4f4;
  --secondary-content: #2a3f66;
  --secondary-glow: 0 2px 10px rgba(26, 79, 145, 0.1);

  --primary-edge: #2d80fd;
  --primary-center: #1a5cf5;
  --primary-sheen: rgba(255, 255, 255, 0.12);
  --primary-border: rgba(111, 168, 255, 0.55);
  --primary-glow: 0 6px 16px rgba(32, 118, 253, 0.3);
  --on-primary: #fff;

  --field-fill: rgba(255, 255, 255, 0.6);
  --field-fill-solid: rgba(255, 255, 255, 0.92);
  --field-border: #b9d8f7;
  --tile-fill: #eaf3fc;
  --tile-text: #56698c;
  --success: #137842;
  --danger: #d32f2f;
  --warning: #e59400;
  --warning-text: #8a5600;
  --empty-title: #0b1b4d;
  --empty-sub: #3a4a66;
  --empty-icon: #4a8ef5;
  --art-glow: transparent;
  --art-glow-wide: transparent;
  --art-shadow: rgba(26, 79, 145, 0.32);
  --dialog-veil: #f5faff;
  --backdrop: rgba(14, 40, 80, 0.28);
  --dropzone-fill: rgba(255, 255, 255, 0.36);
  --dropzone-border: #93b8e6;
  --dropzone-dash: 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='12' fill='none' stroke='%2393B8E6' stroke-width='3' stroke-dasharray='6 5'/%3E%3C/svg%3E");
  --overlay-fill: rgba(220, 238, 255, 0.72);
  --day-header: #3a4a66;
  --src-app: #1a7f37;
  --src-web: #0969da;
  --src-email: #9a6700;
  --src-other: #8250df;
  --private-tint: #f2cc60;
  --private-fill: rgba(0, 0, 0, 0.67);
  --badge-good: #137842;
  --badge-warn: #9a6700;
  --badge-bad: #c62828;
  --focus: #1a5cf5;
  --progress-track: #dbe7f5;
  --toast-fill: rgba(11, 27, 77, 0.92);
  --toast-text: #fff;

  --sky-fill: #cfe8fd;
  --sky-base: url("assets/sky/land/bg_sky_light.webp?v=13d1f3fba8");
  --sky-far: url("assets/sky/land/bg_sky_light_far.webp?v=13d1f3fba8");
  --sky-near: url("assets/sky/land/bg_sky_light_near.webp?v=13d1f3fba8");
  --sky-glow: url("assets/sky/land/bg_sky_light_glow.webp?v=13d1f3fba8");
  --base-ar: 2400 / 1150;
  --far-ar: 1600 / 383;
  --near-ar: 1600 / 383;
  --glow-ar: 600 / 288;

  /* Sizes: desktop (the mocks). Phones override below. */
  --r-card: 20px;
  --r-ctl: 12px;
  --r-btn: 14px;
  --fs-body: 20px;
  --fs-brand: 36px;
  --fs-nav: 21.5px;
  --fs-title: 44px;
  --fs-h2: 36px;
  --fs-banner: 22px;
  --fs-small: 16px;
  --header-h: 90px;
  --bar-h: 106px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --text: #ecf2fd;
  --text-2: #9db5d6;
  --text-3: #b9c9e2;
  --halo: rgba(2, 11, 28, 0.85);
  --accent: #b5d6f6;
  --accent-glow: rgba(90, 160, 255, 0.55);
  --link: #9bc7f0;
  --link-strong: #9bc7f0;
  --icon: #b4d2f2;
  --icon-blue: #9bc7f0;
  --tab: #b5c9e4;
  --tab-active: #9bc7f0;

  --banner-fill: linear-gradient(rgba(58, 60, 67, 0.82), rgba(74, 64, 56, 0.88));
  --banner-border: rgba(192, 143, 98, 0.9);
  --banner-inner: rgba(192, 138, 64, 0.25);
  --banner-text: #e9c9a0;
  --banner-icon: #f2b24a;
  --banner-action: #9bc7f0;
  --banner-glow: rgba(192, 138, 64, 0.12);

  --card-fill: linear-gradient(rgba(20, 58, 99, 0.9) 0, rgba(12, 38, 67, 0.9) 18%, rgba(11, 34, 64, 0.92) 100%);
  --card-border-top: rgba(83, 128, 173, 0.9);
  --card-border-bottom: rgba(93, 155, 232, 0.9);
  --card-shadow: 0 0 16px rgba(47, 114, 214, 0.14);
  /* A deeper, bluer glass: never lighter, so light text keeps its contrast. */
  --card-fill-new: rgba(8, 25, 90, 0.6);
  --card-border-top-new: rgba(156, 200, 245, 0.85);
  --card-border-bottom-new: rgba(111, 174, 245, 0.95);
  --card-edge-new: rgba(111, 174, 245, 0.9);
  --card-wash-new: rgba(111, 174, 245, 0.14);
  --divider: #24456e;

  --seg-sel-fill: linear-gradient(#2a5b97, #224e82);
  --seg-sel-edge: linear-gradient(rgba(104, 166, 228, 0) 78%, rgba(104, 166, 228, 0.85));
  --seg-sel-solid: #1f487c;
  --seg-sel-content: #eaf4ff;
  --seg-sel-border: #4a86d0;
  --seg-unsel-fill: rgba(5, 27, 56, 0.25);
  --seg-unsel-content: #eaf4ff;
  --seg-outline: #2c4e7a;

  --bar-fill: linear-gradient(rgba(5, 27, 56, 0.93), rgba(5, 27, 56, 0.95));
  --bar-border: #1d3f6e;
  --bar-shadow: 0 0 18px rgba(42, 107, 255, 0.12);
  --header-fill: linear-gradient(rgba(4, 18, 40, 0.42), rgba(4, 18, 40, 0.3));
  --header-border: rgba(77, 125, 186, 0.45);

  --secondary-fill: #0f2741;
  --secondary-border: rgba(111, 168, 232, 0.85);
  --secondary-content: #c9d8ee;
  --secondary-glow: 0 0 12px rgba(61, 127, 216, 0.4);

  --primary-edge: #2a6bff;
  --primary-center: #1455e8;
  --primary-sheen: rgba(255, 255, 255, 0.1);
  --primary-border: rgba(143, 203, 255, 0.9);
  --primary-glow: 0 0 16px rgba(42, 107, 255, 0.55);

  --field-fill: rgba(12, 38, 67, 0.9);
  --field-fill-solid: rgba(12, 38, 67, 0.96);
  --field-border: #335b8c;
  --tile-fill: #14365e;
  --tile-text: #8fa9cc;
  --success: #5cd68c;
  --danger: #ff8a80;
  --warning: #f2b24a;
  --warning-text: #e9c9a0;
  --empty-title: #ecf2fd;
  --empty-sub: rgba(236, 242, 253, 0.78);
  --empty-icon: #9bc7f0;
  --art-glow: rgba(220, 235, 255, 0.9);
  --art-glow-wide: rgba(111, 168, 255, 0.22);
  --art-shadow: rgba(0, 8, 20, 0.45);
  --dialog-veil: #0a2140;
  --backdrop: rgba(1, 8, 20, 0.55);
  --dropzone-fill: rgba(8, 30, 60, 0.28);
  --dropzone-border: rgba(111, 168, 232, 0.55);
  --dropzone-dash: 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='12' fill='none' stroke='%236FA8E8' stroke-opacity='0.6' stroke-width='3' stroke-dasharray='6 5'/%3E%3C/svg%3E");
  --overlay-fill: rgba(5, 22, 46, 0.7);
  --day-header: #8fa9cc;
  --src-app: #7ee787;
  --src-web: #79c0ff;
  --src-email: #f2cc60;
  --src-other: #d2a8ff;
  --badge-good: #7ee787;
  --badge-warn: #f2cc60;
  --badge-bad: #ff8a80;
  --focus: #8fcbff;
  --progress-track: #1d3a60;
  --toast-fill: rgba(236, 242, 253, 0.95);
  --toast-text: #0b1b4d;

  --sky-fill: #071a36;
  --sky-base: url("assets/sky/land/bg_sky_dark.webp?v=13d1f3fba8");
  --sky-far: url("assets/sky/land/bg_sky_dark_far.webp?v=13d1f3fba8");
  --sky-near: url("assets/sky/land/bg_sky_dark_near.webp?v=13d1f3fba8");
  --sky-glow: url("assets/sky/land/bg_sky_dark_glow.webp?v=13d1f3fba8");
  --far-ar: 2400 / 575;
  --near-ar: 3200 / 336;
}

/* The sky's variants: near-square (the app's sw600dp set) and portrait. */
@media (max-aspect-ratio: 6/5) {
  :root {
    --sky-base: url("assets/sky/square/bg_sky_light.webp?v=13d1f3fba8");
    --sky-far: url("assets/sky/square/bg_sky_light_far.webp?v=13d1f3fba8");
    --sky-near: url("assets/sky/square/bg_sky_light_near.webp?v=13d1f3fba8");
    --sky-glow: url("assets/sky/square/bg_sky_light_glow.webp?v=13d1f3fba8");
    --base-ar: 1800 / 1900;
    --far-ar: 1200 / 633;
    --near-ar: 1200 / 633;
    --glow-ar: 450 / 475;
  }
  :root[data-theme="dark"] {
    --sky-base: url("assets/sky/square/bg_sky_dark.webp?v=13d1f3fba8");
    --sky-far: url("assets/sky/square/bg_sky_dark_far.webp?v=13d1f3fba8");
    --sky-near: url("assets/sky/square/bg_sky_dark_near.webp?v=13d1f3fba8");
    --sky-glow: url("assets/sky/square/bg_sky_dark_glow.webp?v=13d1f3fba8");
    --far-ar: 1800 / 950;
    --near-ar: 2400 / 591;
  }
}
@media (max-aspect-ratio: 4/5) {
  :root {
    --sky-base: url("assets/sky/port/bg_sky_light.webp?v=13d1f3fba8");
    --sky-far: url("assets/sky/port/bg_sky_light_far.webp?v=13d1f3fba8");
    --sky-near: url("assets/sky/port/bg_sky_light_near.webp?v=13d1f3fba8");
    --sky-glow: url("assets/sky/port/bg_sky_light_glow.webp?v=13d1f3fba8");
    --base-ar: 1080 / 2400;
    --far-ar: 720 / 800;
    --near-ar: 720 / 800;
    --glow-ar: 270 / 600;
  }
  :root[data-theme="dark"] {
    --sky-base: url("assets/sky/port/bg_sky_dark.webp?v=13d1f3fba8");
    --sky-far: url("assets/sky/port/bg_sky_dark_far.webp?v=13d1f3fba8");
    --sky-near: url("assets/sky/port/bg_sky_dark_near.webp?v=13d1f3fba8");
    --sky-glow: url("assets/sky/port/bg_sky_dark_glow.webp?v=13d1f3fba8");
    --far-ar: 1080 / 1200;
    --near-ar: 1440 / 797;
  }
}

/* ------------------------------------------------------------------ base */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--sky-fill);
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 400 var(--fs-body) / 1.35 var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}
img {
  max-width: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: default;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.ic {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.mono {
  font-family: var(--mono);
}
.muted {
  color: var(--text-2);
  font-weight: 400;
}

/* ------------------------------------------------------------------ sky */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--sky-fill);
  container-type: size;
  isolation: isolate;
}
.sky-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  /* "cover": the base picture's aspect, at least as wide and as tall as the window */
  width: max(100cqw, calc(100cqh * var(--base-ar)));
  aspect-ratio: var(--base-ar);
  transform: translate(-50%, -50%);
}
.sky-base,
.sky-glow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.sky-base {
  top: 0;
  background-image: var(--sky-base);
}
.sky-glow {
  aspect-ratio: var(--glow-ar);
  background-image: var(--sky-glow);
}
/* Wide windows, day: the owner's website mock has a paler sky at the top than the
   app's landscape picture; a still white wash over the top half closes the gap
   (the app's layers stay as they are; the clouds still drift under it). */
@media (min-aspect-ratio: 6/5) {
  :root:not([data-theme="dark"]) .sky::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.38) 28%, rgba(255, 255, 255, 0) 55%);
  }
}
/* The night glow is light added to the sky (the app's BlendMode.Plus); the day haze is laid over. */
:root[data-theme="dark"] .sky-glow {
  mix-blend-mode: screen;
  mix-blend-mode: plus-lighter;
}
/* A cloud layer is a two-tile strip (one tile = the base's width), bottom-aligned,
   slid right by one tile per period and wrapped: compositor-only, no repaint. */
.sky-clouds {
  position: absolute;
  left: -100%;
  bottom: 0;
  width: 200%;
  background-repeat: repeat-x;
  background-size: 50% 100%;
  background-position: 0 100%;
  will-change: transform;
  animation: sky-drift var(--period) linear infinite;
}
.sky-far {
  --period: 240s;
  aspect-ratio: var(--far-ar);
  background-image: var(--sky-far);
}
.sky-near {
  --period: 150s;
  aspect-ratio: var(--near-ar);
  background-image: var(--sky-near);
}
@keyframes sky-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(50%, 0, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sky-clouds {
    animation: none;
    transform: translate3d(25%, 0, 0);
  }
}

/* Everything else sits over the sky. */
.topbar,
main,
.drop-overlay,
.toasts {
  position: relative;
  z-index: 1;
}

.framed-note {
  position: relative;
  z-index: 1;
  padding: 32px 24px;
  font-size: 18px;
}

/* ------------------------------------------------------------------ header */

.topbar {
  background: var(--header-fill);
  border-bottom: 1px solid var(--header-border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding: 6px 44px 0 42px;
  max-width: 1640px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  margin-right: 42px;
  flex: none;
  border-radius: 12px;
}
.brand:hover {
  text-decoration: none;
}
.brand-logo {
  width: auto;
  height: 68px;
  margin-top: 0;
  filter: drop-shadow(0 4px 6px rgba(26, 79, 145, 0.22));
}
.brand-name {
  font-size: var(--fs-brand);
  font-weight: 800;
  letter-spacing: -0.022em;
  white-space: nowrap;
  text-shadow: 0 1px 14px var(--halo);
}
.nav {
  align-self: stretch;
  display: flex;
}
.tabs {
  display: flex;
  gap: 4px;
}
.tab {
  position: relative;
  color: var(--tab);
  font-weight: 500;
  padding: 0 22px;
  white-space: nowrap;
  border-radius: 10px 10px 0 0;
}
.tab:hover {
  color: var(--tab-active);
}
.tab[aria-selected="true"] {
  color: var(--tab-active);
  font-weight: 600;
}
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: -1px;
  height: 5px;
  border-radius: 4px 4px 0 0;
  background: var(--tab-active);
}
.nav-tabs {
  align-items: stretch;
}
.nav-tabs {
  gap: 30px;
}
.nav-tabs .tab {
  font-size: var(--fs-nav);
  padding: 2px 8px 0;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--accent);
}
.icon-btn:hover {
  background: rgba(127, 170, 230, 0.16);
}
.icon-btn.small {
  width: 36px;
  height: 36px;
}
.icon-btn.small .ic {
  width: 20px;
  height: 20px;
}
.topbar .icon-btn .ic {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.topbar .theme-btn .ic {
  width: 34px;
  height: 34px;
  stroke-width: 1.6;
}
.topbar .gear-btn .ic {
  width: 37px;
  height: 37px;
}
.theme-btn .ic-sun,
:root[data-theme="dark"] .theme-btn .ic-moon {
  display: none;
}
:root[data-theme="dark"] .theme-btn .ic-sun {
  display: block;
}
.vdiv {
  width: 1px;
  height: 38px;
  background: var(--divider);
}
:root:not([data-theme="dark"]) .vdiv {
  background: #b9cfe6;
}

/* ------------------------------------------------------------------ pages */

main {
  padding-bottom: 0;
}
.page-upload {
  max-width: 1640px;
  margin: 0 auto;
  padding: 32px 29px 0 48px;
}
.page-history {
  max-width: 1418px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.page-title {
  font-size: var(--fs-title);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.026em;
  margin-top: 8px;
  text-shadow: 0 1px 14px var(--halo);
}
.page-history .page-title {
  margin-left: 6px;
}

/* ------------------------------------------------------------------ banner */

.banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 67px;
  margin-top: 15px;
  padding: 8px 12px 8px 20px;
  background: var(--banner-fill);
  border: 1.5px solid var(--banner-border);
  border-radius: 14px;
  box-shadow: 0 2px 12px var(--banner-glow), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  color: var(--banner-text);
  font-size: var(--fs-banner);
  font-weight: 500;
  text-align: left;
}
:root[data-theme="dark"] .banner {
  box-shadow: 0 0 14px var(--banner-glow), inset 0 0 6px var(--banner-inner), inset 0 0 2px var(--banner-inner),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.banner .ic-warn {
  width: 38px;
  height: 38px;
  color: var(--banner-icon);
}
.banner-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.banner-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--banner-action);
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 4px 6px 10px;
  border-radius: 10px;
}
.banner-action .ic {
  width: 26px;
  height: 26px;
  stroke-width: 2.4;
}
.banner-action:hover {
  background: rgba(47, 120, 239, 0.08);
}
.page-history .banner {
  margin-top: 9px;
  min-height: 70px;
  padding-left: 26px;
}
.banner-action .ic-lead {
  width: 22px;
  height: 22px;
}
/* Google sign-in banners: Google's own button (and Sign out) on the right; when
   the banner is narrow (the two-column layout at 1000-1200px) they wrap under the
   text rather than squeeze it into a sliver. */
.banner-gsi {
  flex-wrap: wrap;
  row-gap: 8px;
}
.banner-gsi .banner-text {
  flex: 1 1 14em;
}
.banner-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}
.banner .gsi-host {
  display: flex;
  align-items: center;
  min-height: 32px;
  color-scheme: normal; /* Google's iframe paints its own background */
}
.banner .banner-link {
  font-size: 17px;
  color: var(--link-strong); /* (small text: the darker blue keeps 4.5:1 on the banner) */
  white-space: nowrap;
}
.empty-state .gsi-host {
  display: flex;
  justify-content: center;
  min-height: 40px;
  margin-top: 22px;
  color-scheme: normal;
}

/* ------------------------------------------------------------------ cards */

.card {
  position: relative;
  background: var(--card-fill);
  border-radius: var(--r-card);
  box-shadow: var(--card-shadow);
}
/* A gradient hairline (lit top, softer bottom) drawn as a masked ring. */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.25px;
  background: linear-gradient(var(--card-border-top), var(--card-border-bottom));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
.divider {
  border: 0;
  height: 1px;
  background: var(--divider);
  margin: 0;
}

/* ------------------------------------------------------------------ controls */

.primary-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--r-btn);
  color: var(--on-primary);
  font-weight: 600;
  background: linear-gradient(var(--primary-sheen), rgba(255, 255, 255, 0) 50%),
    linear-gradient(90deg, var(--primary-edge), var(--primary-center) 32%, var(--primary-center) 68%, var(--primary-edge));
  border: 1px solid var(--primary-border);
  box-shadow: var(--primary-glow);
  transition: filter 0.15s, box-shadow 0.15s;
}
.primary-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}
.primary-btn:active:not(:disabled) {
  filter: brightness(0.96);
}
.primary-btn:disabled,
.primary-btn[aria-disabled="true"] {
  opacity: 0.45;
  box-shadow: none;
}
.primary-btn[aria-disabled="true"] {
  filter: none !important;
  cursor: default;
}
.primary-btn.small {
  min-height: 42px;
  padding: 0 20px;
  font-size: 17px;
}
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-ctl);
  background: var(--secondary-fill);
  border: 1px solid var(--secondary-border);
  color: var(--secondary-content);
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.secondary-btn:hover:not(:disabled) {
  border-color: var(--seg-sel-border);
  background: var(--field-fill-solid);
}
.secondary-btn:disabled {
  opacity: 0.45;
}
.secondary-btn.small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 16px;
}
.secondary-btn.icon-only {
  padding: 0;
  width: 44px;
}
.danger-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-ctl);
  border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent);
  color: var(--danger);
  font-weight: 500;
  background: transparent;
}
.danger-btn:hover {
  background: color-mix(in srgb, var(--danger) 9%, transparent);
}
.danger-btn.solid {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
:root[data-theme="dark"] .danger-btn.solid {
  color: #3b0905;
}
.danger-btn.solid:hover {
  filter: brightness(1.08);
}
.link-btn {
  color: var(--link);
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 8px;
}
.link-btn:hover {
  text-decoration: underline;
}
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--secondary-fill);
  border: 1px solid var(--secondary-border);
  color: var(--secondary-content);
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
}
.chip-btn .ic {
  width: 18px;
  height: 18px;
}
.chip-btn:hover:not(:disabled) {
  border-color: var(--seg-sel-border);
}
.chip-btn:disabled {
  opacity: 0.45;
}

.segmented {
  display: flex;
  isolation: isolate;
  border-radius: var(--r-btn);
  box-shadow: 0 2px 8px rgba(26, 79, 145, 0.06);
}
.segmented > button {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-left: -1.5px;
  border: 1.5px solid var(--seg-outline);
  background: var(--seg-unsel-fill);
  color: var(--seg-unsel-content);
  font-weight: 500;
  white-space: nowrap;
}
.segmented > button:first-child {
  margin-left: 0;
  border-radius: var(--r-btn) 0 0 var(--r-btn);
}
.segmented > button:last-child {
  border-radius: 0 var(--r-btn) var(--r-btn) 0;
}
.segmented > button:hover:not([aria-checked="true"]):not(:disabled) {
  background: var(--field-fill-solid);
}
.segmented > button[aria-checked="true"] {
  z-index: 1;
  border-color: var(--seg-sel-border);
  background: var(--seg-sel-edge), var(--seg-sel-fill);
  color: var(--seg-sel-content);
}
.segmented > button:focus-visible {
  z-index: 2;
}
.segmented > button:disabled {
  opacity: 0.55;
}

.select-wrap {
  position: relative;
  display: inline-block;
}
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 56px;
  padding: 0 54px 0 15px;
  border-radius: var(--r-ctl);
  border: 1.5px solid var(--field-border);
  background: var(--field-fill);
  color: var(--text);
  cursor: pointer;
}
.select-wrap select:hover {
  border-color: var(--seg-sel-border);
}
.select-wrap .select-chev {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translateY(-50%);
  color: var(--link-strong);
  stroke-width: 2.4;
  pointer-events: none;
}
.select-wrap.small select {
  height: 44px;
  padding: 0 40px 0 14px;
  font-size: 16px;
}
.select-wrap.small .select-chev {
  right: 10px;
  width: 20px;
  height: 20px;
}
.input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: var(--r-ctl);
  border: 1.5px solid var(--field-border);
  background: var(--field-fill-solid);
  color: var(--text);
}
.input::placeholder {
  color: var(--text-2);
  opacity: 0.85;
}
.input:hover {
  border-color: var(--seg-sel-border);
}
.input.mono {
  font-family: var(--mono);
  font-size: 0.85em;
}

/* A switch: a checkbox with role="switch", the primary blue track, a white thumb. */
.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 54px;
  height: 32px;
  margin: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-2) 30%, transparent);
  border: 2px solid color-mix(in srgb, var(--text-2) 55%, transparent);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.switch::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text-2) 85%, transparent);
  transform: translateY(-50%);
  transition: left 0.18s, width 0.18s, height 0.18s, background 0.18s;
}
.switch:checked {
  background: var(--primary-edge);
  border-color: var(--primary-edge);
}
.switch:checked::before {
  left: 25px;
  width: 22px;
  height: 22px;
  background: #fff;
}
.switch:disabled {
  opacity: 0.4;
  cursor: default;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--seg-outline);
  background: var(--field-fill);
  color: var(--seg-unsel-content);
  font-size: 16px;
}
.chip[aria-pressed="true"] {
  background: var(--seg-sel-solid);
  border-color: var(--seg-sel-border);
  color: var(--seg-sel-content);
}
.chip:hover {
  border-color: var(--seg-sel-border);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-3);
}
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.field-hint {
  font-size: 15px;
  color: var(--text-2);
}
.field-error {
  font-size: 15px;
  color: var(--danger);
}
.switch-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.switch-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.switch-label {
  cursor: pointer;
}
.switch-sub {
  font-size: 15px;
  color: var(--text-2);
}

/* ------------------------------------------------------------------ upload page */

/* One column (phones, tablets): title, banner, the Destination card, the queue,
   in DOM order. */
.upload-grid {
  display: flex;
  flex-direction: column;
}
.col-head,
.col-main {
  display: contents;
}

/* Two columns: the queue column fills the window's height (the bar floats at its
   foot); the Destination card sits on the right from the top, sticky. */
@media (min-width: 1000px) {
  .upload-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 484px;
    grid-template-rows: auto 1fr;
    column-gap: 32px;
    min-height: calc(100dvh - var(--header-h) - 33px);
  }
  .col-head {
    display: block;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .col-main {
    display: flex;
    flex-direction: column;
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }
  .col-side {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    position: sticky;
    top: 24px;
  }
}

.queue {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.queue-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 45px;
  margin-bottom: 17px;
}
.section-title {
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 14px var(--halo);
}
.queue-count {
  font-size: var(--fs-body);
  color: var(--text-2);
  text-shadow: 0 1px 14px var(--halo);
}
.queue-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: center;
}

.dropzone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 32px 24px 40px;
  border-radius: 12px;
  /* A drawn dashed outline: longer dashes than a CSS dashed border gives. */
  background: var(--dropzone-dash) no-repeat, var(--dropzone-fill);
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.dropzone-art {
  position: relative;
  width: 196px;
  margin-bottom: 6px;
}
.dropzone-art img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}
/* As the app draws it: a soft ground shadow just under the folder; at night
   also a wide wash of light on the clouds and a tight halo above the folder. */
.dropzone-art::after {
  content: "";
  position: absolute;
  left: 53%;
  top: 95%;
  width: 130px;
  height: 22px;
  transform: translate(-50%, -30%);
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--art-shadow), transparent);
}
.dropzone-art::before {
  content: "";
  position: absolute;
  left: 53%;
  top: 72%;
  width: 320px;
  height: 220px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background:
    radial-gradient(65px 65px at 50% 46%, var(--art-glow), color-mix(in srgb, var(--art-glow) 45%, transparent) 25%, transparent),
    radial-gradient(140px 45px at 50% 64%, var(--art-glow-wide), transparent);
}
.dropzone-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--empty-title);
  text-shadow: 0 1px 14px var(--halo);
}
.dropzone-sub {
  margin-top: 4px;
  font-size: 22px;
  color: var(--empty-sub);
  text-shadow: 0 1px 14px var(--halo);
}
/* With files queued the drop zone is a slim strip under the list. */
.has-files .dropzone {
  flex: none;
  min-height: 0;
  flex-direction: row;
  gap: 14px;
  padding: 14px 20px;
  margin-top: 14px;
}
.has-files .dropzone-art {
  width: 46px;
  margin: 0;
}
.has-files .dropzone-art::before,
.has-files .dropzone-art::after {
  display: none;
}
.has-files .dropzone-title {
  font-size: 18px;
  font-weight: 600;
}
.has-files .dropzone-sub {
  margin: 0;
  font-size: 16px;
}
.dropzone.dragging,
.drag-active .dropzone {
  background: var(--dropzone-dash) no-repeat, color-mix(in srgb, var(--link-strong) 10%, transparent);
}

.bottombar {
  display: flex;
  gap: 16px;
  align-items: stretch;
  padding: 16px 15px 16px 16px;
  border-radius: 18px;
  background: var(--bar-fill);
  border: 1px solid var(--bar-border);
  box-shadow: var(--bar-shadow);
  z-index: 5;
}
@media (min-width: 1000px) and (max-height: 860px) {
  /* Short windows: a smaller empty drop zone, so the bar doesn't sit on it. */
  .dropzone {
    min-height: 220px;
    padding-top: 20px;
    padding-bottom: 24px;
  }
  .dropzone-art {
    width: 150px;
  }
}
@media (min-width: 1000px) {
  .bottombar {
    position: sticky;
    bottom: 43px;
    align-self: flex-end;
    margin-top: 19px;
    margin-bottom: 43px;
  }
  /* The slim strip's words sit on the left, clear of the bar floating on the right. */
  .has-files .dropzone {
    justify-content: flex-start;
  }
  /* Toasts rise above the floating bar (43 px off the bottom) on the Upload page. */
  body[data-route="upload"] .toasts {
    bottom: calc(var(--bar-h) + 43px + 14px);
  }
}
.square-btn {
  width: 76px;
  height: 74px;
  padding: 0;
  border-radius: var(--r-btn);
  border-color: rgba(255, 255, 255, 0.95);
  background: linear-gradient(#fbfdff, #f1f7fd);
  box-shadow: 0 3px 10px rgba(26, 79, 145, 0.1);
}
:root[data-theme="dark"] .square-btn {
  border-color: var(--secondary-border);
  background: var(--secondary-fill);
  box-shadow: var(--secondary-glow);
}
.square-btn .ic {
  width: 36px;
  height: 36px;
  stroke-width: 1.8;
}
.add-btn {
  width: 298px;
  height: 74px;
  font-size: 23px;
  gap: 22px;
  padding: 0 4px 0 14px;
}
.add-btn .ic {
  width: 36px;
  height: 36px;
  stroke-width: 2;
}

/* Destination card */
.dest-card {
  padding: 25px 25px 12px;
}
.dest-row {
  display: flex;
  align-items: center;
  gap: 30px;
}
.dest-title {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.dest-domain {
  flex: 1;
  min-width: 0;
}
.dest-domain select {
  font-size: 21px;
}
.dest-seg {
  margin-top: 22px;
  height: 66px;
}
.dest-seg > button {
  font-size: 18.5px;
}
.dest-seg .ic {
  width: 30px;
  height: 30px;
  stroke-width: 2.1;
}
.dest-seg > button[aria-checked="true"] {
  font-weight: 600;
}
.host-row {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 44px;
  margin-top: 22px;
  padding: 0 4px;
}
.host-icon {
  width: 30px;
  height: 30px;
  color: var(--icon-blue);
  stroke-width: 2.4;
}
.host-name {
  flex: 1;
  min-width: 0;
  font-size: 21.5px;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.host-kind {
  font-size: 19px;
  color: #3557a8;
  white-space: nowrap;
}
:root[data-theme="dark"] .host-kind {
  color: var(--text-2);
}
.dest-card > .divider {
  margin-top: 19px;
}
.options-toggle {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  min-height: 64px;
  margin-top: 12px;
  padding: 0 4px;
  border-radius: 12px;
  text-align: left;
}
.options-toggle:hover {
  background: color-mix(in srgb, var(--link) 6%, transparent);
}
.opt-icon {
  width: 34px;
  height: 34px;
  color: var(--icon);
  stroke-width: 2.2;
}
:root:not([data-theme="dark"]) .opt-icon {
  color: #213d80;
}
.opt-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.opt-label {
  font-size: 21px;
}
.opt-prefix {
  font-size: 15px;
  color: var(--link);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opt-chev {
  width: 28px;
  height: 28px;
  color: var(--link-strong);
  stroke-width: 2.4;
  margin-right: 2px;
  transition: transform 0.2s;
}
.options-toggle[aria-expanded="true"] .opt-chev {
  transform: rotate(180deg);
}
.options-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 10px 4px 14px;
}
.options-body .switch-label {
  font-size: 19px;
}
.upload-action {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 2px 0 12px;
}
.upload-btn {
  width: 100%;
  height: 62px;
  font-size: 21px;
}
.upload-btn .ic {
  width: 28px;
  height: 28px;
  stroke-width: 2.2;
}
.upload-note {
  font-size: 16px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.upload-warn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--warning-text);
}
.upload-warn .ic {
  width: 20px;
  height: 20px;
  color: var(--warning);
}
.upload-warn span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.upload-warn .link-btn {
  color: var(--link-strong);
  white-space: nowrap;
}
/* The whole batch while it runs (files, bytes, speed, time left). */
.batch {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}
.batch-bar {
  height: 12px;
  margin-top: 6px;
}
.batch-text {
  font-size: 16.5px;
  line-height: 1.4;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.batch-text .nw,
.qprog .nw {
  white-space: nowrap;
}
/* Offline: the bar holds still in the warning colour. */
.batch.paused .batch-bar > div,
.qitem.paused .progress > div {
  background: var(--warning);
}
.batch.paused .batch-text {
  color: var(--warning-text);
}
/* "Signing in with Google…": nothing is wrong yet. */
.upload-warn.quiet {
  color: var(--text-2);
}
.upload-warn.quiet .ic {
  display: none;
}

/* Queue rows */
.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qitem {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 16px 16px 16px 16px;
  /* The padding and the thumbnail beside it, where no text is: a new row's wash. */
  --qlead: 80px;
  /* Brought into view (a new group on top): clear of the window's edge and the bar. */
  scroll-margin: 12px 0 calc(var(--bar-h) + 43px + 12px);
}
/* The newest group, while older rows are there too (js/queue-order.js): a bar
   along the leading edge, its wash fading out across the thumbnail column, a
   bluer border; at night a deeper fill. All paint: the row's size never changes. */
.qitem.new {
  --edge: left;
  --edge-out: to right;
  background:
    linear-gradient(var(--card-edge-new), var(--card-edge-new)) var(--edge) / 3px 100% no-repeat,
    linear-gradient(var(--edge-out), var(--card-wash-new), transparent) var(--edge) / var(--qlead) 100% no-repeat,
    linear-gradient(var(--card-fill-new), var(--card-fill-new)),
    var(--card-fill);
}
/* Right to left, the leading edge is the right one. */
.qitem.new:dir(rtl) {
  --edge: right;
  --edge-out: to left;
}
.qitem.new::before {
  background: linear-gradient(var(--card-border-top-new), var(--card-border-bottom-new));
}
.qthumb {
  position: relative;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--tile-fill);
  border: 1px solid var(--seg-outline);
  color: var(--accent);
}
.qthumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.qthumb .ic {
  width: 30px;
  height: 30px;
  stroke-width: 1.7;
}
.qbody {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.qname {
  font-size: 18px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The name, and the pencil beside it (Rename, until the file is on its way). The
   pencil's column stays when it hides, so the name never moves; its 44 px target
   reaches over the line's edges without making the line taller. */
.qhead {
  display: grid;
  grid-template-columns: minmax(0, max-content) 44px;
  align-items: center;
  column-gap: 2px;
}
.qrename {
  width: 44px;
  height: 44px;
  margin: -10px 0;
  color: var(--icon);
}
.qrename .ic {
  width: 20px;
  height: 20px;
}
.qpath {
  font-size: 14px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
}
.qmeta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--text-2);
  min-width: 0;
}
.qstatus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.qstatus .ic {
  width: 18px;
  height: 18px;
}
.qstatus.done {
  color: var(--success);
  font-weight: 600;
}
.qstatus.failed {
  color: var(--danger);
  font-weight: 600;
}
.qstatus.auth,
.qstatus.paused {
  color: var(--warning-text);
  font-weight: 600;
}
.qstatus.cancelled {
  color: var(--text-2);
  font-weight: 600;
}
/* A big file's bytes, speed and time left (or, failed, what Retry keeps). */
.qprog {
  font-size: 14.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.qitem[data-status="failed"] .qprog,
.qitem[data-status="auth"] .qprog {
  color: var(--text-3);
}
.progress {
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--progress-track);
  overflow: hidden;
}
.progress > div {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-edge), var(--primary-center));
  transition: width 0.2s linear;
}
.qlink {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 15px;
  margin-top: 2px;
}
.qlink .ic {
  width: 18px;
  height: 18px;
  color: var(--link);
}
.qlink a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.qerror {
  font-size: 15px;
  color: var(--danger);
  overflow-wrap: anywhere;
}
.qactions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex: none;
  max-width: 50%;
}
.qactions .secondary-btn {
  min-height: 40px;
  padding: 0 14px;
  font-size: 16px;
}
.qactions .secondary-btn .ic {
  width: 18px;
  height: 18px;
}
.qremove {
  color: var(--text-2);
}

/* ------------------------------------------------------------------ history */

.sub-tabs {
  margin-top: 21px;
  border-bottom: 1px solid color-mix(in srgb, var(--seg-sel-border) 80%, transparent);
  gap: 18px;
  padding-left: 0;
}
.sub-tabs .tab {
  font-size: 20.5px;
  height: 52px;
  padding: 0 26px;
}
.sub-tabs .tab[aria-selected="true"]::after {
  height: 4px;
  left: 0;
  right: 0;
  border-radius: 3px 3px 0 0;
}
.panel {
  margin-top: 30px;
}
@media (min-width: 1000px) {
  /* The mock's cards sit a hair wider than the banner and tabs above them. */
  .page-history .panel > .card {
    margin-left: -5px;
    margin-right: -5px;
  }
}
.empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 300px;
  padding: 40px 24px;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 68px 24px 44px;
}
.empty-state .ic {
  width: 60px;
  height: 60px;
  color: var(--empty-icon);
  margin-bottom: 22px;
}
.empty-state .ic-error {
  color: var(--danger);
}
/* The mock's empty-state document: a blue outline over a very pale fill. */
.empty-state .ic-doc {
  stroke-width: 1.7;
  fill: color-mix(in srgb, var(--empty-icon) 14%, transparent);
}
.empty-title {
  font-size: 26.5px;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--empty-title);
}
.empty-sub {
  margin-top: 8px;
  font-size: 20px;
  color: var(--empty-sub);
  overflow-wrap: anywhere;
}
.empty-state .secondary-btn,
.empty-state .primary-btn {
  margin-top: 22px;
}
/* (Not the empty state's big icon: a button's own, e.g. Retry's.) */
.empty-state .secondary-btn .ic,
.empty-state .primary-btn .ic {
  width: 22px;
  height: 22px;
  margin: 0;
  color: inherit;
}
.empty-state .setup-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 19px;
}
.empty-state .setup-link .ic {
  width: 22px;
  height: 22px;
  margin: 0;
  color: inherit;
  stroke-width: 2.4;
}

.files-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
}
.search {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
}
.search > .ic {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: var(--text-2);
  pointer-events: none;
}
.search .input {
  height: 44px;
  padding-left: 46px;
  padding-right: 42px;
  font-size: 17px;
}
.search .input::-webkit-search-cancel-button {
  display: none;
}
.search .clear-search {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
}
.search.small {
  flex: 1 1 220px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.date-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--text-3);
}
.date-filter .input {
  height: 44px;
  width: auto;
  font-size: 16px;
  padding: 0 10px;
}
.view-toggle {
  height: 44px;
}
.view-toggle > button {
  width: 46px;
  flex: none;
}
.view-toggle .ic {
  width: 22px;
  height: 22px;
}
.files-status {
  margin: 14px 4px 0;
  font-size: 15px;
  color: var(--text-2);
  text-shadow: 0 1px 10px var(--halo), 0 0 3px var(--halo);
  min-height: 1.35em;
}
.new-pill {
  position: sticky;
  top: 12px;
  z-index: 3;
  display: block;
  margin: 10px auto 0;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-edge), var(--primary-center));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--primary-glow);
}
.day {
  margin: 22px 6px 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--day-header);
  text-shadow: 0 1px 10px var(--halo), 0 0 3px var(--halo);
}
.files .day:first-child {
  margin-top: 8px;
}
.day-items {
  display: grid;
  gap: 14px;
}
.files.grid .day-items {
  grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
}
.files.list .day-items {
  grid-template-columns: 1fr;
  gap: 8px;
}
.fcard {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 16px;
  transition: opacity 0.28s, transform 0.28s;
}
.fcard.leaving {
  opacity: 0;
  transform: scale(0.94);
}
.fcard.busy {
  opacity: 0.55;
}
.fthumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  background: var(--tile-fill);
}
.fthumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s;
}
.fthumb img.ready {
  opacity: 1;
}
.tile {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--tile-text);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
}
.tile .ic {
  width: 34px;
  height: 34px;
  color: var(--accent);
  stroke-width: 1.6;
}
.lock-badge {
  position: absolute;
  z-index: 2;
  top: 7px;
  left: 7px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--private-fill);
  color: var(--private-tint);
}
.lock-badge .ic {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}
.fbody {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px 4px;
  min-width: 0;
}
.fname {
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fhost,
.fmeta {
  font-size: 13.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fmeta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fmeta > span:not(.src) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fmeta .who {
  flex: 1 1 0;
}
.src {
  flex: none;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 50%, transparent);
  font-size: 12px;
  line-height: 18px;
  color: var(--src-other);
}
.src-app {
  color: var(--src-app);
}
.src-web {
  color: var(--src-web);
}
.src-email {
  color: var(--src-email);
}
.factions {
  display: flex;
  gap: 2px;
  padding: 2px 6px 8px;
  margin-top: auto;
}
.factions .icon-btn {
  width: 38px;
  height: 38px;
  color: var(--icon);
}
.factions .icon-btn .ic {
  width: 20px;
  height: 20px;
}
.factions .icon-btn.del {
  margin-left: auto;
  color: var(--danger);
}
/* An account that may view but not upload doesn't get Delete either. */
.view-only .factions .icon-btn.del {
  display: none;
}
.files.list .fcard {
  flex-direction: row;
  align-items: center;
  border-radius: 14px;
  padding: 8px 8px 8px 10px;
}
.files.list .fthumb {
  flex: none;
  width: 64px;
  height: 64px;
  aspect-ratio: auto;
  border-radius: 10px;
}
.files.list .fthumb .tile {
  font-size: 11px;
  gap: 2px;
}
.files.list .fthumb .tile .ic {
  width: 22px;
  height: 22px;
}
.files.list .lock-badge {
  top: auto;
  left: auto;
  right: 3px;
  bottom: 3px;
  width: 20px;
  height: 20px;
}
.files.list .lock-badge .ic {
  width: 13px;
  height: 13px;
}
.files.list .fbody {
  flex: 1;
  padding: 0 12px;
}
.files.list .factions {
  padding: 0;
  margin: 0;
}
.files.list .factions .icon-btn.del {
  margin-left: 0;
}
.sentinel {
  height: 1px;
}
.more-row {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

/* Audit log */
.audit-card {
  padding: 22px 16px 8px;
  min-height: 406px;
  display: flex;
  flex-direction: column;
}
.audit-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 0 17px;
  border-bottom: 1px solid var(--divider);
  margin: 0 2px 0 3px;
}
.audit-where {
  display: flex;
  align-items: center;
  gap: 21px;
  padding-left: 6px;
  font-size: 20px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
}
.audit-where .ic {
  width: 40px;
  height: 40px;
  color: var(--icon);
  stroke-width: 1.6;
}
.audit-buttons {
  display: flex;
  gap: 11px;
  align-items: center;
}
.audit-modes {
  display: flex;
  gap: 11px;
}
.audit-buttons .secondary-btn {
  height: 59px;
  min-width: 160px;
  font-size: 18px;
  gap: 16px;
  padding: 0 26px;
  border-radius: 12px;
}
.audit-buttons .secondary-btn .ic {
  width: 32px;
  height: 32px;
  stroke-width: 1.6;
}
.audit-buttons .secondary-btn.icon-only {
  width: 66px;
  min-width: 0;
  padding: 0;
}
.audit-buttons .mode-btn[aria-checked="true"] {
  background: var(--seg-sel-edge), var(--seg-sel-fill);
  border-color: var(--seg-sel-border);
  color: var(--seg-sel-content);
}
:root:not([data-theme="dark"]) .audit-buttons .secondary-btn {
  background: rgba(244, 250, 255, 0.85);
  border-color: #d6e8f8;
  color: #3d5079;
}
:root:not([data-theme="dark"]) .audit-buttons .mode-btn[aria-checked="true"] {
  background: var(--seg-sel-edge), var(--seg-sel-fill);
  border-color: var(--seg-sel-border);
  color: var(--seg-sel-content);
}
.audit-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 4px 4px;
}
.audit-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.inline-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  cursor: pointer;
}
.audit-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font-size: 15px;
  color: var(--text-2);
}
.audit-summary:empty {
  display: none;
}
.audit-summary .warn {
  color: var(--warning-text);
  font-weight: 600;
}
.top-ips {
  flex-basis: 100%;
  font-size: 15px;
}
.top-ips summary {
  cursor: pointer;
  color: var(--link);
  font-weight: 600;
}
.top-ips ol {
  margin: 8px 0 4px;
  padding-left: 22px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  columns: 2 220px;
}
.top-ips .secondary-btn {
  margin: 4px 0 6px;
}
.audit-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.audit-body > .empty-state {
  flex: 1;
  justify-content: center;
}
.table-wrap {
  overflow-x: auto;
  margin-top: 6px;
}
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  table-layout: fixed;
}
.audit-table th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--divider);
}
.audit-table td {
  padding: 10px;
  vertical-align: top;
  border-bottom: 1px solid color-mix(in srgb, var(--divider) 70%, transparent);
  overflow: hidden;
}
.audit-table tr:last-child td {
  border-bottom: 0;
}
/* Fixed columns 552 px; Source and Email a share each; File takes the rest
   (about 170 px at the narrowest table, 1030 px, below which rows stack). */
.audit-table .c-time {
  width: 128px;
}
.audit-table .c-type {
  width: 168px;
}
.audit-table .c-where {
  width: 120px;
}
.audit-table .c-src {
  width: 16%;
}
.audit-table .c-email {
  width: 14%;
}
.audit-table .c-act {
  width: 184px;
}
.cell-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cell-lines > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-lines .sub {
  color: var(--text-2);
  font-size: 13.5px;
}
.cell-lines .mono {
  font-size: 13px;
}
.badge {
  display: inline-block;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
  font-size: 12.5px;
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}
.badge.good {
  color: var(--badge-good);
}
.badge.warn {
  color: var(--badge-warn);
}
.badge.bad {
  color: var(--badge-bad);
}
.audit-table .secondary-btn {
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
  gap: 6px;
}
.audit-table .secondary-btn .ic {
  width: 16px;
  height: 16px;
}
.audit-note {
  padding: 10px 6px 4px;
  font-size: 14px;
  color: var(--text-2);
}

/* Small link text uses --link-strong (light: #115fdf, the app's link blue, 5.2:1+ on
   the glass over the bluest sky; both themes now have one link blue). */
.qlink a,
.audit-table a,
.opt-prefix,
.top-ips summary {
  color: var(--link-strong);
}

/* ------------------------------------------------------------------ dialogs */

dialog {
  color: var(--text);
  border: 0;
  padding: 0;
  background: transparent;
}
dialog::backdrop {
  background: var(--backdrop);
}
.sheet,
.alert,
.popover {
  background: var(--dialog-veil);
  border-radius: 26px;
  box-shadow: 0 18px 60px rgba(8, 30, 70, 0.28);
  outline: 1px solid color-mix(in srgb, var(--card-border-bottom) 70%, transparent);
}
:root[data-theme="dark"] .sheet,
:root[data-theme="dark"] .alert,
:root[data-theme="dark"] .popover {
  outline-color: rgba(93, 155, 232, 0.7);
  box-shadow: 0 0 30px rgba(42, 107, 255, 0.2);
}
.sheet {
  width: min(660px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  flex-direction: column;
}
.sheet[open] {
  display: flex;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 10px 28px;
}
.sheet-head h2 {
  font-size: 28px;
  font-weight: 800;
}
.sheet-head .icon-btn {
  color: var(--accent);
}
.sheet-body {
  overflow-y: auto;
  padding: 6px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 17px;
}
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}
.settings-section h3 {
  font-size: 19px;
  font-weight: 700;
}
.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  color: var(--text-2);
}
.status-line::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
  flex: none;
}
.status-line.ok::before {
  background: var(--success);
}
.status-line.bad::before {
  background: var(--danger);
}
.settings .input {
  height: 48px;
  font-size: 16px;
}
.input-with-btn {
  position: relative;
}
.input-with-btn .input {
  padding-right: 48px;
}
.input-with-btn .icon-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
}
.gsi-slot {
  min-height: 44px;
  color-scheme: normal;
}
.gsi-note {
  font-size: 15px;
  color: var(--text-2);
}
#googleFields:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.signed-in {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 12px;
}
.signed-in-label {
  font-size: 14px;
  color: var(--text-2);
}
.signed-in-email {
  grid-column: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}
.signed-in .secondary-btn {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.advanced summary {
  cursor: pointer;
  color: var(--text-2);
  font-size: 15.5px;
  font-weight: 600;
}
.advanced[open] summary {
  margin-bottom: 10px;
}
.test-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.test-result {
  font-size: 15.5px;
  overflow-wrap: anywhere;
}
.test-result.ok {
  color: var(--success);
  font-weight: 600;
}
.test-result.bad {
  color: var(--danger);
}
.theme-seg {
  height: 48px;
  max-width: 420px;
}
.theme-seg > button {
  font-size: 16px;
}
.muted-note {
  text-align: center;
  font-size: 15px;
  color: var(--text-2);
}
.alert {
  width: min(480px, calc(100vw - 32px));
  padding: 26px 26px 22px;
}
.alert h2 {
  font-size: 23px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.alert p {
  margin-top: 12px;
  font-size: 17px;
  color: var(--text-3);
  overflow-wrap: anywhere;
}
.alert-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.popover {
  position: fixed;
  margin: 0;
  width: min(380px, calc(100vw - 24px));
  padding: 20px;
  border-radius: 18px;
}
.popover::backdrop {
  background: transparent;
}
.popover h2 {
  font-size: 18px;
  font-weight: 700;
}
.range-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.range-fields .input {
  min-width: 0;
  height: 46px;
  font-size: 16px;
  padding: 0 10px;
}
@media (max-width: 400px) {
  .range-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}
.range-form .field-error {
  margin-top: 10px;
}
.range-form .alert-buttons {
  margin-top: 16px;
}
/* Rename: the name in a field that wraps (a long one shows whole), and under it a
   line kept for why it can't be, a warning or the folder, so the dialog holds still. */
.rename-field {
  margin-top: 16px;
}
.rename-input {
  display: block;
  height: auto;
  min-height: 52px;
  max-height: 40vh;
  padding: 12px 16px;
  font-size: 17px;
  line-height: 1.4;
  resize: none;
  overflow-wrap: anywhere;
}
.rename-input[aria-invalid="true"] {
  border-color: var(--danger);
}
.rename .rename-note {
  margin-top: 0;
  min-height: 1.4em;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-2);
}
.rename .rename-note.error {
  color: var(--danger);
}
.rename .rename-note.warn {
  color: var(--warning-text);
}
.rename .alert-buttons {
  margin-top: 14px;
}
/* A phone: up where the keyboard leaves it room. */
@media (max-width: 640px) {
  .rename {
    margin-top: max(16px, 8dvh);
  }
}

/* ------------------------------------------------------------------ overlays */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--overlay-fill);
  pointer-events: none;
}
.drop-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  height: 100%;
  border: 3px dashed var(--link-strong);
  border-radius: 26px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.drop-overlay-inner img {
  width: 200px;
  height: auto;
}
.toasts {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--toast-fill);
  color: var(--toast-text);
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(5, 20, 50, 0.28);
  overflow-wrap: anywhere;
  animation: toast-in 0.2s ease-out;
}
.toast.bad {
  background: var(--danger);
  color: #fff;
}
/* The night --danger is a light salmon: dark text on it, as .danger-btn.solid. */
:root[data-theme="dark"] .toast.bad {
  color: #3b0905;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.celebration {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 70;
  pointer-events: none;
}

/* ------------------------------------------------------------------ downloads */

/* History cards: five actions (six with Share) share one row; on a narrow
   card they narrow (never below a 26 px target) rather than wrap. */
.factions .icon-btn {
  flex: 0 1 38px;
  min-width: 26px;
}
a.icon-btn:hover {
  text-decoration: none;
}
/* Audit rows: Download beside Copy link. */
.row-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.audit-table a.secondary-btn {
  color: var(--secondary-content);
  text-decoration: none;
}
.audit-table .secondary-btn.icon-only {
  width: 34px;
  padding: 0;
  flex: none;
}

:root {
  --dl-panel-fill: linear-gradient(rgba(255, 255, 255, 0.97), rgba(243, 249, 255, 0.97));
  --dl-panel-shadow: 0 18px 48px rgba(26, 79, 145, 0.24), 0 2px 8px rgba(26, 79, 145, 0.08);
  --dl-pill-shadow: 0 8px 26px rgba(26, 79, 145, 0.2);
}
:root[data-theme="dark"] {
  --dl-panel-fill: linear-gradient(rgba(20, 58, 99, 0.98) 0, rgba(12, 38, 67, 0.98) 22%, rgba(9, 31, 59, 0.98) 100%);
  --dl-panel-shadow: 0 0 30px rgba(42, 107, 255, 0.22), 0 12px 40px rgba(0, 6, 18, 0.5);
  --dl-pill-shadow: 0 0 20px rgba(42, 107, 255, 0.3);
}

/* The tray: a pill in the bottom-right corner, its panel above it (the pill
   comes first in the page, so Tab goes from it into the panel). */
.dl-tray {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 40;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}
.dl-tray > * {
  pointer-events: auto;
}
.dl-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px 0 16px;
  border-radius: 999px;
  background: var(--bar-fill);
  border: 1px solid var(--bar-border);
  box-shadow: var(--dl-pill-shadow);
  color: var(--text);
  font-size: 16.5px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.dl-pill:hover {
  border-color: var(--seg-sel-border);
}
.dl-pill > .ic {
  width: 24px;
  height: 24px;
  color: var(--link-strong);
  stroke-width: 2.1;
}
.dl-pill[aria-expanded="true"] {
  border-color: var(--seg-sel-border);
  background: var(--seg-sel-fill);
}
/* While something downloads: a thin bar along the pill's foot. */
.dl-pill-bar {
  display: none;
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 6px;
  height: 3px;
  border-radius: 999px;
  background: var(--progress-track);
  overflow: hidden;
}
.dl-pill-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-edge), var(--primary-center));
  transition: width 0.3s linear;
}
.dl-pill.running .dl-pill-bar {
  display: block;
}
.dl-pill.paused > .ic,
.dl-pill.paused {
  color: var(--warning-text);
}
.dl-pill.paused .dl-pill-bar > span {
  background: var(--warning);
}

.dl-panel {
  display: flex;
  flex-direction: column;
  width: min(470px, calc(100vw - 32px));
  max-height: min(72vh, 640px);
  border-radius: var(--r-card);
  background: var(--dl-panel-fill);
  border: 1px solid var(--bar-border);
  box-shadow: var(--dl-panel-shadow);
  overflow: hidden;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.dl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 10px 6px 20px;
}
.dl-title {
  flex: 1;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.dl-head .icon-btn {
  color: var(--icon);
}
.dl-list {
  list-style: none;
  margin: 0;
  padding: 0 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.dl-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 12px 8px 12px 10px;
}
.dl-item + .dl-item {
  border-top: 1px solid var(--divider);
}
.dl-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--tile-fill);
  border: 1px solid var(--seg-outline);
  color: var(--accent);
}
.dl-icon .ic {
  width: 24px;
  height: 24px;
  stroke-width: 1.7;
}
.dl-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dl-name {
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-bar {
  margin-top: 3px;
}
.dl-line {
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.dl-line .nw {
  white-space: nowrap;
}
.dl-error {
  font-size: 13.5px;
  color: var(--danger);
  overflow-wrap: anywhere;
}
.dl-note {
  flex: 1 1 100%;
  padding-left: 56px; /* under the name: past the icon and its gap */
  font-size: 13px;
  color: var(--text-2);
}
.dl-plain {
  align-self: flex-start;
  padding: 2px 0;
  font-size: 14px;
  color: var(--link-strong);
}
.dl-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
}
.dl-actions .icon-btn {
  width: 38px;
  height: 38px;
  color: var(--icon);
}
.dl-actions .icon-btn .ic {
  width: 21px;
  height: 21px;
}
/* A button's word: shown on a phone, where the buttons have their own line (elsewhere the tooltip). */
.dl-actions .icon-btn .dl-btn-text {
  display: none;
}
.dl-actions [data-act="cancel"],
.dl-actions [data-act="remove"] {
  color: var(--text-2);
}
.dl-actions [data-act="remove"]:hover {
  color: var(--danger);
}
.dl-actions .dl-save {
  min-height: 38px;
  padding: 0 16px 0 12px;
  gap: 8px;
  font-size: 15.5px;
  margin-right: 4px;
}
.dl-actions .dl-save .ic {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}
/* State colours, as the upload queue's. */
.dl-item[data-status="done"] .dl-bar > div,
.dl-item[data-status="saved"] .dl-bar > div,
.dl-item[data-status="saving"] .dl-bar > div {
  background: var(--success);
}
.dl-item[data-status="done"] .dl-line > span:first-child {
  color: var(--success);
  font-weight: 600;
}
.dl-item[data-status="paused"] .dl-bar > div,
.dl-item[data-status="interrupted"] .dl-bar > div,
.dl-item[data-status="auth"] .dl-bar > div,
.dl-item.paused .dl-bar > div {
  background: var(--warning);
}
.dl-item[data-status="paused"] .dl-line > span:first-child,
.dl-item[data-status="interrupted"] .dl-line > span:first-child,
.dl-item[data-status="auth"] .dl-line > span:first-child,
.dl-item.paused .dl-line > span:first-child {
  color: var(--warning-text);
  font-weight: 600;
}
.dl-item[data-status="error"] .dl-bar > div {
  background: var(--danger);
}
.dl-item[data-status="error"] .dl-line > span:first-child {
  color: var(--danger);
  font-weight: 600;
}
.dl-item[data-status="elsewhere"] .dl-bar > div {
  background: var(--text-2);
}
.dl-foot {
  padding: 10px 20px 14px;
  border-top: 1px solid var(--divider);
  font-size: 13.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.dl-foot .nw {
  white-space: nowrap;
}
.dl-foot p + p {
  margin-top: 3px;
}
/* The last cards stay clear of the pill. */
body.has-downloads .page-history {
  padding-bottom: 120px;
}

/* ------------------------------------------------------------------ narrower screens */

@media (max-width: 1280px) {
  :root {
    --fs-title: 40px;
  }
  .topbar-inner {
    padding: 0 28px 0 28px;
  }
  .page-upload {
    padding-left: 32px;
    padding-right: 24px;
  }
}

@media (max-width: 999px) {
  :root {
    --fs-body: 17px;
    --fs-brand: 28px;
    --fs-nav: 18px;
    --fs-title: 30px;
    --fs-h2: 26px;
    --fs-banner: 17px;
    --header-h: 72px;
    --r-card: 16px;
  }
  .brand-logo {
    width: auto;
    height: 52px;
  }
  .brand {
    margin-right: 20px;
  }
  .nav-tabs .tab {
    padding: 4px 14px 0;
  }
  .page-upload {
    padding: 18px 20px calc(var(--bar-h) + 24px + env(safe-area-inset-bottom));
    max-width: 720px;
  }
  .page-history {
    padding: 18px 16px 48px;
  }
  .page-title {
    margin-top: 0;
  }
  .banner {
    min-height: 56px;
    margin-top: 12px;
    padding: 6px 10px 6px 14px;
    gap: 12px;
  }
  .banner .ic-warn {
    width: 28px;
    height: 28px;
  }
  .banner-action .ic {
    width: 22px;
    height: 22px;
  }
  .banner .banner-link {
    font-size: 15.5px;
  }
  .col-side {
    margin-top: 16px;
  }
  .queue-head {
    margin-top: 28px;
    margin-bottom: 12px;
  }
  .dropzone {
    min-height: 0;
    flex: none;
    padding: 26px 16px 30px;
    background: transparent;
  }
  .dropzone-art {
    width: 168px;
  }
  .dropzone-title {
    font-size: 21px;
  }
  .dropzone-sub {
    font-size: 16px;
  }
  .has-files .dropzone {
    background: var(--dropzone-dash) no-repeat, var(--dropzone-fill);
    /* The slim strip: the wings beside its two lines, stacked (one row is too narrow on a phone). */
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: center;
    column-gap: 14px;
    row-gap: 0;
    padding: 12px 16px;
    text-align: left;
  }
  .has-files .dropzone-art {
    grid-row: span 2;
  }
  .bottombar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    border-width: 1px 0 0;
  }
  .square-btn {
    width: 64px;
    height: 56px;
  }
  .square-btn .ic {
    width: 30px;
    height: 30px;
  }
  .add-btn {
    flex: 1;
    width: auto;
    height: 56px;
    font-size: 20px;
    padding-right: 24px;
  }
  .add-btn .ic {
    width: 28px;
    height: 28px;
  }
  .dest-card {
    padding: 14px 16px 6px;
  }
  .dest-row {
    gap: 12px;
  }
  .dest-title {
    font-size: 21px;
  }
  .dest-domain {
    flex: 0 1 auto;
    margin-left: auto;
  }
  .dest-domain select {
    height: 46px;
    font-size: 17px;
    border-color: transparent;
    background: transparent;
    padding: 0 44px 0 10px;
    text-align: right;
  }
  .dest-domain .select-chev {
    right: 8px;
    width: 24px;
    height: 24px;
  }
  .dest-seg {
    margin-top: 12px;
    height: 50px;
  }
  .dest-seg > button {
    font-size: 15.5px;
    gap: 8px;
  }
  .dest-seg .ic {
    width: 22px;
    height: 22px;
  }
  .host-row {
    margin-top: 10px;
    gap: 14px;
    min-height: 40px;
    padding: 0;
  }
  .host-icon {
    width: 24px;
    height: 24px;
  }
  .host-name {
    font-size: 17px;
  }
  .host-kind {
    font-size: 15px;
  }
  .dest-card > .divider {
    margin-top: 10px;
  }
  .options-toggle {
    min-height: 52px;
    margin-top: 4px;
    gap: 16px;
    padding: 0;
  }
  .opt-icon {
    width: 26px;
    height: 26px;
  }
  .opt-label {
    font-size: 17px;
  }
  .opt-chev {
    width: 24px;
    height: 24px;
  }
  .options-body .switch-label {
    font-size: 17px;
  }
  .upload-btn {
    height: 54px;
    font-size: 18px;
  }
  .qitem {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    --qlead: 64px;
    scroll-margin-bottom: calc(var(--bar-h) + 12px + env(safe-area-inset-bottom));
  }
  .qthumb {
    width: 52px;
    height: 52px;
  }
  .qactions {
    max-width: none;
    width: 100%;
    justify-content: flex-start;
  }
  .qitem {
    position: relative;
  }
  .qitem .qbody {
    padding-right: 34px;
  }
  .qactions .qremove {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
  }
  /* While a file uploads, Cancel takes the x's corner (the x is hidden then): an icon, like it. */
  .qactions .secondary-btn.cancel {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 36px;
    min-height: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    box-shadow: none;
    color: var(--text-2);
  }
  .qactions .secondary-btn.cancel .ic {
    width: 20px;
    height: 20px;
  }
  .qactions .secondary-btn.cancel span {
    display: none;
  }
  /* Waiting, queued and uploading rows have only the x or Cancel: no empty actions line under them. */
  .qactions:not(:has(> .secondary-btn:not([hidden]):not(.cancel))) {
    width: auto;
    margin-left: -12px;
  }
  .sub-tabs {
    margin-top: 18px;
    gap: 4px;
  }
  .sub-tabs .tab {
    font-size: 17px;
    height: 46px;
    padding: 0 16px;
  }
  .panel {
    margin-top: 16px;
  }
  .audit-card {
    min-height: 0;
    padding: 12px 10px 6px;
  }
  .audit-where {
    font-size: 17px;
    gap: 12px;
    padding-left: 4px;
  }
  .audit-where .ic {
    width: 26px;
    height: 26px;
  }
  .audit-buttons .secondary-btn {
    height: 46px;
    font-size: 16px;
    padding: 0 14px;
    gap: 8px;
  }
  .audit-buttons .secondary-btn .ic {
    width: 22px;
    height: 22px;
  }
  .audit-buttons .secondary-btn.icon-only {
    width: 46px;
  }
  .empty-state {
    padding: 40px 12px 36px;
  }
  .empty-title {
    font-size: 21px;
  }
  .empty-sub {
    font-size: 16px;
  }
  body[data-route="upload"] .toasts {
    bottom: calc(var(--bar-h) + 8px + env(safe-area-inset-bottom));
  }
  /* History has no bottom bar. */
  body:not([data-route="upload"]) .toasts {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 1099px) {
  /* Below a 1030 px table the columns get too narrow: the audit table becomes stacked cards. */
  .audit-table,
  .audit-table tbody,
  .audit-table tr,
  .audit-table td {
    display: block;
    width: 100%;
  }
  .audit-table {
    table-layout: auto;
  }
  .audit-table thead {
    display: none;
  }
  .audit-table tr {
    padding: 10px 4px;
    border-bottom: 1px solid var(--divider);
  }
  .audit-table td {
    padding: 3px 4px;
    border: 0;
    display: flex;
    gap: 10px;
    align-items: baseline;
  }
  .audit-table td,
  .audit-table td.c-time,
  .audit-table td.c-type,
  .audit-table td.c-where,
  .audit-table td.c-src,
  .audit-table td.c-email,
  .audit-table td.c-act {
    width: 100%;
  }
  .audit-table td.c-act::before {
    content: "";
  }
  .audit-table td::before {
    content: attr(data-label);
    flex: none;
    width: 64px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-2);
  }
  .audit-table td.c-empty {
    display: none;
  }
  .audit-table td .cell-lines {
    flex: 1;
  }
}

@media (max-width: 760px) {
  .files.grid .day-items {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
    gap: 10px;
  }
  .files-toolbar {
    padding: 10px;
    gap: 10px;
  }
  .filters {
    gap: 8px;
  }
  .filters .select-wrap.small select {
    font-size: 15px;
    padding: 0 34px 0 10px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 64px;
  }
  /* Google's button goes under the text, lined up with it (and Sign out under
     that if the two don't fit side by side: 360px phones). */
  .banner-actions {
    flex-basis: 100%;
    flex-wrap: wrap;
    row-gap: 6px;
    margin-left: 40px;
    padding-bottom: 4px;
  }
  .topbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 6px 12px 0 10px;
  }
  .brand {
    margin-right: 0;
    gap: 8px;
  }
  .brand-logo {
    width: auto;
    height: 44px;
  }
  .brand-name {
    font-size: 24px;
  }
  .topbar-actions {
    gap: 8px;
  }
  .topbar .icon-btn .ic {
    width: 28px;
    height: 28px;
  }
  .nav {
    order: 3;
    flex-basis: 100%;
    height: 46px;
  }
  .nav-tabs {
    width: 100%;
  }
  .nav-tabs .tab {
    flex: 1;
    font-size: 17px;
    padding-top: 0;
  }
  .page-upload {
    padding-left: 14px;
    padding-right: 14px;
  }
  .page-title {
    font-size: 26px;
  }
  .page-upload .page-title {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .page-upload .banner {
    margin-top: 0;
  }
  .files.list .fcard {
    flex-wrap: wrap;
  }
  .files.list .factions {
    width: 100%;
    padding-left: 70px;
  }
  .date-filter > span {
    display: none;
  }
  .audit-modes .secondary-btn span {
    font-size: 15px;
  }
  .audit-where {
    flex-basis: 100%;
  }
  .audit-buttons {
    width: 100%;
  }
  .audit-modes {
    flex: 1;
  }
  .audit-modes .secondary-btn {
    flex: 1;
    min-width: 0;
  }
  .audit-buttons .secondary-btn.icon-only {
    flex: none;
  }
  .sheet {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    outline: 0;
  }
  .sheet-body {
    padding: 4px 12px calc(24px + env(safe-area-inset-bottom));
  }
  .sheet-head {
    padding: calc(10px + env(safe-area-inset-top)) 8px 6px 18px;
  }
  .settings-section {
    padding: 16px;
  }
  /* The queue's buttons get their own line under the title and count (which keep
     theirs whole), shared out across it, tall enough for a thumb. */
  .queue-actions {
    margin-left: 0;
    width: 100%;
    gap: 6px;
  }
  .chip-btn {
    height: 34px;
    padding: 0 9px;
    font-size: 14px;
    gap: 5px;
  }
  .queue-actions .chip-btn {
    flex: 1 1 auto;
    justify-content: center;
    height: 42px;
  }
  .files-toolbar .search {
    order: 1;
    flex: 1 1 0;
    min-width: 0;
  }
  .files-toolbar .view-toggle {
    order: 2;
  }
  .files-toolbar #filesRefresh {
    order: 3;
  }
  .files-toolbar .filters {
    order: 4;
  }
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    /* overflow clips both ways: room for the 3 px focus ring and its offset. */
    width: calc(100% + 12px);
    margin: -6px;
    padding: 6px;
    scrollbar-width: none;
  }
  .filters > * {
    flex: none;
  }
  .qactions .secondary-btn span {
    display: none;
  }
  .qactions .secondary-btn {
    width: 44px;
    padding: 0;
  }
  .qactions .secondary-btn.retry span {
    display: inline;
  }
  .qactions .secondary-btn.retry {
    width: auto;
    padding: 0 14px;
  }
}

@media (max-width: 380px) {
  .brand-name {
    font-size: 21px;
  }
  .dest-seg > button .ic {
    display: none;
  }
}

@media (max-width: 999px) {
  .dl-tray {
    right: 12px;
    left: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    gap: 10px;
  }
  /* On the Upload page the pill sits over the fixed bottom bar. */
  body[data-route="upload"] .dl-tray {
    bottom: calc(var(--bar-h) - 10px + env(safe-area-inset-bottom));
  }
  .dl-pill {
    min-height: 46px;
    padding: 0 18px 0 14px;
    font-size: 15.5px;
  }
  .dl-panel {
    width: 100%;
    max-height: min(64vh, calc(100dvh - 180px));
  }
  body.has-downloads .page-history {
    padding-bottom: 96px;
  }
  body.has-downloads .page-upload {
    padding-bottom: calc(var(--bar-h) + 84px + env(safe-area-inset-bottom));
  }
  /* Toasts ("Link copied", "Saved film.bin") rise above the pill instead of covering it. */
  body.has-downloads[data-route="upload"] .toasts {
    bottom: calc(var(--bar-h) - 10px + 46px + 12px + env(safe-area-inset-bottom));
  }
  body.has-downloads:not([data-route="upload"]) .toasts {
    bottom: calc(14px + 46px + 12px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 999px) and (min-width: 520px) {
  .dl-tray {
    left: auto;
  }
  .dl-panel {
    width: min(470px, calc(100vw - 24px));
  }
}
/* On the Upload page of a short screen (a phone on its side, a small phone) the
   open panel, stacked above the bottom bar, would reach over the header: it opens
   over the bar instead, where its height limit keeps it below the header. */
@media (max-width: 999px) and (max-height: 760px) {
  body[data-route="upload"] .dl-tray.open {
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
}
/* So short that the list would show less than a row: the whole panel scrolls instead. */
@media (max-height: 520px) {
  .dl-panel {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .dl-list {
    flex: none;
    overflow: visible;
  }
}
/* A phone: each download's buttons get a line of their own under it, with words,
   as wide as the row (the name and the numbers keep the whole width above). */
@media (max-width: 519px) {
  .dl-list {
    padding: 0 8px;
  }
  .dl-item {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 10px;
    padding: 12px 6px;
  }
  .dl-body {
    flex: 1 1 calc(100% - 56px);
  }
  .dl-note {
    order: 1;
    margin-top: -6px;
  }
  .dl-actions {
    order: 2; /* under the note */
    flex: 1 1 100%;
    gap: 10px;
  }
  .dl-actions > * {
    flex: 1 1 auto;
  }
  .dl-actions .icon-btn,
  .dl-actions .dl-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding: 0 14px;
    border-radius: var(--r-ctl);
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
  }
  .dl-actions .icon-btn {
    background: var(--secondary-fill);
    border: 1px solid var(--secondary-border);
    color: var(--secondary-content);
  }
  .dl-actions .icon-btn:hover {
    border-color: var(--seg-sel-border);
    background: var(--field-fill-solid);
  }
  .dl-actions .dl-save {
    font-weight: 600;
  }
  .dl-actions .icon-btn .ic,
  .dl-actions .dl-save .ic {
    width: 19px;
    height: 19px;
  }
  .dl-actions .icon-btn .dl-btn-text {
    display: inline;
  }
  .dl-actions [data-act="remove"]:hover {
    color: var(--danger);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .sky-clouds {
    animation: none !important;
  }
}
