/* Two shapes only: everything you can press is a capsule (buttons, inputs, chips, codes, status,
   standalone rows, the tab bar); everything that holds content is a 22px card. Nested corners stay
   concentric: inner radius = outer radius - inset (tab bar 30 - 6 = pill 24, card 22 - 10 = thumb 12).
   Cards float on a cool paper with layered shadow instead of hairline borders.
   Chinese text uses two weights (400 / 600); Barlow carries codes and every count.
   No top bar on root tabs: large titles sit in the content; pushed pages get a floating back button. */
@font-face {
  font-family: Barlow;
  src: url('/static/fonts/barlow-600-latin.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Barlow;
  src: url('/static/fonts/barlow-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
:root {
  --ink: #17191C;
  --ink-2: #6B7079;
  --ink-3: #A4A9B2;
  --paper: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #F8F9FA;
  --fill: #ECEEF1;
  --line: #E6E8EC;
  --action: #2563EB;
  --action-tint: #2563EB14;
  --ok: #12A150;
  --mine: #2563EB;
  --taken: #E08600;
  --late: #E5484D;
  --off: #8B9099;
  --ok-tint: #12A1501A;
  --mine-tint: #2563EB14;
  --taken-tint: #E086001F;
  --late-tint: #E5484D1A;
  --off-tint: #8B90991F;
  --blue: var(--action);
  --green: var(--ok);
  --red: var(--late);
  --orange: var(--taken);
  --muted: var(--ink-2);
  --capsule: 999px;
  --r-card: 22px;
  --r-inner: 12px;
  --r-sheet: 28px;
  --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'HarmonyOS Sans SC', 'MiSans', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  --tabs-height: calc(84px + env(safe-area-inset-bottom, 0px));
  --actions-height: 72px;
  --card-edge: 0 0 0 .5px #1118270d, 0 1px 2px #1118270a, 0 6px 16px -6px #11182714;
  --float-shadow: 0 0 0 .5px #1118270f, 0 10px 30px -6px #11182729;
  --num: 600 1em/1 Barlow, var(--font);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  overscroll-behavior: none;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overscroll-behavior: none;
}
main {
  max-width: 640px;
  margin: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px calc(var(--tabs-height) + var(--actions-height) + 16px);
}
h1, h2, h3 {
  line-height: 1.3;
  font-weight: 600;
  overflow-wrap: anywhere;
}
h1 {
  font-size: 22px;
  margin: 16px 0 12px;
}
h2 {
  font-size: 17px;
  margin: 0 0 12px;
}
h3 {
  font-size: 16px;
  margin: 0 0 6px;
}
p {
  margin: 12px 0;
}
small, .muted {
  font-size: 13px;
  color: var(--ink-2);
}
a {
  color: var(--action);
  text-decoration: none;
}
button, input, select, textarea {
  font: inherit;
}
button, a, input, label, summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  border: 0;
  cursor: pointer;
  border-radius: var(--capsule);
  background: var(--action);
  color: white;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  min-height: 50px;
  transition: opacity 120ms, background-color 120ms;
}
button:disabled {
  opacity: .4;
  cursor: not-allowed;
}
button:active:not(:disabled) {
  opacity: .7;
}
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}
input:not([type=checkbox]), textarea, select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--capsule);
  background: var(--surface);
  color: var(--ink);
  margin-top: 6px;
  font-size: 16px;
}
textarea {
  border-radius: 18px;
  min-height: 96px;
}
input:not([type=checkbox]):focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--action);
  box-shadow: 0 0 0 3px var(--action-tint);
}
input::placeholder, textarea::placeholder {
  color: var(--ink-3);
}
label {
  display: block;
}
.form-field > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.secondary {
  background: var(--action-tint);
  color: var(--action);
}
.quiet {
  background: transparent;
  color: var(--action);
  font-size: 15px;
  font-weight: 500;
  min-height: 44px;
}
.danger {
  background: var(--late-tint);
  color: var(--late);
}
.wide {
  width: 100%;
}
.stack, form, #drawer-content, .scan-entry-buttons, .registration {
  display: grid;
  gap: 12px;
}
.stack > *, #drawer-content > * {
  margin-top: 0;
  margin-bottom: 0;
}
.card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--card-edge);
  padding: 16px;
  margin: 0 0 16px;
}
.row, .switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.row + .row {
  border-top: 1px solid var(--line);
}
.row > span:first-child {
  flex-shrink: 0;
  color: var(--ink-2);
}
.row > strong {
  text-align: right;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.card.row {
  padding: 16px;
}
.count {
  font: 600 1.08em/1 Barlow, var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  margin-left: 2px;
}
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.empty, .quiet-line {
  color: var(--ink-2);
  padding: 20px 16px;
  margin: 0;
  font-size: 14px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* No bar on root tabs; pushed pages get a floating back button and a centred title */
#app-header {
  position: sticky;
  top: 0;
  z-index: 15;
  height: calc(env(safe-area-inset-top, 0px) + 56px);
  padding: env(safe-area-inset-top, 0px) 12px 0;
  display: flex;
  align-items: center;
  background: linear-gradient(var(--paper) 55%, #f4f5f700);
}
#app-header.is-root {
  display: none;
}
#page-title {
  position: absolute;
  left: 72px;
  right: 72px;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.header-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
}
.icon-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--card-edge);
  border-radius: var(--capsule);
}
.large-title {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .3px;
  line-height: 1.25;
  margin: 12px 4px 20px;
}

