:root {
  color-scheme: light;

  /* Material Design 3 roles — hard-coded purple seed */
  --md-sys-color-primary: #6750a4;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #eaddff;
  --md-sys-color-on-primary-container: #21005d;
  --md-sys-color-secondary: #625b71;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #e8def8;
  --md-sys-color-on-secondary-container: #1d192b;
  --md-sys-color-tertiary: #7d5260;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #ffd8e4;
  --md-sys-color-on-tertiary-container: #31111d;
  --md-sys-color-error: #b3261e;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #f9dedc;
  --md-sys-color-on-error-container: #410e0b;
  --md-sys-color-background: #fffbfe;
  --md-sys-color-on-background: #1d1b20;
  --md-sys-color-surface: #fffbfe;
  --md-sys-color-on-surface: #1d1b20;
  --md-sys-color-surface-variant: #e7e0ec;
  --md-sys-color-on-surface-variant: #49454f;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f7f2fa;
  --md-sys-color-surface-container: #f3edf7;
  --md-sys-color-surface-container-high: #ece6f0;
  --md-sys-color-surface-container-highest: #e6e0e9;
  --md-sys-color-outline: #79747e;
  --md-sys-color-outline-variant: #cac4d0;
  --md-sys-color-inverse-surface: #322f35;
  --md-sys-color-inverse-on-surface: #f5eff7;
  --md-sys-color-scrim: #000000;

  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-full: 999px;
  --md-sys-elevation-1: 0 1px 2px rgb(0 0 0 / 0.08), 0 1px 3px 1px rgb(0 0 0 / 0.04);
  --md-sys-elevation-2: 0 2px 6px 2px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.12);
  --md-sys-elevation-3: 0 8px 24px 4px rgb(0 0 0 / 0.12), 0 2px 6px rgb(0 0 0 / 0.12);
  --md-sys-motion-duration-short: 160ms;
  --md-sys-motion-duration-medium: 260ms;
  --md-sys-motion-duration-long: 420ms;
  --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-standard-accelerate: cubic-bezier(0.3, 0, 1, 1);
  --md-sys-motion-easing-standard-decelerate: cubic-bezier(0, 0, 0, 1);
  --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-emphasized-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15);
  --md-sys-motion-easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
  --app-glass-background: color-mix(in srgb, var(--md-sys-color-surface) 78%, transparent);
  --app-glass-backdrop: blur(20px) saturate(145%);
  --content-max-width: 1760px;

  font-family:
    "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Inter, Roboto,
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--md-sys-color-on-background);
  background: var(--md-sys-color-background);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --md-sys-color-primary: #d0bcff;
  --md-sys-color-on-primary: #381e72;
  --md-sys-color-primary-container: #4f378b;
  --md-sys-color-on-primary-container: #eaddff;
  --md-sys-color-secondary: #ccc2dc;
  --md-sys-color-on-secondary: #332d41;
  --md-sys-color-secondary-container: #4a4458;
  --md-sys-color-on-secondary-container: #e8def8;
  --md-sys-color-tertiary: #efb8c8;
  --md-sys-color-on-tertiary: #492532;
  --md-sys-color-tertiary-container: #633b48;
  --md-sys-color-on-tertiary-container: #ffd8e4;
  --md-sys-color-error: #f2b8b5;
  --md-sys-color-on-error: #601410;
  --md-sys-color-error-container: #8c1d18;
  --md-sys-color-on-error-container: #f9dedc;
  --md-sys-color-background: #141218;
  --md-sys-color-on-background: #e6e0e9;
  --md-sys-color-surface: #141218;
  --md-sys-color-on-surface: #e6e0e9;
  --md-sys-color-surface-variant: #49454f;
  --md-sys-color-on-surface-variant: #cac4d0;
  --md-sys-color-surface-container-lowest: #0f0d13;
  --md-sys-color-surface-container-low: #1d1b20;
  --md-sys-color-surface-container: #211f26;
  --md-sys-color-surface-container-high: #2b2930;
  --md-sys-color-surface-container-highest: #36343b;
  --md-sys-color-outline: #938f99;
  --md-sys-color-outline-variant: #49454f;
  --md-sys-color-inverse-surface: #e6e0e9;
  --md-sys-color-inverse-on-surface: #322f35;
  --md-sys-elevation-1: 0 1px 3px rgb(0 0 0 / 0.34);
  --md-sys-elevation-2: 0 3px 8px rgb(0 0 0 / 0.38);
  --md-sys-elevation-3: 0 10px 30px rgb(0 0 0 / 0.46);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--md-sys-color-background);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--md-sys-color-primary-container) 36%, transparent), transparent 34rem),
    var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  transition:
    background-color 440ms var(--md-sys-motion-easing-emphasized),
    color 360ms var(--md-sys-motion-easing-emphasized);
}

body.heavy-dialog-open {
  position: fixed;
  top: var(--heavy-dialog-scroll-offset, 0);
  right: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button,
[role="button"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--md-sys-color-primary) 42%, transparent);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.icon {
  width: 24px;
  height: 24px;
  display: block;
  flex: 0 0 auto;
  overflow: visible;
  fill: currentColor;
}

.eyebrow {
  display: block;
  color: var(--md-sys-color-primary);
  font-size: 12px;
  font-weight: 750;
  line-height: 16px;
  letter-spacing: 0.12em;
}

/* Login */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  padding: 40px;
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 65%, transparent);
  border-radius: 32px;
  background: var(--md-sys-color-surface-container-lowest);
  box-shadow: var(--md-sys-elevation-3);
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  box-shadow: 0 5px 18px color-mix(in srgb, var(--md-sys-color-primary) 18%, transparent);
}

.brand-mark .icon {
  width: 27px;
  height: 27px;
}

.login-mark {
  width: 58px;
  height: 58px;
  margin-bottom: 30px;
  border-radius: 20px;
}

.login-mark .icon {
  width: 32px;
  height: 32px;
}

.login-heading {
  margin-bottom: 28px;
}

