:root {
  --bo-bg: #f5f6f2;
  --bo-surface: #ffffff;
  --bo-surface-2: #eef1ec;
  --bo-ink: #18201d;
  --bo-muted: #748079;
  --bo-line: #e1e6e1;
  --bo-line-strong: #cbd3cd;
  --bo-green: #176b55;
  --bo-green-soft: #e4f0eb;
  --bo-gold: #b88a3b;
  --bo-gold-soft: #f7efdf;
  --bo-red: #b95445;
  --bo-red-soft: #fae9e5;
  --bo-accent: #4338ca;
  --bo-accent-soft: #eef2ff;
  --bo-radius: 14px;
  --bo-shadow: 0 18px 50px rgba(25,38,32,.07);
  --bo-shadow-sm: 0 6px 18px rgba(25,38,32,.06);
  --bo-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "DM Sans", sans-serif;
  --bo-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --bo-dur-press: 140ms;
  --bo-dur-fast: 160ms;
  --bo-dur-med: 220ms;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bo-bg: #0e1311;
  --bo-surface: #171d1a;
  --bo-surface-2: #202823;
  --bo-ink: #edf2ee;
  --bo-muted: #9ca9a2;
  --bo-line: #29322d;
  --bo-line-strong: #3b4841;
  --bo-green: #55b494;
  --bo-green-soft: #17332b;
  --bo-gold: #d6ad61;
  --bo-gold-soft: #362c1d;
  --bo-red: #df8272;
  --bo-red-soft: #38221e;
  --bo-accent: #c7d2fe;
  --bo-accent-soft: #312e81;
  --bo-shadow: 0 20px 60px rgba(0,0,0,.22);
  --bo-shadow-sm: 0 10px 28px rgba(0,0,0,.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bo-bg);
  color: var(--bo-ink);
  font: 14px/1.55 var(--bo-font);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
button { font: inherit; color: inherit; border: 0; cursor: pointer; background: none; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--bo-green) 30%, transparent);
  outline-offset: 2px;
}
input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

.bo-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 22px;
  background: color-mix(in srgb, var(--bo-surface) 92%, transparent);
  border-bottom: 1px solid var(--bo-line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.bo-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bo-back {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--bo-line);
  color: var(--bo-muted);
  text-decoration: none;
  transition: border-color var(--bo-dur-fast) ease, color var(--bo-dur-fast) ease, transform var(--bo-dur-press) var(--bo-ease-out);
  flex: none;
}
.bo-back:hover { border-color: var(--bo-green); color: var(--bo-green); }
.bo-back:active { transform: scale(0.95); }
.bo-brand strong { font-size: 15px; letter-spacing: -.01em; }
.bo-crumb {
  font-size: 12px;
  color: var(--bo-muted);
  border-left: 1px solid var(--bo-line);
  padding-left: 12px;
  margin-left: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bo-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.bo-icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border: 1px solid var(--bo-line);
  background: var(--bo-surface);
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 18px;
  color: var(--bo-ink);
  transition: border-color var(--bo-dur-fast) ease, color var(--bo-dur-fast) ease, transform var(--bo-dur-press) var(--bo-ease-out);
}
.bo-icon-btn:hover { border-color: var(--bo-green); color: var(--bo-green); }
.bo-icon-btn:active { transform: scale(0.95); }
.bo-icon-btn svg { display: block; }
.bo-badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--bo-red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bo-surface);
}

.bo-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d8c4a2, #8eaa9c);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: grid; place-items: center;
  border: 1px solid var(--bo-line);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.bo-notif-wrap, .bo-account-wrap { position: relative; }

.bo-notif-panel, .bo-account-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bo-surface);
  border: 1px solid var(--bo-line);
  border-radius: 14px;
  box-shadow: var(--bo-shadow);
  z-index: 200;
  overflow: hidden;
  transform-origin: top right;
  animation: boPop 160ms var(--bo-ease-out) both;
}
@keyframes boPop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }

.bo-notif-panel { width: min(380px, calc(100vw - 24px)); max-height: 70vh; display: flex; flex-direction: column; }
.bo-notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid var(--bo-line);
}
.bo-notif-head strong { font-size: 13px; }
.bo-link { color: var(--bo-green); font-size: 11px; font-weight: 700; }

.bo-notif-list { overflow-y: auto; flex: 1; max-height: calc(70vh - 50px); }
.bo-notif-empty { padding: 26px 16px; text-align: center; color: var(--bo-muted); font-size: 12px; margin: 0; }

