/* Ingredient archive. All geometry is responsive; cabinet and basket layouts retired. */
.inventory-orb {
  position: fixed;
  z-index: 70;
  width: 51.2px;
  height: 51.2px;
  border: 1px solid #cbd3e7;
  border-radius: 50%;
  background: #fff;
  color: #283e8c;
  box-shadow: 0 5px 22px #283e8c12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  touch-action: none;
  cursor: grab;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 3px;
}
.inventory-orb svg {
  width: 11px;
  height: 21px;
}
.inventory-orb:active {
  cursor: grabbing;
}
.inventory-dialog,
.inventory-editor {
  --atlas-blue: #283e8c;
  box-sizing: border-box;
  color: #293650;
  background: #fff;
  border: 1px solid #dce2ed;
  box-shadow: 0 24px 100px #14264b25;
  border-radius: 10px;
  padding: 26px;
  width: min(940px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100dvh - 36px);
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  font:
    15px/1.6 -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    sans-serif;
}
.inventory-dialog {
  background: linear-gradient(
    90deg,
    #fff 0%,
    #fff 49.5%,
    #f4f5f8 50%,
    #fff 50.5%,
    #fff 100%
  );
}
.inventory-editor {
  width: min(560px, calc(100vw - 28px));
  padding: 24px;
}
.inventory-dialog::backdrop,
.inventory-editor::backdrop {
  background: #17223b4a;
  backdrop-filter: blur(4px);
}
.inventory-dialog *,
.inventory-editor * {
  box-sizing: border-box;
}
.inventory-dialog button,
.inventory-editor button {
  font: inherit;
  color: var(--atlas-blue);
  background: transparent;
  border: 1px solid #dce2ed;
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
  min-height: 42px;
  margin: 0;
}
.inventory-dialog button:disabled,
.inventory-editor button:disabled {
  opacity: 0.45;
  cursor: wait;
}
.inventory-dialog button:focus-visible,
.inventory-editor button:focus-visible,
.inventory-orb:focus-visible {
  outline: 2px solid #6e82bd;
  outline-offset: 3px;
}
.inventory-dialog .inv-primary,
.inventory-editor .inv-primary {
  background: var(--atlas-blue);
  color: white;
  border-color: var(--atlas-blue);
}
.inv-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #cfd7e8;
  padding-bottom: 20px;
  margin-bottom: 20px;
}
.inv-head small {
  display: block;
  color: #8793ac;
  font-size: 10px;
  letter-spacing: 0.16em;
}
.inv-head h1 {
  font-family: Georgia, "Songti SC", serif;
  letter-spacing: 0.12em;
  font-size: 26px;
  font-weight: 500;
  margin: 7px 0 0;
  color: var(--atlas-blue);
}
.inv-head h2 {
  font-size: 19px;
  font-weight: 500;
  margin: 0;
}
.inv-head button {
  font-size: 25px;
  border: 0;
  flex-shrink: 0;
  padding: 0;
  width: 44px;
}
.atlas-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.atlas-tools nav {
  display: flex;
  gap: 10px;
}
.atlas-tools nav button {
  border: 0;
  border-radius: 0;
  padding: 8px 5px;
  color: #9299a6;
  border-bottom: 1px solid transparent;
}
.atlas-tools nav button[aria-pressed="true"] {
  border-bottom-color: var(--atlas-blue);
  color: var(--atlas-blue);
}
.atlas-tools > span {
  font-size: 12px;
  color: #8d96a7;
  white-space: nowrap;
}
.atlas-filters {
  display: flex;
  gap: 10px;
  margin: 20px 0 12px;
}
.inventory-dialog input,
.inventory-editor input,
.inventory-dialog select,
.inventory-editor select,
.inventory-editor textarea {
  font: inherit;
  color: #34415b;
  background: #fafbfc;
  border: 1px solid #e0e5ee;
  border-radius: 5px;
  padding: 10px;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
}
.atlas-filters input {
  flex: 1;
  width: 50%;
}
.atlas-filters select {
  width: 115px;
}
.atlas-actions {
  display: flex;
  gap: 10px;
}
.atlas-actions [data-refresh] {
  margin-left: auto;
  font-size: 20px;
  padding: 2px 12px;
}
.inv-status {
  font-size: 13px;
  color: #76849c;
  min-height: 0;
  white-space: pre-wrap;
  margin: 12px 0;
}
.inv-status:empty {
  margin: 6px 0;
}
.inv-error {
  color: #a84848;
}
.atlas-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 12px 0 22px;
}
.inventory-dialog .atlas-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  background: #ffffffc9;
  padding: 15px 12px 20px;
  border-radius: 2px;
  border: 1px solid #dfe4ee;
  min-width: 0;
  animation: atlas-enter 0.28s ease-out both;
  box-shadow: 0 3px 10px #283e8c03;
  transition: border-color 0.2s;
}
.atlas-card:hover {
  border-color: #99a8ce;
}
.atlas-number {
  position: absolute;
  left: 10px;
  top: 8px;
  font:
    10px Georgia,
    serif;
  color: #9ca7bf;
  letter-spacing: 0.1em;
}
.atlas-art {
  height: 180px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 10px 9px;
  color: #526a9e;
}
.atlas-art > svg {
  max-width: 75px;
  max-height: 125px;
  width: 100%;
  height: 100%;
}
.atlas-card-name {
  font-size: 14px;
  line-height: 1.6;
  color: #283e70;
  margin-top: 10px;
  overflow-wrap: anywhere;
}
.atlas-card small {
  font-size: 11px;
  color: #96a0b0;
  margin-top: 6px;
}
.atlas-image {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.atlas-image img {
  max-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.atlas-image-fallback {
  height: 80%;
  width: 55px;
}
.atlas-image-fallback svg {
  width: 100%;
  height: 100%;
}
.atlas-footer {
  border-top: 1px solid #dce2ed;
  padding: 20px 0 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 18px;
}
.atlas-footer small {
  color: #a3adbd;
  font-size: 10px;
  letter-spacing: 0.2em;
}
.atlas-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 72px 15px;
  color: #9ba5b4;
  font-size: 14px;
}
.atlas-loading {
  grid-column: 1/-1;
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 75px;
}
.atlas-loading i {
  width: 6px;
  height: 28px;
  border: 1px solid #9baccb;
  animation: atlas-breathe 1.3s ease-in-out infinite alternate;
}
.atlas-loading i:nth-child(2) {
  animation-delay: 0.2s;
}
.atlas-loading i:nth-child(3) {
  animation-delay: 0.4s;
}
.atlas-record-picture {
  height: 250px;
  background: #fafbfc;
  border: 1px solid #e6e9ef;
  padding: 24px;
  color: #526a9e;
  display: flex;
  justify-content: center;
}
.atlas-record-picture > svg {
  height: 100%;
  max-width: 120px;
}
.atlas-record h3 {
  font:
    25px/1.4 Georgia,
    "Songti SC",
    serif;
  color: #283e70;
  margin: 24px 0 7px;
}
.atlas-category {
  color: #99a3b4;
  font-size: 12px;
  margin: 0 0 22px;
}
.atlas-record section {
  border-top: 1px solid #e5e8f0;
  padding: 14px 0;
  overflow-wrap: anywhere;
}
.atlas-record h4 {
  font-size: 14px;
  font-weight: 500;
  color: #283e8c;
  margin: 0 0 12px;
}
.atlas-record p {
  white-space: pre-wrap;
}
.atlas-record textarea {
  width: 100%;
  resize: vertical;
  display: block;
  margin: 12px 0;
  min-height: 130px;
}
.atlas-record article {
  border-bottom: 1px solid #eee;
  padding: 10px 0;
  font-size: 13px;
}
.atlas-record article b {
  font-weight: 500;
}
.atlas-record article p {
  margin: 5px 0;
}
.atlas-date {
  font-size: 12px;
  color: #9ba5b4;
}
.atlas-record .atlas-remove {
  color: #985c5c;
  border-color: #e8dada;
}
.atlas-sources a {
  display: block;
  font-size: 12px;
  color: #6479a6;
  margin: 7px 0;
}
.inv-input-row {
  border-bottom: 1px solid #eceff5;
  padding: 10px 0;
}
.inv-input-fields {
  display: flex;
  gap: 6px;
}
.inv-input-fields input {
  flex: 1;
  width: 50%;
}
.inv-input-fields select {
  width: 78px;
  padding: 6px;
}
.inv-input-fields button {
  border: 0;
  padding: 5px 10px;
}
.inv-suggestions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}
.inv-suggestions:empty {
  display: none;
}
.inv-suggestions button {
  display: flex;
  flex-direction: column;
  text-align: left;
  white-space: normal;
}
.inv-suggestions small {
  color: #8a95ab;
}
.inventory-editor footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}
.inventory-editor [data-line-add] {
  margin-top: 12px;
  border-style: dashed;
}
.atlas-camera-preview {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  margin-top: 15px;
}
.atlas-file {
  display: block;
  color: #283e8c;
  border: 1px dashed #bcc8de;
  padding: 16px;
  border-radius: 6px;
}
.atlas-file input {
  display: block;
  width: 100%;
  margin-top: 10px;
}
.atlas-camera > p {
  font-size: 13px;
  color: #8993a4;
}
.inventory-dialog [hidden],
.inventory-editor [hidden] {
  display: none !important;
}
@keyframes atlas-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes atlas-breathe {
  to {
    opacity: 0.25;
    transform: scaleY(0.65);
  }
}
@media (max-width: 700px) {
  .inventory-dialog,
  .inventory-editor {
    padding: 20px 16px;
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 24px);
  }
  .inventory-dialog {
    background: #fff;
  }
  .atlas-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .atlas-art {
    height: 168px;
  }
  .inv-head h1 {
    font-size: 24px;
  }
  .atlas-tools nav {
    gap: 15px;
  }
  .atlas-card-name {
    font-size: 13px;
  }
  .atlas-record-picture {
    height: 230px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .atlas-card,
  .atlas-loading i {
    animation: none !important;
    transition: none !important;
  }
}