.login-heading h1 {
  margin: 7px 0 8px;
  font-size: 34px;
  font-weight: 600;
  line-height: 42px;
  letter-spacing: -0.035em;
}

.login-heading p,
.dialog-supporting,
.muted {
  margin: 0;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  line-height: 21px;
}

.text-field,
.connection-field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.text-field > span:first-child,
.connection-field > span:first-child {
  padding-left: 4px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  font-weight: 700;
}

.field-control {
  position: relative;
  display: block;
}

.field-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 17px;
  width: 21px;
  height: 21px;
  color: var(--md-sys-color-on-surface-variant);
  transform: translateY(-50%);
  pointer-events: none;
}

input,
textarea {
  width: 100%;
  padding: 0 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-small);
  outline: 0;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  caret-color: var(--md-sys-color-primary);
  transition:
    border-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    background var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

input {
  height: 56px;
}

textarea {
  min-height: 144px;
  padding-block: 14px;
  resize: vertical;
}

.field-control input {
  padding-left: 52px;
}

input::placeholder,
textarea::placeholder {
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.72;
}

input:hover,
textarea:hover {
  border-color: var(--md-sys-color-on-surface);
}

input:focus,
textarea:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: inset 0 0 0 1px var(--md-sys-color-primary);
}

.form-error {
  min-height: 20px;
  margin-top: 12px;
  color: var(--md-sys-color-error);
  font-size: 13px;
  text-align: center;
}

/* Buttons and state layer */
button {
  position: relative;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  overflow: hidden;
  border: 0;
  border-radius: var(--md-sys-shape-corner-full);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  transition:
    background var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.action-link {
  position: relative;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  overflow: hidden;
  border: 0;
  border-radius: var(--md-sys-shape-corner-full);
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.action-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--md-sys-color-primary) 42%, transparent);
  outline-offset: 3px;
}

button::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.action-link::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

button:hover::before,
.action-link:hover::before {
  opacity: 0.08;
}

button:active,
.action-link:active {
  transform: scale(0.97);
}

button:active::before,
.action-link:active::before {
  opacity: 0.12;
}

button:disabled {
  cursor: default;
  opacity: 0.38;
  transform: none;
}

.ripple {
  position: absolute;
  z-index: 4;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.16;
  pointer-events: none;
  transform: scale(0);
  animation: ripple 520ms var(--md-sys-motion-easing-standard-decelerate);
}

@keyframes ripple {
  to {
    opacity: 0;
    transform: scale(4);
  }
}

/* Non-linear page and theme transitions */
.gallery {
  view-transition-name: asset-gallery;
}

html.theme-transition .gallery {
  view-transition-name: none;
}

.bottom-nav {
  view-transition-name: bottom-navigation;
}

::view-transition-group(bottom-navigation) {
  z-index: 120;
  animation: none;
}

html.theme-transition::view-transition-old(root),
html.theme-transition::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

html.theme-transition::view-transition-new(root) {
  animation: theme-reveal 540ms var(--md-sys-motion-easing-emphasized-decelerate);
}

::view-transition-old(asset-gallery) {
  animation: gallery-out 170ms var(--md-sys-motion-easing-emphasized-accelerate) both;
}

::view-transition-new(asset-gallery) {
  animation: gallery-in var(--md-sys-motion-duration-long) var(--md-sys-motion-easing-emphasized-decelerate) both;
}

@keyframes theme-reveal {
  from {
    clip-path: circle(0 at calc(100% - 92px) 38px);
    opacity: 0.72;
  }
  to {
    clip-path: circle(150vmax at calc(100% - 92px) 38px);
    opacity: 1;
  }
}

@keyframes gallery-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

@keyframes gallery-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.filled-button,
.tonal-button,
.outlined-button,
.text-button,
.danger-button {
  min-height: 48px;
}

.filled-button {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-1);
}

.filled-button:hover {
  box-shadow: var(--md-sys-elevation-2);
}

.tonal-button {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.outlined-button {
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-primary);
}

.text-button {
  color: var(--md-sys-color-primary);
}

.danger-button {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.wide {
  width: 100%;
}

.compact {
  min-height: 40px;
  padding-inline: 14px;
}

.icon-button {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 50%;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
}

/* Application shell */
.app-shell {
  width: min(var(--content-max-width), 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 24px 128px;
}

.top-app-bar {
  position: sticky;
  z-index: 30;
  top: 0;
  isolation: isolate;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
  background: transparent;
  transition:
    background-color 440ms var(--md-sys-motion-easing-emphasized),
    color 360ms var(--md-sys-motion-easing-emphasized);
}

.top-app-bar::before {
  position: absolute;
  z-index: -1;
  inset-block: 0;
  left: 50%;
  width: 100vw;
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 28%, transparent);
  background: var(--app-glass-background);
  -webkit-backdrop-filter: var(--app-glass-backdrop);
  backdrop-filter: var(--app-glass-backdrop);
  content: "";
  transform: translateX(-50%);
}

.brand {
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-copy {
  display: grid;
}

.brand-copy strong {
  font-size: 20px;
  font-weight: 750;
  line-height: 24px;
  letter-spacing: -0.03em;
}

.brand-copy small {
  margin-top: 1px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
}

.search {
  position: relative;
  min-width: 0;
  max-width: 620px;
  flex: 1;
}

.search .search-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 18px;
  width: 21px;
  height: 21px;
  color: var(--md-sys-color-on-surface-variant);
  transform: translateY(-50%);
  pointer-events: none;
}

.search input {
  height: 50px;
  padding: 0 48px;
  border: 0;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-high);
}

.search input:hover {
  background: var(--md-sys-color-surface-container-highest);
}

.search input:focus {
  box-shadow: inset 0 0 0 2px var(--md-sys-color-primary);
}

.search-syntax-menu {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  left: 0;
  width: min(420px, 100%);
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 72%, transparent);
  border-radius: var(--md-sys-shape-corner-large);
  background: color-mix(in srgb, var(--md-sys-color-surface-container-high) 97%, transparent);
  box-shadow: var(--md-sys-elevation-3);
}