/* Floating capsule tab bar that hugs its icons; the active pill is concentric (30 - 6 = 24) */
#tabs {
  position: fixed;
  z-index: 25;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  height: 60px;
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: var(--capsule);
  background: var(--surface);
  box-shadow: var(--float-shadow);
}
#tabs button {
  width: 68px;
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink-3);
  background: transparent;
  border-radius: var(--capsule);
  transition: background-color 160ms, color 160ms;
}
#tabs button.active {
  color: var(--action);
  background: var(--action-tint);
}
#tabs button:active:not(:disabled) {
  opacity: .6;
}
@supports (backdrop-filter: blur(20px)) {
  #tabs {
    background: #ffffffd1;
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
  }
}
#dev-banner {
  display: none;
  padding: 4px 12px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  text-align: center;
}
html[data-dev=true] #dev-banner {
  display: block;
}
#dev-banner a {
  color: white;
}
#inventory-banner {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  z-index: 14;
  width: fit-content;
  margin: 8px auto 0;
  padding: 6px 16px;
  border-radius: var(--capsule);
  background: linear-gradient(var(--action-tint), var(--action-tint)), var(--surface);
  box-shadow: var(--card-edge);
  color: var(--action);
  font-size: 13px;
  font-weight: 600;
}
.fixed-action {
  position: fixed;
  z-index: 20;
  bottom: var(--tabs-height);
  left: 0;
  right: 0;
  max-width: 640px;
  margin: auto;
  display: flex;
  gap: 12px;
  padding: 16px 16px 12px;
  background: linear-gradient(#f4f5f700, var(--paper) 35%);
  min-height: var(--actions-height);
}
.fixed-action > button {
  flex: 1;
  min-height: 48px;
}
#toast, #retry {
  position: fixed;
  z-index: 60;
  left: 16px;
  right: 16px;
  max-width: 608px;
  margin: auto;
  bottom: calc(var(--tabs-height) + var(--actions-height) + 12px);
  border-radius: var(--capsule);
  padding: 12px 16px;
  box-shadow: var(--float-shadow);
}
#toast {
  background: #17191Ceb;
  color: white;
  pointer-events: none;
  opacity: 0;
  font-size: 14px;
  transition: opacity 160ms;
}
#retry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  font-size: 14px;
}
#retry button {
  margin-left: 12px;
  min-height: 36px;
  padding: 6px 14px;
  font-size: 14px;
}