.bo-notif-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 11px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--bo-line);
  cursor: pointer;
  transition: background-color var(--bo-dur-press) ease;
}
.bo-notif-item:last-child { border-bottom: 0; }
.bo-notif-item:hover { background: var(--bo-surface-2); }
.bo-notif-item.unread { background: color-mix(in srgb, var(--bo-green-soft) 55%, var(--bo-surface)); }
.bo-notif-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--bo-green-soft);
  color: var(--bo-green);
  font-size: 14px;
  flex: none;
}
.bo-notif-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bo-notif-body strong { font-size: 12px; font-weight: 600; }
.bo-notif-body span { font-size: 11px; color: var(--bo-muted); overflow-wrap: anywhere; }
.bo-notif-body small { font-size: 10px; color: var(--bo-muted); margin-top: 2px; }

.bo-account-panel { width: 260px; padding: 8px; }
.bo-account-head {
  display: flex; flex-direction: column;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--bo-line);
  margin-bottom: 6px;
}
.bo-account-head strong { font-size: 13px; }
.bo-account-head span { font-size: 11px; color: var(--bo-muted); overflow-wrap: anywhere; }
.bo-menu-item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--bo-ink);
  text-decoration: none;
  text-align: left;
  transition: background-color var(--bo-dur-press) ease, transform var(--bo-dur-press) var(--bo-ease-out);
}
.bo-menu-item:hover { background: var(--bo-surface-2); }
.bo-menu-item:active { transform: scale(0.98); }
.bo-menu-item.danger { color: var(--bo-red); }
.bo-menu-item svg { flex: none; }

.bo-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 22px calc(80px + env(safe-area-inset-bottom, 0px));
}

.bo-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.bo-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bo-green);
  margin-bottom: 6px;
}
.bo-hero h1 {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 700;
  letter-spacing: -.035em;
}
.bo-hero p { margin: 8px 0 0; color: var(--bo-muted); max-width: 560px; font-size: 13px; }
.bo-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.bo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 15px;
  border-radius: 12px;
  border: 1px solid var(--bo-line);
  background: var(--bo-surface);
  color: var(--bo-ink);
  font-size: 13px;
  font-weight: 600;
  transition: transform var(--bo-dur-press) var(--bo-ease-out),
              background-color var(--bo-dur-fast) ease,
              border-color var(--bo-dur-fast) ease,
              color var(--bo-dur-fast) ease,
              filter var(--bo-dur-fast) ease;
}
.bo-btn:hover { border-color: var(--bo-green); color: var(--bo-green); }
.bo-btn:active { transform: scale(0.97); }
.bo-btn.primary {
  background: var(--bo-green);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(23,107,85,.16);
}
.bo-btn.primary:hover { filter: brightness(.96); color: #fff; }
.bo-btn.accent { background: var(--bo-accent-soft); color: var(--bo-accent); border-color: transparent; }
.bo-btn.danger { color: var(--bo-red); border-color: color-mix(in srgb, var(--bo-red) 30%, var(--bo-line)); }
.bo-btn.danger:hover { background: var(--bo-red-soft); color: var(--bo-red); }
.bo-btn[disabled] { opacity: .6; cursor: not-allowed; }
.bo-btn[disabled]:active { transform: none; }
.bo-btn.small { padding: 7px 11px; font-size: 12px; }
.bo-btn svg { flex: none; }

.bo-section { margin-bottom: 26px; }
.bo-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.bo-section-head h2 { font-size: 15px; font-weight: 700; margin: 0; }
.bo-pill {
  font-size: 11px; padding: 4px 10px;
  border-radius: 999px;
  background: var(--bo-gold-soft);
  color: #765318;
  font-weight: 600;
}
.bo-hint { font-size: 11px; color: var(--bo-muted); }

.bo-queue, .bo-history { display: flex; flex-direction: column; gap: 12px; }
.bo-empty { padding: 22px; text-align: center; color: var(--bo-muted); font-size: 13px; margin: 0; border: 1.5px dashed var(--bo-line-strong); border-radius: var(--bo-radius); background: var(--bo-surface-2); }

.bo-card {
  background: var(--bo-surface);
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-radius);
  box-shadow: var(--bo-shadow-sm);
  overflow: hidden;
  transition: opacity var(--bo-dur-med) var(--bo-ease-out), max-height var(--bo-dur-med) var(--bo-ease-out);
}
.bo-card-body { padding: 16px; }