.search-syntax-menu[hidden] {
  display: none;
}

.search-syntax-option {
  width: 100%;
  min-height: 52px;
  justify-content: flex-start;
  padding: 7px 12px;
  border-radius: var(--md-sys-shape-corner-medium);
  color: var(--md-sys-color-on-surface);
  text-align: left;
}

.search-syntax-option[aria-selected="true"] {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.search-syntax-option code {
  min-width: 104px;
  color: var(--md-sys-color-primary);
  font: 700 13px/20px ui-monospace, "Cascadia Code", monospace;
}

.search-syntax-option span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.search-syntax-option strong {
  font-size: 13px;
  line-height: 18px;
}

.search-syntax-option small {
  overflow: hidden;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 10px;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search kbd {
  position: absolute;
  top: 50%;
  right: 14px;
  padding: 2px 7px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  color: var(--md-sys-color-on-surface-variant);
  background: transparent;
  font: 12px/18px ui-monospace, monospace;
  transform: translateY(-50%);
  pointer-events: none;
}

.app-bar-actions,
.header-stats {
  display: flex;
  align-items: center;
}

.app-bar-actions {
  flex: 0 0 auto;
  margin-left: auto;
  gap: 8px;
}

.menu-anchor {
  position: relative;
  flex: 0 0 auto;
}

.floating-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  min-width: 184px;
  display: grid;
  gap: 2px;
  padding: 6px;
  visibility: hidden;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 72%, transparent);
  border-radius: var(--md-sys-shape-corner-large);
  background: color-mix(in srgb, var(--md-sys-color-surface-container-high) 96%, transparent);
  color: var(--md-sys-color-on-surface);
  box-shadow: var(--md-sys-elevation-3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  transition:
    opacity 180ms var(--md-sys-motion-easing-emphasized-accelerate),
    transform 180ms var(--md-sys-motion-easing-emphasized-accelerate),
    visibility 0s linear 180ms;
}

.floating-menu.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition:
    opacity 240ms var(--md-sys-motion-easing-standard),
    transform 240ms var(--md-sys-motion-easing-standard),
    visibility 0s;
}

.menu-option {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  padding: 0 12px;
  border-radius: var(--md-sys-shape-corner-medium);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.menu-option > .icon:first-child {
  width: 20px;
  height: 20px;
}

.menu-option[aria-checked="true"] {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.menu-check {
  width: 18px;
  height: 18px;
  margin-left: auto;
  opacity: 0;
  transform: scale(0.72);
  transition:
    opacity var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.menu-option[aria-checked="true"] .menu-check {
  opacity: 1;
  transform: scale(1);
}

.theme-menu {
  width: 190px;
}

.header-stats {
  gap: 7px;
  margin-right: 4px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
}

.header-stats .icon {
  width: 20px;
  height: 20px;
}

.header-stats strong {
  color: var(--md-sys-color-on-surface);
}

.stats-divider {
  width: 1px;
  height: 16px;
  background: var(--md-sys-color-outline-variant);
}

/* Hero */
.hero {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, 0.7fr);
  gap: 32px;
  margin: 20px 0 42px;
  padding: 34px;
  overflow: hidden;
  border-radius: 34px;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--md-sys-color-primary-container) 92%, white 8%),
      color-mix(in srgb, var(--md-sys-color-tertiary-container) 72%, var(--md-sys-color-surface) 28%)
    );
  color: var(--md-sys-color-on-primary-container);
  transition:
    background-color 440ms var(--md-sys-motion-easing-emphasized),
    color 360ms var(--md-sys-motion-easing-emphasized);
}

:root[data-theme="dark"] .hero {
  background:
    linear-gradient(
      135deg,
      var(--md-sys-color-primary-container),
      color-mix(in srgb, var(--md-sys-color-tertiary-container) 70%, var(--md-sys-color-surface-container) 30%)
    );
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero .eyebrow {
  color: inherit;
  opacity: 0.72;
}

.hero h1 {
  max-width: 760px;
  margin: 9px 0 14px;
  font-size: clamp(38px, 5.2vw, 62px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero p {
  max-width: 680px;
  margin: 0;
  color: color-mix(in srgb, var(--md-sys-color-on-primary-container) 78%, transparent);
  font-size: 16px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.drop-zone {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  align-self: stretch;
  gap: 10px;
  padding: 24px;
  border: 1px dashed color-mix(in srgb, var(--md-sys-color-on-primary-container) 38%, transparent);
  border-radius: 26px;
  background: color-mix(in srgb, var(--md-sys-color-surface) 52%, transparent);
  color: var(--md-sys-color-on-primary-container);
  text-align: center;
  transition:
    border-color var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    background var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}

.drop-zone:hover,
.drop-zone.over {
  border-color: var(--md-sys-color-primary);
  background: color-mix(in srgb, var(--md-sys-color-primary-container) 72%, var(--md-sys-color-surface) 28%);
}

.drop-zone.over {
  transform: scale(1.015);
}

.drop-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 23px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-2);
}

.drop-icon .icon {
  width: 34px;
  height: 34px;
}

.drop-copy {
  display: grid;
  gap: 3px;
}

.drop-copy strong {
  font-size: 16px;
}

.drop-copy span {
  font-size: 13px;
  opacity: 0.74;
}

.format-chip {
  margin-top: 7px;
  padding: 6px 10px;
  border-radius: var(--md-sys-shape-corner-small);
  background: color-mix(in srgb, var(--md-sys-color-surface) 58%, transparent);
  font-size: 10px;
  line-height: 15px;
  opacity: 0.78;
}

/* Library controls */
.library-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding-inline: 2px;
}

.library-heading h2 {
  margin: 5px 0 0;
  font-size: 29px;
  font-weight: 650;
  line-height: 36px;
  letter-spacing: -0.035em;
}

.library-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-grid select,
.filter-grid input,
.text-field select {
  height: 48px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  outline: 0;
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  font: inherit;
}

.sort-button {
  min-width: 154px;
  min-height: 48px;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  font-size: 13px;
}

.sort-button[aria-expanded="true"] {
  border-color: var(--md-sys-color-primary);
  box-shadow: inset 0 0 0 1px var(--md-sys-color-primary);
}

.sort-chevron {
  width: 20px;
  height: 20px;
  color: var(--md-sys-color-on-surface-variant);
  transition: transform 240ms var(--md-sys-motion-easing-standard);
}

.sort-button[aria-expanded="true"] .sort-chevron {
  transform: rotate(180deg);
}

.sort-menu {
  width: 184px;
}

.text-field select {
  width: 100%;
  min-height: 56px;
}

.text-field > .field-label {
  padding-left: 4px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  font-weight: 700;
}

.share-duration-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 10px;
}