/* Tag codes: a quiet engraved label, never a second status marker */
.tag-plate {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 1px 8px;
  border-radius: var(--capsule);
  background: var(--fill);
  color: var(--ink-2);
  font: 600 13px/1.4 Barlow, var(--font);
  letter-spacing: .4px;
  vertical-align: middle;
}
.tag-plate.large {
  font-size: 18px;
  padding: 4px 16px;
  border-radius: var(--capsule);
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* Result page */
.result {
  --status: var(--ok);
  --status-tint: var(--ok-tint);
  text-align: center;
  padding: 24px 0 24px;
}
.result.blue {
  --status: var(--mine);
  --status-tint: var(--mine-tint);
}
.result.orange {
  --status: var(--taken);
  --status-tint: var(--taken-tint);
}
.result.gray {
  --status: var(--off);
  --status-tint: var(--off-tint);
}
.result.red {
  --status: var(--late);
  --status-tint: var(--late-tint);
}
.band-heading {
  display: grid;
  justify-items: center;
  gap: 10px;
}
.band-heading h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}
.result-symbol {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: var(--capsule);
  color: var(--status);
  background: linear-gradient(var(--status-tint), var(--status-tint)), var(--surface);
  margin-bottom: 4px;
  animation: symbol-in 200ms cubic-bezier(.2, .8, .2, 1);
}
.result-symbol svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}
.result p {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}
.device-card {
  border-radius: var(--r-card);
}
.device-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}
.device-copy {
  flex: 1;
  min-width: 0;
}
.device-copy h2 {
  font-size: 17px;
  margin: 0 0 2px;
}
.accessories, .tips {
  font-size: 14px;
  color: var(--ink-2);
  padding: 12px 0 0;
  margin: 12px 0 0;
  border-top: 1px solid var(--line);
}
.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stepper strong {
  font-variant-numeric: tabular-nums;
  font: 600 18px/1 Barlow, var(--font);
  min-width: 3em;
  text-align: center;
}
.stepper button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 18px;
  border-radius: var(--capsule);
}
.actions {
  display: flex;
  gap: 12px;
}
.actions > * {
  flex: 1;
}
#scan-next {
  width: 100%;
  margin-top: 12px;
}
.home-link {
  display: block;
  padding: 16px;
  text-align: center;
  font-weight: 500;
}

/* Scan home */
.home > div + div {
  margin-top: 16px;
}
.home > div:empty {
  display: none;
}
.home-guide {
  display: grid;
  justify-items: center;
  text-align: center;
  align-content: center;
  min-height: min(52vh, 420px);
  padding: 40px 24px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--card-edge);
}
.nfc-ripple {
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}
.nfc-ripple::before, .nfc-ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--capsule);
  border: 1.5px solid var(--action);
  opacity: 0;
  animation: ripple 2.8s cubic-bezier(.2, .6, .3, 1) infinite;
}
.nfc-ripple::after {
  animation-delay: 1.4s;
}
.home-guide svg {
  position: relative;
  box-sizing: content-box;
  width: 30px;
  height: 30px;
  padding: 19px;
  border-radius: var(--capsule);
  color: var(--action);
  background: linear-gradient(var(--action-tint), var(--action-tint)), var(--surface);
}
.home-guide h2 {
  font-size: 20px;
  margin: 0 0 8px;
}
.home-guide p {
  color: var(--ink-2);
  font-size: 15px;
  max-width: 20em;
  margin: 0;
}
#home-loans h2 {
  margin-top: 12px;
}
.scan-primary {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 17px;
}
.scan-caption {
  font-size: 14px;
  font-weight: 400;
  opacity: .8;
}
.scan-entry-buttons p {
  text-align: center;
  margin: 0;
}