/* Keep the existing archive close control reachable after long-form scrolling. */
.atlas-record > .inv-head {
  box-shadow: 0 -24px 0 #fff;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}
.atlas-record > .inv-head button {
  min-height: 44px;
}

/* Normar 建木: a responsive book spread. Artwork stays uncropped. */
.atlas-record.inventory-editor {
  width: min(1040px, calc(100vw - 28px));
}
.atlas-record-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
}
.atlas-record-picture {
  position: sticky;
  top: 84px;
  height: min(65vh, 660px);
  padding: 36px 40px 56px;
  background: #fff;
  border: 0;
  border-right: 1px solid #e2e6ee;
  box-shadow: 7px 0 12px -12px #283e8c;
}
.atlas-record-copy {
  padding: 8px 30px 30px;
  min-width: 0;
}
.atlas-record-copy h3 {
  margin-top: 8px;
  font-size: 30px;
}
.atlas-record-picture .atlas-image img {
  mix-blend-mode: normal;
}
.atlas-plate-label {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font:
    10px Georgia,
    serif;
  letter-spacing: 0.2em;
  color: #8f9bb1;
}
.atlas-page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e2e6ee;
  padding-top: 16px;
  margin-top: 12px;
  color: #929db3;
  font:
    12px Georgia,
    serif;
}
.atlas-page-nav button {
  min-height: 44px;
  border: 0;
}
.atlas-record-picture {
  touch-action: pan-y;
}
.atlas-record-body {
  animation: atlas-page-enter 0.22s ease-out both;
}
@keyframes atlas-page-enter {
  from {
    opacity: 0.35;
    transform: translateX(7px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.atlas-camera.inventory-editor {
  width: min(560px, calc(100vw - 24px));
  padding: 22px;
}
.atlas-viewfinder {
  position: relative;
  width: 100%;
  height: min(46dvh, 440px);
  min-height: 200px;
  background: #f5f6f9;
  overflow: hidden;
}
.atlas-viewfinder video,
.atlas-viewfinder .atlas-camera-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0;
  max-height: none;
}
.atlas-camera-guide {
  position: absolute;
  inset: 22px 22%;
  border: 1px solid #a7b5d3;
  border-radius: 60px 60px 12px 12px;
  pointer-events: none;
}
.atlas-camera-guide span {
  position: absolute;
  bottom: -18px;
  left: -50%;
  width: 200%;
  text-align: center;
  font-size: 11px;
  color: #6f7f9e;
  background: #ffffffba;
}
.atlas-capture-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 18px 0;
}
.atlas-capture-controls > button,
.atlas-capture-controls .atlas-file {
  font-size: 12px;
  margin: 0;
}
.atlas-capture-controls .atlas-shutter {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid #283e8c;
  background: #283e8c;
  color: white;
  font:
    42px/1 Georgia,
    serif;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 4px #fff;
}
.atlas-permissions {
  border-top: 1px solid #e2e6ee;
  padding-top: 16px;
  font-size: 12px;
  color: #667791;
}
.atlas-permissions summary {
  cursor: pointer;
  color: #283e8c;
  padding: 8px 0;
}
.atlas-permissions > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
}
.atlas-permissions b {
  display: block;
  font-weight: 500;
  color: #283e8c;
}
.atlas-permissions small {
  display: block;
  margin-top: 4px;
}
.atlas-permissions button {
  flex-shrink: 0;
  font-size: 12px;
  min-height: 44px;
}
.atlas-permissions p {
  color: #929db3;
  font-size: 11px;
}
.atlas-collection-photo {
  width: 100%;
  height: 150px;
  object-fit: contain;
  margin-bottom: 12px;
}
@media (max-width: 640px) {
  .atlas-record-body {
    display: block;
  }
  .atlas-record-picture {
    position: relative;
    top: auto;
    height: min(52dvh, 460px);
    min-height: 240px;
    padding: 20px 28px 44px;
    border-right: 0;
    border-bottom: 1px solid #e2e6ee;
    box-shadow: none;
  }
  .atlas-record-copy {
    padding: 24px 0 10px;
  }
  .atlas-record-copy h3 {
    font-size: 27px;
  }
  .atlas-camera.inventory-editor {
    padding: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .atlas-record-body,
  .atlas-loading i {
    animation: none;
  }
}
.atlas-page-nav {
  position: sticky;
  bottom: -24px;
  z-index: 2;
  background: #fff;
  padding: 12px 0;
  box-shadow: 0 16px 0 #fff;
}
.atlas-camera > .inv-head {
  position: sticky;
  top: -16px;
  z-index: 2;
  background: #fff;
  box-shadow: 0 -20px 0 #fff;
  padding-top: 4px;
}
.atlas-viewfinder {
  height: min(36dvh, 340px);
}
.atlas-capture-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr);
  gap: 14px;
}
.atlas-capture-controls .atlas-file {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 3px;
  min-height: 44px;
  border: 0;
  white-space: nowrap;
  cursor: pointer;
}
.atlas-capture-controls .atlas-file input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.atlas-capture-controls > button:not(.atlas-shutter) {
  border: 0;
  white-space: nowrap;
  padding: 12px 3px;
}