.share-duration-control input,
.duration-unit-toggle {
  height: 56px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container-low);
}

.duration-unit-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 3px;
}

.duration-unit-toggle button {
  min-width: 0;
  min-height: 48px;
  padding: 0 8px;
  border-radius: 13px;
  color: var(--md-sys-color-on-surface-variant);
}

.duration-unit-toggle button.selected {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.share-expiry-control {
  width: 100%;
  transition: margin-bottom 240ms var(--md-sys-motion-easing-standard);
}

.share-expiry-control:has(.share-expiry-menu:not([hidden])) {
  margin-bottom: 296px;
}

.share-expiry-button {
  width: 100%;
  min-height: 56px;
  justify-content: space-between;
  padding: 0 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  font-size: 14px;
  font-weight: 500;
}

.share-expiry-button .select-chevron {
  width: 20px;
  height: 20px;
  color: var(--md-sys-color-on-surface-variant);
  transition: transform 240ms var(--md-sys-motion-easing-standard);
}

.share-expiry-button[aria-expanded="true"] .select-chevron {
  transform: rotate(180deg);
}

.share-expiry-menu {
  right: 0;
  left: 0;
  width: 100%;
  min-width: 0;
  transform-origin: top center;
}

.field-supporting {
  padding-left: 4px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
  line-height: 16px;
}

.text-field select[multiple] {
  min-height: 110px;
  padding: 8px;
}

.filter-panel {
  display: grid;
  gap: 16px;
  margin: -4px 0 20px;
  padding: 18px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 24px;
  background: var(--md-sys-color-surface-container-low);
  animation: panel-enter 280ms var(--md-sys-motion-easing-emphasized-decelerate);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.filter-grid label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.filter-grid label > span {
  padding-left: 4px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
  font-weight: 700;
}

.filter-grid select,
.filter-grid input {
  width: 100%;
}

.quick-filters,
.selection-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 36px;
  padding-inline: 14px;
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
}

.filter-chip.selected {
  border-color: transparent;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.selection-bar {
  position: sticky;
  z-index: 20;
  top: 88px;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 8px 10px 8px 18px;
  border-radius: 20px;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  box-shadow: var(--md-sys-elevation-2);
  font-size: 14px;
}

.selection-copy,
.selection-bar > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selection-copy .icon {
  width: 20px;
  height: 20px;
}

/* Asset feed */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: 1px;
  column-gap: 18px;
  row-gap: 0;
  align-items: start;
}

/* Album library */
.albums-view {
  margin-top: 2px;
}

.albums-view-heading {
  min-height: 96px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding: 2px;
}

.albums-view-heading h2 {
  margin: 5px 0 2px;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.04em;
}

.albums-view-heading p {
  margin: 0;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
}

.albums-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.album-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 68%, transparent);
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: var(--md-sys-color-surface-container-low);
  box-shadow: var(--md-sys-elevation-1);
  transition:
    border-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}

.album-card:hover {
  box-shadow: var(--md-sys-elevation-2);
  transform: translateY(-2px);
}

.album-card.reorder-pending,
.album-card.reorder-pending:hover {
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 56%, transparent);
  box-shadow: var(--md-sys-elevation-2);
  transform: translateY(-2px) scale(0.995);
}

.album-card.dragging,
.album-card.dragging:hover {
  position: fixed;
  z-index: 150;
  top: var(--album-drag-top);
  left: var(--album-drag-left);
  width: var(--album-drag-width);
  height: var(--album-drag-height);
  margin: 0;
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 56%, transparent);
  box-shadow: var(--md-sys-elevation-3);
  opacity: 0.94;
  pointer-events: none;
  transform: translate3d(var(--album-drag-x, 0), var(--album-drag-y, 0), 0) scale(1.02);
  transition:
    box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    opacity var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
  will-change: transform;
}

.albums-gallery.is-reordering {
  user-select: none;
}

.albums-gallery.is-reordering,
.albums-gallery.is-reordering * {
  cursor: grabbing;
}

.album-card-placeholder {
  min-width: 0;
  border: 2px dashed color-mix(in srgb, var(--md-sys-color-primary) 62%, transparent);
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: color-mix(in srgb, var(--md-sys-color-primary-container) 34%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--md-sys-color-primary) 10%, transparent);
  animation: album-placeholder-enter var(--md-sys-motion-duration-short)
    var(--md-sys-motion-easing-emphasized-decelerate);
}

@keyframes album-placeholder-enter {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.album-cover {
  aspect-ratio: 4 / 3;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
  overflow: hidden;
  background: var(--md-sys-color-surface-container);
}

.album-cover-interactive {
  cursor: pointer;
}

.album-cover-interactive:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--md-sys-color-primary) 44%, transparent);
  outline-offset: -3px;
}

.album-cover.single {
  display: block;
}

.album-cover img {
  width: 100%;
  height: 100%;
  min-width: 0;
  display: block;
  object-fit: cover;
}

.album-cover-empty {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  display: grid;
  place-items: center;
  color: var(--md-sys-color-on-surface-variant);
}

.album-cover-empty .icon {
  width: 54px;
  height: 54px;
  opacity: 0.58;
}

.album-card-body {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 15px;
}

.album-card-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.album-card-copy strong,
.album-card-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-card-copy strong {
  color: var(--md-sys-color-on-surface);
  font-size: 16px;
}