/* One list row shared across catalog, loans and administration */
.compact-list {
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--card-edge);
  overflow: hidden;
}
.compact-row, .notice-row {
  position: relative;
}
.compact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 12px 16px;
  text-align: left;
  border-radius: 0;
  color: var(--ink);
  background: var(--surface);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
}
.compact-row:active:not(:disabled), .notice-row:active:not(:disabled) {
  opacity: 1;
  background: var(--surface-2);
}
.compact-row::after, .notice-row::after {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin: 0 2px 0 auto;
  border-top: 1.5px solid var(--ink-3);
  border-right: 1.5px solid var(--ink-3);
  transform: rotate(45deg);
}
.compact-row + .compact-row::before, .notice-row + .notice-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 72px;
  right: 0;
  border-top: 1px solid var(--line);
}
.notice-row + .notice-row::before {
  left: 16px;
}
.compact-copy {
  flex: 1;
  min-width: 0;
}
.compact-top, .compact-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.compact-top {
  margin-bottom: 3px;
}
.compact-top strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 500;
}
.compact-bottom {
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compact-bottom > span:not(.tag-plate) {
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-word {
  flex-shrink: 0;
  border-radius: var(--capsule);
  padding: 1px 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--off);
  background: var(--off-tint);
}
.status-word.ok {
  color: var(--ok);
  background: var(--ok-tint);
}
.status-word.taken {
  color: var(--taken);
  background: var(--taken-tint);
}
.late {
  color: var(--late) !important;
}
.device-thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: var(--r-inner);
  overflow: hidden;
  background: var(--fill);
  color: var(--ink-3);
  font-size: 15px;
  font-weight: 500;
}
.device-thumb > svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
}
.device-thumb.large {
  width: 56px;
  height: 56px;
  flex-basis: 56px;
  border-radius: 14px;
  font-size: 18px;
}
.device-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 160ms;
}
.device-thumb img.loaded {
  opacity: 1;
}

/* Search */
.search-tools {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 0 12px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}
body:has(#inventory-banner:not([hidden])) .search-tools {
  top: 40px;
}
.search-field {
  position: relative;
}
.search-field > svg {
  position: absolute;
  left: 16px;
  top: 13px;
  width: 20px;
  height: 20px;
  color: var(--ink-3);
  pointer-events: none;
}
#search {
  margin: 0;
  min-height: 46px;
  padding: 10px 64px 10px 44px;
  border: 0;
  border-radius: var(--capsule);
  background: var(--fill);
}
#search:focus {
  box-shadow: 0 0 0 3px var(--action-tint);
  background: var(--surface);
}
#search-count {
  position: absolute;
  right: 18px;
  top: 14px;
  font: 600 14px/1.3 Barlow, var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
.category-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding-top: 12px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  scroll-padding: 0 16px;
}
.category-chips::-webkit-scrollbar {
  display: none;
}
.category-chips button {
  flex-shrink: 0;
  scroll-snap-align: start;
  min-height: 34px;
  padding: 6px 14px;
  background: transparent;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
}
.category-chips button.active {
  color: var(--action);
  background: var(--action-tint);
  font-weight: 600;
}

/* Device detail */
.detail-title {
  padding: 8px 4px 0;
}
.detail-title h1 {
  font-size: 24px;
  margin: 8px 0 4px;
}
.detail-title p {
  margin: 0 0 16px;
}
.detail-title p:empty {
  display: none;
}
.photos {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--r-card);
}
.photos:empty {
  display: none;
}
.photo-frame {
  flex: 0 0 100%;
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--fill);
  scroll-snap-align: start;
}
.photo-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.photo-preview {
  filter: blur(8px);
}
.photo-full {
  opacity: 0;
}
.photo-frame.loaded .photo-full {
  opacity: 1;
}
.photo-frame.loaded .photo-preview {
  opacity: 0;
}
.photo-dots {
  display: flex;
  justify-content: center;
}
.photo-dots:empty {
  height: 16px;
}
.photo-dots button {
  width: 28px;
  min-height: 32px;
  padding: 13px 11px;
  background: transparent;
}
.photo-dots button::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: var(--capsule);
  background: var(--ink-3);
  opacity: .5;
}
.photo-dots button.active::after {
  background: var(--ink);
  opacity: 1;
}
.card > h2 {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin: 16px 0 4px;
}
.card > h2 + p {
  margin: 0;
}
#detail-records p {
  margin: 0;
  padding: 10px 0;
  font-size: 14px;
  border-top: 1px solid var(--line);
}
#detail-records p:first-child {
  border-top: 0;
}