.bo-compare {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
}
.bo-image {
  background: var(--bo-surface-2);
  border-radius: 12px;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bo-muted);
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  font-size: 12px;
}
.bo-image img { width: 100%; height: 100%; object-fit: contain; max-height: 460px; }
.bo-image-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bo-image-placeholder svg { opacity: .5; }

.bo-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bo-field { display: flex; flex-direction: column; gap: 4px; }
.bo-field label { font-size: 11px; font-weight: 600; color: var(--bo-muted); letter-spacing: .02em; }
.bo-field input, .bo-field select {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--bo-line);
  background: var(--bo-surface);
  padding: 0 11px;
  font-size: 13px;
  transition: border-color var(--bo-dur-fast) ease;
}
.bo-field input:focus, .bo-field select:focus { border-color: var(--bo-green); }
.bo-field input[readonly] { background: var(--bo-surface-2); color: var(--bo-muted); }
.bo-field.invalid input, .bo-field.invalid select { border-color: var(--bo-red); }

.bo-items-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 0 8px;
}
.bo-items-head strong { font-size: 13px; }

.bo-item-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 90px 90px 34px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.bo-item-grid.head {
  font-size: 11px; color: var(--bo-muted);
  padding: 0 2px 6px;
  font-weight: 600;
}
.bo-item-grid input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--bo-line);
  background: var(--bo-surface);
  padding: 0 9px;
  font-size: 12px;
}
.bo-item-total { font-size: 12px; text-align: right; color: var(--bo-muted); font-variant-numeric: tabular-nums; padding-right: 4px; }

.bo-item-add {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--bo-green);
  font-weight: 600;
}

.bo-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--bo-line);
}

.bo-extract-fail-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff8eb;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  color: #9a3412;
  font-size: 12px;
}
.bo-extract-fail-text strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 2px;
}
.bo-extract-fail-text p {
  margin: 0;
  color: #b45309;
  font-size: 11.5px;
  word-break: break-word;
}
.bo-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-weight: 600;
}
@keyframes boSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.bo-spin {
  display: inline-block;
  animation: boSpin 0.8s linear infinite;
}

.bo-error {
  display: none;
  font-size: 12px;
  color: var(--bo-red);
  text-align: right;
  margin: 10px 0 0;
}

.bo-history-card { padding: 14px 16px; }
.bo-history-summary { display: flex; align-items: center; gap: 12px; }
.bo-history-thumb {
  width: 40px; height: 40px; flex: none;
  border-radius: 10px;
  background: var(--bo-surface-2);
  display: grid; place-items: center;
  color: var(--bo-muted);
  overflow: hidden;
}
.bo-history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bo-history-info {
  flex: 1; min-width: 0;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
  font-size: 12px;
}
.bo-history-info strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-history-info span { color: var(--bo-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bo-history-edit { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.bo-history-items {
  margin-top: 8px;
  font-size: 11px;
  color: var(--bo-muted);
  overflow-wrap: anywhere;
}
.bo-history-editor { margin-top: 4px; }

.bo-image-attach {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bo-surface-2);
  border: 1px solid var(--bo-line);
  border-radius: 12px;
  margin-bottom: 14px;
}
.bo-image-attach.hidden { display: none; }
.bo-image-attach-thumb {
  width: 48px; height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bo-surface);
  display: grid; place-items: center;
  flex: none;
}
.bo-image-attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bo-image-attach-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.bo-image-attach-info strong { font-size: 13px; }
.bo-image-attach-info span { font-size: 11px; color: var(--bo-muted); overflow-wrap: anywhere; }

.bo-fab {
  position: fixed;
  right: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bo-green);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 12px 30px rgba(23,107,85,.42);
  z-index: 60;
  transition: transform var(--bo-dur-press) var(--bo-ease-out), box-shadow var(--bo-dur-fast) var(--bo-ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .bo-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(23,107,85,.5); }
}
.bo-fab:active { transform: scale(0.95); }
.bo-fab.busy { pointer-events: none; opacity: .7; }
.bo-fab.busy svg { animation: boSpin .9s linear infinite; }
@keyframes boSpin { to { transform: rotate(360deg); } }