.album-card-copy span {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
}

.album-card-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.album-card-actions .icon-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  background: transparent;
}

.album-drag-handle {
  touch-action: none;
  cursor: grab;
}

.album-drag-handle:active,
.album-card.dragging .album-drag-handle {
  cursor: grabbing;
}

.albums-empty {
  min-height: 390px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 64px 24px;
  border-radius: 34px;
  background: var(--md-sys-color-surface-container-low);
  text-align: center;
}

.albums-empty h2 {
  margin: 0;
}

.albums-empty p {
  margin: 7px 0 20px;
  color: var(--md-sys-color-on-surface-variant);
}

.card {
  position: relative;
  width: 100%;
  min-width: 0;
  align-self: start;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 65%, transparent);
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: var(--md-sys-color-surface-container);
  box-shadow: var(--md-sys-elevation-1);
  transition:
    border-color var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    background-color var(--md-sys-motion-duration-long) var(--md-sys-motion-easing-emphasized),
    color var(--md-sys-motion-duration-long) var(--md-sys-motion-easing-emphasized),
    box-shadow var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}

.card:hover {
  border-color: transparent;
  box-shadow: var(--md-sys-elevation-3);
  transform: translateY(-3px);
}

.card.selected {
  border-color: var(--md-sys-color-primary);
  box-shadow: inset 0 0 0 1px var(--md-sys-color-primary), var(--md-sys-elevation-2);
}

.image-wrap {
  position: relative;
  min-height: 170px;
  overflow: hidden;
  background: var(--md-sys-color-surface-container-highest);
  cursor: zoom-in;
}

.image-wrap > img {
  width: 100%;
  height: auto;
  max-height: 560px;
  display: block;
  object-fit: cover;
  transition:
    opacity var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    transform 360ms var(--md-sys-motion-easing-standard);
}

.card:hover .image-wrap > img {
  transform: scale(1.018);
}

.select-image {
  position: absolute;
  z-index: 6;
  top: 14px;
  left: 14px;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 2px solid white;
  border-radius: 7px;
  outline: 3px solid rgb(0 0 0 / 0.22);
  accent-color: var(--md-sys-color-primary);
  box-shadow: var(--md-sys-elevation-1);
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.card:hover .select-image,
.card:focus-within .select-image,
.card.selected .select-image {
  opacity: 1;
  transform: scale(1);
}

.archive-badge {
  position: absolute;
  z-index: 5;
  top: 13px;
  right: 13px;
  padding: 7px 11px;
  border-radius: var(--md-sys-shape-corner-full);
  background: rgb(31 27 35 / 0.72);
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.card-body {
  padding: 18px 18px 14px;
}

.card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--md-sys-color-primary);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.card-name {
  overflow: hidden;
  margin-bottom: 9px;
  color: var(--md-sys-color-on-surface);
  font-size: 18px;
  font-weight: 700;
  line-height: 25px;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
}

.card-meta span {
  padding: 5px 9px;
  border-radius: 9px;
  background: var(--md-sys-color-surface-container-high);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 10px 11px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

.card-actions::after {
  flex: 1;
  order: 3;
  content: "";
}

.card-actions .icon-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  background: transparent;
}

.card-actions .icon-button:nth-child(1) {
  order: 1;
}

.card-actions .icon-button:nth-child(2) {
  order: 2;
}

.card-actions .icon-button:nth-child(3) {
  order: 4;
}

.card-actions .icon-button:nth-child(4) {
  order: 5;
}

.card-actions .icon-button:nth-child(5) {
  order: 6;
}

.card-actions .danger-icon {
  color: var(--md-sys-color-error);
}

.card-actions .icon {
  width: 21px;
  height: 21px;
}

.empty {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 72px 24px;
  border-radius: 34px;
  background: var(--md-sys-color-surface-container-low);
  text-align: center;
}

.empty-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 24px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.empty-icon .icon {
  width: 38px;
  height: 38px;
}

.empty h2 {
  margin: 0;
  font-size: 23px;
}

.empty p {
  margin: 7px 0 20px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 30px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px;
}

#pageInfo {
  min-width: 56px;
  text-align: center;
}

/* Floating navigation */
.bottom-nav {
  position: fixed;
  z-index: 120;
  bottom: 18px;
  left: 50%;
  width: min(360px, calc(100% - 28px));
  height: 78px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 68%, transparent);
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: var(--app-glass-background);
  -webkit-backdrop-filter: var(--app-glass-backdrop);
  backdrop-filter: var(--app-glass-backdrop);
  box-shadow: var(--md-sys-elevation-3);
  transform: translateX(-50%);
  transition:
    background-color 440ms var(--md-sys-motion-easing-emphasized),
    color 360ms var(--md-sys-motion-easing-emphasized);
}

.bottom-nav-item {
  min-width: 0;
  min-height: 60px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 4px;
  border-radius: 20px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
}

.bottom-nav-item .nav-indicator {
  min-width: 54px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--md-sys-shape-corner-full);
  transform: scale(0.92);
  transition:
    background-color var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized),
    color var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.bottom-nav-item .icon {
  width: 21px;
  height: 21px;
}

.bottom-nav-item.active {
  color: var(--md-sys-color-on-secondary-container);
}

.bottom-nav-item.active .nav-indicator {
  background: var(--md-sys-color-secondary-container);
  transform: scale(1);
}

/* Monet dynamic color */
.palette-panel {
  position: fixed;
  z-index: 55;
  top: 82px;
  right: max(24px, calc((100vw - var(--content-max-width)) / 2 + 24px));
  width: min(360px, calc(100% - 32px));
  padding: 22px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 26px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  box-shadow: var(--md-sys-elevation-3);
  transition:
    background-color 440ms var(--md-sys-motion-easing-emphasized),
    color 360ms var(--md-sys-motion-easing-emphasized);
}

.palette-panel:not([hidden]) {
  animation: panel-enter 320ms var(--md-sys-motion-easing-emphasized-decelerate);
}

