:root{
  --bg: #ffffff;
  --ink: #0f172a;
  --muted: #5b667a;
  --line: rgba(15, 23, 42, .12);

  --blue: #1f4aff;
  --purple: #6d28d9;
  --green: #16a34a;

  --radius: 18px;
  --shadow: 0 18px 40px rgba(15,23,42,.12);
}

*{ box-sizing: border-box; }
html,body{ height: 100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--ink);
  background: var(--bg);
}

a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display: block; }

.wrap{
  width: min(1100px, calc(100% - 24px));
  margin-inline: auto;
}
@media (max-width:540px) {
  .wrap { width: calc(100% - 16px); }
}

.muted{ color: var(--muted); }

/* ── Topbar ── */
.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}

.brandMark{
  display: grid;
  place-items: center;
  color: var(--blue);
  font-weight: 900;
}

.brandName{ font-weight: 850; letter-spacing: -0.01em; }

/* Mobile-first nav */
.nav{ display: none; }
.topbarCtas{ display: none; }

/* menuBtn: block on mobile, hidden on desktop */
.menuBtn{
  display: block;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.navLink{
  font-size: 14px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
}
.navLink:hover{ background: rgba(31,74,255,.08); color: var(--ink); }

/* ── Buttons ── */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  font-weight: 650;
  letter-spacing: .1px;
  cursor: pointer;
  background: white;
}

.btnPrimary{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  background: linear-gradient(135deg, #2e6bff, #1c4ed8);
  color: white;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
  box-shadow: 0 6px 18px rgba(28, 78, 216, 0.25);
}

.btnPrimary:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 22px rgba(28, 78, 216, 0.32);
}
.btnPrimary:active{
  transform: translateY(0px);
  filter: brightness(0.98);
}

/* Save button attention pulse — triggered after a photo is added */
@keyframes saveBtnPulseAnim {
  0%   { box-shadow: 0 6px 18px rgba(28,78,216,.25); transform: scale(1);    background: var(--blue); }
  15%  { box-shadow: 0 0 0 8px rgba(31,74,255,.45), 0 6px 18px rgba(28,78,216,.30); transform: scale(1.08); background: #3a5fff; }
  40%  { box-shadow: 0 0 0 14px rgba(31,74,255,.15), 0 6px 18px rgba(28,78,216,.20); transform: scale(1.03); background: #3a5fff; }
  70%  { box-shadow: 0 0 0 18px rgba(31,74,255,.05), 0 6px 18px rgba(28,78,216,.15); transform: scale(1.01); background: #2e6bff; }
  100% { box-shadow: 0 6px 18px rgba(28,78,216,.25); transform: scale(1);    background: var(--blue); }
}
.saveBtnPulse {
  animation: saveBtnPulseAnim 1.4s ease-out 3;
}
.saveBtnLocked { opacity: 0.45; cursor: not-allowed; }

.btnSoft{
  background: rgba(109,40,217,.10);
  color: #3b1a77;
  border-color: rgba(109,40,217,.22);
}

.btnGhost{
  background: white;
  color: var(--ink);
}

/* ── Hero ── */
.hero{
  position: relative;
  overflow: hidden;
  min-height: 520px;
  border-bottom: 1px solid var(--line);
}

.heroMedia{
  position: absolute;
  inset: 0;
}
.heroMedia img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  filter: saturate(1.02);
}

.heroFade{
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.97) 0%,
    rgba(255,255,255,0.88) 34%,
    rgba(255,255,255,0.35) 58%,
    rgba(255,255,255,0.00) 74%
  );
}

.heroInner{
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  padding: 64px 0;
  align-items: start;
}

.heroCopy{ max-width: 620px; }