.bo-modal {
  position: fixed; inset: 0;
  background: rgba(8,14,11,.55);
  backdrop-filter: blur(5px);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 400;
}
.bo-modal.open { display: grid; animation: boFade 150ms var(--bo-ease-out) both; }
@keyframes boFade { from { opacity: 0; } to { opacity: 1; } }
.bo-modal-box {
  background: var(--bo-surface);
  border-radius: 18px;
  border: 1px solid var(--bo-line);
  width: min(720px, 100%);
  box-shadow: var(--bo-shadow);
  padding: 20px;
  animation: boModalIn var(--bo-dur-med) var(--bo-ease-out) both;
}
@keyframes boModalIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.bo-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.bo-close { font-size: 24px; color: var(--bo-muted); }

.bo-toast {
  position: fixed;
  right: 22px;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  background: var(--bo-ink);
  color: var(--bo-surface);
  padding: 12px 15px;
  border-radius: 12px;
  box-shadow: var(--bo-shadow);
  font-size: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--bo-dur-med) var(--bo-ease-out), transform var(--bo-dur-med) var(--bo-ease-out);
  pointer-events: none;
  z-index: 500;
  max-width: calc(100vw - 44px);
}
.bo-toast.show { opacity: 1; transform: none; }

@media (max-width: 720px) {
  html {
    width: 100%;
    min-height: 100%;
    overflow-x: clip;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  body {
    width: 100%;
    min-height: 100%;
    min-width: 0;
    overflow-x: clip;
    overflow-y: visible !important;
    touch-action: pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
  }
  * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .bo-topbar { padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px; gap: 8px; background: var(--bo-surface) !important; min-height: 50px; }
  .bo-crumb { display: none; }
  .bo-brand strong { font-size: 15px; }
  .bo-main { padding: 14px 12px calc(90px + env(safe-area-inset-bottom, 0px)); overflow: visible; }
  .bo-hero { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
  .bo-hero h1 { font-size: 20px; font-weight: 700; line-height: 1.15; margin: 0; }
  .bo-hero p { font-size: 12px; line-height: 1.45; color: var(--bo-muted); margin: 0; }
  .bo-hero-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
  .bo-hero-actions .bo-btn { flex: 1 1 135px; justify-content: center; min-height: 44px; font-size: 13px; font-weight: 600; }
  
  .bo-card { border-radius: 14px; }
  .bo-card-body { padding: 12px; }

  /* Compact & flexible mobile receipt preview */
  .bo-imgpane--queue .bo-imgpane-scroll { height: min(34vh, 250px); border-radius: 10px; }
  .bo-imgpane { padding: 8px; border-radius: 12px; }

  /* Touch-friendly card actions on mobile */
  .bo-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 12px;
  }
  .bo-card-actions .bo-retry-btn {
    grid-column: 1 / -1;
    width: 100%;
    margin-right: 0 !important;
    min-height: 44px;
    font-size: 13px;
    font-weight: 600;
    justify-content: center;
  }
  .bo-card-actions .bo-btn {
    min-height: 44px;
    font-size: 13px;
    font-weight: 600;
    justify-content: center;
  }

  /* Responsive line items grid */
  .bo-item-grid { grid-template-columns: minmax(0, 1.35fr) 46px 60px 62px 28px; gap: 4px; }
  .bo-item-grid input { height: 38px; padding: 0 5px; font-size: 13px !important; border-radius: 8px; }
  .bo-item-grid.head { font-size: 10px; color: var(--bo-muted); }
  .bo-item-grid.head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .bo-fields { grid-template-columns: 1fr; gap: 10px; }
  .bo-field label { font-size: 11.5px; font-weight: 600; color: var(--bo-muted); margin-bottom: 3px; display: block; }
  .bo-fields input:not([type="checkbox"]),
  .bo-fields select,
  .bo-field input,
  .bo-field select {
    font-size: 16px !important;
    height: 44px;
    min-height: 44px;
    border-radius: 10px;
  }
  .bo-history-info { grid-template-columns: 1fr; gap: 2px; }
}

.bo-items-total {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--bo-line);
  font-size: 12px;
  flex-wrap: wrap;
}
.bo-items-total > span {
  color: var(--bo-muted);
  font-weight: 600;
}
.bo-items-total > strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.bo-items-total .bo-items-diff {
  font-style: normal;
  font-size: 11px;
  color: var(--bo-muted);
  background: var(--bo-surface-2);
  padding: 2px 8px;
  border-radius: 999px;
}

body.role-user .bo-history-edit { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bo-notif-panel, .bo-account-panel, .bo-modal-box { animation: boFade 150ms ease both; }
  .bo-toast { transform: none; }
  .bo-fab:hover, .bo-btn:active, .bo-icon-btn:active, .bo-fab:active { transform: none; }
}

