:root {
  --ink: #142033;
  --ink-soft: #344054;
  --muted: #667085;
  --line: #e4e8ef;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --canvas: #f2f5f9;
  --nav: #0d1726;
  --nav-soft: #1a2940;
  --brand: #2859ff;
  --brand-dark: #1740cb;
  --brand-soft: #eaf0ff;
  --success: #08795b;
  --success-soft: #e4f6ef;
  --warning: #a75200;
  --warning-soft: #fff2dc;
  --danger: #bd2d39;
  --danger-soft: #ffe9eb;
  --radius: 14px;
  --shadow: none;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

/* Property fees share the existing controls and adapt without horizontal scrolling. */
.fee-settings-basics { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin: 20px 0; max-width: 540px; }
.fee-rule { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 0 20px; min-width: 0; }
.fee-rule legend, .fee-handling legend { padding: 0 6px; font-weight: 750; font-size: 15px; }
.fee-rule-fields { display: grid; grid-template-columns: minmax(100px, 150px) minmax(160px, 1fr) auto; gap: 14px; align-items: end; }
.fee-rule-fields button { min-height: 45px; }
.fee-rule p { margin: 12px 0 0; }
#packageFeeForm > .check-label { margin: 16px 0; }
#packageFeeActivity { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.fee-handling { min-width: 0; padding: 16px; margin: 20px 0 12px; border: 1px solid var(--line); border-radius: 12px; }
.fee-handling-options { display: flex; flex-wrap: wrap; gap: 16px 24px; }
.fee-quote { background: var(--surface-soft); border-radius: 10px; padding: 14px; margin-bottom: 16px; line-height: 1.5; }
.fee-quote p { margin: 0 0 8px; }
.fee-quote p:last-child { margin-bottom: 0; }
.fee-total-row { display: flex; justify-content: space-between; gap: 16px; margin: 6px 0; }
.fee-activity-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.fee-activity-row p { margin: 6px 0 0; }
.fee-activity-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#feeActionForm { display: grid; gap: 16px; }
@media (max-width: 650px) {
  .fee-rule-fields, .fee-settings-basics { grid-template-columns: 1fr; max-width: none; }
  .fee-handling-options { display: grid; }
  .fee-activity-row { align-items: stretch; flex-direction: column; }
  .fee-activity-actions > button { flex: 1; }
  #savePackageFeeSettings { width: 100%; }
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd6e2;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  transition: border .16s ease, box-shadow .16s ease;
}
input, select { min-height: 45px; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(40, 89, 255, .12);
}
label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.error { color: var(--danger); margin: 0; min-height: 20px; font-size: 13px; font-weight: 650; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
button, a.primary, a.secondary, a.nav-item, .reservation-choice, .mode-tab {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(40, 89, 255, .12);
}
.primary, .secondary, .text-button, .icon-button {
  border: 0;
  border-radius: 11px;
  min-height: 43px;
  padding: 10px 15px;
  font-weight: 800;
  transition: background .12s ease, box-shadow .12s ease;
}
.primary { background: var(--brand); color: #fff; box-shadow: none; }
.primary:hover:not(:disabled) { background: var(--brand-dark); }
.secondary { background: #edf1f7; color: #27364d; }
.secondary:hover:not(:disabled) { background: #e1e7f0; }
.text-button { background: transparent; color: var(--brand); padding-inline: 2px; min-height: auto; }
.icon-button { width: 42px; padding: 0; font-size: 26px; background: #edf1f6; color: var(--ink); }
.large-button { width: 100%; min-height: 50px; font-size: 15px; }

/* Sign in */
.login-shell { min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; place-items: center; gap: 24px; padding: 24px; }
.login-panel { width: min(100%, 420px); display: grid; gap: 20px; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.login-panel h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.6px; }
.login-panel p { margin: 0; }
.mobile-brand { display: flex; margin-bottom: 8px; }
.demo-note { padding: 12px; background: var(--surface-soft); border-radius: 10px; color: var(--muted); font-size: 12px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup h1 { font-size: 30px; font-weight: 760; line-height: 1; margin: 0; letter-spacing: -.9px; }
.brand-lockup p { margin: 6px 0 0; color: var(--muted); font-size: 16px; font-weight: 450; }
.compact.brand-lockup { gap: 10px; }
.compact.brand-lockup h1 { font-size: 25px; }
.compact.brand-lockup p { font-size: 14px; margin-top: 5px; }
.brand-lockup.inverse p { color: #9badc5; }
.brand-mark { position: relative; flex: 0 0 auto; width: 64px; height: 64px; }
.brand-mark > img { position: absolute; left: 50%; top: 50%; width: 112px; height: 112px; transform: translate(-50%, -50%); }
.brand-mark-image { display: block; object-fit: contain; }
.compact .brand-mark { width: 52px; height: 52px; }
.compact .brand-mark > img { width: 92px; height: 92px; }
.compact h1 { font-size: 22px; color: #fff; }

/* App shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--nav); color: #fff; padding: 24px 20px; display: flex; flex-direction: column; z-index: 20; overflow-y: auto; overscroll-behavior-y: contain; }
.sidebar nav { display: grid; gap: 7px; margin-top: 32px; }
.nav-item { border: 0; background: transparent; color: #aebbd0; padding: 12px 13px; border-radius: 11px; text-align: left; font-weight: 750; display: flex; align-items: center; gap: 12px; text-decoration: none; }
a.primary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: #fff; }
.nav-item:hover, .nav-item.active { background: var(--nav-soft); color: #fff; }
.nav-item.active { box-shadow: inset 3px 0 0 var(--brand); }
.nav-icon { width: 22px; text-align: center; font-size: 17px; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid #26354b; }
.profile-row { display: flex; gap: 11px; align-items: center; min-width: 0; width: 100%; padding: 8px 0; border: 0; border-radius: 10px; text-align: left; background: transparent; color: inherit; }
.profile-row:hover { background: var(--nav-soft); }
.profile-identity { display: grid; min-width: 0; gap: 3px; }
.profile-caption { font-size: 11px; font-weight: 500; color: #9eb8ff; }
.account-identity { font-weight: 700; margin-bottom: 6px; overflow-wrap: anywhere; }
.account-role { font-size: 12px; margin-top: 0; overflow-wrap: anywhere; }
.account-plan { padding: 20px; margin-top: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.account-plan h3 { margin: 0 0 12px; font-size: 20px; }
.account-plan p { font-size: 14px; line-height: 1.6; }
.account-plan .muted { font-size: 12px; }
.account-plan .primary { width: 100%; margin-top: 8px; }
.account-plan progress { width: 100%; height: 9px; accent-color: var(--brand); }
.account-plan progress::-webkit-progress-bar { background: #dfe5f0; border-radius: 9px; }
.account-plan progress::-webkit-progress-value { background: var(--brand); border-radius: 9px; }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #233754; color: #dce6f7; font-weight: 750; font-size: 12px; }
.user-name { font-weight: 780; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .muted { color: #8fa0b9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-signout { color: #9eb8ff; margin-top: 12px; }
main { padding: 32px clamp(22px, 4vw, 54px) 60px; min-width: 0; min-height: 100dvh; display: flex; flex-direction: column; }
.platform-footer { color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
main > .platform-footer { margin-top: auto; padding-top: 32px; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 12px; }
.desk-notice { margin: 0 0 18px; min-height: 0; }
.desk-notice:not(.hidden) { min-height: 20px; }
.page-header h2 { font-size: 28px; margin: 0; letter-spacing: -.9px; }
.eyebrow { color: var(--brand); font-size: 10px; font-weight: 750; letter-spacing: 1.8px; margin: 0 0 6px; }
.header-actions { display: flex; gap: 9px; align-items: center; }
.header-actions .primary span { margin-right: 5px; font-size: 18px; }
.view-section { animation: viewIn .2s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Package dashboard */
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 17px; }
.summary-card { padding: 18px; box-shadow: none; }
.summary-card .value { font-size: 30px; font-weight: 750; letter-spacing: -1px; }
.summary-card .label { color: var(--muted); margin-top: 3px; font-size: 12px; }
.toolbar { padding: 14px; display: grid; grid-template-columns: 1fr 220px; gap: 12px; margin-bottom: 15px; box-shadow: none; }
.toolbar label { gap: 5px; }
.toolbar label > span { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
#packageSearchForm label { min-width: 0; }
#packageSearchForm label > span { font-size: 12px; text-transform: none; letter-spacing: 0; }
.package-search-hint { grid-column: 1 / -1; margin: 0; }
.package-unassigned-filter { grid-column: 1 / -1; justify-self: start; }
.package-recipient { display: flex; align-items: center; gap: 8px; }
.package-select { display: flex; flex: 0 0 32px; align-items: center; justify-content: center; min-height: 44px; margin: 0; cursor: pointer; }
.package-select input { width: 20px; height: 20px; min-height: 0; margin: 0; cursor: pointer; }
.package-selected { background: var(--brand-soft); }
.package-selection-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; }
.package-selection-bar > div:first-child { display: grid; gap: 4px; }
.package-selection-bar .muted { font-size: 12px; }
.package-selection-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk-assignment-packages { margin: 20px 0; }
.bulk-assignment-packages li { margin: 8px 0; }
.bulk-assignment-fee { border-top: 1px solid var(--line); padding: 12px 0; margin-top: 12px; }
@media (max-width: 850px) {
  .package-selection-actions { width: 100%; }
  .package-selection-actions .primary { flex: 1; }
  .package-recipient { align-items: flex-start; }
}
.package-search-summary { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; border-top: 1px solid var(--line); padding-top: 8px; min-height: 53px; }
.package-search-summary .text-button { min-height: 44px; }
.table-panel { overflow: hidden; box-shadow: none; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th { padding: 13px 16px; text-align: left; color: var(--muted); font-size: 10px; letter-spacing: .7px; text-transform: uppercase; border-bottom: 1px solid var(--line); background: #fbfcfe; }
td { padding: 15px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f7f9ff; }
.tracking { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; }
.subtext { color: var(--muted); font-size: 11px; margin-top: 4px; }
.carrier-tag { display: inline-flex; align-items: center; border-radius: 8px; background: #eef2f7; color: #3a4658; padding: 4px 7px; font-size: 10px; font-weight: 850; }
.badge { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 750; letter-spacing: .2px; background: #eef2f7; color: #455265; white-space: nowrap; }
.badge.RECEIVED { background: var(--warning-soft); color: var(--warning); }
.badge.STORED { background: #eee8ff; color: #65449b; }
.storage-choice { margin: 20px 0; align-items: flex-start; }
.storage-choice small { display: block; margin-top: 5px; color: var(--muted); font-weight: 400; line-height: 1.5; }
.package-status-action { padding-bottom: 20px; }
.package-assignment { display: grid; gap: 16px; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.package-assignment > h3, .package-assignment > p, .package-assignment .toolbar { margin: 0; }
.package-assignment .reservation-list:empty, .package-assignment .error:empty { display: none; }
.package-assignment .guest-search { align-items: end; }
.package-assignment .manual-booking form { margin-top: 16px; }
.package-assignment .fee-quote p { margin: 8px 0 0; }
.package-status-action p { margin-top: 0; }
.badge.OUT_FOR_DELIVERY { background: var(--brand-soft); color: #2449bd; }
.badge.DELIVERED, .badge.COLLECTED { background: var(--success-soft); color: var(--success); }
.badge.EXCEPTION, .badge.RETURNED { background: var(--danger-soft); color: var(--danger); }
.empty { padding: 64px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin: 12px 0 5px; }
.empty p { margin: 0; }
.empty-icon { font-size: 37px; color: #9ca9bb; }

/* Scanner */
.scanner-layout > .review-panel { margin-top: 0; }
.scanner-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.scanner-panel, .preview-panel, .review-panel, .workflow-panel { padding: 21px; box-shadow: none; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 17px; }
.section-heading h3 { font-size: 21px; letter-spacing: -.4px; margin: 0; }
.section-heading .muted { margin: 5px 0 0; } .status-dot { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; background: #edf1f6; color: #4a586b; font-size: 10px; font-weight: 850; white-space: nowrap; }
.mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: #eef2f7; border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.mode-tab { border: 0; background: transparent; border-radius: 9px; padding: 9px 8px; font-weight: 800; color: var(--muted); }
.mode-tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(25, 39, 61, .08); }
.scanner-heading-actions { display: flex; align-items: center; gap: 9px; }
.scanner-close-button { display: none; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 27px; line-height: 1; }
.camera-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-bottom: 11px; }
.camera-stage { position: relative; aspect-ratio: 3 / 4; min-height: 280px; border-radius: 15px; overflow: hidden; background: #e8eef6; border: 1px solid var(--line); }
.camera-stage video { width: 100%; height: 100%; object-fit: cover; display: block; background: #d9e2ee; }
body:not(.scanner-fullscreen) .camera-toolbar,
body:not(.scanner-fullscreen) #cameraStage,
body:not(.scanner-fullscreen) #captureButton { display: none !important; }
#startCameraButton { min-height: 56px; font-size: 17px; }
.live-pill { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); background: rgba(20, 32, 51, .72); color: #fff; border: 0; backdrop-filter: blur(10px); border-radius: 999px; padding: 8px 12px; font-size: 11px; font-weight: 850; white-space: nowrap; }
.upload-dropzone { min-height: 330px; border: 2px dashed #c9d2e0; border-radius: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: #fafcff; color: var(--muted); cursor: pointer; text-align: center; padding: 25px; }
.upload-dropzone:hover, .upload-dropzone.dragover { border-color: var(--brand); background: #f3f6ff; }
.upload-dropzone strong { color: var(--ink); font-size: 16px; }
.upload-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--brand-soft); color: var(--brand); font-size: 27px; font-weight: 750; }
.scan-progress { background: #f7f9fc; border: 1px solid var(--line); border-radius: 13px; padding: 14px; margin-top: 14px; }

.progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.progress-track { height: 7px; border-radius: 999px; background: #e2e7ef; overflow: hidden; margin: 10px 0 7px; }
.progress-track > div { height: 100%; width: 0; background: var(--brand); border-radius: inherit; transition: width .2s ease; }
.scan-progress p { margin: 0; color: var(--muted); font-size: 11px; }
.preview-panel { position: static; }
.label-preview { display: block; width: 100%; max-height: 500px; object-fit: contain; border-radius: 13px; background: #f3f4f6; }
.barcode-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.barcode-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 8px; padding: 6px 8px; background: #edf1f7; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; color: #354257; }
.review-panel, .workflow-panel { margin-top: 16px; }
.review-simple { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 8px; }
.review-simple .wide-field { grid-column: 1 / -1; }
.custody-chain.compact-chain { grid-template-columns: 1fr 1fr; margin: 12px 14px; }
.guest-search { grid-template-columns: 1fr auto; margin: 12px 0 0; box-shadow: none; }
.custody-chain { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: start; margin: 8px 0 18px; }
.chain-node { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--surface-soft); display: grid; gap: 11px; }
.chain-node .eyebrow { margin: 0; }
.pms-form { display: grid; gap: 12px; margin: 16px 0; }
.reservation-board { margin-top: 18px; }

@media (max-width: 860px) {
  .custody-chain { grid-template-columns: 1fr; }
}
.ocr-details { margin-top: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; overflow: hidden; }
.ocr-details summary { cursor: pointer; padding: 12px 14px; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.ocr-details textarea { border-radius: 0; border-width: 1px 0 0; box-shadow: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.candidate-list { display: grid; gap: 7px; padding: 0 14px 12px; }
.candidate-row { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px; background: #fff; }
.candidate-row input { width: 16px; height: 16px; min-height: auto; accent-color: var(--brand); }
.candidate-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 800; overflow-wrap: anywhere; }
.candidate-meta { color: var(--muted); font-size: 10px; }
.candidate-score { font-weight: 750; color: var(--brand); font-size: 11px; }
.review-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 15px; }

/* Mobile camera fills the screen; desktop keeps the receiving workspace. */
@media (max-width: 1099px) {
body.scanner-fullscreen { overflow: hidden; background: #f2f5f9; }
body.scanner-fullscreen .sidebar,
body.scanner-fullscreen .page-header,
body.scanner-fullscreen .platform-footer { display: none; }
body.scanner-fullscreen main { padding: 0; }
body.scanner-fullscreen #scannerView { position: fixed; inset: 0; z-index: 100; overflow: hidden; background: #f2f5f9; }
body.scanner-fullscreen .scanner-layout { display: block; width: 100%; height: 100%; }
body.scanner-fullscreen .scanner-panel {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #111827;
  box-shadow: none;
}
body.scanner-fullscreen .preview-panel,
body.scanner-fullscreen #reviewPanel,
body.scanner-fullscreen #workflowPanel { display: none !important; }
body.scanner-fullscreen .section-heading {
  position: static;
  height: 0;
  margin: 0;
}
body.scanner-fullscreen .section-heading > div:first-child,
body.scanner-fullscreen .mode-tabs,
body.scanner-fullscreen #startCameraButton{ display: none !important; }
body.scanner-fullscreen .scanner-heading-actions {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 106;
}
body.scanner-fullscreen .scanner-close-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-color: rgba(255,255,255,.55);
  background: rgba(5,12,22,.66);
  backdrop-filter: blur(12px);
}
body.scanner-fullscreen #cameraMode {
  position: fixed;
  inset: 0;
  z-index: 101;
  display: block;
  width: 100vw;
  height: 100dvh;
  min-height: 100vh;
  margin: 0;
  background: #111827;
}
body.scanner-fullscreen .camera-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100% !important;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}
body.scanner-fullscreen .camera-toolbar {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 106;
  display: block;
  margin: 0;
}
body.scanner-fullscreen #cameraSelect,
body.scanner-fullscreen #startCameraButton { display: none !important; }
body.scanner-fullscreen #torchButton {
  min-width: 48px;
  height: 48px;
  padding: 0 15px;
  border-color: rgba(255,255,255,.55);
  background: rgba(5,12,22,.66);
  color: #fff;
  backdrop-filter: blur(12px);
}
body.scanner-fullscreen #captureButton {
  position: fixed;
  z-index: 106;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: auto;
  max-width: 640px;
  min-height: 62px;
  margin: 0 auto;
  font-size: 17px;
  box-shadow: 0 8px 22px rgba(40, 89, 255, .28);
}
body.scanner-fullscreen #scanProgress {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 108;
  max-width: 640px;
  margin: 0 auto;
}
body.scanner-fullscreen #scannerError {
  position: fixed;
  z-index: 108;
  top: calc(max(14px, env(safe-area-inset-top)) + 60px);
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(91, 12, 22, .84);
  color: #fff;
  text-align: center;
  backdrop-filter: blur(12px);
}
body.scanner-fullscreen #scannerError:empty { display: none; }
}
.scan-summary { display: grid; gap: 4px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 13px; margin-bottom: 14px; }
.scan-summary strong { font-size: 17px; }
.scan-summary span { color: var(--muted); font-size: 12px; }
.reservation-list { display: grid; gap: 8px; margin: 12px 0; }
.reservation-choice { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 11px; cursor: pointer; background: #fff; }
.reservation-choice:hover { border-color: #aabcf7; background: #f8faff; }
.reservation-choice input { width: 17px; height: 17px; min-height: auto; margin-top: 2px; accent-color: var(--brand); }
.reservation-choice span { display: grid; gap: 3px; }
.reservation-choice small { color: var(--muted); line-height: 1.4; }
.unmatched-choice { border-style: dashed; }
.compact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.full-button { grid-column: 1 / -1; width: 100%; }
.scan-success { text-align: center; padding: 18px; }
.scan-success-mark { margin: 0 auto 12px; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--success-soft); color: var(--success); font-size: 28px; font-weight: 750; }
.scan-success h3 { font-size: 23px; margin: 0 0 7px; }
.scan-success p { color: var(--muted); line-height: 1.55; max-width: 600px; margin: 0 auto 16px; }

/* Integration / settings */
.status-dot.waiting { background: var(--warning-soft); color: var(--warning); }
.status-dot.ready { background: var(--success-soft); color: var(--success); }
.status-dot.error { background: var(--danger-soft); color: var(--danger); }
.settings-grid { display: grid; grid-template-columns: 1fr; max-width: 800px; gap: 16px; }
.settings-card { padding: 22px; box-shadow: none; }
.settings-card h3 { margin: 0 0 9px; font-size: 21px; }
.settings-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
#propertyAddressSetting { min-height: 142px; padding: 14px 16px; line-height: 1.55; }
#savePropertyAddressButton { margin: 18px 0 20px; }
#propertyAddressStatus { min-height: 20px; margin: 12px 0 0; }
.shipper-form { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.shipper-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0 16px; }
.shipper-form-grid .wide-field { grid-column: span 2; }
.shipper-list { display: grid; gap: 8px; margin-top: 12px; }
.shipper-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.shipper-row strong { display: block; font-size: 15px; }
.shipper-row p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.shipper-row-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; font-size: 11px; font-weight: 750; color: #5b6b80; }
.shipper-code { background: #e8eef8; color: #1f3a63; border-radius: 999px; padding: 3px 8px; letter-spacing: .4px; }
.full-span { grid-column: 1 / -1; }
.capability-list { display: grid; gap: 9px; margin: 17px 0; }
.capability-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.capability-row strong.ok { color: var(--success); }
.capability-row strong.no { color: var(--danger); }

/* Drawer */
.backdrop { position: fixed; inset: 0; background: rgba(7, 14, 25, .46); z-index: 80; backdrop-filter: blur(2px); }
.drawer { position: fixed; z-index: 90; top: 0; right: 0; width: min(560px, 94vw); height: 100vh; overflow-y: auto; background: #fff; padding: 24px; box-shadow: -18px 0 52px rgba(14, 26, 43, .22); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding-bottom: 17px; border-bottom: 1px solid var(--line); margin-bottom: 17px; }
.drawer-head h2 { margin: 0; font-size: 25px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.detail-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfcfe; min-width: 0; }
.detail-box .label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .6px; }
.detail-box .value { margin-top: 5px; font-weight: 800; overflow-wrap: anywhere; }
.label-photo { width: 100%; max-height: 340px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: #f4f5f7; margin-top: 15px; }
.raw-label { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 11px; color: #4b596d; max-height: 220px; overflow: auto; }
.timeline { margin-top: 22px; }
.timeline h3 { margin-bottom: 16px; }
.timeline-item { position: relative; padding: 0 0 21px 26px; border-left: 2px solid #e0e5ed; margin-left: 5px; }
.timeline-item:last-child { border-left-color: transparent; }
.timeline-dot { position: absolute; left: -7px; top: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 3px solid #dbe4ff; }
.timeline-title { font-weight: 850; }
.timeline-meta { color: var(--muted); font-size: 11px; margin-top: 3px; }
.proof-photo { width: 100%; max-height: 250px; object-fit: cover; border-radius: 11px; margin-top: 10px; }

.preview-panel .label-preview { max-height: 360px; }

@media (max-width: 850px) {
  .login-shell { padding: 20px; }
  .login-panel { padding: 24px; }
  body:has(> .app-shell:not(.hidden)) { height: 100dvh; min-height: 0; overflow: hidden; }
  /* Reserve space for navigation instead of overlaying the iPhone scroll viewport. */
  .app-shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  }
  .sidebar {
    position: static;
    inset: auto;
    order: 2;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    padding: 6px 8px max(8px, env(safe-area-inset-bottom));
    flex-direction: row;
    align-items: center;
    z-index: 60;
    background: #fff;
    color: var(--ink);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(18, 32, 51, .06);
  }
  .sidebar > .brand-lockup, .sidebar-bottom { display: none; }
  .sidebar nav { margin: 0; width: 100%; }
  .nav-item { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); border-radius: 10px; }
  .nav-item:hover, .nav-item.active { background: var(--brand-soft); color: var(--brand); }
  .nav-item.active { box-shadow: none; }
  .nav-icon { font-size: 16px; }
  main {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-padding-block: 16px 110px;
  }
  main > * { flex-shrink: 0; }
  .page-header { align-items: center; gap: 10px; margin-bottom: 16px; }
  .page-header h2 { font-size: 22px; letter-spacing: -.4px; }
  .header-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .header-actions .primary, .header-actions .secondary { min-height: 44px; padding: 8px 12px; font-size: 13px; }
  body.desk-scanner:not(.has-capture) .preview-panel { display: none; }
  .toolbar { grid-template-columns: 1fr; }
  .review-simple { grid-template-columns: 1fr; }
  .review-simple .wide-field { grid-column: auto; }
  .custody-chain.compact-chain { grid-template-columns: 1fr; }
  .guest-search { grid-template-columns: 1fr; }
  .compact-fields { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .full-span { grid-column: auto; }
  .shipper-form-grid { grid-template-columns: 1fr; }
  .shipper-form-grid .wide-field { grid-column: auto; }
  .shipper-row { flex-direction: column; }
  input, select, textarea { font-size: 16px; min-height: 42px; padding: 9px 11px; }
  label { font-size: 12px; font-weight: 650; }
  .custody-chain { margin: 0 0 12px; gap: 10px; }
  .chain-node { padding: 12px; }
  .section-heading h3 { font-size: 18px; }
  .scanner-panel, .preview-panel, .review-panel, .workflow-panel { padding: 14px; }
  .review-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .review-actions .primary, .review-actions .secondary { width: 100%; min-height: 46px; }
}

@media (max-width: 560px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .summary-card { padding: 14px; }
  .camera-toolbar { grid-template-columns: 1fr 1fr; }
  .camera-toolbar select { grid-column: 1 / -1; }
  .camera-stage { min-height: 220px; }
  .mode-tab { font-size: 11px; padding-inline: 4px; }
  .detail-grid { grid-template-columns: 1fr; }
  table { min-width: 640px; }
}

/* Account users */
.users-layout { display: grid; grid-template-columns: 1fr; max-width: 900px; gap: 18px; align-items: start; }
.users-list-panel { padding: 24px; }
.user-create-form { display: grid; gap: 16px; padding: 0; }
.users-layout h3 { margin: 4px 0 0; }
.user-create-form .muted { margin: 0; }
.users-list { display: grid; gap: 14px; margin-top: 20px; }
.user-card { border: 1px solid var(--line); border-radius: 13px; padding: 18px; }
.user-card-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.user-card-heading > div { min-width: 0; overflow-wrap: anywhere; }
.user-self { color: var(--muted); font-size: 11px; font-weight: 600; padding-left: 5px; }
.user-status { white-space: nowrap; padding: 4px 9px; border-radius: 20px; font-size: 11px; font-weight: 800; }
.user-status.is-active { color: var(--success); background: var(--success-soft); }
.user-status.is-inactive { color: var(--muted); background: #edf1f7; }
.user-access-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.user-access-controls label { flex: 1; min-width: 120px; }
.user-access-controls .text-button { min-height: 43px; }
.user-self-note { margin-bottom: 0; font-size: 11px; }
@media (max-width: 600px) { .users-list-panel { padding: 18px; } .users-list-panel .section-heading { align-items: start; flex-wrap: wrap; } }

/* Consistent actions and responsive operations. */
a.primary, a.secondary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #7494ff; outline-offset: 3px; }
.primary, .secondary { min-height: 44px; line-height: 1.35; }
.mobile-more { display: none; }
.page-header > div, .section-heading > div { min-width: 0; }
.desk-notice:not(.hidden) { padding: 13px 16px; border: 1px solid #cde5da; border-radius: 12px; background: var(--success-soft); color: var(--success); line-height: 1.5; font-size: 14px; }
.desk-notice.error { background: var(--danger-soft); color: var(--danger); border-color: #f1c4ca; }
.package-link { padding: 0; border: 0; background: transparent; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 750; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.booking-roster-panel, .integration-panel { max-width: 1100px; padding: 24px; margin-bottom: 20px; box-shadow: none; }
.booking-roster-panel .section-heading { align-items: center; }
.booking-roster-panel .section-heading .primary { flex-shrink: 0; }
.roster-status { padding: 14px 16px; margin: 0; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.booking-roster-panel > .muted { margin: 12px 0 0; }
.reservation-board { margin-top: 20px; }
.connection-settings { border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; margin: 18px 0; }
.connection-settings > summary, .reservation-list-details > summary { cursor: pointer; padding: 16px 0; font-size: 14px; font-weight: 750; }
.connection-settings .pms-form { margin-top: 0; }
.connection-settings .review-actions { justify-content: flex-start; }
.connection-settings p { line-height: 1.55; }
#streamlineBrowserStatus { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
#streamlineMfaForm { padding: 18px; border: 1px solid #d4defe; border-radius: 12px; background: var(--brand-soft); }
#streamlineMfaForm .primary { justify-self: start; }
.queue-table td:last-child { display: flex; flex-wrap: wrap; gap: 8px; }
.integration-panel table, .booking-roster-panel table { min-width: 0; }
.reservation-list-details { margin-top: 8px; }
.reservation-sync-panel { display: grid; gap: 16px; }
.reservation-sync-panel > * { min-width: 0; margin: 0; }
.reservation-sync-panel > button { justify-self: start; }
.reservation-sync-panel > :empty { display: none; }
.reservation-sync-panel > .reservation-list-details > summary { padding: 12px 0; }
#integrationStatus { color: var(--muted); font-size: 14px; line-height: 1.6; }
.reservation-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.reservation-form { display: grid; gap: 14px; }
.reservation-form > p { margin: 0; }
.reservation-field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.reservation-form input, .reservation-field-pair > label { min-width: 0; }
.reservation-form .field-help { font-size: 12px; font-weight: 400; color: var(--muted); }
.reservation-filter { margin-top: 14px; }
.reservation-edit { display: block; margin-top: 4px; }
.reservation-import-dialog { width: min(680px, calc(100vw - 32px)); }
.reservation-import-dialog > label { margin-top: 18px; }
#reservationImportErrors { white-space: pre-line; font-size: 13px; }
#reservationImportPreview { max-height: 280px; overflow: auto; }
#reservationImportPreview table { min-width: 0; width: 100%; font-size: 13px; }
#reservationImportPreview td { overflow-wrap: anywhere; }
#reservationImportPreview caption { text-align: left; padding: 12px 0; color: var(--muted); }
#moreReservations { margin-top: 16px; }
@media (max-width: 600px) {
  .reservation-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .reservation-field-pair { grid-template-columns: 1fr; }
  #downloadReservationTemplate, #refreshBookingsNow { width: 100%; }
}
.reservation-list-details .reservation-board { margin-top: 0; max-height: 500px; overflow: auto; }

/* A single destination and guest remain visible for each selected package. */
#deliverView { max-width: 1100px; }
.delivery-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px; margin-bottom: 16px; box-shadow: none; }
.delivery-heading h3 { margin: 0; font-size: 21px; letter-spacing: -.4px; }
.delivery-heading p { margin: 6px 0 0; }
.delivery-heading button { flex-shrink: 0; }
.delivery-toolbar { grid-template-columns: minmax(0, 1fr); align-items: end; }
.delivery-list-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 4px 0 12px; }
.check-label { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.5; cursor: pointer; }
input[type=checkbox] { flex: 0 0 auto; width: 20px; height: 20px; min-height: 20px; padding: 0; accent-color: var(--brand); }
input[role=switch] { appearance: none; width: 42px; height: 24px; border-radius: 20px; border: 0; background: var(--muted); cursor: pointer; }
input[role=switch]::before { content: ""; display: block; width: 18px; height: 18px; margin: 3px; border-radius: 50%; background: #fff; }
input[role=switch]:checked { background: var(--brand); }
input[role=switch]:checked::before { transform: translateX(18px); }
.delivery-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.delivery-card { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px; box-shadow: none; }
.delivery-card.is-selected { border-color: var(--brand); background: #f5f8ff; box-shadow: inset 0 0 0 1px var(--brand); }
.delivery-choice { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; cursor: pointer; padding: 4px 0; }
.delivery-card-body { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.delivery-unit { font-size: 16px; color: var(--ink); line-height: 1.4; }
.delivery-guest { color: var(--ink-soft); font-size: 14px; font-weight: 650; }
.delivery-card .muted { font-size: 12px; font-weight: 450; }
.delivery-details { padding: 10px 4px; min-height: 44px; font-size: 12px; align-self: end; }
.delivery-warning { color: #8a4900; background: var(--warning-soft); padding: 7px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.delivery-selection-bar { position: sticky; bottom: 18px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; margin-top: 18px; border-color: #ccd7ee; box-shadow: 0 6px 24px rgba(19,33,55,.1); }
.delivery-selection-bar > div { display: grid; gap: 4px; }
.delivery-selection-bar strong { font-size: 14px; }
.delivery-selection-bar .text-button { font-size: 12px; text-align: left; }
.load-more { display: block; margin: 18px auto 0; }
#deliveryError:empty, #bulkDeliveryError:empty { display: none; }
#deliveryError { margin-bottom: 12px; }
.app-dialog { border: 1px solid var(--line); padding: 24px; border-radius: 20px; color: var(--ink); background: #fff; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; box-shadow: 0 24px 80px rgba(9,20,39,.25); }
.app-dialog::backdrop { background: rgba(13,23,38,.5); backdrop-filter: blur(3px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.dialog-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.dialog-heading .icon-button { flex: 0 0 42px; }
.delivery-review-list { display: grid; gap: 10px; margin: 18px 0; max-height: 38dvh; overflow-y: auto; }
.delivery-review-item { display: grid; gap: 5px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; overflow-wrap: anywhere; }
.delivery-review-item p { margin: 6px 0; }
.optional-label { display: inline; font-weight: 450; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
#bulkDeliveryError { margin-top: 12px; }
.more-links { display: grid; gap: 10px; margin-top: 18px; }
.more-links .nav-item { display: flex; align-items: center; color: var(--ink); padding: 15px; font-size: 15px; background: var(--surface-soft); }
.more-links .nav-item:hover { color: var(--brand); background: var(--brand-soft); }
.more-links .secondary { margin-top: 6px; }

@media (max-width: 850px) {
  .sidebar nav { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; }
  .sidebar [data-secondary-nav] { display: none !important; }
  .sidebar .mobile-more { display: grid; }
  .sidebar .nav-item { min-height: 55px; min-width: 0; align-content: center; padding: 7px 2px; }
  .sidebar .nav-item span:last-child { white-space: nowrap; }
  main { padding: 22px 16px 24px; }
  .page-header { margin-bottom: 20px; }
  .page-header h2 { font-size: 26px; }
  .booking-roster-panel, .integration-panel, .settings-card, .users-list-panel { padding: 20px; border-radius: 16px; }
  .integration-panel .section-heading { flex-wrap: wrap; align-items: center; gap: 12px; }
  .booking-roster-panel .section-heading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .booking-roster-panel .section-heading button { width: 100%; }
  .delivery-heading { padding: 18px; align-items: flex-start; flex-direction: column; gap: 14px; }
  .delivery-heading .secondary { width: 100%; font-size: 13px; }
  .delivery-toolbar { padding: 14px; grid-template-columns: minmax(0,1fr); gap: 10px; }
  .delivery-toolbar .secondary { font-size: 12px; padding: 10px; }
  .delivery-list { grid-template-columns: minmax(0, 1fr); }
  .delivery-list-heading { flex-wrap: wrap; gap: 8px; }
  .delivery-list-heading .muted { font-size: 12px; }
  .delivery-card { padding: 14px; }
  .delivery-selection-bar { bottom: 0; padding: 12px; gap: 12px; }
  .delivery-selection-bar .text-button { min-height: 44px; }
  .delivery-selection-bar strong { font-size: 12px; }
  .delivery-selection-bar .primary { font-size: 13px; padding: 12px; }
  .responsive-table { min-width: 0; display: block; }
  .responsive-table thead { display: none; }
  .responsive-table tbody { display: block; }
  .responsive-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); padding: 16px; gap: 14px 16px; border-bottom: 1px solid var(--line); }
  .responsive-table tr:last-child { border-bottom: 0; }
  .responsive-table td { display: block; padding: 0; border: 0; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
  .responsive-table td::before { content: attr(data-label); display: block; text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .7px; color: var(--muted); margin-bottom: 6px; }
  .queue-table td:first-child, .queue-table td:nth-child(4), .queue-table td:last-child { grid-column: 1 / -1; }
  .package-table tr { grid-template-areas: "guest unit" "from from" "tracking status"; gap: 10px 16px; }
  .package-table td:nth-child(1) { grid-area: tracking; }
  .package-table td:nth-child(2) { grid-area: from; }
  .package-table td:nth-child(3) { grid-area: guest; font-size: 16px; }
  .package-table td:nth-child(4) { grid-area: unit; text-align: right; font-weight: 650; }
  .package-table td:nth-child(5) { grid-area: status; align-self: end; text-align: right; }
  .package-table td:nth-child(6) { display: none; }
  .package-table td:nth-child(1)::before, .package-table td:nth-child(3)::before, .package-table td:nth-child(5)::before { display: none; }
  .package-table .package-link { font-size: 12px; }
  .queue-table td:last-child { display: flex; gap: 8px; }
  .queue-table td:last-child::before { display: none; }
  .queue-table .secondary { font-size: 12px; }
  .reservation-table tr { padding-inline: 0; }
  .app-dialog { max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overscroll-behavior-y: contain; }
  .more-dialog { margin: auto; }
  .more-links .nav-item { display: flex; justify-content: flex-start; text-align: left; gap: 12px; }
  .drawer { width: 100%; height: 100dvh; padding: calc(20px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); overscroll-behavior-y: contain; }
}
@media (max-width: 380px) {
  main { padding-inline: 12px; }
  .booking-roster-panel, .integration-panel { padding: 16px; }
  .delivery-card { gap: 8px; padding: 12px; }
  .delivery-choice { gap: 10px; }
  .delivery-unit { font-size: 14px; }
  .app-dialog { padding: 18px; }
  .dialog-actions { display: grid; grid-template-columns: 1fr; }
  .dialog-actions .primary { grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) { .view-section { animation: none; } }
@media (max-width: 850px) {
  .summary-grid { gap: 8px; }
  .summary-card { padding: 12px; }
  .summary-card .value { font-size: 24px; }
  .summary-card .label { font-size: 11px; line-height: 1.4; }
}
@media (min-width: 600px) and (max-width: 850px) {
  #packagesView .toolbar { grid-template-columns: minmax(0, 1fr) 180px; }
}

.admin-navigation { display: flex; gap: 8px; margin: 0 0 24px; border-bottom: 1px solid var(--line); }
.admin-navigation a { padding: 12px 16px; min-height: 44px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font-size: 14px; font-weight: 650; }
.admin-navigation a.active { color: var(--brand); border-bottom-color: var(--brand); }
summary { cursor: pointer; min-height: 44px; padding-block: 12px; font-weight: 650; }
details.panel > summary { color: var(--ink); }
details.panel[open] > summary { margin-bottom: 12px; }
.list-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; }
.list-footer .text-button, .package-link { min-height: 44px; }
#scannerView { max-width: 1280px; }
.receive-details { min-width: 0; }
.receive-empty { display: none; }
.camera-start > p { margin: 0 0 16px; }
#scannerError:empty, #scanError:empty { display: none; }
.review-panel, .preview-panel { padding: 16px 22px; }
.raw-text-label { padding: 12px; }
.manual-booking { margin: 12px 0; }
.user-access-controls { padding-top: 12px; }
@media (max-width: 1099px) {
  body.has-capture .scanner-panel .section-heading,
  body.has-capture .mode-tabs,
  body.has-capture #cameraMode,
  body.has-capture #uploadMode,
  body.has-capture #manualMode { display: none !important; }
  body.has-capture .scanner-panel { padding: 0; border: 0; background: transparent; }
  body.scanner-fullscreen .camera-start { display: none; }
}
@media (max-width: 850px) {
  .admin-navigation { margin-bottom: 18px; }
  .admin-navigation a { flex: 1; text-align: center; padding-inline: 8px; }
  .review-panel, .preview-panel { padding: 12px 16px; }
  .login-panel { border: 0; }
  .login-shell { background: #fff; }
}

/* Desktop workspace: compact controls, a readable content width and parallel review. */
@media (min-width: 851px) {
  .app-shell { grid-template-columns: 216px minmax(0, 1fr); }
  main { width: 100%; max-width: 1400px; margin-inline: auto; padding: 28px clamp(24px, 3vw, 48px) 32px; }
  .sidebar { padding: 24px 16px; }
  .nav-item { font-size: 14px; min-height: 44px; }
  .profile-row > div:last-child { min-width: 0; }
  .page-header { margin-bottom: 24px; }
  .eyebrow { font-size: 11px; letter-spacing: .08em; }
  .scanner-panel .section-heading h3 { font-size: 18px; }
  .mode-tab { min-height: 40px; font-size: 13px; }
  #startCameraButton { width: auto; min-height: 44px; font-size: 14px; padding-inline: 24px; }
  .camera-start { min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
  .upload-dropzone { min-height: 250px; }
  .upload-dropzone:focus-within { outline: 3px solid #7494ff; outline-offset: 3px; }
}
@media (min-width: 1100px) {
  #scannerView { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(380px, 1.1fr); gap: 24px; align-items: start; }
  .scanner-layout { min-width: 0; }
  #workflowPanel { margin-top: 0; }
  body.has-capture .scanner-panel .scan-mode-panel { display: none; }
  body.has-capture .scanner-panel .section-heading p { display: none; }
  .receive-empty { display: flex; min-height: 390px; padding: 40px; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: transparent; border-style: dashed; }
  .receive-empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #e5ebf5; color: var(--muted); font-size: 24px; }
  .receive-empty h3 { margin: 18px 0 8px; font-size: 18px; }
  .receive-empty p { max-width: 300px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
  .receive-empty p + p { margin-top: 14px; font-size: 12px; }
  .receive-details:has(#workflowPanel:not(.hidden)) .receive-empty { display: none; }
  .review-simple { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-simple .wide-field { grid-column: auto; }
  .custody-chain.compact-chain { grid-template-columns: minmax(0, 1fr); }
  .scanner-panel .error:not(:empty) { margin-top: 12px; }
  body.scanner-fullscreen .camera-start { display: none; }
  body.scanner-fullscreen .scanner-close-button { display: grid; place-items: center; flex-shrink: 0; background: #edf1f7; color: var(--ink); border: 0; }
  body.scanner-fullscreen .camera-stage { aspect-ratio: 4 / 3; min-height: 0; }
  body.scanner-fullscreen #captureButton { margin-top: 12px; min-height: 44px; font-size: 14px; }
}

.system-request-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;min-height:44px;padding:13px 20px;border-radius:12px;background:var(--blue,#2e54ff);color:#fff;font-weight:700}
@media(max-width:700px){.system-request-link{width:100%;text-align:center}}

.reservation-session-banner { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 18px; margin-bottom:20px; border:1px solid var(--line); border-radius:12px; background:#fff; font-size:14px; line-height:1.5; }
.reservation-session-banner .text-button { flex-shrink:0; }
.reservation-session-dialog #reservationSessionDescription { margin:20px 0; line-height:1.6; }
.reservation-session-fields { display:grid; gap:18px; }
.reservation-session-fields .field-help { margin:0; font-size:12px; line-height:1.6; color:var(--muted); }
.reservation-session-options { margin-top:22px; font-size:14px; }
.reservation-session-options summary { cursor:pointer; color:var(--muted); }
.reservation-session-option-buttons { display:flex; flex-wrap:wrap; gap:16px; padding-top:16px; }
.reservation-session-dialog .error:empty { display:none; }
@media(max-width:600px) { .reservation-session-banner { align-items:flex-start; flex-direction:column; gap:8px; } .reservation-session-dialog { padding:24px; } .reservation-session-dialog .dialog-actions { display:grid; grid-template-columns:1fr; } .reservation-session-dialog .dialog-actions .primary { grid-row:1; } }

.shipping-log-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.shipping-log-setup { margin-top: 16px; }
.shipping-log-setup ol { padding-left: 24px; }
.shipping-log-setup li { margin: 12px 0; line-height: 1.6; }
#shippingLogKeyPanel { margin-top: 20px; }
#shippingLogKeyPanel button { margin-top: 12px; }
@media (max-width: 600px) { .shipping-log-actions > button { width: 100%; } }

.account-reservation-session { padding: 12px 0; border-bottom: 1px solid var(--line); }
.account-reservation-session p { margin: 4px 12px 12px; font-size: 13px; line-height: 1.5; }

/* Staff parcel recipients use the same settings rhythm on desktop and mobile. */
.staff-recipient-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 16px; margin: 20px 0; }
.staff-recipient-form label { min-width: 0; }
.staff-recipient-form input { width: 100%; }
.staff-recipient-row { border-top: 1px solid #dce3ef; padding: 16px 0; }
.staff-recipient-row summary { cursor: pointer; }
.staff-recipient-row summary span { display: block; margin: 6px 0 0 20px; color: #566680; font-size: 14px; }
@media (max-width: 720px) {
  .staff-recipient-form { grid-template-columns: 1fr; }
  .staff-recipient-form button { width: 100%; }
}

.reservation-login-inline { max-width: 640px; }
.reservation-login-inline #reservationSessionDescription { margin: 18px 0 22px; line-height: 1.6; }
.reservation-login-inline .reservation-session-fields input { width: 100%; }
.reservation-login-inline .error:empty { display: none; }
#resumeSavedReservationLogin { margin-top: 18px; }
@media (max-width: 600px) {
  .reservation-login-inline .dialog-actions { display: grid; grid-template-columns: 1fr; }
  .reservation-login-inline .dialog-actions button, #resumeSavedReservationLogin { width: 100%; }
}

/* Named storage and recipient changes reuse the existing settings/drawer layout. */
.storage-picker { margin: 16px 0; display: grid; gap: 16px; }
.parcel-reference { margin: 16px 0 24px; }
.parcel-reference summary { cursor: pointer; font-weight: 700; }
.parcel-reference form, .parcel-reference > label { margin-top: 16px; }
.reference-input-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.reference-input-row input { min-width: 0; flex: 1; }
.reference-input-row button { flex: 0 0 auto; }
.parcel-reference p { margin: 12px 0 16px; }
.package-status-action .error:empty, .parcel-reference .error:empty { display: none; }
@media (max-width: 480px) { .reference-input-row { flex-wrap: wrap; } .reference-input-row input { flex-basis: 100%; } }
.storage-picker select { width: 100%; }
.package-assignment-change { margin: 0 0 24px; padding: 16px; border: 1px solid var(--line, #dce2ee); border-radius: 12px; }
.package-assignment-change > summary { cursor: pointer; font-weight: 700; }
.package-assignment-change[open] > summary { margin-bottom: 16px; }
.assignment-warning { border-left: 3px solid #b7791f; padding-left: 12px; }
@media (min-width: 701px) {
  #storageLocationSettings .staff-recipient-form { grid-template-columns: minmax(0, 1fr) auto; }
}