/* Section labels and the admin landing */
.admin-section h2, #my-intake h2, #my-list > h2, #home-loans h2, .event-day, #page-content > h2 {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin: 0 0 8px;
  padding-left: 4px;
}
.admin-section, #my-intake {
  margin: 0 0 28px;
}
.admin-section > .muted {
  margin: 0;
  padding: 16px;
  font-size: 14px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--card-edge);
}
#new-intake {
  margin: 0 0 28px;
  background: var(--surface);
  color: var(--action);
  box-shadow: var(--card-edge);
}
#my-intake {
  margin-top: 28px;
}
.admin-section > .quiet, #my-intake > .quiet {
  margin-top: 4px;
}
.notice-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 14px 20px 14px 22px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  font-size: 16px;
  font-weight: 400;
  border-radius: var(--capsule);
  box-shadow: var(--card-edge);
}
.notice-row > span:first-child {
  flex: 1;
}
.compact-list .notice-row {
  border-radius: 0;
  box-shadow: none;
}
.notice-row strong {
  font: 600 18px/1 Barlow, var(--font);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.notice-row strong > span, #intake-entry > span {
  display: none;
}
.notice-row > span:last-child:not(:first-child) {
  color: var(--ink-3);
  font-size: 14px;
}
.notice-row[data-notice=overdue] strong {
  color: var(--late);
}
#event-page {
  margin-top: 8px;
}

#my-account {
  margin-top: 28px;
}
.account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  background: var(--surface);
  border-radius: var(--capsule);
  box-shadow: var(--card-edge);
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--capsule);
  background: var(--action-tint);
  color: var(--action);
  font-weight: 600;
}
.account-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  line-height: 1.3;
}
.account-copy strong {
  font-weight: 600;
}
.account-card .quiet {
  color: var(--ink-2);
  padding: 8px 14px;
}

/* Disclosures read as list rows with a rotating chevron */
details {
  margin: 20px 0;
}
summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-height: 44px;
  padding: 10px 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: '';
  width: 6px;
  height: 6px;
  margin-left: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms;
}
details[open] > summary::after {
  transform: translateY(1px) rotate(225deg);
}
details[open] > * + * {
  margin-top: 8px;
}

/* Sheets, switches and forms */
dialog {
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 88dvh;
  margin: auto;
  border: 0;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 8px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--float-shadow);
}
dialog[open] {
  animation: arrive 200ms cubic-bezier(.2, .8, .2, 1);
}
dialog::backdrop {
  background: #11182759;
}
dialog h2 {
  font-size: 18px;
}
.sheet-handle {
  width: 36px;
  height: 5px;
  background: var(--fill);
  border-radius: var(--capsule);
  margin: 0 auto 20px;
}
#close-drawer {
  margin-top: 8px;
  color: var(--ink-2);
}
.date-picker {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: var(--capsule);
}
.date-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
}
.switch-row {
  min-height: 52px;
  padding: 0;
  font-weight: 500;
}
input[role=switch] {
  appearance: none;
  -webkit-appearance: none;
  width: 56px;
  height: 44px;
  border: 0;
  border-radius: var(--capsule);
  background: transparent;
  padding: 0;
  position: relative;
  margin: 0;
  min-height: 0;
  flex-shrink: 0;
  cursor: pointer;
}
input[role=switch]:focus {
  box-shadow: none;
}
input[role=switch]::before {
  content: '';
  position: absolute;
  inset: 7px 2px;
  border-radius: var(--capsule);
  background: var(--fill);
  transition: background-color 160ms;
}
input[role=switch]::after {
  position: absolute;
  top: 9px;
  left: 4px;
  content: '';
  display: block;
  height: 26px;
  width: 26px;
  border-radius: var(--capsule);
  background: white;
  box-shadow: 0 1px 3px #11182733;
  transition: transform 160ms;
}
input[role=switch]:checked::before {
  background: var(--ok);
}
input[role=switch]:checked::after {
  transform: translateX(22px);
}
.inventory-card p {
  font-size: 13px;
  margin: 4px 0 0;
}
.event {
  padding: 14px 18px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--card-edge);
  margin-bottom: 8px;
  font-size: 14px;
}
.event p {
  margin: 0 0 4px;
  font-weight: 500;
}
.event-day {
  margin-top: 20px;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--capsule);
  background: var(--action-tint);
  color: var(--action);
  font-size: 13px;
  font-weight: 500;
}