.bo-imgpane {
  background: var(--bo-surface-2);
  border: 1px solid var(--bo-line);
  border-radius: 14px;
  padding: 10px;
}
.bo-imgpane-scroll {
  display: flex;
  height: min(78vh, 780px);
  overflow: auto;
  border-radius: 10px;
  background: #1b1f1d;
  cursor: zoom-in;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.bo-imgpane-scroll.dragging { cursor: grabbing; user-select: none; }
.bo-imgpane-scroll img {
  flex: none;
  margin: auto;
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  user-select: none;
  -webkit-user-drag: none;
}
.bo-imgpane[data-fit="height"] .bo-imgpane-scroll img { width: auto; height: 100%; }
.bo-imgpane:not([data-zoom-level="1"]) .bo-imgpane-scroll { cursor: grab; }
.bo-zoom-controls {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.bo-zoom-level {
  min-width: 52px; height: 30px; padding: 0 8px;
  border: 0; border-radius: 8px; background: transparent;
  font: 600 12px ui-monospace, monospace; color: var(--bo-ink); cursor: pointer;
}
.bo-zoom-level:hover { background: var(--bo-surface); }

.bo-split {
  display: grid;
  grid-template-columns: minmax(320px, 46%) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 14px;
}
.bo-split.no-image { grid-template-columns: minmax(0, 1fr); }
.bo-split-media { position: sticky; top: 76px; }
.bo-split-form { min-width: 0; }
@media (max-width: 900px) {
  .bo-split { grid-template-columns: minmax(0, 1fr); }
  .bo-split-media { position: static; }
  .bo-imgpane-scroll { height: 60vh; }
}

.bo-imgpane--queue .bo-imgpane-scroll { height: min(60vh, 560px); }

.bo-viewer {
  position: fixed; inset: 0; z-index: 9999;
  display: none;
  background: rgba(8,14,11,.92);
  padding: 0; border: 0; border-radius: 0;
}
.bo-viewer.open { display: block; }
.bo-viewer .bo-imgpane-scroll {
  position: absolute; inset: 0;
  height: auto; border-radius: 0; background: transparent;
  padding: 56px 16px 84px;
  box-sizing: border-box;
}
.bo-viewer .bo-imgpane-scroll img { border-radius: 8px; }
.bo-viewer-close {
  position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 14px;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.14); color: #fff; font-size: 26px; cursor: pointer; z-index: 2;
}
.bo-viewer .bo-zoom-controls {
  position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); margin: 0; z-index: 2;
  background: rgba(20,20,20,.85); padding: 8px 16px; border-radius: 30px;
}
.bo-viewer .bo-zoom-level { color: #fff; }
.bo-viewer .bo-zoom-level:hover { background: rgba(255,255,255,.12); }
.bo-viewer .bo-btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }

/* Smooth rotation */
.bo-imgpane-scroll img {
  transition: transform 0.2s ease-in-out;
}

/* Lively Empty State */
.bo-empty-v2 {
  background: var(--bo-surface);
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-radius);
  padding: 40px 20px;
  text-align: center;
  box-shadow: var(--bo-shadow-sm);
  animation: boFade 300ms ease both;
}
.bo-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: inline-block;
  animation: boBounce 2s infinite;
}
@keyframes boBounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}
.bo-empty-v2 h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--bo-ink);
}
.bo-empty-v2 p {
  margin: 0;
  color: var(--bo-muted);
  font-size: 14px;
}

/* Item Search Summary Pill (matches Spendly style) */
.bo-report-summary-pill {
  background: var(--bo-surface-2);
  border: 1px solid var(--bo-line);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--bo-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  animation: boFade 200ms ease;
}
.bo-report-summary-pill strong {
  color: var(--bo-ink);
  font-weight: 700;
}
.bo-report-summary-pill .pill-amount {
  color: var(--bo-ink);
  font-weight: 700;
  margin-left: auto;
}

/* History Segmented Toggle & Type Badges */
.bo-segmented-toggle {
  display: inline-flex;
  gap: 3px;
  background: var(--bo-surface-2);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--bo-line);
}
.bo-type-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--bo-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.bo-type-btn:hover {
  color: var(--bo-ink);
}
.bo-type-btn.active {
  background: var(--bo-surface);
  color: var(--bo-ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.bo-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.bo-type-badge.cost {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.bo-type-badge.revenue {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