.palette-panel[hidden] {
  display: none;
}

.palette-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.palette-heading h2 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 29px;
  letter-spacing: -0.03em;
}

.palette-panel > p {
  margin: 14px 0 18px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px;
  line-height: 20px;
}

.palette-label {
  margin: 20px 0 10px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  font-weight: 700;
}

.palette-swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.palette-swatch {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: 3px solid var(--md-sys-color-surface-container-high);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--md-sys-color-outline-variant);
}

.palette-swatch.selected {
  box-shadow:
    0 0 0 2px var(--md-sys-color-surface-container-high),
    0 0 0 5px var(--md-sys-color-primary);
}

.palette-footer {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
}

.palette-footer strong {
  color: var(--md-sys-color-on-surface);
}

/* Dialogs */
dialog {
  width: min(540px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 30px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  box-shadow: var(--md-sys-elevation-3);
  transition:
    background-color 440ms var(--md-sys-motion-easing-emphasized),
    color 360ms var(--md-sys-motion-easing-emphasized);
}

dialog::backdrop {
  background: rgb(0 0 0 / 0.5);
}

dialog[open] {
  animation: dialog-enter 360ms var(--md-sys-motion-easing-emphasized-decelerate);
}

dialog[open]::backdrop {
  animation: backdrop-enter 260ms var(--md-sys-motion-easing-standard);
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes backdrop-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dialog-form {
  max-height: calc(100vh - 40px);
  padding: 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: inherit;
  scrollbar-color: var(--md-sys-color-outline) transparent;
  scrollbar-width: thin;
}

.dialog-form::-webkit-scrollbar {
  width: 12px;
}

.dialog-form::-webkit-scrollbar-track {
  background: transparent;
}

.dialog-form::-webkit-scrollbar-thumb {
  min-height: 44px;
  border: 4px solid transparent;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-outline);
  background-clip: padding-box;
}

.dialog-form::-webkit-scrollbar-thumb:hover {
  background: var(--md-sys-color-on-surface-variant);
  background-clip: padding-box;
}

#settingsDialog .settings-content {
  scrollbar-gutter: stable;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.dialog-heading h2 {
  margin: 5px 0 0;
  font-size: 27px;
  font-weight: 650;
  line-height: 34px;
  letter-spacing: -0.035em;
}

.dialog-supporting {
  margin-bottom: 24px;
}

.dialog-close {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
  color: var(--md-sys-color-on-surface-variant);
}

.preview-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 24px;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.preview-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: preview-layer-enter 240ms var(--md-sys-motion-easing-standard);
}

.preview-dialog img {
  max-width: 92vw;
  max-height: 82vh;
  display: block;
  border-radius: 24px;
  object-fit: contain;
  box-shadow: var(--md-sys-elevation-3);
}

.preview-dialog[open] img {
  animation: preview-image-enter var(--md-sys-motion-duration-long) var(--md-sys-motion-easing-emphasized-decelerate);
}

@keyframes preview-layer-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes preview-image-enter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.preview-dialog > div {
  width: max-content;
  max-width: 80vw;
  margin: 14px auto 0;
  padding: 8px 14px;
  overflow: hidden;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-close {
  position: fixed;
  z-index: 2;
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  box-shadow: var(--md-sys-elevation-2);
}

.copy-field {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-low);
}

.copy-field code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--md-sys-color-on-surface);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-field button {
  flex: 0 0 auto;
}

.settings-section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 10px;
}

.settings-section-icon {
  width: 44px;
  height: 44px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.settings-section-icon .icon {
  width: 23px;
  height: 23px;
}

.settings-section-heading > div {
  display: grid;
  gap: 2px;
}

.settings-section-heading strong,
.settings-danger-copy strong {
  font-size: 14px;
}

.settings-section-heading span,
.settings-danger-copy span {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
}

.settings-divider {
  height: 1px;
  margin: 24px 0 20px;
  background: var(--md-sys-color-outline-variant);
}

.settings-danger-copy {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.muted {
  font-size: 12px;
}

.details-preview {
  width: 100%;
  max-height: 280px;
  display: block;
  margin: 8px 0 22px;
  border-radius: 20px;
  background: var(--md-sys-color-surface-container-highest);
  object-fit: contain;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}

.details-grid > div {
  min-width: 0;
  padding: 12px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container);
}

.details-grid dt {
  margin-bottom: 5px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
}

.details-grid dd {
  margin: 0;
  overflow: hidden;
  color: var(--md-sys-color-on-surface);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#detailsDialog,
#albumsDialog,
#albumCoverDialog,
#paletteSourceDialog {
  width: min(720px, calc(100% - 32px));
}

.details-grid .details-wide {
  grid-column: 1 / -1;
}

.details-grid .details-wide dd {
  white-space: normal;
  overflow-wrap: anywhere;
}

.organization-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.album-field {
  min-width: 0;
}

.album-choice-list {
  max-height: 126px;
  display: grid;
  gap: 5px;
  padding: 6px;
  overflow-y: auto;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container);
  scrollbar-color: var(--md-sys-color-outline) transparent;
  scrollbar-width: thin;
}

.album-choice {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--md-sys-shape-corner-small);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  transition:
    background var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.album-choice:hover {
  background: var(--md-sys-color-surface-container-high);
}

.album-choice:has(input:checked) {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.album-choice input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  accent-color: var(--md-sys-color-primary);
}

.album-choice > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.album-choice strong,
.album-choice small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-choice strong {
  font-size: 12px;
}

.album-choice small {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 10px;
}

.album-picker-empty {
  min-height: 110px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
}

.album-picker-empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.album-picker-empty-icon .icon {
  width: 21px;
  height: 21px;
}

.album-picker-empty > span:nth-child(2) {
  min-width: 0;
  display: grid;
  flex: 1;
  gap: 3px;
}

.album-picker-empty strong,
.album-picker-empty small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-picker-empty strong {
  font-size: 13px;
}

.album-picker-empty small {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 10px;
  line-height: 15px;
}