/* Intake steps, photography and comparison */
.intake > button, .intake > label {
  margin-top: 12px;
}
.step-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}
.intake-guide {
  margin-top: 16px;
}
.intake-guide p {
  color: var(--ink-2);
}
.instruction-icon {
  display: grid;
  place-items: center;
  height: 96px;
  color: var(--action);
}
.instruction-icon svg {
  box-sizing: content-box;
  width: 32px;
  height: 32px;
  padding: 18px;
  border-radius: var(--capsule);
  background: var(--action-tint);
}
.intake-guide button, .intake-guide label, .intake-guide input {
  margin-top: 12px;
}
.intake-guide details {
  margin-bottom: 0;
}
.intake-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.intake-options button {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--fill);
}
.intake-options button[aria-pressed=true] {
  background: var(--action-tint);
  color: var(--action);
  box-shadow: inset 0 0 0 1.5px var(--action);
}
.intake-options button.danger {
  background: var(--late-tint);
  color: var(--late);
}
.intake-upload, .shot {
  display: block;
  position: relative;
  overflow: hidden;
}
.intake-upload {
  padding: 14px 16px;
  border-radius: var(--capsule);
  background: var(--action);
  color: white;
  text-align: center;
  font-weight: 600;
  min-height: 52px;
}
.intake-upload input, .shot input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0 !important;
}
.intake-status {
  min-height: 48px;
  font-size: 13px;
}
.intake-preview {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: var(--fill);
  border-radius: var(--r-inner);
}
.intake-photos {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}
.intake-photos a {
  width: 50%;
}
.intake-photos img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  border-radius: var(--r-inner);
}
.intake-accessory {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px;
  margin: 12px 0;
}
.intake .matched {
  border-color: var(--ok);
}
.intake .different {
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--action);
}
.intake .different small {
  color: var(--action);
}
.intake-hidden {
  margin-top: 24px;
}
.intake-submit {
  min-height: 52px;
}
.audit-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  font-size: 13px;
}
.audit-comparison > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.audit-comparison > div + div {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.shots {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}
.shot {
  flex: 1;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 12px;
  border: 1.5px dashed var(--line);
  border-radius: 18px;
  font-size: 13px;
  text-align: center;
  min-height: 96px;
  color: var(--ink-2);
  background: var(--surface-2);
}
.shot img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
}
.shot.uploaded {
  border-style: solid;
  border-color: var(--ok);
  color: var(--ok);
  background: var(--ok-tint);
}
.skeleton {
  height: 220px;
  border-radius: var(--r-card);
  background: linear-gradient(90deg, var(--fill) 0, var(--surface-2) 50%, var(--fill) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
#batch {
  margin-top: 24px;
}
#batch > button {
  margin: 12px 0;
}
#batch .item {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
#view-scan, #view-search, #view-my, #view-admin, #view-page, #view-intake {
  animation: tab-in 120ms ease-out;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes symbol-in {
  from {
    opacity: 0;
    transform: scale(.86);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes tab-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ripple {
  0% {
    opacity: .45;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 350px) {
  .large-title {
    font-size: 26px;
  }
  .band-heading h1 {
    font-size: 20px;
  }
  .compact-row {
    gap: 10px;
    padding: 10px 12px;
  }
  .compact-row + .compact-row::before {
    left: 66px;
  }
  #tabs button {
    width: 60px;
  }
}