.hero h1{
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.05;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.lead{
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
  margin: 0 0 18px;
}

.heroBtns{ display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.myBoxesList{ display: grid; gap: 0; }

/* ── Location groups (index page) ── */
.locationGroup { margin-bottom: 28px; }
.locationGroup[data-collapsed="true"] { margin-bottom: 8px; }
.locationGroup:last-child { margin-bottom: 0; }

/* Locations bar — count + expand/collapse all */
.locationsBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.locationsCount {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #5b667a);
}
.expandCollapseAll {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #5b667a);
  cursor: pointer;
  padding: 4px 12px;
  text-decoration: none;
}
.expandCollapseAll:hover { background: #e2e8f0; }

.locationGroupHeader {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.locationGroupHeader:hover { background: #1e293b; }
.lgHeaderText {
  flex: 1;
  min-width: 0;
  margin-right: 8px;
  line-height: 1.35;
}
.lgContainerCount {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.75;
  font-size: 11px;
}
.lgChevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  opacity: 0.7;
  margin-top: 2px;
}
.locationGroupRows { margin-top: 0; }
.locationGroup .boxRowWrap { margin-bottom: 8px; }
.locationGroup .boxRowWrap:last-child { margin-bottom: 0; }

/* First row of the first location group gets a subtle blue tint to suggest it's tappable */
.locationGroup:first-child .locationGroupRows .boxRowWrap:first-child .boxRow {
  background: #dbeafe;
  border-color: #93c5fd;
}

/* Pulse animation for first row on group expand */
@keyframes mkRowPulse {
  0%   { box-shadow: 0 0 0 0 rgba(59,130,246,0.45); }
  50%  { box-shadow: 0 0 0 7px rgba(59,130,246,0); }
  100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}
.mk-pulse-hint {
  animation: mkRowPulse 500ms ease-out 2;
}

/* Item count on container card */
.boxRowItemCount {
  font-size: 11px;
  color: var(--muted, #5b667a);
  margin-top: 2px;
  text-align: right;
}

/* ── Box rows (My Boxes list) ── */
.boxRow{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 48px 12px 12px;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 16px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  width: 100%;
  box-sizing: border-box;
  align-items: flex-start;
}
.boxRow:hover{ background: rgba(15,23,42,.03); }
.boxRowWrap { position:relative; }
.boxRowDeleteBtn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(220, 38, 38, 0.10);
  color: #dc2626;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 150ms, color 150ms;
  z-index: 1;
}
.boxRowDeleteBtn:hover,
.boxRowDeleteBtn:active { background: #fee2e2; color: #b91c1c; }
.boxRowTitle{
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.boxRowIcon { display:flex; align-items:center; flex-shrink:0; margin-top:2px; }
.boxRowTitleText {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.boxRowMeta{ font-size: 14px; color: rgba(15,23,42,.65); margin-top: 3px; }
.boxRowRight{ font-weight: 800; color: rgba(15,23,42,.75); white-space: nowrap; }

/* ── Bullets ── */
.bullets{ display: grid; gap: 10px; margin-top: 10px; }
.bullet{ display: flex; gap: 10px; align-items: flex-start; color: var(--muted); }
.bullet strong{ color: var(--ink); }
.dot{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
  flex: 0 0 auto;
}
.dotBlue{ background: rgba(31,74,255,.12); color: var(--blue); }
.dotPurple{ background: rgba(109,40,217,.12); color: var(--purple); }
.dotGreen{ background: rgba(22,163,74,.12); color: var(--green); }

/* ── QR stack ── */
.qrStack{
  width: 140px;
  display: grid;
  gap: 10px;
  padding-top: 8px;
  opacity: .95;
  animation: floatStack 10s ease-in-out infinite;
}
@keyframes floatStack{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-14px); }
}
.qrCard{
  height: 86px;
  border-radius: 14px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(15,23,42,.14);
  box-shadow: 0 10px 25px rgba(15,23,42,.10);
  display: grid;
  place-items: center;
  padding: 8px;
  user-select: none;
}
.qrCard img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: crisp-edges;
}

/* ── Value section ── */
.value{ padding: 34px 0; }
.valueGrid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* ── Card ── */
.card{
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(15,23,42,.06);
  padding: 16px;
}
.card h2{ margin: 0 0 8px; }
.card p{ margin: 0; color: var(--muted); line-height: 1.45; }

/* ── CTA section ── */
.cta{ padding: 10px 0 44px; }
.ctaInner{
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(31,74,255,.16);
  background: rgba(31,74,255,.04);
  border-radius: var(--radius);
  padding: 18px;
}
.ctaInner h2{ margin: 0 0 4px; }
.ctaInner p{ margin: 0; color: var(--muted); }
.ctaBtns{ display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Footer ── */
.footer{
  border-top: 1px solid var(--line);
  padding: 18px 0;
}
.footerInner{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.footerLinks{ display: flex; gap: 14px; }
.footerLinks a{ color: var(--muted); }
.footerLinks a:hover{ color: var(--ink); }

/* ── Mobile menu ── */
.mobileMenu{
  position: fixed;
  top: 58px;
  right: 12px;
  left: 12px;
  z-index: 50;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  gap: 6px;
}
.mobileMenu a{
  padding: 12px 12px;
  border-radius: 14px;
  color: var(--muted);
}
.mobileMenu a:hover{
  background: rgba(31,74,255,.08);
  color: var(--ink);
}
.mobileMenu[hidden]{ display: none; }

/* ── Desktop overrides ── */
@media (min-width: 981px){
  .nav{ display: flex; }
  .topbarCtas{ display: flex; gap: 10px; margin-left: auto; }
  .menuBtn{ display: none; }
  .mobileMenu{ display: none !important; }
}

/* ── Create page ── */
.pagePad{ padding: 14px 0; }
.pageTitle{ margin: 0 0 10px; }
.rowBtns{ margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.smallNote{ margin-top: 14px; font-size: 13px; }
.tiny{ font-size: 13px; }
.paddingtop{ padding-top: 4px; }
.req{ color: #dc2626; }

.boxHeader #createRow{ margin-top: 0; }

.boxHeaderTop{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

/* Box name row (appears after creation) */
.boxNameRow{
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 18px;
}

#boxNameRow{
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 240ms ease, transform 240ms ease;
}
#boxNameRow.fadeIn{
  opacity: 1;
  transform: translateY(0);
}

.boxNameLabel{
  font-size: 13px;
  font-weight: 600;
  color: rgba(15,23,42,.65);
  white-space: nowrap;
}

.boxNameInlineInput{
  font-size: 18px;
  font-weight: 800;
  border: none;
  background: transparent;
  padding: 0;
  outline: none;
  color: #0f172a;
  min-width: 80px;
}
.boxNameInlineInput:focus{
  border-bottom: 2px solid #1f4aff;
  padding-bottom: 2px;
}

/* Save badge */
.saveBadge{
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(22,163,74,.25);
  background: rgba(22,163,74,.10);
  color: #166534;
  font-weight: 700;
  font-size: 13px;
}

/* Edit tip */
.editTip{
  margin-top: 8px;
  font-size: 13px;
  color: rgba(15,23,42,.65);
  font-weight: 600;
}

/* Write reminder */
.reminder{
  position: relative;
  margin-top: 10px;
  padding: 10px 40px 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(31,74,255,.18);
  background: rgba(31,74,255,.06);
  color: rgba(15,23,42,.92);
}

#writeReminder{
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 240ms ease, transform 240ms ease;
}
#writeReminder.fadeIn{
  opacity: 1;
  transform: translateY(0);
}

.reminderDismiss{
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.12);
  background: white;
  color: rgba(15,23,42,.65);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.reminderDismiss:hover{
  background: rgba(15,23,42,.04);
  color: rgba(15,23,42,.85);
}

/* Field grid */
.fieldGrid{
  margin-top: 12px;
  margin-bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.fieldFull{ grid-column: 1 / -1; }

/* ── Document toggle ── */

.fieldLabel{
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: rgba(15,23,42,.85);
}
.fieldHint {
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
}

.field input,
.field textarea{
  width: 100%;
  border: 1px solid rgba(15,23,42,.14);
  border-radius: 14px;
  padding: 12px 12px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
}
.field input:focus,
.field textarea:focus{
  border-color: rgba(31,74,255,.35);
  box-shadow: 0 0 0 3px rgba(31,74,255,.12);
}

/* Create complete banner */
.createComplete{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(22,163,74,.08);
  border: 1px solid rgba(22,163,74,.18);
  color: rgba(15,23,42,.88);
  font-size: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.createCompleteDot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(22,163,74,.85);
  flex: 0 0 auto;
}
#createComplete{
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 220ms ease, transform 220ms ease;
}
#createComplete.fadeIn{
  opacity: 1;
  transform: translateY(0);
}

/* Fade out (create row disappears) */
.fadeOut{
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 220ms ease;
}

/* Scan page */
.scanFrame{
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 3/4;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,.14);
  box-shadow: 0 18px 40px rgba(15,23,42,.10);
  background: #000;
}
.scanFrame video{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scanOverlay{
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(0,0,0,.35), rgba(0,0,0,0) 35%, rgba(0,0,0,0) 65%, rgba(0,0,0,.35)),
    linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,0) 35%, rgba(0,0,0,0) 65%, rgba(0,0,0,.35));
}

/* ── Items section ── */

.itemsHeader{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.itemsTitle{
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.itemCount{
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.printQrBtn{
  height: 38px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--blue);
  border-color: rgba(31,74,255,.25);
}
.printQrBtn:hover{
  background: rgba(31,74,255,.06);
}
.qrBtnIcon { width:16px; height:16px; flex-shrink:0; vertical-align:middle; position:relative; top:-1px; }
.qrBtnIconLg { width:22px; height:22px; top:-2px; }

/* ── Item type picker ── */
.itemTypePicker{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0;
}
.itemTypePicker[hidden]{ display: none; }
.typePickerBtn{
  flex: 1;
  min-width: 90px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted, #475569);
  cursor: pointer;
  transition: all 140ms;
  text-align: center;
}
.typePickerBtn:hover{
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(31,74,255,.04);
}
.typePickerBtn--active{
  border-color: var(--blue);
  background: rgba(31,74,255,.08);
  color: var(--blue);
}

/* ── AssetStore item card ── */
.assetCard{
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 120ms, border-color 120ms;
}
.assetCard:hover{
  border-color: var(--blue);
  box-shadow: 0 2px 12px rgba(31,74,255,.10);
}

/* ── Empty state ── */
.itemsEmpty{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 0 14px;
  color: var(--muted);
  text-align: center;
}
.itemsEmpty[hidden]{ display: none; }
.itemsEmptyIcon{
  font-size: 32px;
  line-height: 1;
}
.itemsEmpty p{
  margin: 0;
  font-size: 14px;
}

/* ── Item list ── */
.itemsList{
  display: grid;
  gap: 10px;
}

/* ── Item card ── */
.itemCard{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  transition: background 120ms;
}
.itemCard:hover{ background: rgba(15,23,42,.02); }

.itemCardThumb{
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(15,23,42,.05);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
}
.itemThumbImg{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.itemThumbEmpty,
.itemThumbLoading{
  font-size: 22px;
  line-height: 1;
  user-select: none;
}

.itemCardBody{
  flex: 1;
  min-width: 0;
}
.itemCardLabel{
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itemCardMeta{
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  flex-wrap: wrap;
}
.itemCardNotes{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.itemEditBtn{
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 0;
  border: none;
  background: none;
  box-shadow: none;
  cursor: pointer;
  font-size: 15px;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
  padding: 0;
}
.itemEditBtn img { display:block; filter:none; width:32px; height:32px; }
.itemEditBtn:hover{
  transform: scale(1.12);
  opacity: 0.8;
}

/* ── Add / Edit form ── */
.itemForm{
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(31,74,255,.18);
  border-radius: 14px;
  background: rgba(31,74,255,.03);
}

.itemFormInner{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

/* Photo target */
.itemPhotoTarget{
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
  border-radius: 12px;
  border: 2px dashed rgba(15,23,42,.18);
  background: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 150ms, background 150ms;
  position: relative;
}
.itemPhotoTarget:hover,
.itemPhotoTarget:focus{
  border-color: var(--blue);
  background: rgba(31,74,255,.04);
  outline: none;
}

.itemPhotoPlaceholder{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.itemPhotoIcon{ font-size: 22px; line-height: 1; }
.itemPhotoHint{
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.itemPhotoPreview{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}

/* Form fields area */
.itemFormFields{
  flex: 1;
  display: grid;
  gap: 10px;
}
.itemFormRow{
  display: flex;
  gap: 10px;
}

/* Form actions */
.itemFormActions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Asset type button row: + Photo | + Scan Document | + Voice Note */
.itemAssetBtnRow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.itemAssetBtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink, #0f172a);
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
}
.itemAssetBtn:hover { background: #f0f4ff; border-color: #c7d2fe; }
.itemAssetBtn:disabled { opacity: 0.4; cursor: not-allowed; background: #f8fafc; }
.itemAssetBtnIcon { font-size: 20px; line-height: 1; }

.btnDanger{
  background: white;
  color: #dc2626;
  border-color: rgba(220,38,38,.22);
}
.btnDanger:hover{
  background: rgba(220,38,38,.06);
  border-color: rgba(220,38,38,.38);
}

/* Ensure hidden attribute works on elements with display overrides */
.btn[hidden],
.itemsEmpty[hidden],
.itemForm[hidden],
.itemAssetBtnRow[hidden] { display: none !important; }

/* ── Mobile responsive (items) ── */
@media (max-width: 980px){
  .itemFormInner{
    flex-direction: column;
    align-items: stretch;
  }
  .itemPhotoTarget{
    width: 100%;
    height: 120px;
    flex: none;
  }
}
  .heroInner{
    grid-template-columns: 1fr;
    padding: 44px 0;
  }
  .qrStack{ display: none; }

  .heroFade{
    background: linear-gradient(
      180deg,
      rgba(255,255,255,0.98) 0%,
      rgba(255,255,255,0.86) 40%,
      rgba(255,255,255,0.35) 70%,
      rgba(255,255,255,0.00) 100%
    );
  }

  .heroMedia img{ object-position: center top; }

  .valueGrid{ grid-template-columns: 1fr; }

  /* Fix: two-column field grid is too cramped on small screens */
  .fieldGrid{ grid-template-columns: 1fr; }
  .fieldFull{ grid-column: 1; }
}

/* ═══════════════════════════════════════════
   Print page — screen styles
═══════════════════════════════════════════ */

.printPageHeader{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}
.printPageTitle{
  margin: 0;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 900;
  letter-spacing: -0.02em;
}
.printActionBtn{ white-space: nowrap; }
.printEmptyState{
  text-align: center;
  padding: 40px 0;
  color: var(--muted);
}
.printLink{ color: var(--blue); font-weight: 600; }

/* Step labels */
.printStepLabel{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 22px 0 10px;
}

/* ── Label size picker ── */
.labelSizePicker{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}
.labelSizeCard{
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: white;
  cursor: pointer;
  transition: border-color 140ms, box-shadow 140ms;
  user-select: none;
}
.labelSizeCard input[type="radio"]{
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.labelSizeCard:hover{
  border-color: rgba(31,74,255,.35);
}
.labelSizeCardActive{
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31,74,255,.12);
}
.labelSizePreview{
  width: 100%;
}
.labelSizeSvg{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.labelSizeInfo{ }
.labelSizeName{
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.labelSizeBadge{
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(31,74,255,.1);
  color: var(--blue);
  letter-spacing: .02em;
}
.labelSizeDims{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 600;
}
.labelSizeNote{
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
}
.labelSizeCardHeader{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.labelSizeToggle{
  flex-shrink: 0;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: var(--muted);
  transition: border-color 140ms, color 140ms, transform 180ms;
  margin-top: 2px;
}
.labelSizeToggle:hover{
  border-color: var(--blue);
  color: var(--blue);
}
.labelSizeToggle[aria-expanded="true"]{
  transform: rotate(180deg);
}

/* ── Box selector table ── */
.printSelectorCard{ padding: 0; overflow: hidden; }
.printSelectorHeader{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.printSelectorTitle{
  font-size: 14px;
  font-weight: 800;
}
.printSelectorActions{ display: flex; gap: 10px; }

.btnText{
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  border-radius: 6px;
  transition: background 120ms;
}
.btnText:hover{ background: rgba(31,74,255,.07); }
.btnText:disabled{ color: var(--muted); cursor: default; }
.btnText:disabled:hover{ background: none; }

.printBoxTable{
  width: 100%;
  border-collapse: collapse;
}
.printBoxTable thead th{
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: rgba(15,23,42,.02);
}
.printBoxTable tbody tr{
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 100ms;
}
.printBoxTable tbody tr:last-child{ border-bottom: none; }
.printBoxTable tbody tr:hover{ background: rgba(31,74,255,.03); }
.printBoxTable td{
  padding: 10px 12px;
  font-size: 14px;
  vertical-align: middle;
}
.printBoxRow.printBoxRowSelected{
  background: rgba(31,74,255,.04);
}
.pbtCheck{ width: 44px; }
.pbtCheck input{ cursor: pointer; width: 22px; height: 22px; accent-color: #1f4aff; }
.pbtName{ font-weight: 700; }
.pbtColQr{ width: 52px; text-align: center; padding: 6px 4px; }
.pbtHideMobile{ }
.pbtBoxLink{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  text-decoration: none;
  background: #f1f5f9;
  transition: background 140ms, transform 120ms;
}
.pbtBoxLink:hover{
  background: #e0e7ff;
  transform: scale(1.05);
}

/* ── Preview section ── */
.printPreviewHeader{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.printPreviewCount{
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

/* Label grid — screen preview */
.printLabelGrid{
  /* Dimensions set inline by JS in mm */
  display: grid;
}

/* ── Sheet simulator wrapper ── */
.printSheetWrap{
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-bottom: 8px;
  background: #dde3ea;
  border-radius: 8px;
  padding: 16px;
  box-sizing: border-box;
}

.printSheet{
  background: white;
  box-shadow: 0 4px 24px rgba(15,23,42,.18);
  transform-origin: top left;
  overflow: hidden;
}

/* Sheet separator label between multiple sheets */
.printSheetSep{
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 14px 0 6px;
  text-align: center;
}

/* Layout hint */
.printLayoutHint{
  font-size: 13px;
  margin: -4px 0 12px;
}

/* ── Slots — each label position on the sheet ── */
.printSlot{
  position: relative;
  box-sizing: border-box;
}

/* Empty slot — dashed outline to show the available space */
.printSlot--empty{
  border: 1.5pt dashed rgba(15,23,42,.12);
  background: rgba(15,23,42,.015);
}

/* Slot highlighted while dragging over it */
.printSlot--dragover{
  background: rgba(31,74,255,.07) !important;
  border: 1.5pt dashed rgba(31,74,255,.5) !important;
}

/* Drag handle — shown in top-right of each label on screen only */
.plDragHandle{
  position: absolute;
  top: 1.5mm;
  right: 1.5mm;
  font-size: 3.5mm;
  color: rgba(15,23,42,.25);
  cursor: grab;
  line-height: 1;
  user-select: none;
}
.plDragHandle:hover{ color: rgba(15,23,42,.55); }
.plDraggable{ cursor: grab; position: relative; }
.plDraggable:active{ cursor: grabbing; }
.plDragging{ opacity: .35; }

/* ── Individual label — both screen (scaled) and print ── */
.printLabel{
  display: flex;
  align-items: center;
  gap: 0;
  background: white;
  box-sizing: border-box;
  overflow: hidden;
}
.printLabel--5164{
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5mm;
  gap: 3mm;
  border: 0.5pt solid #d0d7e3;
}
.printLabel--5163{
  flex-direction: row;
  align-items: center;
  text-align: left;
  padding: 3mm 4mm;
  gap: 3mm;
  border: 0.5pt solid #d0d7e3;
}

/* QR block — dimensions set inline by JS */
.plQr{
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Label text info */
.plInfo{
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.plName{
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.printLabel--5164 .plName{ font-size: 7.5mm; }
.printLabel--5163 .plName{ font-size: 4.5mm; }
.plLoc{
  color: #64748b;
  margin-top: 1mm;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.printLabel--5164 .plLoc{ font-size: 3.2mm; }
.printLabel--5163 .plLoc{ font-size: 2.8mm; }
.plTag{
  display: inline-block;
  margin-top: 1.5mm;
  padding: 0.5mm 2mm;
  border-radius: 999px;
  background: rgba(31,74,255,.1);
  color: #1f4aff;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.printLabel--5164 .plTag{ font-size: 2.8mm; }
.printLabel--5163 .plTag{ font-size: 2.5mm; }
.plUrl{
  color: rgba(15,23,42,.28);
  letter-spacing: .04em;
  margin-top: 2mm;
}
.printLabel--5164 .plUrl{ font-size: 2.5mm; }
.printLabel--5163 .plUrl{ font-size: 2mm; }

/* Qty column in print table */
.pbtColQty{ width: 70px; text-align: center; }
.pbtQtyLabel{ display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
.printBoxQty{
  width: 52px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  background: #fff;
}
.printBoxQty:focus{ outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,74,255,.1); }

/* Preview header row */
.printPreviewHeaderRight{
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile: allow sheet to scroll horizontally */
@media (max-width: 640px){
  .labelSizePicker{ grid-template-columns: 1fr 1fr; }
  .pbtHideMobile{ display: none; }
  .printSheetWrap{ overflow-x: auto; padding: 10px; }
}

/* ═══════════════════════════════════════════
   Print media — render at real mm dimensions, no scaling
═══════════════════════════════════════════ */

@media print {

  .noPrint,
  .topbar,
  .footer,
  .mobileMenu { display: none !important; }

  body { background: white; margin: 0; padding: 0; }
  .wrap { width: 100%; max-width: none; margin: 0; padding: 0; }
  .pagePad { padding: 0; }

  /* Hide screen previews; show the print-only clone */
  #sheetsContainer  { display: none !important; }
  .printSheetWrap   { display: none !important; }
  .printOnlySheet   { display: block !important; }

  /* Each cloned grid is one page */
  .printOnlySheet .printLabelGrid {
    display: grid;
    page-break-after: always;
    break-after: page;
  }

  /* Empty slots: no border on print */
  .printOnlySheet .printSlot--empty { border: none !important; background: none !important; }
  .printOnlySheet .printLabel       { box-shadow: none; }

  /* Never print drag handles */
  .plDragHandle { display: none !important; }

  .printLabel {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  #previewSection[hidden] { display: none !important; }
}

/* printOnlySheet hidden on screen — shown only at print */
.printOnlySheet { display: none; }

/* ═══════════════════════════════════════════
   PIN — shared styles (privacy-lock + box gate)
═══════════════════════════════════════════ */

/* Status badge on privacy-lock page */
.pinStatus{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}
.pinStatusOff{
  background: rgba(15,23,42,.05);
  color: var(--muted);
}
.pinStatusOn{
  background: rgba(22,163,74,.08);
  color: #16a34a;
}
.pinStatusDot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: currentColor;
}

/* Privacy lock page layout */
.pinLockPage{
  max-width: 400px;
  margin: 0 auto;
  padding-top: 12px;
}
.pinLockIcon{
  font-size: 44px;
  text-align: center;
  margin-bottom: 10px;
}
.pinLockTitle{
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 8px;
}
.pinLockDesc{
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 18px;
}
.pinNoneNote {
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  margin: -8px 0 18px;
}
.pinNoneNote[hidden] { display: none; }
.pinForgotNote {
  text-align: center;
  font-size: 13px;
  margin: 14px 0 0;
}
.pinForgotLink {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Card */
.pinLockCard{
  margin-bottom: 16px;
}
.pinRemoveCard{
  border-color: rgba(220,38,38,.2);
}
.pinLockCardTitle{
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 16px;
  text-align: center;
}
.pinLockCardActions{
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.pinLockCardActions .btn{
  flex: 1;
  justify-content: center;
}

/* PIN dots */
.pinDots{
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}
.pinDot{
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: white;
  transition: background 120ms, border-color 120ms;
}
.pinDotFilled{
  background: var(--blue);
  border-color: var(--blue);
}

/* Hidden real input (receives keyboard on desktop) */
.pinHiddenInput{
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* Keypad */
.pinPad{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 240px;
  margin: 0 auto;
}
.pinKey{
  height: 58px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: background 100ms, transform 80ms;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}
.pinKey:hover:not(:disabled){
  background: rgba(31,74,255,.06);
  border-color: rgba(31,74,255,.25);
}
.pinKey:active:not(:disabled){
  transform: scale(.93);
  background: rgba(31,74,255,.12);
}
.pinKey:disabled{ opacity: 0; pointer-events: none; }
.pinKeyDelete{
  font-size: 18px;
  color: var(--muted);
}
.pinKeyEmpty{ opacity: 0; pointer-events: none; }

/* Message */
.pinMessage{
  min-height: 20px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-top: 12px;
}
.pinMessage--error{   color: #dc2626; }
.pinMessage--success{ color: #16a34a; }
.pinMessage--info{    color: var(--blue); }

/* Shake animation on wrong PIN */
@keyframes pinShakeAnim {
  0%,100%{ transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-5px); }
  80%     { transform: translateX(5px); }
}
.pinShake{ animation: pinShakeAnim 0.45s ease; }

/* ── PIN gate on box.html ── */
.pinGate{
  display: flex;
  justify-content: center;
  padding: 24px 0 40px;
}
.pinGate[hidden]{ display: none; }
.pinGateInner{
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.pinGateIcon{
  font-size: 40px;
  margin-bottom: 10px;
}
.pinGateTitle{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.pinGateDesc{
  font-size: 14px;
  margin: 0 0 20px;
}

/* ── Privacy lock redirect banner ── */
.pinRedirectBanner{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(31,74,255,.07);
  border: 1px solid rgba(31,74,255,.2);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  line-height: 1.45;
}
.pinRedirectBanner[hidden]{ display: none; }
.pinRedirectBannerIcon{ font-size: 20px; flex: 0 0 auto; }

/* ═══════════════════════════════════════════
   My Boxes — QR per row + Print All
═══════════════════════════════════════════ */

.myBoxesHeader{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.myBoxesPrimaryBtn {
  height: 36px;
  padding: 0 14px;
  font-size: 14px;
  white-space: nowrap;
}
.myBoxesIconBtn {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #2e6bff, #1c4ed8);
  box-shadow: 0 4px 12px rgba(28,78,216,0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: filter 0.15s ease, transform 0.15s ease;
  text-decoration: none;
}
.myBoxesIconBtn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.myBoxesIconBtn:active { filter: brightness(0.97); transform: translateY(0); }

/* Share button active/selected state — lighter blue signals "mode on" */
.myBoxesIconBtn--active {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}
.myBoxesIconBtn--active:hover { filter: brightness(1.05); }

/* Box row: left text + right (name + QR) */
.boxRowLeft{
  flex: 1;
  min-width: 0;
}
.boxRowRight{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}
.boxRowName{
  font-weight: 800;
  color: #1f4aff;
  white-space: nowrap;
  font-size: 17px;
}
.boxRowQr{
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
}
.boxRowQr img,
.boxRowQr canvas{
  width: 52px !important;
  height: 52px !important;
  display: block;
  border-radius: 6px;
  image-rendering: crisp-edges;
}

/* ═══════════════════════════════════════════
   Create page — QR in box header
═══════════════════════════════════════════ */

.boxHeaderQr{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.boxHeaderQr[hidden]{ display: none; }
.boxHeaderQrCode{
  width: 100px;
  height: 100px;
}
.boxHeaderQrCode img,
.boxHeaderQrCode canvas{
  width: 100px !important;
  height: 100px !important;
  display: block;
  border-radius: 8px;
  image-rendering: crisp-edges;
}
.boxHeaderQrLabel{
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════
   Create page — phase 2 box view (box.html style)
═══════════════════════════════════════════ */

.createPhaseTitle{
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.createDictateHint {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--muted);
}

/* Top row: name+meta left, QR right */
.boxViewTop{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}
.boxViewTopLeft{ flex: 1; min-width: 0; }
.boxViewNameRow{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

/* Inline QR in header — small, same style as index.html rows */
.boxHeaderQrInline{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}
.boxHeaderQrInline[hidden]{ display: none; }
.boxHeaderQrCode{
  width: 56px;
  height: 56px;
}
.boxHeaderQrCode img,
.boxHeaderQrCode canvas{
  width: 56px !important;
  height: 56px !important;
  display: block;
  border-radius: 6px;
  image-rendering: crisp-edges;
}
.boxHeaderQrLabel{
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Edit form inside card */
.boxEditForm{
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 10px;
}
.boxEditForm[hidden]{ display: none; }

/* Action buttons at bottom of box header card */
.boxHeaderActions{
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.boxHeaderActionBtn{
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

/* fieldInput — same as existing field inputs but explicit */
.fieldInput{
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: white;
  outline: none;
  transition: border-color 140ms;
  resize: vertical;
}
.fieldInput:focus{
  border-color: var(--blue);
}

/* Mobile */
@media (max-width: 600px){
  .boxViewTop{ flex-direction: row; }
  .boxViewName{ font-size: 24px; }
}

/* ═══════════════════════════════════════════
   box.html — Container presentation view
═══════════════════════════════════════════ */

.boxPresHeader { display:flex; flex-direction:column; gap:4px; position:relative; padding-right:72px; }
.boxHeaderQrCorner { position:absolute; top:0; right:0; width:56px; height:56px; }
.boxHeaderQrCorner[hidden] { display:none; }
.boxPresKey { font-size:15px; font-weight:800; color:#1f4aff; letter-spacing:0.03em; }
.boxPresName { display:none; }
.boxPresLocation { font-size:28px; font-weight:800; color:var(--ink); letter-spacing:-0.02em; line-height:1.15; margin-top:2px; }
.boxPresLabelTag { display:inline-block; background:rgba(31,74,255,.09); color:var(--blue); font-size:12px; font-weight:700; padding:3px 10px; border-radius:999px; margin-top:6px; align-self:flex-start; }
.boxPresNotes { font-size:14px; color:var(--muted); margin-top:4px; line-height:1.5; }
.boxPresCreatedAt { font-size:12px; color:var(--muted); margin-top:6px; font-style:italic; }
.boxPresEditRow { margin-top:12px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

/* Wider gap between the three nav button groups:
   [edit | home]  ··  [prev | next]  ··  [print]  */
#prevContainerBtn,
#printQrBtn {
  margin-left: 14px;
}
/* Edit / Home — rounded squares */
.btnEdit { display:inline-flex; align-items:center; justify-content:center; gap:5px; font-size:12px; font-weight:600; color:#fff; background:linear-gradient(135deg,#2e6bff,#1c4ed8); border:none; border-radius:14px; width:48px; height:48px; cursor:pointer; text-decoration:none; box-shadow:0 4px 12px rgba(28,78,216,0.28); transition:filter 0.15s ease, transform 0.15s ease; flex-shrink:0; }
.btnEdit:hover { filter:brightness(1.08); transform:translateY(-1px); color:#fff; }
.btnEdit:active { filter:brightness(0.97); transform:translateY(0); }
.btnIcon { padding:0; width:48px; height:48px; border-radius:14px; }
.btnIcon img { display:block; filter:brightness(0) invert(1); }
.btnAddItem { display:inline-flex; align-items:center; gap:5px; font-size:13px; font-weight:700; color:#fff; background:var(--blue); border:1px solid var(--blue); border-radius:10px; padding:7px 14px; cursor:pointer; text-decoration:none; transition:opacity 120ms; }
.btnAddItem:hover { opacity:.88; }
.btnAddItem--ghost { background:transparent; color:var(--blue); }
.btnAddItem[hidden] { display:none !important; }

/* ── Debug panel ── */
.debugPanel { background:#0f1117; color:#a3e635; font-size:11px; font-family:monospace; padding:12px; margin:10px 0 14px; border-radius:8px; border:1px solid #1e3a1e; }
.dbgTitle { font-size:13px; font-weight:700; color:#86efac; margin-bottom:8px; letter-spacing:.03em; }
.dbgSection { font-size:10px; font-weight:700; color:#6b7280; text-transform:uppercase; letter-spacing:.08em; margin:8px 0 4px; border-top:1px solid #1f2937; padding-top:6px; }
.dbgRow { display:flex; justify-content:space-between; gap:8px; padding:2px 0; }
.dbgRow span { color:#6b7280; }
.dbgRow b { color:#d1fae5; }
.dbgItem { background:#111827; border-radius:6px; padding:8px; margin:4px 0; }
.dbgItemHeader { font-weight:700; color:#fbbf24; margin-bottom:4px; font-size:11px; }
.dbgOcrPreview { color:#93c5fd; font-style:italic; margin-top:4px; line-height:1.4; word-break:break-word; }
.dbgMuted { color:#4b5563; font-style:italic; }
.dbgPre { background:#000; color:#86efac; font-size:10px; padding:8px; border-radius:4px; overflow-x:auto; max-height:200px; overflow-y:auto; margin:4px 0; white-space:pre; }
.dbgCopyBtn { margin-top:6px; background:#1f2937; color:#d1fae5; border:1px solid #374151; border-radius:6px; padding:5px 10px; font-size:11px; font-family:monospace; cursor:pointer; }
.dbgCopyBtn:hover { background:#374151; }
.boxPresItems { margin-top:14px; }
.boxPresItemsHeader { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.boxPresItemsTitle { font-size:18px; font-weight:800; margin:0; letter-spacing:-0.01em; }

/* ── Document viewer ── */
.docViewer { display:flex; flex-direction:column; gap:12px; }
.docViewer[hidden] { display:none !important; }
.docViewerList { display:grid; gap:18px; }
.docViewerCard { display:flex; flex-direction:column; gap:12px; border:1px solid var(--line); border-radius:16px; padding:14px; background:#fff; position:relative; }
.docViewerLoading { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; font-size:13px; color:var(--muted); background:rgba(248,250,252,0.85); border-radius:12px; z-index:1; }
.docViewerLoading[hidden] { display:none !important; }
.ast-photo-optimize-row { display:flex; align-items:center; gap:4px; padding:3px 0 2px; flex-wrap:wrap; }
.ast-photo-optimize-row--done .ast-photo-optimize-info { font-size:10px; color:var(--green,#16a34a); font-weight:600; }
.ast-photo-optimize-status { font-size:10px; color:var(--muted); }
.ast-photo-optimize-btn { font-size:10px; font-weight:600; color:#fff; background:var(--blue); border:none; border-radius:5px; padding:3px 7px; cursor:pointer; white-space:nowrap; }
.ast-photo-optimize-btn:disabled { opacity:0.5; cursor:default; }
.docViewerCardHeader { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; padding-bottom:4px; }
.docViewerCardTitle { display:flex; flex-direction:column; gap:4px; min-width:0; }
.docSearchScore { display:inline-flex; align-items:baseline; gap:6px; flex-wrap:wrap; }
.docSearchScoreLabel { font-size:12px; font-weight:700; padding:2px 8px; border-radius:999px; white-space:nowrap; }
.docSearchScoreMsg { font-size:12px; color:var(--muted); line-height:1.4; }
.docSearchScore--good .docSearchScoreLabel { background:#dcfce7; color:#15803d; }
.docSearchScore--fair .docSearchScoreLabel { background:#dbeafe; color:#1d4ed8; }
.docSearchScore--poor .docSearchScoreLabel { background:#fee2e2; color:#b91c1c; }
.docSearchScore--unknown .docSearchScoreLabel { background:#f1f5f9; color:var(--muted); }
.docSearchScore--strong .docSearchScoreLabel  { background:#1e293b; color:#fff; }
.docViewerPage { position:relative; width:100%; background:#f8fafc; border-radius:12px; overflow:hidden; display:flex; align-items:center; justify-content:center; min-height:200px; }
.docViewerImg { width:100%; height:auto; display:block; max-height:70vh; object-fit:contain; transition:opacity 180ms; border-radius:12px; }
.docViewerNoImg { color:var(--muted); font-size:14px; padding:40px; text-align:center; }
.docViewerNav { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.docViewerNavBtn { width:44px; height:44px; border:1.5px solid var(--line); border-radius:50%; background:#fff; font-size:24px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--ink); transition:opacity 120ms, background 120ms; }
.docViewerNavBtn:hover:not(:disabled) { background:var(--blue); color:#fff; border-color:var(--blue); }
.docViewerNavBtn:disabled { cursor:default; }
.docViewerCounter { font-size:13px; font-weight:700; color:var(--muted); letter-spacing:.01em; text-align:center; flex:1; }
.docViewerMeta { display:flex; flex-direction:column; gap:8px; padding-top:4px; }
.docViewerNotes { font-size:14px; color:var(--muted); line-height:1.5; }
.docViewerOcrDetails { border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.docViewerOcrSummary { font-size:13px; font-weight:700; color:var(--blue); padding:10px 14px; cursor:pointer; list-style:none; display:flex; align-items:center; gap:6px; }
.docViewerOcrSummary::-webkit-details-marker { display:none; }
.docViewerOcrDetails[open] .docViewerOcrSummary { border-bottom:1px solid var(--line); }
.docViewerOcrText { font-size:13px; color:var(--ink); line-height:1.6; padding:12px 14px; white-space:pre-wrap; max-height:240px; overflow-y:auto; background:#f8fafc; }
.itemsHeaderBtns { margin-left:auto; display:flex; gap:8px; align-items:center; }
.itemGrid { display:grid; grid-template-columns:1fr; gap:8px; }
.itemTile { display:flex; flex-direction:column; border:1px solid var(--line); border-radius:16px; overflow:hidden; background:#fff; position:relative; }
.itemTilePhotos { display:grid; grid-template-columns:repeat(3,1fr); gap:2px; background:#f1f5f9; width:100%; }
.itemTilePhotos--1 .itemTilePhoto { grid-column:1/-1; aspect-ratio:4/3; }
.itemTilePhotos--2 .itemTilePhoto { aspect-ratio:1/1; }
.itemTilePhoto { aspect-ratio:1/1; overflow:hidden; background:rgba(15,23,42,.05); cursor:pointer; position:relative; }
.itemTilePhoto img { width:100%; height:100%; object-fit:cover; display:block; transition:transform 180ms; }
.itemTilePhoto:hover img { transform:scale(1.04); }
.itemTileNoPhoto { width:100%; aspect-ratio:3/1; display:flex; align-items:center; justify-content:center; font-size:36px; background:rgba(15,23,42,.04); color:var(--muted); }
.itemTileBody { padding:12px 14px 36px; flex:1; min-width:0; }
.itemTileLabel { font-size:15px; font-weight:700; color:var(--ink); line-height:1.3; margin-bottom:4px; }
.itemTileMeta { font-size:13px; color:var(--muted); display:flex; gap:6px; flex-wrap:wrap; }
.itemTileEditBtn { position:absolute; bottom:8px; right:10px; width:36px; height:36px; border-radius:8px; display:flex; align-items:center; justify-content:center; color:var(--muted); background:rgba(15,23,42,.05); transition:opacity 120ms,background 120ms; text-decoration:none; }
.itemTileEditBtn:hover { opacity:0.7; background:rgba(31,74,255,.1); }

/* ── Voice item tile (box.html display renderer) ── */
.itemTile--voice { flex-direction:row; align-items:flex-start; padding:14px 44px 14px 14px; gap:12px; }
.mk-voice-icon-wrap { flex-shrink:0; }
.mk-voice-play { width:38px; height:38px; border-radius:50%; border:none; background:#1f4aff; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:background 120ms; padding:0; }
.mk-voice-play--idle { background:#94a3b8; cursor:default; }
.mk-voice-play--ready { background:#1f4aff; }
.mk-voice-play--ready:hover { background:#1a3fd4; }
.mk-voice-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
.mk-item-pill { display:inline-block; font-size:10px; font-weight:700; border-radius:999px; padding:2px 8px; }
.mk-item-pill--voice { color:#16a34a; background:#dcfce7; }
.mk-item-pill--transcript-only { color:#92400e; background:#fef3c7; margin-left:4px; }
.mk-voice-play--transcript-only { background:#94a3b8; cursor:default; }
.mk-voice-transcript { font-size:12px; color:#334155; line-height:1.4; }
.mk-voice-transcript--empty { color:#94a3b8; font-style:italic; }
.mk-voice-notes { font-size:12px; color:#64748b; }
.photoLightbox { position:fixed; inset:0; z-index:1000; background:rgba(0,0,0,.92); display:flex; flex-direction:column; align-items:center; justify-content:center; padding:16px; box-sizing:border-box; }
.photoLightbox[hidden] { display:none !important; }
.lightboxImg { max-width:100%; max-height:65vh; border-radius:12px; object-fit:contain; display:block; box-shadow:0 20px 60px rgba(0,0,0,.5); }
.lightboxCaption { color:rgba(255,255,255,.7); font-size:14px; margin-top:10px; text-align:center; }
.lightboxCounter { color:rgba(255,255,255,.4); font-size:12px; margin-top:3px; text-align:center; min-height:16px; }
.lightboxNav { display:flex; align-items:center; gap:20px; margin-top:12px; }
.lightboxNavBtn { width:42px; height:42px; border-radius:50%; border:none; background:rgba(255,255,255,.15); color:#fff; font-size:22px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background 120ms; }
.lightboxNavBtn:hover { background:rgba(255,255,255,.28); }
.lightboxNavBtn:disabled { opacity:.2; cursor:default; }
.lightboxActions { display:flex; gap:10px; margin-top:12px; flex-wrap:wrap; justify-content:center; }
.lightboxBtn { display:inline-flex; align-items:center; gap:7px; padding:9px 18px; border-radius:10px; font-size:14px; font-weight:700; cursor:pointer; border:none; text-decoration:none; transition:opacity 120ms; }
.lightboxBtn:hover { opacity:.82; }
.lightboxBtnLens { background:#fff; color:#0f172a; }
.lightboxBtnEdge { background:#0078d4; color:#fff; }
.lightboxBtnClose { background:rgba(255,255,255,.15); color:#fff; }
.lightboxBackdrop { position:absolute; inset:0; z-index:-1; }
.googleIcon { width:18px; height:18px; flex-shrink:0; }

/* ═══════════════════════════════════════════
   search.html — Search page
═══════════════════════════════════════════ */

.searchWrap { max-width:680px; margin:0 auto; padding:24px 0 48px; }
.searchBar { position:relative; margin-bottom:20px; }
.searchIcon { position:absolute; left:14px; top:50%; transform:translateY(-50%); font-size:17px; pointer-events:none; opacity:.45; }
.searchInput { width:100%; padding:13px 78px 13px 42px; font-size:16px; border:1.5px solid var(--line); border-radius:14px; background:#fff; box-shadow:0 2px 10px rgba(15,23,42,.06); outline:none; box-sizing:border-box; transition:border-color 150ms,box-shadow 150ms; color:var(--ink); }
.searchInput:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(31,74,255,.10),0 2px 10px rgba(15,23,42,.06); }
.searchMic { position:absolute; right:44px; top:50%; transform:translateY(-50%); width:30px; height:30px; border:none; background:none; cursor:pointer; font-size:18px; display:flex; align-items:center; justify-content:center; color:var(--muted); border-radius:50%; transition:color 120ms,background 120ms; padding:0; }
.searchMic:hover { color:var(--blue); background:rgba(31,74,255,.08); }
.searchMic.recording { color:#dc2626; animation:voicePulse 1s ease-in-out infinite; }
.itemHighlight { animation:itemFlash 2s ease-out forwards; }
@keyframes itemFlash { 0% { box-shadow:0 0 0 3px var(--blue); background:rgba(31,74,255,.08); } 100% { box-shadow:none; background:transparent; } }
.searchClear { position:absolute; right:10px; top:50%; transform:translateY(-50%); width:28px; height:28px; border:none; background:rgba(15,23,42,.08); border-radius:50%; cursor:pointer; font-size:13px; display:none; align-items:center; justify-content:center; color:var(--ink); line-height:1; }
.searchClear:hover { background:rgba(15,23,42,.14); }
.filterRow { display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap; }
.filterPill { padding:5px 13px; border-radius:999px; border:1.5px solid var(--line); background:#fff; font-size:13px; font-weight:600; cursor:pointer; transition:all 120ms; color:var(--ink); }
.filterPill:hover { border-color:var(--blue); color:var(--blue); }
.filterPill.active { background:var(--blue); border-color:var(--blue); color:#fff; }
.filterPill--solid { background:var(--blue); border-color:var(--blue); color:#fff; }
.filterPill--solid:hover { background:#1a3fd4; border-color:#1a3fd4; color:#fff; }
.filterPill--solid.active { background:#1a3fd4; border-color:#1a3fd4; }
.searchSummary { font-size:13px; color:var(--muted); margin-bottom:14px; min-height:20px; }
.searchSummary strong { color:var(--ink); }
.resultGroup { margin-bottom:24px; }
.resultGroupTitle { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin:0 0 10px; padding:0 2px; }
.resultList { display:grid; gap:8px; overflow:hidden; }
.resultBox { display:flex; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--line); border-radius:14px; background:#fff; text-decoration:none; color:inherit; transition:border-color 120ms,box-shadow 120ms; overflow:hidden; min-width:0; max-width:100%; }
.resultBox:hover { border-color:var(--blue); box-shadow:0 2px 12px rgba(31,74,255,.10); }
.resultBoxIcon { flex:0 0 38px; width:38px; height:38px; border-radius:10px; background:rgba(31,74,255,.08); display:flex; align-items:center; justify-content:center; font-size:18px; }
.resultBoxBody { flex:1; min-width:0; }
.resultBoxName { font-weight:800; font-size:13px; color:var(--muted); }
.resultBoxLocation { font-weight:700; font-size:15px; overflow:hidden; text-overflow:ellipsis; overflow-wrap:anywhere; }
.resultBoxMeta { font-size:12px; color:var(--muted); margin-top:2px; overflow:hidden; text-overflow:ellipsis; overflow-wrap:anywhere; }
.resultBoxArrow { flex:0 0 auto; color:var(--muted); font-size:14px; opacity:.4; }
.resultItem { display:flex; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--line); border-radius:14px; background:#fff; text-decoration:none; color:inherit; transition:border-color 120ms,box-shadow 120ms; overflow:hidden; min-width:0; max-width:100%; }
.resultItem:hover { border-color:var(--blue); box-shadow:0 2px 12px rgba(31,74,255,.10); }
.resultItemThumb { flex:0 0 48px; width:48px; height:48px; border-radius:10px; background:rgba(15,23,42,.05); border:1px solid var(--line); overflow:hidden; display:flex; align-items:center; justify-content:center; font-size:22px; }
.resultItemThumb img { width:100%; height:100%; object-fit:cover; display:block; }
.resultItemBody { flex:1; min-width:0; }
.resultItemLabel { font-weight:700; font-size:15px; overflow:hidden; text-overflow:ellipsis; overflow-wrap:anywhere; }
.resultItemNotes { font-size:12px; color:var(--muted); margin-top:2px; overflow:hidden; text-overflow:ellipsis; overflow-wrap:anywhere; }
.resultItemMeta  { display:flex; align-items:center; gap:4px; flex-wrap:wrap; font-size:11px; color:var(--muted); margin-top:4px; }
.resultItemQty   { font-weight:700; color:var(--ink); }
/* Document result card */
.resultItemDoc { border-left:3px solid #dbeafe; }
.resultItemDoc:hover { border-left-color:var(--blue); }
.resultItemThumbDoc { background:#eff6ff; border-color:#dbeafe; font-size:24px; }
.resultItemThumbDocImg img { width:100%; height:100%; object-fit:cover; display:block; }
.resultDocPageCount { font-weight:600; }
.resultDocMatch { margin-top:6px; display:flex; flex-direction:column; gap:4px; }
.resultDocMatchTop { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.resultDocMatch .docSearchScoreLabel { font-size:11px; padding:2px 6px; }
.resultDocMatchLabel { font-size:11px; font-weight:700; color:var(--blue); text-transform:uppercase; letter-spacing:.04em; }
.resultDocMatchSnippet { font-size:12px; color:var(--ink); line-height:1.5; white-space:normal; background:#eff6ff; border-radius:6px; padding:4px 8px; margin-top:0; }
.resultItemBox { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:700; color:var(--blue); background:rgba(31,74,255,.07); border-radius:6px; padding:2px 7px; margin-top:4px; }
mark { background:rgba(255,235,59,0.65); color:var(--ink); border-radius:3px; padding:0 1px; }
.searchIdle { text-align:center; padding:48px 20px 24px; color:var(--muted); }
.searchIdleIcon { font-size:44px; margin-bottom:12px; }
.searchIdleTitle { font-size:17px; font-weight:700; color:var(--ink); margin:0 0 6px; }
.searchIdleText { font-size:14px; margin:0; }
.searchEmpty { text-align:center; padding:40px 20px; color:var(--muted); }
.searchEmptyIcon { font-size:36px; margin-bottom:10px; }
.searchEmptyTitle { font-size:16px; font-weight:700; color:var(--ink); margin:0 0 4px; }
.searchEmptyText { font-size:14px; margin:0; }
.searchNoBoxes { text-align:center; padding:48px 20px; }
.searchNoBoxesIcon { font-size:44px; margin-bottom:12px; }

/* ═══════════════════════════════════════════
   scan.html — QR Scanner
═══════════════════════════════════════════ */

.scanReticle { position:absolute; inset:0; pointer-events:none; display:flex; align-items:center; justify-content:center; }
.scanReticleBox { width:58%; aspect-ratio:1/1; position:relative; }
.scanReticleBox::before,.scanReticleBox::after,.scanReticleBox .scanCornerBR,.scanReticleBox .scanCornerTR { content:""; position:absolute; width:28px; height:28px; border-color:#fff; border-style:solid; border-radius:2px; opacity:.9; }
.scanReticleBox::before { top:0; left:0; border-width:3px 0 0 3px; }
.scanReticleBox::after { bottom:0; left:0; border-width:0 0 3px 3px; }
.scanReticleBox .scanCornerTR { top:0; right:0; border-width:3px 3px 0 0; }
.scanReticleBox .scanCornerBR { bottom:0; right:0; border-width:0 3px 3px 0; }
.scanLine { position:absolute; left:6%; right:6%; height:2px; background:linear-gradient(90deg,transparent,rgba(31,74,255,.9),transparent); border-radius:2px; animation:scanLineAnim 2s ease-in-out infinite; top:10%; }
@keyframes scanLineAnim { 0% { top:10%; opacity:0; } 10% { opacity:1; } 90% { opacity:1; } 100% { top:90%; opacity:0; } }
.scanSuccessFlash { position:absolute; inset:0; background:rgba(31,74,255,.25); border-radius:18px; opacity:0; pointer-events:none; transition:opacity 80ms; }
.scanSuccessFlash.show { opacity:1; }
#scanStatus { display:inline-flex; align-items:center; gap:6px; font-size:14px; font-weight:500; min-height:22px; }
#scanStatus.scanning::before { content:""; display:inline-block; width:8px; height:8px; border-radius:50%; background:#22c55e; animation:statusPulse 1.2s ease-in-out infinite; flex-shrink:0; }
#scanStatus.error { color:#dc2626; }
@keyframes statusPulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.5; transform:scale(.7); } }

/* ═══════════════════════════════════════════
   Items separator — gradient divider between action buttons and item grid
═══════════════════════════════════════════ */

.itemsSeparator {
  height: 1px;
  margin: 8px 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--line) 20%,
    var(--line) 80%,
    transparent 100%
  );
  position: relative;
}
.itemsSeparator::after {
  content: '≈';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 0 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 4px;
}

/* ═══════════════════════════════════════════
   Voice input button — Label / Notes fields
═══════════════════════════════════════════ */

.fieldWithVoice {
  position: relative;
}
.fieldWithVoice input,
.fieldWithVoice textarea {
  padding-right: 52px;
}
/* ── Location picker button (edit form) ── */
.fieldWithPicker {
  position: relative;
}
.fieldWithPicker input {
  padding-right: 52px;
}
.locationPickerBtn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms;
}
.locationPickerBtn:active,
.locationPickerBtn:hover { background: rgba(15,23,42,.07); }
.voiceBtn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 120ms, background 120ms;
  padding: 0;
}
.voiceBtn:hover { color: var(--blue); background: rgba(31,74,255,.08); }
.voiceBtn.recording { animation: voicePulse 1s ease-in-out infinite; }
.voiceBtn.recording img { content: url('/assets/icons/icon-mic-active.svg'); }
.voiceBtnTextarea {
  top: 36px;
  transform: none;
}
@keyframes voicePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ═══════════════════════════════════════════
   AssetStore — shared styles (was injectStyles)
   Moved from assetstore.types.js injectStyles()
   so all ast-* classes are always available,
   inspectable in DevTools, and not timing-dependent.
═══════════════════════════════════════════ */

/* ── Shared form chrome ── */
.ast-form { display:flex; flex-direction:column; gap:10px; }
.ast-label { font-size:12px; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:.04em; }
.ast-input { width:100%; padding:8px 10px; border:1px solid #e2e8f0; border-radius:8px; font-size:14px; box-sizing:border-box; }
.ast-input:focus { outline:none; border-color:#1f4aff; box-shadow:0 0 0 3px rgba(31,74,255,.1); }

/* ── Photo type ── */
.ast-photo-btns { display:none; }
.ast-photo-add-btn { display:inline-flex; align-items:center; gap:6px; padding:7px 13px; border:2px solid #e2e8f0; border-radius:9px; background:#fff; font-size:13px; font-weight:600; cursor:pointer; transition:all 140ms; color:#334155; white-space:nowrap; }
.ast-photo-add-btn:hover { border-color:#1f4aff; color:#1f4aff; background:#eff4ff; }
.ast-photo-add-btn:disabled { opacity:.45; cursor:not-allowed; }
.ast-photo-label { font-size:11px; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:.06em; margin-bottom:6px; }
.ast-photo-label-opt { font-weight:400; text-transform:none; letter-spacing:0; font-size:11px; }
.ast-photo-strip { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:6px; align-items:start; }
.ast-photo-grid-cell { display:flex; flex-direction:column; gap:0; }
.ast-photo-grid-item { position:relative; width:100%; aspect-ratio:1/1; border-radius:8px; overflow:hidden; background:#f1f5f9; flex-shrink:0; }
.ast-photo-grid-img { width:100%; height:100%; object-fit:cover; display:block; }
.ast-photo-grid-loading { display:flex; align-items:center; justify-content:center; height:100%; font-size:20px; }
.ast-photo-grid-remove { position:absolute; top:4px; right:4px; width:22px; height:22px; border-radius:50%; border:none; background:rgba(0,0,0,.6); color:#fff; font-size:11px; cursor:pointer; display:flex; align-items:center; justify-content:center; line-height:1; padding:0; }

/* ── Ghost photo slot — next available add slot in the 3-col grid ── */
.ast-photo-ghost-slot {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 8px;
  border: 1.5px dashed #a8c4e8;
  background: #f0f6ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: #93b8d8;
  font-size: 11px;
  font-weight: 600;
  padding: 0;
  transition: background 140ms, border-color 140ms, color 140ms, opacity 140ms;
  opacity: 0.65;
}
.ast-photo-ghost-slot .ast-photo-ghost-icon { display:flex; align-items:center; justify-content:center; }
.ast-photo-ghost-slot .ast-photo-ghost-icon svg { fill: #93b8d8; transition: fill 140ms; }
.ast-photo-ghost-slot.is-active,
.ast-photo-ghost-slot:active {
  background: #1f4aff;
  border-color: #1f4aff;
  color: #fff;
  opacity: 1;
}
.ast-photo-ghost-slot.is-active .ast-photo-ghost-icon svg,
.ast-photo-ghost-slot:active .ast-photo-ghost-icon svg { fill: #fff; }

/* ── Photo action menu popup ── */
.ast-photo-menu {
  position: fixed;
  z-index: 99999;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15,23,42,.18);
  padding: 6px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Ensure it never goes off-screen */
  max-width: calc(100vw - 24px);
}
.ast-photo-menu--card {
  min-width: 240px;
  padding: 8px;
  gap: 4px;
}
.ast-photo-menu-title {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 8px 6px;
}
.ast-photo-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  transition: background 100ms;
}
.ast-photo-menu--card .ast-photo-menu-btn {
  padding: 10px;
  align-items: flex-start;
}
.ast-photo-menu--card .ast-photo-menu-btn svg { flex-shrink: 0; margin-top: 1px; }
.ast-photo-menu--card .ast-photo-menu-btn span { display: flex; flex-direction: column; gap: 1px; }
.ast-photo-menu--card .ast-photo-menu-btn strong { font-size: 14px; color: #0f172a; }
.ast-photo-menu--card .ast-photo-menu-btn small { font-size: 11px; color: #64748b; font-weight: 400; }
.ast-photo-menu-btn:active { background: #f1f5f9; }
.ast-photo-empty-hint { font-size:13px; color:#94a3b8; padding:4px 0 2px; grid-column:1/-1; }
.ast-photo-target { width:100%; min-height:120px; border:2px dashed #e2e8f0; border-radius:12px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:border-color 140ms; }
.ast-photo-target:hover { border-color:#1f4aff; }
.ast-photo-preview { width:100%; max-height:240px; object-fit:cover; border-radius:10px; display:block; }
.ast-photo-hint { font-size:13px; color:#94a3b8; text-align:center; padding:16px; }
.ast-photo-title-row { display:flex; align-items:center; gap:4px; margin-top:4px; }
.ast-photo-title-label { font-size:10px; font-weight:700; color:#94a3b8; text-transform:uppercase; letter-spacing:.05em; margin-bottom:2px; }
.ast-photo-title-input { flex:1; padding:4px 28px 4px 6px; border:1px solid #e2e8f0; border-radius:7px; font-size:11px; box-sizing:border-box; width:100%; }
.ast-photo-title-input:focus { outline:none; border-color:#1f4aff; box-shadow:0 0 0 2px rgba(31,74,255,.1); }

/* ── Shared mic button (photo titles, OCR notes, voice notes) ── */
.ast-voice-title-btn { flex-shrink:0; width:28px; height:28px; border-radius:50%; border:none; background:none; font-size:14px; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#64748b; transition:color 120ms, background 120ms; padding:0; }
.ast-voice-title-btn:hover { color:#1f4aff; background:rgba(31,74,255,.08); }
.ast-voice-title-btn--recording { color:#dc2626 !important; animation:astVoicePulse 1s ease-in-out infinite; }
@keyframes astVoicePulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ── Shared card elements ── */
.ast-card-thumb { width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:8px; background:#f1f5f9; display:block; }
.ast-card-thumb--empty { width:100%; aspect-ratio:4/3; background:#f1f5f9; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:28px; }
.ast-card-thumb-grid { display:grid; grid-template-columns:1fr 1fr; gap:3px; border-radius:8px; overflow:hidden; aspect-ratio:4/3; }
.ast-card-thumb-grid-img { width:100%; height:100%; object-fit:cover; display:block; }
.ast-card-thumb-more { font-size:11px; color:#64748b; text-align:right; }
.ast-card-label { font-size:14px; font-weight:700; color:#0f172a; }
.ast-card-meta { font-size:12px; color:#64748b; }

/* ── OCR type ── */
.ast-ocr-status { font-size:13px; color:#1f4aff; min-height:20px; }

/* ── OCR Feedback component (Step 5F) ── */
.ocrFeedback { border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:8px; }
.ocrFeedback[hidden] { display:none !important; }
.ocrFeedback--good    { background:#f0fdf4; border:1px solid #bbf7d0; }
.ocrFeedback--fair    { background:#eff6ff; border:1px solid #bfdbfe; }
.ocrFeedback--poor    { background:#fff7ed; border:1px solid #fed7aa; }
.ocrMessage           { font-size:14px; font-weight:700; }
.ocrFeedback--good  .ocrMessage { color:#15803d; }
.ocrFeedback--fair  .ocrMessage { color:#1d4ed8; }
.ocrFeedback--poor  .ocrMessage { color:#c2410c; }
.ocrSubMessage        { font-size:13px; color:var(--muted); line-height:1.45; }
.ocrActions           { display:flex; gap:8px; padding-top:2px; }
.btnRetake            { flex:1; padding:8px 10px; border:2px solid #94a3b8; border-radius:8px; background:none; color:#475569; font-size:13px; font-weight:600; cursor:pointer; transition:border-color 120ms, color 120ms; }
.btnRetake:hover      { border-color:var(--blue); color:var(--blue); }
.btnContinue          { flex:1; padding:8px 10px; border:none; border-radius:8px; background:var(--blue); color:#fff; font-size:13px; font-weight:700; cursor:pointer; opacity:1; transition:opacity 120ms; }
.btnContinue:hover    { opacity:.88; }
.ast-ocr-preview { background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; padding:10px; font-size:13px; line-height:1.5; min-height:60px; white-space:pre-wrap; max-height:160px; overflow-y:auto; }
.ast-ocr-page-stack { margin-bottom:10px; }
.ast-ocr-page-count { font-size:12px; font-weight:700; color:var(--blue,#1f4aff); margin-bottom:6px; letter-spacing:.01em; }
.ast-ocr-page-thumbs { display:flex; flex-wrap:wrap; gap:8px; }
.ast-ocr-page-thumb { position:relative; width:72px; }
.ast-ocr-page-thumb img { width:72px; height:96px; object-fit:cover; border-radius:6px; border:1px solid #e2e8f0; display:block; }
.ast-ocr-page-num { position:absolute; bottom:18px; left:4px; font-size:10px; font-weight:700; color:#fff; background:rgba(0,0,0,.45); border-radius:4px; padding:1px 4px; }
.ast-ocr-page-status { font-size:10px; color:#64748b; text-align:center; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ast-ocr-page-remove { position:absolute; top:2px; right:2px; width:18px; height:18px; border:none; border-radius:50%; background:rgba(0,0,0,.5); color:#fff; font-size:10px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; }
.ast-ocr-hint-wrap { display:flex; flex-direction:column; align-items:center; gap:6px; padding:16px; }
.ast-ocr-hint-primary { font-size:14px; font-weight:600; color:#475569; text-align:center; }
.ast-ocr-hint-guidance { font-size:12px; color:#94a3b8; text-align:center; line-height:1.4; }
.ast-ocr-tips-inline { background:none; border:none; font-size:12px; color:#1d4ed8; cursor:pointer; padding:2px 0; text-decoration:underline; text-underline-offset:2px; opacity:.8; }
.ast-ocr-tips-inline:hover { opacity:1; }
.ast-tips-overlay { position:fixed; inset:0; z-index:1200; background:rgba(15,23,42,.45); display:flex; align-items:center; justify-content:center; padding:20px; }
.ast-tips-card { background:#fff; border-radius:16px; box-shadow:0 16px 48px rgba(15,23,42,.22); padding:24px 22px 20px; max-width:340px; width:100%; position:relative; }
.ast-tips-close { position:absolute; top:12px; right:14px; background:none; border:none; font-size:16px; color:var(--muted,#64748b); cursor:pointer; line-height:1; padding:4px; }
.ast-tips-header { font-size:17px; font-weight:800; color:var(--ink,#0f172a); margin-bottom:8px; padding-right:24px; }
.ast-tips-intro { font-size:13px; color:var(--muted,#64748b); margin:0 0 12px; line-height:1.5; }
.ast-tips-list { margin:0 0 18px; padding-left:18px; display:flex; flex-direction:column; gap:6px; }
.ast-tips-list li { font-size:14px; color:var(--ink,#0f172a); line-height:1.4; }
.ast-tips-got-it { width:100%; padding:12px; background:var(--blue,#1f4aff); color:#fff; border:none; border-radius:10px; font-size:15px; font-weight:700; cursor:pointer; transition:opacity 120ms; }
.ast-tips-got-it:hover { opacity:.88; }
.ast-ocr-page-actions { display:flex; gap:8px; margin-top:10px; }
.ast-ocr-btn-next { flex:1; padding:10px; border:2px dashed #94a3b8; border-radius:10px; background:none; color:#475569; font-size:14px; font-weight:600; cursor:pointer; transition:border-color 120ms, color 120ms; }
.ast-ocr-btn-next:hover { border-color:var(--blue); color:var(--blue); }
.ast-ocr-btn-done { flex:1; padding:10px; border:none; border-radius:10px; background:var(--blue); color:#fff; font-size:14px; font-weight:700; cursor:pointer; transition:opacity 120ms; }
.ast-ocr-btn-done:hover { opacity:.88; }
@keyframes saveBtnPulseSlowAnim { 0%,100% { box-shadow:0 6px 18px rgba(28,78,216,.20); transform:scale(1); } 50% { box-shadow:0 0 0 8px rgba(31,74,255,.25), 0 6px 20px rgba(28,78,216,.30); transform:scale(1.04); } }
.saveBtnPulseSlow { animation:saveBtnPulseSlowAnim 2s ease-in-out infinite; }
.ast-card-ocr { display:flex; flex-direction:column; gap:6px; }
.ast-card-ocr-thumb { width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:8px; background:#f1f5f9; display:block; opacity:.55; }
.ast-card-ocr-text { font-size:12px; color:#334155; line-height:1.4; overflow:hidden; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; }
.ast-card-ocr-badge { display:inline-block; font-size:10px; font-weight:700; color:#1d4ed8; background:#dbeafe; border-radius:999px; padding:2px 8px; }

/* ── Voice type — form ── */
.ast-voice-controls { display:flex; gap:8px; align-items:center; }
.ast-voice-btn { padding:8px 16px; border:none; border-radius:8px; font-size:13px; font-weight:700; cursor:pointer; transition:background 120ms; }
.ast-voice-btn--record { background:#fee2e2; color:#dc2626; }
.ast-voice-btn--record.recording { background:#dc2626; color:#fff; }
.ast-voice-btn--stop { background:#e2e8f0; color:#334155; }
.ast-voice-status { font-size:12px; color:#64748b; }
.ast-voice-transcript { background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; padding:10px; font-size:13px; line-height:1.5; min-height:60px; max-height:160px; overflow-y:auto; white-space:pre-wrap; }

/* ── Voice type — card (create.html item list) ── */
.ast-card-voice { display:flex; flex-direction:row; gap:12px; align-items:flex-start; }
.ast-card-voice-icon { flex-shrink:0; width:48px; height:48px; background:#1f4aff; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.ast-card-voice-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.ast-card-voice-text { font-size:12px; color:#334155; line-height:1.4; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.ast-card-voice-badge { display:inline-block; font-size:10px; font-weight:700; color:#16a34a; background:#dcfce7; border-radius:999px; padding:2px 8px; }
.ast-card-voice-play { width:48px; height:48px; border-radius:50%; border:none; background:#1f4aff; cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; transition:background 120ms; }
.ast-card-voice-play:hover { background:#1a3fd4; }

/* =========================================
   MyKeeper Search Polish — mobile-first
   Step 5G / 6A — drop-in after existing search styles
   ========================================= */

.resultItem,
.resultBox {
  border-radius: 20px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.resultItem:active,
.resultBox:active {
  transform: scale(0.995);
  background-color: rgba(31, 74, 255, 0.03);
}

.resultGroup { margin-top: 14px; }
.resultList  { gap: 12px; }

.resultItemLabel,
.resultBoxName {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.2;
  color: #18212f;
  margin-bottom: 4px;
}

.resultItemBody,
.resultBoxBody { min-width: 0; }

.resultDocMatch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
}

/* Badge: tighter, faster to scan */
.docSearchScore,
.resultDocMatchLabel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

/* Suppress helper message inside badges in search result cards only —
   box viewer cards still show it */
.resultDocMatch .docSearchScoreMsg { display: none; }

/* Badge colors — override box viewer defaults for search context */
.docSearchScore--good  { background: #e7f7ec; color: #1f7a45; }
.docSearchScore--fair  { background: #fff4dd; color: #9a6b00; }
.docSearchScore--poor  { background: #fdeaea; color: #b23a3a; }

/* Non-OCR match labels (title, notes, photo title) */
.resultDocMatchLabel   { background: #eef2f7; color: #4a5565; }

/* Snippet: no card feel */
.resultDocMatchSnippet {
  display: block;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.45;
  color: #2f3a49;
  opacity: 0.92;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Highlight marks in search results */
.resultDocMatchSnippet mark,
.resultItemLabel mark,
.resultItemNotes mark,
.resultBoxLocation mark,
.resultBoxMeta mark {
  background: #fff08a;
  color: inherit;
  padding: 0 1px;
  border-radius: 3px;
}

.resultItemMeta,
.resultBoxMeta,
.resultBoxLocation { font-size: 0.84rem; line-height: 1.35; color: #6a7482; }

.resultDocPageCount,
.resultItemQty      { font-weight: 600; color: #5b6472; }

.resultItemThumb,
.resultItemThumbDoc,
.resultBoxIcon      { border-radius: 16px; overflow: hidden; flex-shrink: 0; }

.resultItemNotes    { margin-top: 2px; font-size: 0.92rem; color: #4c5663; line-height: 1.35; }
.resultItemSnippet  { display:block; margin-top:6px; font-size:0.98rem; line-height:1.42; color:#2f3a49; opacity:0.92; overflow-wrap:anywhere; }

.resultBoxArrow     { color: #9aa4b2; font-size: 1.35rem; }

.resultItem,
.resultBox          { border: 1px solid #e8edf4; box-shadow: 0 1px 2px rgba(16,24,40,0.04); }

.resultGroupTitle   { font-size: 0.86rem; letter-spacing: 0.04em; font-weight: 800; color: #5c6877; margin-bottom: 10px; }

@media (max-width: 640px) {
  .resultItem,
  .resultBox          { padding: 14px; border-radius: 18px; }
  .resultItemLabel,
  .resultBoxName      { font-size: 1.02rem; }
  .resultDocMatchSnippet { font-size: 0.95rem; line-height: 1.38; }
  .resultItemMeta,
  .resultBoxMeta,
  .resultBoxLocation  { font-size: 0.8rem; }
}

/* ── Move Item Modal ── */
.moveModal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.moveModal[hidden] { display: none; }
.moveModalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.45);
}
.moveModalSheet {
  position: relative;
  background: #fff;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -4px 32px rgba(15,23,42,.18);
}
.moveModalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.moveModalTitle {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}
.moveModalClose {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(15,23,42,.07);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 0;
}
.moveModalList {
  overflow-y: auto;
  flex: 1;
  padding: 12px 0;
}
.moveModalGroup { margin-bottom: 4px; }
.moveModalGroupHeader {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 20px 4px;
}
.moveModalLocationHeader {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  color: var(--ink);
  background: rgba(15,23,42,.05);
  padding: 10px 16px;
  margin: 4px 12px 0;
  border-radius: 8px;
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.moveModalLocationIcon { font-size: 14px; flex-shrink: 0; }
.moveModalContainers { padding-left: 12px; }
.moveModalRow {
  display: flex;
  align-items: baseline;
  gap: 4px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
  color: var(--ink);
  transition: background 120ms;
}
.moveModalRow:active,
.moveModalRow:hover { background: rgba(31,74,255,.06); }
.moveModalRowName { font-weight: 700; }
.moveModalRowLabel { color: var(--muted); font-size: 14px; }
.moveModalEmpty {
  padding: 24px 20px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.moveModalFooter {
  padding: 12px 20px 20px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.moveModalFooter .btn { width: 100%; justify-content: center; }

/* ── Move toast ── */
.moveToast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 24px;
  opacity: 0;
  transition: opacity 200ms, transform 200ms;
  pointer-events: none;
  z-index: 300;
  white-space: nowrap;
}
.moveToast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Staging editor (photo + OCR) v3.43 ── */
.ast-stage-btn--accept {
  background: #1f4aff;
  color: #fff;
  border-color: #1f4aff;
}
.ast-stage-btn--accept:disabled {
  background: #94a3b8;
  border-color: #94a3b8;
  color: #fff;
  opacity: 1;
}

.ast-photo-topbar {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.ast-photo-editor-actions {
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.ast-stage-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:7px 11px;
  border:1px solid #dbe3ef;
  border-radius:10px;
  background:#fff;
  color: var(--ink);
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  white-space:nowrap;
}
.ast-stage-btn:disabled { opacity:.4; cursor:not-allowed; }

.ast-stage-wrap {
  margin-top:10px;
  border:1px solid #dbe3ef;
  border-radius:14px;
  background:#fff;
  padding:10px;
}
.ast-stage-canvas {
  position:relative;
  width:100%;
  border-radius:10px;
  overflow:hidden;
  background:#0f172a;
  display:flex;
  align-items:center;
  justify-content:center;
}
.ast-stage-img {
  display:block;
  width:100%;
  height:auto;
  transform-origin:center center;
  max-height:55vh;
  object-fit:contain;
}
.ast-stage-overlay {
  position:absolute;
  inset:0;
  pointer-events:none;
  --crop-x:5%;--crop-y:5%;--crop-w:90%;--crop-h:90%;
}
.ast-stage-overlay::before {
  content:"";
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.38);
  mask:
    linear-gradient(#000 0 0) top/100% var(--crop-y) no-repeat,
    linear-gradient(#000 0 0) left/var(--crop-x) 100% no-repeat,
    linear-gradient(#000 0 0) right/calc(100% - (var(--crop-x) + var(--crop-w))) 100% no-repeat,
    linear-gradient(#000 0 0) bottom/100% calc(100% - (var(--crop-y) + var(--crop-h))) no-repeat;
  -webkit-mask:
    linear-gradient(#000 0 0) top/100% var(--crop-y) no-repeat,
    linear-gradient(#000 0 0) left/var(--crop-x) 100% no-repeat,
    linear-gradient(#000 0 0) right/calc(100% - (var(--crop-x) + var(--crop-w))) 100% no-repeat,
    linear-gradient(#000 0 0) bottom/100% calc(100% - (var(--crop-y) + var(--crop-h))) no-repeat;
}
.ast-stage-cropbox {
  position:absolute;
  left:var(--crop-x);
  top:var(--crop-y);
  width:var(--crop-w);
  height:var(--crop-h);
  border:2px solid #fff;
  border-radius:10px;
  pointer-events:auto;
  touch-action:none;
}
.ast-stage-handle {
  position:absolute;
  right:-2px; bottom:-2px;
  width:22px; height:22px;
  border-radius:50%;
  background:#1f4aff;
  border:2px solid #fff;
  box-shadow:0 2px 8px rgba(15,23,42,.3);
}
.ast-stage-help {
  margin-top:8px;
  font-size:12px;
  color:#64748b;
  text-align:center;
}

/* OCR page controls (reorder + remove) */
.ast-ocr-page-controls {
  display:flex;
  gap:4px;
  justify-content:center;
  margin-top:4px;
}
.ast-ocr-page-up,
.ast-ocr-page-down {
  width:26px; height:26px;
  border-radius:6px;
  border:1px solid #dbe3ef;
  background:#fff;
  font-size:11px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  color:var(--ink);
}
.ast-ocr-page-up:hover,
.ast-ocr-page-down:hover { background:#f1f5f9; }

/* ── Stage controls restructure (photo + OCR) ── */
/* Controls now live inside .ast-stage-wrap, below the canvas */
.ast-stage-controls {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ast-stage-controls-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
/* Use photo / Use Page — full width, prominent */
.ast-stage-accept-full {
  width: 100%;
  justify-content: center;
  font-size: 15px;
  padding: 12px;
}

/* ── Index card thumbnail ── */
.boxRowIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  vertical-align: middle;
}
.boxRowThumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}

/* ── Container nav buttons < > ── */
.btnContainerNav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #2e6bff, #1c4ed8);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(28,78,216,0.28);
  transition: filter 0.15s ease, transform 0.15s ease;
  padding: 0;
  line-height: 1;
  text-decoration: none;
}
.btnContainerNav:hover,
.btnContainerNav:active {
  filter: brightness(1.08);
  transform: translateY(-1px);
  color: #fff;
}
.btnContainerNav img { display:block; filter:brightness(0) invert(1); }

/* ─────────────────────────────────────────────
   Phase 2: Share mode — checkbox select, action bar, name modal, toast
   ───────────────────────────────────────────── */

/* Share action bar — sits below the container list when in share mode */
.shareActionBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line, #e2e8f0);
  flex-wrap: wrap;
}
.shareActionBar[hidden] { display: none; }

.shareSelectionCount {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #0f172a);
}

/* Checkbox overlay on each container row */
.shareCheckbox {
  display: none; /* hidden until share mode is active */
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 100%;
  z-index: 2;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.shareModeActive .shareCheckbox {
  display: flex;
}

.shareCheckbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--blue, #1f4aff);
  cursor: pointer;
  flex-shrink: 0;
}

/* Indent rows left to make room for checkbox in share mode */
.shareModeActive .boxRow {
  padding-left: 48px;
}

.shareModeActive .boxRowDeleteBtn {
  display: none; /* hide delete buttons while selecting */
}

/* Highlight checked rows */
.shareChecked .boxRow {
  background: rgba(31, 74, 255, 0.05);
  border-radius: 10px;
}

/* ── Share name modal ── */
.shareNameOverlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.50);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.shareNameOverlay--visible {
  opacity: 1;
}

.shareNameCard {
  background: #fff;
  border-radius: 18px;
  padding: 28px 24px 22px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.16);
}

.shareNameTitle {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink, #0f172a);
  margin: 0 0 16px;
  line-height: 1.3;
}

.shareNameLabel {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #0f172a);
  margin-bottom: 4px;
}

.shareNameHint {
  font-size: 12px;
  color: var(--muted, #64748b);
  margin: 0 0 10px;
  line-height: 1.5;
}

.shareNameInput {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  border: 1.5px solid var(--line, #e2e8f0);
  border-radius: 10px;
  color: var(--ink, #0f172a);
  background: #fff;
  outline: none;
  transition: border-color 140ms;
  margin-bottom: 16px;
}

.shareNameInput:focus {
  border-color: var(--blue, #1f4aff);
}

.shareNameActions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.shareNameStatus {
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 8px;
  margin-top: 12px;
  line-height: 1.45;
}

.shareNameStatus--ok {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.shareNameStatus--err {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ── Share success toast ── */
.shareToast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 30px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 99998;
}

.shareToast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .shareNameCard {
    padding: 22px 18px 18px;
  }
  .shareNameTitle {
    font-size: 16px;
  }
  .shareNameActions {
    flex-direction: column-reverse;
  }
  .shareNameActions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ─────────────────────────────────────────────
   mkAppNotice — full-screen modal notice
   Used for share outcomes, confirmations, and alerts
   ───────────────────────────────────────────── */

/* ── Install banner (Facebook-style bottom strip) ── */
.mkInstallBanner {
  position: fixed;
  left: 10px; right: 10px; bottom: 10px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #dbe3f0;
  border-radius: 14px;
  padding: 12px 12px 12px 14px;
  box-shadow: 0 4px 20px rgba(15,23,42,.15);
}
.mkInstallBannerClose {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.mkInstallBannerBody {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mkInstallBannerBody strong {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
.mkInstallBannerBody span {
  font-size: 13px;
  color: #536174;
}
.mkInstallBannerBtn {
  flex-shrink: 0;
  background: #1f4aff;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms;
}
.mkInstallBannerBtn:active { background: #1a3fd4; }
/* Keep demo page clean — banner shows at bottom of page via CTA instead */
body.demo-page .mkInstallBanner,
body[data-page="demo"] .mkInstallBanner { display: none !important; }

.mkAppNoticeOverlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.mkAppNoticeCard {
  background: #fff;
  border-radius: 20px;
  padding: 32px 24px 24px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.18);
  text-align: center;
  box-sizing: border-box;
}

.mkAppNoticeIcon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 14px;
}

.mkAppNoticeTitle {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink, #0f172a);
  margin: 0 0 10px;
  line-height: 1.3;
}

.mkAppNoticeText {
  font-size: 14px;
  color: var(--muted, #64748b);
  margin: 0 0 8px;
  line-height: 1.55;
}

.mkAppNoticeNote {
  font-size: 12px;
  color: var(--muted, #64748b);
  margin: 0 0 16px;
  line-height: 1.5;
  font-style: italic;
}

.mkAppNoticeActions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.mkAppNoticeActions .btn {
  width: 100%;
  justify-content: center;
  height: 44px;
  font-size: 15px;
}

@media (max-width: 400px) {
  .mkAppNoticeCard {
    padding: 24px 18px 18px;
  }
  .mkAppNoticeTitle {
    font-size: 16px;
  }
}

/* ─────────────────────────────────────────────
   Phase 3: Shared Copy badge on imported container cards
   ───────────────────────────────────────────── */
.sharedCopyBadge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.09);
  border: 1px solid rgba(37, 99, 235, 0.18);
  line-height: 1.4;
}

/* ─────────────────────────────────────────────
   FAB speed dial (box.html)
   ───────────────────────────────────────────── */

/* Backdrop — tapping dismisses the speed dial */
.fabBackdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 23, 42, 0.35);
}
.fabBackdrop[hidden] { display: none; }

/* Speed dial card — slides up from bottom right */
.fabSpeedDial {
  position: fixed;
  bottom: 90px;
  right: 16px;
  z-index: 1200;
  width: min(300px, calc(100vw - 32px));
  animation: fabDialIn 0.18s ease;
}
.fabSpeedDial[hidden] { display: none; }

@keyframes fabDialIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.fabCard {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  padding: 6px 0;
}

.fabGroup {
  padding: 10px 16px 6px;
}

.fabGroupLabel {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fabGroupIcon {
  font-size: 15px;
}

.fabAction {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  background: none;
  border: none;
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  gap: 1px;
}
.fabAction:hover { background: rgba(31, 74, 255, 0.06); }
.fabAction:active { background: rgba(31, 74, 255, 0.12); }

.fabActionSingle {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.fabActionLabel {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.fabActionSub {
  font-size: 12px;
  color: var(--muted);
}

.fabDivider {
  height: 1px;
  background: var(--line);
  margin: 4px 16px;
}

/* FAB button — fixed bottom right circle */
.fabBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1300;
  height: 52px;
  padding: 0 24px;
  border-radius: 26px;
  background: var(--blue);
  color: #fff;
  border: none;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(31, 74, 255, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.fabBtn[hidden] { display: none; }
.fabBtn:hover  { transform: scale(1.07); box-shadow: 0 6px 20px rgba(31, 74, 255, 0.5); }
.fabBtn:active { transform: scale(0.95); }
.fabBtn--open  { background: var(--ink); box-shadow: 0 4px 16px rgba(15, 23, 42, 0.3); }

.fabBtnIcon {
  display: block;
  transition: transform 0.2s ease;
  font-weight: 300;
}
.fabBtn--open .fabBtnIcon { transform: rotate(0deg); }


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Desktop & wider screens
   Strategy: mobile-first is the real product (PWA on phone).
   These rules make it look intentional on laptop/tablet
   without touching mobile behaviour.
   Breakpoints:
     600px  — small tablet / large phone landscape
     768px  — tablet portrait
     981px  — desktop (nav already handled above)
     1200px — wide desktop polish
═══════════════════════════════════════════════════════════ */

/* ── 600px: breathing room starts ── */
@media (min-width: 600px) {
  .pagePad { padding: 20px 0; }

  .card { padding: 20px; }

  /* Index — My Containers header scales up */
  .myBoxesHeader { margin-bottom: 16px; }
  .myBoxesPrimaryBtn { height: 40px; padding: 0 18px; font-size: 15px; }
  .myBoxesIconBtn { width: 52px; height: 52px; }

  /* Box row — slightly more generous */
  .boxRow { padding: 14px 52px 14px 14px; }
  .boxRowName { font-size: 18px; }
  .boxRowTitle { font-size: 17px; }
  .boxRowDeleteBtn { width: 36px; height: 36px; font-size: 19px; bottom: 10px; right: 10px; }

  /* box.html — header */
  .boxPresKey { font-size: 16px; }
  .boxPresLocation { font-size: 30px; }
}

/* ── 768px: tablet portrait — two-column index option ── */
@media (min-width: 768px) {
  .pagePad { padding: 28px 0; }

  .card { padding: 24px; border-radius: 20px; }

  /* Topbar — give brand and nav more room */
  .topbar { padding: 14px 24px; gap: 24px; }

  /* My Containers — icon buttons a touch larger */
  .myBoxesIconBtn { width: 54px; height: 54px; }
  .myBoxesPrimaryBtn { height: 42px; font-size: 15px; }

  /* Box rows — roomier */
  .boxRow { padding: 16px 56px 16px 16px; border-radius: 18px; }
  .boxRowTitle { font-size: 17px; }
  .boxRowDeleteBtn { width: 38px; height: 38px; font-size: 20px; }

  /* box.html header */
  .boxPresLocation { font-size: 32px; }
  .boxPresKey { font-size: 16px; }
  .boxPresEditRow { gap: 10px; margin-top: 16px; }

  /* Export / Backup card */
  .exportEngineToggle { padding: 16px 20px; }
  .exportEngineTitle { font-size: 16px; }
}

/* ── 981px: desktop — full nav visible (already handled),
   now polish layout and spacing ── */
@media (min-width: 981px) {
  .pagePad { padding: 32px 0; }

  .card { padding: 28px; }

  /* Wrap gets a comfortable max with side breathing room */
  .wrap { width: min(760px, calc(100% - 48px)); }

  /* My Containers — keep icon buttons at a good desktop size */
  .myBoxesIconBtn { width: 52px; height: 52px; }
  .myBoxesPrimaryBtn { height: 40px; font-size: 15px; }
  .myBoxesHeader h2 { font-size: 18px; }

  /* Box rows — desktop hover feels intentional */
  .boxRow { padding: 16px 60px 16px 16px; }
  .boxRow:hover { background: rgba(31,74,255,.03); border-color: rgba(31,74,255,.2); }
  .boxRowName { font-size: 18px; }
  .boxRowDeleteBtn { opacity: 0; transition: opacity 150ms, background 150ms, color 150ms; }
  .boxRowWrap:hover .boxRowDeleteBtn { opacity: 1; }

  /* box.html */
  .boxPresLocation { font-size: 34px; }
  .boxPresKey { font-size: 16px; }

  /* Footer */
  .footer { padding: 24px 0; }
  .footerInner { font-size: 14px; }
}

/* ── 1200px: wide desktop — subtle polish only ── */
@media (min-width: 1200px) {
  .wrap { width: min(800px, calc(100% - 64px)); }

  .card { padding: 32px; }
  .pagePad { padding: 36px 0; }

  .boxPresLocation { font-size: 36px; }
  .myBoxesHeader h2 { font-size: 19px; }
}

/* ── Visual Item Lookup hint — one-time pulse on Search Image button ── */
.mkSearchPulse {
  animation: mkSearchPulse 1.2s ease-in-out 2;
}
@keyframes mkSearchPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(66, 133, 244, 0);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(66, 133, 244, 0.25);
    transform: scale(1.03);
  }
}
