:root {
  --surface: light-dark(#f8f8f3, #161e1b);
  --app-backdrop: var(--surface);
  --sidebar: light-dark(#edf1e9, #212d26);
  --ink: light-dark(#203229, #e8efe9);
  --muted: light-dark(#52655a, #aebeb4);
  --line: light-dark(#d7e0d6, #3a4a41);
  --soft-line: light-dark(#e5ebe2, #293a30);
  --accent: light-dark(#285741, #a9d8b7);
  --accent-hover: light-dark(#1d4433, #bce6c8);
  --accent-soft: light-dark(#e2eee3, #2a4636);
  --study-fill: light-dark(#eaf1e4, #24362c);
  --identify-fill: light-dark(#edf3f8, #223541);
  --identify-accent: light-dark(#244f73, #b4d6f3);
  --identify-soft: light-dark(#e3edf5, #2a4458);
  --working-ink: light-dark(#274e6b, #badbf2);
  --working-fill: light-dark(#e6f0f7, #233a4c);
  --review-ink: light-dark(#704713, #f3ce96);
  --review-fill: light-dark(#faf0d9, #3a2e1f);
  --retry-ink: light-dark(#863d38, #ffc0b9);
  --retry-fill: light-dark(#faeae6, #492c2b);
  --raised-surface: light-dark(#fff, #24342c);
  --preview-rectangle-radius: 52px;
}

body[data-app-page="identify"] {
  --accent: var(--identify-accent);
  --accent-hover: light-dark(#163e62, #cde5f8);
  --accent-soft: var(--identify-soft);
  --sidebar: light-dark(#eef2f5, #1d2b34);
  --line: light-dark(#d7e1e9, #394b59);
  --soft-line: light-dark(#e5ecf1, #2b3c49);
}

.app-shell.has-app-navigation {
  --app-compact-top-gap: calc((var(--app-compact-row) - 36px * var(--app-compact-pill-scale)) / 2);
  --app-mode-track-fill: var(--sidebar);
  --app-mode-selection: var(--raised-surface);
  --app-drawer-fill: var(--surface);
  --app-top-glass: color-mix(in srgb, var(--surface) 80%, transparent);
}

.app-shell.has-app-navigation > .app-top-bar {
  --app-mode-time: 430ms;
  --app-pill-ease: var(--app-mode-ease);
  --app-contact-height: 30px;
  --app-control-center: calc(var(--app-safe-top) - env(safe-area-inset-top, 0px) + var(--app-top-row) / 2);
}

.app-shell.has-app-navigation > .app-top-bar[data-expanded="true"] {
  --app-mode-time: 440ms;
  --app-pill-ease: cubic-bezier(.32, .42, .24, 1);
}

.app-shell.has-app-navigation > .app-top-bar[data-expanded="false"] {
  /* Add the existing gap above the selected pill to the whole collapsed row. */
  --app-contact-height: 26px;
  --app-safe-top: calc(env(safe-area-inset-top, 0px) + var(--app-compact-top-gap));
  --app-top-height: calc(var(--app-safe-top) + var(--app-top-row));
}

body:not([data-guide-demo])
.app-shell:is([data-app-page="home"], [data-app-page="identify"]):has(> .workspace.material-surface.material-intro:not(.has-media):not(.material-entering))
> .app-top-bar::before {
  inset-block-end: auto;
  block-size: var(--app-top-height);
}

@media (prefers-reduced-motion: no-preference) {
  body:not([data-guide-demo])
  .app-shell:is([data-app-page="home"], [data-app-page="identify"]):has(> .workspace.material-surface.material-intro:not(.has-media):not(.material-entering))
  > .app-top-bar::before {
    transition: block-size var(--app-mode-time) var(--app-pill-ease);
  }
}

/* Pin the controls to the safe-area edge while the workspace takes its final size. */
.app-top-bar > :is(.app-mode-switcher, .app-contact-button) {
  align-self: start;
  margin-block-start: calc(env(safe-area-inset-top, 0px) - var(--app-safe-top));
}

.app-top-bar > .app-mode-switcher {
  translate: 0 calc(var(--app-control-center) - 20px);
}

.app-top-bar > .app-profile-toggle {
  --app-profile-center: var(--app-control-center);
  inset-block-start: calc(env(safe-area-inset-top, 0px) - var(--app-profile-hit-size) / 2);
  translate: 0 var(--app-profile-center);
}

.app-top-bar > .app-profile-toggle[aria-expanded="true"] {
  --app-profile-center: calc(var(--app-safe-top) - env(safe-area-inset-top, 0px) + var(--app-drawer-heading-size) / 2);
  inset-block-start: calc(env(safe-area-inset-top, 0px) - var(--app-profile-hit-size) / 2);
}

.app-top-bar > .app-contact-button {
  --feedback-trigger-fill: light-dark(#c9e8d1, #315d46);
  --feedback-trigger-ink: light-dark(#18492f, #e1f7e7);
  --feedback-trigger-line: transparent;
  translate: 0 calc(var(--app-control-center) - var(--app-contact-height) / 2);
}

@media (prefers-reduced-motion: no-preference) {
  .app-top-bar > :is(.app-mode-switcher, .app-profile-toggle) {
    transition: translate var(--app-mode-time) var(--app-pill-ease);
  }

  .app-top-bar > .app-profile-toggle[aria-expanded="true"] {
    transition: translate var(--app-drawer-time) var(--app-mode-ease);
  }

  .app-top-bar > .app-contact-button {
    transition:
      translate var(--app-mode-time) var(--app-pill-ease),
      min-block-size var(--app-mode-time) var(--app-pill-ease),
      padding-inline var(--app-mode-time) var(--app-pill-ease);
  }

  .app-top-bar .app-mode-switcher :is(.app-mode-track, .app-nav-button, .app-mode-shape, .app-mode-selection) {
    transition-timing-function: var(--app-pill-ease);
  }

  .app-top-bar .app-mode-switcher .app-mode-copy {
    transition:
      transform var(--app-mode-time) var(--app-pill-ease),
      font-size var(--app-mode-time) var(--app-pill-ease),
      gap var(--app-mode-time) var(--app-pill-ease);
  }

  .app-top-bar .app-mode-copy svg {
    transition:
      flex-basis var(--app-mode-time) var(--app-pill-ease),
      inline-size var(--app-mode-time) var(--app-pill-ease),
      block-size var(--app-mode-time) var(--app-pill-ease);
  }
}

.app-shell[data-app-page="home"] { --upload-field: var(--study-fill); }
.app-shell[data-app-page="identify"] {
  --upload-field: var(--identify-fill);
  --upload-field-shadow: var(--layout-card-shadow);
}

body:not([data-guide-demo]) .app-shell[data-app-page="identify"]:has(> .workspace.material-surface.material-intro:not(.has-media)) {
  --material-page-wash: 26.4%;
}

.app-shell[data-app-page="identify"] > .workspace.material-surface > .media {
  box-shadow: var(--upload-field-shadow);
}

body:not([data-guide-demo]) .app-shell:is([data-app-page="home"], [data-app-page="identify"])
> .workspace.material-intro > .media:not(.has-preview) {
  background: var(--upload-field);
  box-shadow: var(--upload-field-shadow, 0 14px 32px -24px color-mix(in srgb, var(--accent) 45%, transparent));
}

body:not([data-guide-demo]) .app-shell:is([data-app-page="home"], [data-app-page="identify"])
> .workspace.material-intro > .media:not(.has-preview) .media-content > #drop-zone {
  gap: clamp(12px, 2dvh, 20px);
  color: var(--accent);
  background: transparent;
}

body:not([data-guide-demo]) .app-shell:is([data-app-page="home"], [data-app-page="identify"])
> .workspace.material-intro > .media:not(.has-preview) #drop-zone > .upload-focus-reticle {
  width: clamp(40px, 7dvh, 60px);
  height: auto;
  flex-basis: auto;
  color: var(--accent);
}

@property --learning-photo-feather {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

.learning-upload-wash {
  display: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  corner-shape: inherit;
  pointer-events: none;
}

.learning-upload-wash::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/assets/identify-upload/front-soft-extended.jpg");
  background-position: var(--learning-wash-position, center 40%);
  background-size: var(--learning-wash-size, cover);
  background-repeat: no-repeat;
  --wash-start: var(--learning-wash-fade-start, 35%);
  --wash-distance: var(--learning-wash-fade-distance, 34%);
  --learning-wash-fade: linear-gradient(
    #000 var(--wash-start),
    rgb(0 0 0 / .86) calc(var(--wash-start) + var(--wash-distance) * .26),
    rgb(0 0 0 / .52) calc(var(--wash-start) + var(--wash-distance) * .53),
    rgb(0 0 0 / .13) calc(var(--wash-start) + var(--wash-distance) * .79),
    transparent calc(var(--wash-start) + var(--wash-distance))
  );
  -webkit-mask-image: var(--learning-wash-fade);
  mask-image: var(--learning-wash-fade);
}

:is(.learning-upload-photo, .mode-upload-motion [data-motion-role="photo-bounds"] > [data-motion-role="frame"]) {
  --learning-photo-edges:
    linear-gradient(to right,
      transparent, rgb(0 0 0 / .48) calc(5% * var(--learning-photo-feather)),
      #000 calc(16% * var(--learning-photo-feather)), #000 calc(100% - 18% * var(--learning-photo-feather)),
      rgb(0 0 0 / .42) calc(100% - 5% * var(--learning-photo-feather)), transparent),
    linear-gradient(to bottom,
      transparent, rgb(0 0 0 / .46) calc(5% * var(--learning-photo-feather)),
      #000 calc(21% * var(--learning-photo-feather)), #000 calc(100% - 27% * var(--learning-photo-feather)),
      rgb(0 0 0 / .35) calc(100% - 9% * var(--learning-photo-feather)), transparent);
  -webkit-mask-image: var(--learning-photo-edges);
  -webkit-mask-composite: source-in;
  mask-image: var(--learning-photo-edges);
  mask-composite: intersect;
}

.learning-upload-photo {
  --learning-photo-feather: 1;
  display: none;
  overflow: hidden;
  pointer-events: none;
}

body:not([data-guide-demo]) .app-shell[data-app-page="home"]
> .workspace.material-intro:not(.has-media):not(.material-entering) > .media:not(.has-preview) #drop-zone > .learning-upload-wash {
  display: block;
}

body:not([data-guide-demo]) .app-shell[data-app-page="home"]
> .workspace.material-intro:not(.has-media):not(.material-entering) > .media:not(.has-preview) #drop-zone {
  flex-direction: column;
  gap: clamp(12px, 2dvh, 20px);
  padding: 12px 11px;
}

body:not([data-guide-demo]) .app-shell[data-app-page="home"]
> .workspace.material-intro:not(.has-media):not(.material-entering) > .media:not(.has-preview) #drop-zone > .upload-focus-reticle {
  display: none;
}

body:not([data-guide-demo]) .app-shell[data-app-page="home"]
> .workspace.material-intro:not(.has-media):not(.material-entering) > .media:not(.has-preview) #drop-zone > .upload-copy {
  flex: none;
  /* Lower the copy without shifting the centered photo or its wash. */
  position: relative;
  inset-inline: auto;
  inset-block-start: clamp(0px, calc((100cqh - 245px) * .115), 19px);
  z-index: 1;
  inline-size: 100%;
  justify-items: center;
  text-align: center;
}

body:not([data-guide-demo]) .app-shell[data-app-page="home"]
> .workspace.material-intro:not(.has-media):not(.material-entering) > .media:not(.has-preview) #drop-zone > .learning-upload-photo {
  --learning-photo-block-size: clamp(0px, calc(100cqh - 96px), var(--learning-photo-height, 236px));
  position: relative;
  display: block;
  flex: 0 1 auto;
  min-block-size: 0;
  inline-size: min(100%, 354px, calc(var(--learning-photo-block-size) * 1.5));
  block-size: var(--learning-photo-block-size);
}

@media (max-width: 360px) {
  .learning-upload-photo { --learning-photo-height: 223px; }
}

.learning-upload-photo img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  transform-origin: 46% 53%;
  transform: translate(3.5%, -3%) scale(1.55);
  filter: saturate(1.15) contrast(1.035);
}

.learning-upload-photo::after {
  content: "";
  position: absolute;
  inset: 50% 0 0;
  background: linear-gradient(transparent 4%, #0b2016b8 66%, #081912ed);
}

.learning-upload-focus {
  --corner: linear-gradient(#e7fff0, #e7fff0);
  position: absolute;
  z-index: 1;
  inset: 49% auto auto 50%;
  inline-size: clamp(min(96px, 42%), 34%, 122px);
  block-size: 45%;
  transform: translate(-50%, -50%);
  background:
    var(--corner) left top / 13px 1.5px,
    var(--corner) left top / 1.5px 13px,
    var(--corner) right top / 13px 1.5px,
    var(--corner) right top / 1.5px 13px,
    var(--corner) left bottom / 13px 1.5px,
    var(--corner) left bottom / 1.5px 13px,
    var(--corner) right bottom / 13px 1.5px,
    var(--corner) right bottom / 1.5px 13px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 1px 2px #162e21a0);
  opacity: .9;
}

.identify-upload-deck {
  display: none;
}

body:not([data-guide-demo]) .app-shell[data-app-page="identify"]
> .workspace.material-intro:not(.has-media) > .media:not(.has-preview) .media-content > #drop-zone {
  flex-direction: column;
  gap: clamp(6px, 1.5dvh, 14px);
  padding-block: clamp(8px, 2dvh, 22px);
  background: linear-gradient(147deg, light-dark(#f3f3ea, #272f29), light-dark(#e6eced, #1d2930));
  box-shadow: inset 0 0 0 .2px light-dark(rgb(95 117 103 / .38), rgb(132 155 139 / .38));
}

body:not([data-guide-demo]) .app-shell[data-app-page="identify"]
> .workspace.material-intro:not(.has-media) > .media:not(.has-preview) #drop-zone > .upload-focus-reticle {
  display: none;
}

body:not([data-guide-demo]) .app-shell[data-app-page="identify"]
> .workspace.material-intro:not(.has-media) > .media:not(.has-preview) #drop-zone > .upload-copy {
  flex: none;
  justify-items: center;
  text-align: center;
}

body:not([data-guide-demo]) .app-shell[data-app-page="identify"]
> .workspace.material-intro:not(.has-media) > .media:not(.has-preview) #drop-zone > .identify-upload-deck {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 1 220px;
  inline-size: min(100%, 360px);
  min-block-size: 0;
  container-type: size;
  pointer-events: none;
}

.identify-upload-print {
  --print-height: min(166px, 76cqh, 54cqw);
  --print-edge: clamp(2px, 2.3cqh, 5px);
  position: absolute;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  block-size: var(--print-height);
  inline-size: calc(var(--print-height) * .91);
  padding: var(--print-edge);
  overflow: hidden;
  border-radius: clamp(5px, 7cqh, 15px);
  background: light-dark(#fffdf7, #e2e6dd);
  box-shadow: 0 9px 19px #182d2c29;
  transform: var(--upload-print-pose);
}

.identify-upload-print img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  min-block-size: 0;
  object-fit: cover;
  border-radius: clamp(3px, 5cqh, 11px);
  filter: saturate(1.28) contrast(1.08) brightness(.98);
}

.identify-upload-back-left {
  --upload-print-pose: translate(-39%, 4%) rotate(-13deg) scale(.87);
  --upload-press-pose: translate(-20%, 4%) rotate(-7deg) scale(.86);
}

.identify-upload-back-left img { object-position: 100% 50%; }

.identify-upload-back-right {
  --upload-print-pose: translate(40%, 12%) rotate(13deg) scale(.87);
  --upload-press-pose: translate(23%, 7%) rotate(7deg) scale(.86);
}

.identify-upload-back-right img { object-position: 10% 48%; }

.identify-upload-front {
  --upload-print-pose: rotate(-3deg);
  --upload-press-pose: scale(.95);
}

.identify-upload-front img {
  filter: saturate(1.24) contrast(1.05);
  transform: scale(1.38);
  transform-origin: 45% 54%;
}

.identify-upload-print-frame {
  display: block;
  overflow: hidden;
  border-radius: clamp(3px, 5cqh, 11px);
}

.mode-upload-motion {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  contain: layout paint;
  pointer-events: none;
}

.app-shell[data-upload-mode-moving] #drop-zone
> :is(.learning-upload-photo, .learning-upload-wash, .identify-upload-deck, .upload-copy) {
  visibility: hidden;
}

.mode-upload-motion [data-motion-role] { position: absolute; }

.mode-upload-motion [data-motion-role="rim"],
.mode-upload-motion [data-motion-role="photo-bounds"] > [data-motion-role="frame"] {
  inset: 0;
  border-radius: inherit;
}

.mode-upload-motion [data-motion-role="primary"] > [data-motion-role="rim"] {
  box-sizing: border-box;
  border-style: solid;
}

.mode-upload-motion > .learning-upload-wash { display: block; }

.mode-upload-motion :is([data-motion-role="primary"], [data-motion-role="left"],
  [data-motion-role="right"], [data-motion-role="frame"]) {
  overflow: hidden;
}

.mode-upload-motion img {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
}

.mode-upload-motion [data-motion-role="learning-details"] { inset: 0; }
.mode-upload-motion [data-motion-role="learning-details"]::after {
  content: "";
  position: absolute;
  inset: 50% 0 0;
  background: linear-gradient(transparent 4%, #0b2016b8 66%, #081912ed);
}

.mode-upload-motion [data-motion-role^="copy-"] {
  text-align: center;
  overflow-wrap: anywhere;
}

/* The previous card is drawn at its on-screen size while the real photo
   and blur are prepared in the final layout behind it. */
.photo-upload-outgoing {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.photo-upload-outgoing-surface,
.photo-upload-outgoing-art,
.photo-upload-outgoing-artwork,
.photo-upload-outgoing-copy {
  position: absolute;
  transform-origin: top left;
}

.photo-upload-outgoing-art {
  overflow: hidden;
}

.photo-upload-outgoing-artwork.identify-upload-deck {
  display: grid;
  place-items: center;
  container-type: size;
}

.photo-upload-outgoing-artwork:is(.learning-upload-photo, .learning-upload-wash) {
  display: block;
}

.photo-upload-outgoing-copy {
  display: grid;
  justify-items: center;
  text-align: center;
  overflow-wrap: anywhere;
}

.workspace[data-photo-upload-handoff] > .media {
  opacity: 0;
}

.workspace[data-photo-upload-handoff] > .reveal-sheet,
[data-app-page="home"] .workspace[data-photo-upload-handoff] > .dialogue {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 350px) {
  .identify-upload-back-left img { object-position: 93% 50%; }
}

@media (prefers-reduced-motion: no-preference) {
  .identify-upload-print { transition: transform .32s cubic-bezier(.24, .84, .32, 1.14); }
  #drop-zone:not([aria-disabled="true"]):active .identify-upload-print { transform: var(--upload-press-pose); }
}

@media (prefers-reduced-motion: no-preference) {
  .app-shell[data-app-page] > .app-top-bar,
  body:not([data-guide-demo]) .app-shell[data-app-page]:not([data-upload-mode-entered])
  > .workspace.material-intro:not(.has-media):not(.material-entering) > .media:not(.has-preview) {
    animation: preview-frame-in 340ms cubic-bezier(.2, .7, .25, 1);
  }

  body:not([data-guide-demo]) .app-shell[data-app-page="identify"]:not([data-upload-mode-entered])
  > .workspace.material-intro:not(.has-media) > .media:not(.has-preview) .identify-upload-print {
    animation: preview-photo-open 410ms cubic-bezier(.24, .07, .22, 1) var(--print-entrance-delay, 0ms) backwards;
  }

  .identify-upload-back-left { --print-entrance-delay: 34ms; }
  .identify-upload-back-right { --print-entrance-delay: 64ms; }

  body:not([data-guide-demo]) .app-shell[data-app-page="identify"]:not([data-upload-mode-entered])
  > .workspace.material-intro:not(.has-media) > .media:not(.has-preview) #drop-zone > .upload-copy {
    animation: preview-identify-copy-in 340ms cubic-bezier(.2, .7, .25, 1) 55ms backwards;
  }

  body:not([data-guide-demo]) .app-shell[data-app-page="home"]:not([data-upload-mode-entered])
  > .workspace.material-intro:not(.has-media) > .media:not(.has-preview)
  #drop-zone > :is(.upload-focus-reticle, .learning-upload-photo, .upload-copy) {
    animation: preview-learn-in 390ms cubic-bezier(.2, .7, .25, 1);
  }

  body:not([data-guide-demo]) .app-shell[data-app-page="home"]:not([data-upload-mode-entered])
  > .workspace.material-intro:not(.has-media) > .media:not(.has-preview) #drop-zone > .learning-upload-wash {
    animation: preview-learning-wash-in 390ms ease-out;
  }

  body:not([data-guide-demo]) .app-shell[data-app-page="identify"]
  > .workspace.material-intro:not(.has-media):not(.material-entering) > .identify-recent {
    animation: preview-frame-in 350ms cubic-bezier(.2, .7, .25, 1);
  }

  .app-shell[data-profile-open="true"] .app-profile-page[data-profile-page="about"] .app-profile-content {
    animation: preview-about-in 310ms cubic-bezier(.2, .7, .25, 1);
  }

  .app-shell[data-profile-open="true"] .app-profile-page[data-profile-page="mine"] .app-profile-content {
    animation: preview-profile-in 310ms cubic-bezier(.2, .7, .25, 1);
  }

  body[data-app-page="home"] .workspace:not(.material-intro):not(.material-entering)
  :is(.study-direction-intro, .study-direction-dock, .study-direction-picker):not([hidden]) {
    animation: preview-learn-in 300ms cubic-bezier(.2, .7, .25, 1);
  }

  #learning-invite[open] {
    animation: preview-learn-in 320ms cubic-bezier(.2, .7, .25, 1);
  }
}

@keyframes preview-frame-in { from { opacity: .35; } }
@keyframes preview-learning-wash-in { from { opacity: 0; } }
@keyframes preview-photo-open { from { opacity: 0; transform: translateY(10px) rotate(-3deg) scale(.91); } }
@keyframes preview-identify-copy-in { from { opacity: 0; translate: 0 8px; } }
@keyframes preview-learn-in { from { opacity: 0; translate: 0 10px; } }
@keyframes preview-about-in { from { opacity: .25; translate: 9px 0; } }
@keyframes preview-profile-in { from { opacity: .5; translate: -7px 0; } }

body:not([data-guide-demo]) .app-shell:is([data-app-page="home"], [data-app-page="identify"])
> .workspace.material-intro > .media:not(.has-preview) #drop-zone :is(#upload-instructions, #upload-limits) {
  color: var(--muted);
}

body:not([data-guide-demo]) .app-shell:is([data-app-page="home"], [data-app-page="identify"])
> .workspace.material-intro > .media:not(.has-preview) #drop-zone #upload-instructions {
  margin-block-start: 10px;
  color: var(--ink);
  font-size: 14px;
}

body:not([data-guide-demo]) .app-shell[data-app-page="identify"]
> .workspace.material-intro:not(.has-media) > .media:not(.has-preview) #drop-zone #upload-title {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

body:not([data-guide-demo]) .app-shell[data-app-page="identify"]
> .workspace.material-intro:not(.has-media) > .media:not(.has-preview) #drop-zone #upload-instructions {
  font-size: 15px;
}

body:not([data-guide-demo]) .app-shell[data-app-page="identify"]
> .workspace.material-intro:not(.has-media) > .media:not(.has-preview) #drop-zone #upload-limits {
  font-size: 13px;
}

body[data-app-page="home"] :is(.study-direction-choices, .study-direction-picker) button[aria-pressed="true"],
body[data-app-page="home"] #turns > .turn.user {
  background: var(--accent-soft);
  color: var(--ink);
}

#material-upload-status {
  background: var(--working-fill) !important;
  color: var(--working-ink) !important;
  inset-inline: var(--layout-inset) !important;
  min-block-size: 40px;
}

#material-upload-status[data-phase="recognizing"] > span {
  display: flex;
  align-items: center;
  gap: var(--layout-gap);
}

#material-upload-status[data-phase="recognizing"] > span::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: none;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: preview-working 950ms linear infinite;
}

@keyframes preview-working { to { transform: rotate(1turn); } }

@media (prefers-reduced-motion: reduce) {
  #material-upload-status[data-phase="recognizing"] > span::before { animation: none; }
}

#material-upload-status[data-phase="error"] {
  background: var(--retry-fill) !important;
  color: var(--retry-ink) !important;
}

#material-upload-status > button {
  min-block-size: var(--layout-touch) !important;
  padding-inline: 12px !important;
  background: var(--raised-surface);
  color: inherit;
  border-color: transparent;
}

.reveal-sheet .preview-result-primary .candidate-score {
  color: var(--accent);
}

.reveal-sheet .candidate:has([data-conflict]) .preview-result-primary .candidate-score {
  color: var(--review-ink);
}

.reveal-sheet .candidate:has([data-conflict]) .preview-result-notice,
.workspace[data-material-recognition-state="no_candidate"] #recognition-cards > p {
  padding: 8px 12px;
  border-inline-start: 3px solid currentColor;
  border-radius: 8px;
}

.reveal-sheet .candidate:has([data-conflict]) .preview-result-notice {
  color: var(--review-ink);
  background: var(--review-fill);
}

.workspace[data-material-recognition-state="no_candidate"] #recognition-cards > p {
  color: var(--muted);
  background: var(--sidebar);
}

@media (max-height: 560px) {
  body:not([data-guide-demo]) .app-shell:is([data-app-page="home"], [data-app-page="identify"])
  > .workspace.material-intro > .media:not(.has-preview) .media-content > #drop-zone {
    gap: var(--layout-gap);
  }

  body:not([data-guide-demo]) .app-shell:is([data-app-page="home"], [data-app-page="identify"])
  > .workspace.material-intro > .media:not(.has-preview) #drop-zone > .upload-focus-reticle {
    width: 28px;
  }
}