/* Jianmu: a finite opening/closing gesture, then quiet, readable pages. */
.inventory-dialog.atlas-volume {
  width: min(860px, calc(100vw - 32px));
  height: min(730px, calc(100dvh - 40px));
  padding: 24px 30px 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 3px 12px 12px 3px;
  border-left: 7px solid #dfe4ef;
  background: linear-gradient(90deg, #eef0f5 0, #fff 24px, #fff 99%, #f0f1f5);
  box-shadow:
    3px 3px 0 #f2f3f6,
    5px 5px 0 #dce1eb,
    0 26px 90px #17223b33;
  transform-origin: center;
  perspective: 1500px;
}
.atlas-volume .inv-head {
  margin: 0;
  padding-bottom: 12px;
  flex-shrink: 0;
}
.atlas-volume .inv-head h1 {
  font-size: 24px;
}
.atlas-volume .inv-status {
  margin: 0;
  min-height: 0;
  font-size: 12px;
}
.atlas-volume .inv-status:not(:empty) {
  padding-top: 8px;
}
.atlas-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(90deg, #e5e9f2, #fff 5%, #fafbfe);
  border: 1px solid #cbd3e7;
  border-radius: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  color: #283e8c;
  transform-origin: left center;
  backface-visibility: hidden;
  opacity: 0;
  transform: rotateY(-155deg);
}
.atlas-cover::after {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid #dce2ed;
}
.atlas-cover small {
  letter-spacing: 0.4em;
  font:
    15px Georgia,
    serif;
}
.atlas-cover strong {
  font:
    42px "Songti SC",
    Georgia,
    serif;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
}
.atlas-cover > span {
  font-size: 9px;
  letter-spacing: 0.18em;
}
.is-opening.atlas-volume {
  animation: atlas-arrive 0.56s cubic-bezier(0.2, 0.65, 0.25, 1) both;
}
.is-opening .atlas-cover {
  animation: atlas-unfold 0.56s cubic-bezier(0.2, 0.65, 0.25, 1) both;
}
.is-closing.atlas-volume {
  animation: atlas-return 0.48s cubic-bezier(0.55, 0, 0.75, 0.3) both;
}
.is-closing .atlas-cover {
  animation: atlas-fold 0.32s ease-in both;
}
@keyframes atlas-arrive {
  from {
    opacity: 0;
    transform: translate(var(--book-x, 0), var(--book-y, 40px)) scale(0.12);
  }
  45% {
    opacity: 1;
  }
  to {
    transform: none;
  }
}
@keyframes atlas-return {
  0%,
  35% {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translate(var(--book-x, 0), var(--book-y, 40px)) scale(0.12);
  }
}
@keyframes atlas-unfold {
  0%,
  25% {
    opacity: 1;
    transform: rotateY(0);
  }
  85% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: rotateY(-155deg);
  }
}
@keyframes atlas-fold {
  from {
    opacity: 0;
    transform: rotateY(-155deg);
  }
  15% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: rotateY(0);
  }
}
.atlas-directory {
  flex-shrink: 0;
}
.atlas-directory summary {
  cursor: pointer;
  color: #74809a;
  font-size: 12px;
  min-height: 40px;
  padding: 10px 0;
}
.atlas-directory summary span {
  float: right;
}
.atlas-directory[open] {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
.atlas-directory[open] ~ .atlas-leaf,
.atlas-directory[open] ~ .atlas-book-nav {
  display: none;
}
.atlas-leaf {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  position: relative;
  touch-action: pan-y;
}
.atlas-leaf-plate {
  height: 100%;
  min-height: 0;
  padding: 24px 40px;
  border-right: 1px solid #e5e8ef;
  background: linear-gradient(90deg, transparent 97%, #f2f3f7);
}
.atlas-leaf .atlas-image {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}
.atlas-leaf .atlas-image img,
.atlas-leaf .atlas-image svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.atlas-leaf .atlas-image > span {
  width: 55%;
  height: 80%;
}
.atlas-leaf-caption {
  padding: 30px;
}
.atlas-leaf-caption small,
.atlas-blank > small {
  color: #9aa3b5;
  font-size: 10px;
  letter-spacing: 0.18em;
}
.atlas-leaf-caption h2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: #283e8c;
  font-size: 26px;
  font-weight: 500;
  font-family: "Songti SC", Georgia, serif;
  line-height: 1.5;
  overflow-wrap: anywhere;
  margin: 20px 0 8px;
}
.atlas-leaf-caption p {
  color: #8992a4;
  font-size: 13px;
}
.atlas-leaf-caption button {
  border: 0;
  border-bottom: 1px solid #dce2ed;
  border-radius: 0;
  padding: 8px 0;
  font-size: 13px;
  margin-top: 16px;
}
.atlas-leaf-caption button span {
  margin-left: 25px;
}
.atlas-book-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #e5e8ef;
  flex-shrink: 0;
}
.atlas-book-nav button {
  border: 0;
  min-width: 48px;
  font-size: 22px;
  padding: 0;
}
.atlas-book-nav span {
  color: #9aa3b5;
  font:
    12px Georgia,
    serif;
  letter-spacing: 0.16em;
}
.atlas-blank {
  grid-column: 1 / -1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
}
.atlas-blank .atlas-inscribe {
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  font-size: 13px;
}
.atlas-inscribe > span {
  font-size: 48px;
  font-weight: 200;
  color: #93a1c5;
  line-height: 1;
}
.atlas-entry-choices {
  display: flex;
  gap: 18px;
}
.atlas-entry-choices button {
  padding: 12px 20px;
}
.atlas-volume [hidden],
.atlas-camera [hidden] {
  display: none !important;
}
/* Capture stays camera-first. Permission denial is an inline recovery, never a separate wall. */
.inventory-editor.atlas-camera {
  width: min(480px, calc(100vw - 24px));
  padding: 18px;
  border-radius: 12px;
}
.atlas-camera .inv-head {
  margin-bottom: 14px;
  padding-bottom: 12px;
  gap: 6px;
}
.atlas-camera .inv-head > div {
  text-align: center;
}
.atlas-camera .inv-head button {
  border: 0;
  box-shadow: none;
  background: transparent;
}
.atlas-camera .inv-head h2 {
  font-size: 16px;
  margin-top: 3px;
}
.atlas-camera .atlas-viewfinder {
  position: relative;
  height: min(51dvh, 470px);
  min-height: 180px;
  border: 0;
  border-radius: 5px;
  background: #f1f3f7;
  overflow: hidden;
}
.atlas-camera .atlas-viewfinder video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.atlas-camera .atlas-camera-guide {
  position: absolute;
  inset: 12% 17% 16%;
  border: 0;
  border-radius: 0;
  pointer-events: none;
  background: none;
}
.atlas-camera-guide i {
  position: absolute;
  width: 22px;
  height: 22px;
  border: solid #8f9fc2;
}
.atlas-camera-guide i:nth-child(1) {
  left: 0;
  top: 0;
  border-width: 1px 0 0 1px;
}
.atlas-camera-guide i:nth-child(2) {
  right: 0;
  top: 0;
  border-width: 1px 1px 0 0;
}
.atlas-camera-guide i:nth-child(3) {
  left: 0;
  bottom: 0;
  border-width: 0 0 1px 1px;
}
.atlas-camera-guide i:nth-child(4) {
  right: 0;
  bottom: 0;
  border-width: 0 1px 1px 0;
}
.atlas-camera .atlas-camera-guide span {
  position: absolute;
  bottom: -30px;
  left: -10%;
  width: 120%;
  font-size: 11px;
  color: #75839f;
  background: #ffffffd9;
  text-align: center;
}
.atlas-camera [data-enable-camera] {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  font-size: 13px;
}
.atlas-camera .atlas-capture-controls {
  margin: 18px 0 8px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 76px 1fr;
  align-items: center;
  justify-items: center;
  gap: 10px;
}
.atlas-camera .atlas-capture-controls > button:not(.atlas-shutter),
.atlas-camera .atlas-file {
  border: 0;
  font-size: 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.atlas-camera .atlas-shutter {
  width: 64px;
  height: 64px;
  border: 1px solid #7185b8;
  border-radius: 50%;
  background: white;
  padding: 5px;
}
.atlas-camera .atlas-shutter span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #283e8c;
}
.atlas-camera .inv-status {
  font-size: 12px;
  margin: 8px 0;
  min-height: 0;
  text-align: center;
}
@media (max-width: 600px) {
  .inventory-dialog.atlas-volume {
    padding: 18px 20px 12px;
    height: calc(100dvh - 48px);
  }
  .atlas-leaf {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .atlas-leaf-plate {
    border: 0;
    background: none;
    padding: 12px 42px;
  }
  .atlas-leaf-caption {
    text-align: center;
    padding: 10px 4px 18px;
  }
  .atlas-leaf-caption h2 {
    font-size: 22px;
    margin: 10px 0 4px;
  }
  .atlas-leaf-caption p {
    margin: 4px 0;
  }
  .atlas-leaf-caption button {
    margin-top: 4px;
  }
  .atlas-blank {
    grid-row: 1 / -1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .atlas-volume,
  .atlas-cover {
    animation: none !important;
  }
}
/* Scan is tied to an active recognition job, never to an idle camera or finished result. */
.atlas-scan { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; background: #283e8c08; }
.atlas-scan span { position: absolute; inset: 0 0 auto; height: 22%; border-bottom: 1px solid #8daaf1; background: linear-gradient(transparent,#7899e12b); animation: atlas-label-scan 2.4s ease-in-out infinite alternate; }
@keyframes atlas-label-scan { from { transform: translateY(-100%); } to { transform: translateY(455%); } }
.atlas-read-text { color: #74809a; font-size: 12px; margin: 14px 0; }
.atlas-read-text summary { padding: 10px 0; cursor: pointer; }
.atlas-read-text textarea { width: 100%; min-height: 96px; font-size: 14px; }
.atlas-read-text small { display: block; margin: 8px 0; line-height: 1.7; }
.atlas-read-text button { font-size: 12px; }
.atlas-match-evidence { color: #536b9d !important; margin-top: 5px; }
@media (prefers-reduced-motion: reduce) { .atlas-scan span { animation: none; top: 40%; } }
.atlas-turn-stage { flex: 1; min-height: 0; position: relative; perspective: 1200px; }
.atlas-turn-stage > .atlas-leaf { width: 100%; height: 100%; background: #fff; }
.atlas-turn-stage > main.atlas-leaf { position: relative; z-index: 2; backface-visibility: hidden; }
.atlas-leaf-under { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.atlas-leaf.is-following { box-shadow: 10px 0 24px #283e8c15; will-change: transform; user-select: none; }
.atlas-directory[open] ~ .atlas-turn-stage { display: none; }
.atlas-leaf-caption .atlas-leaf-origin { font-size: 11px; margin: 8px 0; color: #8793a9; }
.atlas-leaf-review { text-align: left; margin: 12px 0 4px; padding: 10px 0 0; border-top: 1px solid #edf0f5; }
.atlas-leaf-review > small { font-size: 10px; letter-spacing: .08em; }
.atlas-leaf-review p { color: #526078; font-size: 12px; line-height: 1.7; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 5px 0; }
.atlas-leaf-review footer { color: #8c97ab; font-size: 10px; }
@media (max-width: 600px) { .atlas-leaf-caption { padding-bottom: 8px; } .atlas-leaf-caption h2 { -webkit-line-clamp: 2; } }
/* Single-bottle capture guidance; modest line drawing, independent of the scan. */
.atlas-camera-guide svg {position:absolute;inset:0;margin:auto;width:75%;height:90%;fill:none;pointer-events:none;}
.atlas-camera-guide svg path {stroke:#a4b2d3;stroke-width:1.3;stroke-linejoin:round;stroke-dasharray:1080;stroke-dashoffset:1080;animation:atlas-bottle-outline 4s ease-in-out infinite;}
@keyframes atlas-bottle-outline {0% {stroke-dashoffset:1080;opacity:.3;}45%,90%{stroke-dashoffset:0;opacity:.9;}100%{stroke-dashoffset:0;opacity:.3;}}
.atlas-camera-guide>span {font-size:11px;white-space:normal;line-height:1.6;}
.atlas-unmatched {padding:16px;background:#f5f7fb;border-radius:12px;color:#63728f;font-size:13px;}
.atlas-custom-fields {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:10px;}
.atlas-custom-fields label {font-size:12px;color:#7d89a2;display:grid;gap:6px;min-width:0;}
.atlas-custom-fields input,.atlas-custom-fields select {width:100%;min-width:0;font-size:max(16px,1rem);}
.atlas-photo-tools,.atlas-cutout nav {display:flex;flex-wrap:wrap;gap:8px;margin:10px 0;}
.atlas-cutout-canvas {text-align:center;background:repeating-conic-gradient(#eef0f4 0% 25%,#fff 0% 50%) 0/16px 16px;max-height:55dvh;}
.atlas-cutout canvas {display:block;max-width:100%;max-height:55dvh;width:auto;height:auto;margin:auto;touch-action:none;}
.atlas-cutout>p {font-size:12px;color:#7d89a2;line-height:1.7;}
.atlas-cutout button[aria-pressed=true] {background:#edf0f8;color:#283e8c;}
@media(prefers-reduced-motion:reduce){.atlas-camera-guide svg path {animation:none;stroke-dashoffset:0;}}