.album-picker-empty button {
  flex: 0 0 auto;
}

.details-secondary-actions,
.settings-maintenance-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.settings-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.settings-status-grid > div {
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--md-sys-color-surface-container);
}

.settings-status-grid dt {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 10px;
}

.settings-status-grid dd {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
}

.maintenance-result {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  font-size: 12px;
  line-height: 18px;
}

#storageStrategiesDialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(860px, calc(100dvh - 32px));
  overflow: visible;
}

.storage-strategies-content {
  width: 100%;
  max-height: min(860px, calc(100dvh - 32px));
  padding: 26px 24px 28px;
}

.storage-strategies-content.storage-menu-open {
  overflow-y: visible;
}

.storage-strategy-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.storage-strategy-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container);
}

.storage-provider-mark {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-primary);
  overflow: hidden;
}

.storage-provider-mark img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.storage-strategy-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 3px;
}

.storage-strategy-row strong {
  color: var(--md-sys-color-on-surface);
  font-size: 14px;
}

.storage-strategy-row span {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
}

.storage-strategy-row > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.storage-form-heading {
  margin: 18px 0 4px;
  color: var(--md-sys-color-on-surface);
  font-size: 16px;
}

.storage-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.storage-form-grid > * {
  min-width: 0;
}

.storage-config-fields {
  display: contents;
}

.storage-form-grid .text-field {
  margin: 0;
}

.storage-form-grid input,
.storage-form-grid textarea {
  min-width: 0;
}

.storage-form-grid .storage-checkbox-field {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-low);
}

.storage-form-grid .storage-checkbox-field > input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--md-sys-color-primary);
}

.storage-form-grid .storage-checkbox-field > span {
  padding: 0;
  color: var(--md-sys-color-on-surface);
  font-size: 14px;
}

.storage-driver-control {
  width: 100%;
}

.storage-driver-button {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-medium);
  background: transparent;
  color: var(--md-sys-color-on-surface);
  text-align: left;
}

.storage-driver-button:hover {
  background: var(--md-sys-color-surface-container);
}

.storage-driver-button[aria-expanded="true"] {
  border-color: var(--md-sys-color-primary);
  box-shadow: inset 0 0 0 1px var(--md-sys-color-primary);
}

.storage-driver-button-mark {
  width: 30px;
  height: 30px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-primary);
}

.storage-driver-button-mark img {
  width: 21px;
  height: 21px;
  object-fit: contain;
}

.storage-driver-button > span:nth-child(2) {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-driver-chevron {
  flex: 0 0 auto;
  color: var(--md-sys-color-on-surface-variant);
  transition: transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.storage-driver-button[aria-expanded="true"] .storage-driver-chevron {
  transform: rotate(180deg);
}

.storage-driver-menu {
  z-index: 80;
  right: 0;
  left: 0;
  min-width: 0;
  max-height: min(474px, calc(100dvh - 180px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  touch-action: pan-y;
}

.storage-driver-menu.opens-up {
  top: auto;
  bottom: calc(100% + 8px);
  transform-origin: bottom right;
}

.storage-driver-option {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--md-sys-shape-corner-medium);
  background: transparent;
  color: var(--md-sys-color-on-surface);
  text-align: left;
}

.storage-driver-option:hover,
.storage-driver-option[aria-checked="true"] {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.storage-driver-option img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.storage-driver-option small {
  color: inherit;
  font-size: 10px;
  opacity: 0.74;
}

.storage-form-grid [data-storage-local] {
  grid-column: 1 / -1;
}

.storage-strategy-result {
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  font-size: 12px;
}

@media (max-width: 620px) {
  #storageStrategiesDialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: var(--md-sys-shape-corner-extra-large);
  }

  .storage-strategies-content {
    max-height: calc(100dvh - 20px);
    padding: 22px 18px 24px;
  }

  .storage-form-grid {
    grid-template-columns: 1fr;
  }
}

.album-create-form {
  display: grid;
  grid-template-columns: 1fr 1.3fr auto;
  align-items: end;
  gap: 10px;
  margin: 18px 0 26px;
}

.album-create-form .text-field {
  margin: 0;
}

.album-create-result {
  margin: -12px 0 22px;
  padding: 12px 14px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  font-size: 12px;
  font-weight: 650;
}

.albums-content h3 {
  margin: 20px 0 10px;
  font-size: 15px;
}

.management-list {
  display: grid;
  gap: 8px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
}

.management-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border-radius: 16px;
  background: var(--md-sys-color-surface-container);
}

.management-row > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.management-row strong,
.management-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.management-row strong {
  color: var(--md-sys-color-on-surface);
}

.management-row > div:last-child {
  display: flex;
}

.album-cover-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

/* Palette source picker */
.palette-source-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 18px;
}

.palette-source-search input {
  height: 44px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container);
}

.palette-source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.palette-source-option {
  min-width: 0;
  display: grid;
  justify-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container);
  text-align: left;
}

.palette-source-option img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
}

.palette-source-option span {
  overflow: hidden;
  padding: 9px 10px 10px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-source-option.loading {
  pointer-events: none;
  opacity: 0.64;
}

.palette-source-empty,
.palette-source-status {
  margin: 16px 0;
  padding: 18px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  text-align: center;
}

.palette-source-status {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

.palette-source-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
}

/* Batch album assignment */
.batch-album-choices {
  display: grid;
  gap: 7px;
  margin-bottom: 20px;
}

.batch-album-choice {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container);
  cursor: pointer;
}

.batch-album-choice:has(input:checked),
.batch-album-choice.partial {
  background: var(--md-sys-color-secondary-container);
}

.batch-album-choice input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  accent-color: var(--md-sys-color-primary);
}

.batch-album-choice > span {
  min-width: 0;
  display: grid;
  flex: 1;
  gap: 2px;
}

.batch-album-choice strong {
  font-size: 13px;
}

.batch-album-choice small {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 10px;
}

.batch-albums-result {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  font-size: 12px;
}

.batch-albums-result.success {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

.album-cover-option {
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 3px solid transparent;
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container);
}

.album-cover-option.selected {
  border-color: var(--md-sys-color-primary);
}

.album-cover-option img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.danger-text {
  color: var(--md-sys-color-error);
}

/* Public sharing */
.share-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, color-mix(in srgb, var(--md-sys-color-primary-container) 78%, transparent), transparent 34rem),
    var(--md-sys-color-surface);
}

.share-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.share-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.share-brand > div {
  display: grid;
  gap: 1px;
}

.share-brand span {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
}

.share-access {
  width: min(440px, 100%);
  display: grid;
  justify-items: center;
  margin: 12vh auto 0;
  padding: 36px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 32px;
  background: var(--md-sys-color-surface-container-high);
  box-shadow: var(--md-sys-elevation-2);
  text-align: center;
}

.share-lock {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.share-lock .icon {
  width: 32px;
  height: 32px;
}

.share-access h1 {
  margin: 20px 0 8px;
  font-size: 24px;
}

.share-access p {
  margin: 0 0 20px;
  color: var(--md-sys-color-on-surface-variant);
}

.share-access form {
  width: 100%;
}

.share-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.share-heading h1 {
  margin: 5px 0 0;
  font-size: clamp(30px, 5vw, 52px);
}

.share-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.share-heading-actions > span,
#shareDescription {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
}

.share-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.share-image {
  overflow: hidden;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 28px;
  background: var(--md-sys-color-surface-container);
}

.share-image > img {
  width: 100%;
  max-height: 520px;
  display: block;
  object-fit: contain;
  background: var(--md-sys-color-surface-container-highest);
}

.share-image > strong {
  display: block;
  padding: 16px 16px 4px;
}

.share-image > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px 14px;
}

.share-image a {
  text-decoration: none;
}

/* Snackbar and progress */
.toast {
  position: fixed;
  z-index: 100;
  bottom: 112px;
  left: 50%;
  max-width: calc(100vw - 32px);
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  box-shadow: var(--md-sys-elevation-3);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition:
    opacity var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
  font-size: 14px;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.uploading {
  position: fixed;
  z-index: 90;
  right: 24px;
  bottom: 112px;
  width: min(430px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--md-sys-color-outline-variant);
  visibility: hidden;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  box-shadow: var(--md-sys-elevation-3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.98);
  transition:
    opacity 220ms var(--md-sys-motion-easing-emphasized-accelerate),
    transform 220ms var(--md-sys-motion-easing-emphasized-accelerate),
    visibility 0s linear 220ms;
}

.uploading.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition:
    opacity 320ms var(--md-sys-motion-easing-standard),
    transform 320ms var(--md-sys-motion-easing-standard),
    visibility 0s;
}

.uploading-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.uploading-icon {
  width: 46px;
  height: 46px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.uploading-heading > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.uploading-heading strong {
  font-size: 14px;
}

.uploading-heading span {
  overflow: hidden;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linear-progress {
  height: 6px;
  overflow: hidden;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-secondary-container);
}

.linear-progress > span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--md-sys-color-primary);
  transition: width 280ms var(--md-sys-motion-easing-emphasized-decelerate);
}

.linear-progress.indeterminate > span {
  width: 42%;
  animation: indeterminate-progress 1.35s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.upload-result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

@keyframes indeterminate-progress {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(340%);
  }
}

@media (max-width: 960px) {
  .brand {
    min-width: 0;
  }

  .brand-copy small,
  .header-stats .icon,
  .stats-divider,
  #storageSize {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  }

  .albums-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1800px) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1179px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .app-shell {
    padding: 0 12px 116px;
  }

  .top-app-bar {
    min-height: 68px;
    gap: 8px;
    padding: 9px 0;
  }

  .brand-copy,
  .header-stats,
  .desktop-action,
  .search kbd {
    display: none;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .search input {
    height: 46px;
    padding-right: 16px;
  }

  .search-syntax-menu {
    position: fixed;
    top: 68px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .icon-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 14px 0 32px;
    padding: 26px 20px 20px;
    border-radius: 28px;
  }

  .hero h1 {
    font-size: clamp(36px, 11vw, 50px);
  }

  .hero p {
    font-size: 14px;
  }

  .drop-zone {
    min-height: 185px;
  }

  .library-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .library-tools {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .library-tools .sort-control {
    min-width: 0;
    flex: 1 1 100%;
  }

  .sort-button {
    width: 100%;
  }

  #filterButton {
    margin-left: auto;
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-bar {
    top: 78px;
    align-items: flex-start;
    flex-direction: column;
  }

  .albums-view-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .albums-gallery {
    grid-template-columns: 1fr;
  }

  .card {
    margin: 0;
  }

  .image-wrap > img {
    max-height: none;
  }

  .select-image {
    opacity: 1;
    transform: scale(1);
  }

  .bottom-nav {
    bottom: 10px;
  }

  .palette-panel {
    top: 72px;
    right: 12px;
    width: min(360px, calc(100% - 24px));
  }

  .uploading {
    right: 12px;
    bottom: 100px;
    left: 12px;
    justify-content: center;
  }

  .toast {
    bottom: 100px;
  }

  .dialog-form {
    padding: 24px 20px;
  }

  .album-create-form,
  .organization-grid {
    grid-template-columns: 1fr;
  }

  .album-cover-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .palette-source-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .management-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .share-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 619px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .login {
    padding: 0;
    background: var(--md-sys-color-surface-container-lowest);
  }

  .login-card {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 24px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .hero-actions {
    display: grid;
  }

  .hero-actions button {
    width: 100%;
  }

  .selection-bar {
    padding-left: 12px;
  }

  .selection-copy {
    font-size: 12px;
  }

  .selection-bar .compact {
    padding-inline: 10px;
  }

  .filter-grid,
  .settings-status-grid {
    grid-template-columns: 1fr;
  }

  .palette-source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-actions {
    gap: 0;
    padding-inline: 6px;
  }

  .card-actions .icon-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .pagination {
    gap: 8px;
  }

  .pagination button {
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
