/* Auction Camera — web app
   Look: Apple. Action blue on parchment and white, hairline borders, 18px cards, pill buttons, frosted bars.
   Tokens come from the DESIGN.md "apple" analysis. The manila lot tag stays as the signature element. */
:root {
  --ink: #1d1d1f;
  --ink-2: #333336;
  --paper: #f5f5f7;
  --card: #ffffff;
  --line: #e0e0e0;
  --muted: #6e6e73;
  --teal: #0066cc;
  --teal-ink: #0058b0;
  --teal-soft: #e8f1fb;
  --tag: #f1cf7a;
  --tag-edge: #d9b24f;
  --tag-ink: #4a380c;
  --danger: #d70015;
  --ok: #1d7f3a;
  --warn: #b45309;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow: 0 0 0 1px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, "Segoe UI", sans-serif;
  letter-spacing: -.01em;
  color: var(--ink);
  background: var(--paper);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-size: 16px; line-height: 1.45; overflow-x: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--teal); }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid rgba(0, 102, 204, .45); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  padding: calc(var(--safe-top) + 8px) 12px 8px; min-height: 52px;
  background: rgba(245, 245, 247, .82); color: var(--ink);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.bar-title {
  flex: 1; min-width: 0; font-weight: 600; font-size: 17px; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 6px;
}
.bar-back, .bar-icon {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  background: transparent; border: 0; color: var(--teal); cursor: pointer;
}
.bar-back:active, .bar-icon:active { background: rgba(0, 0, 0, .06); }
.bar-sync {
  display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff;
  color: var(--muted); font-size: 13px; cursor: pointer; max-width: 40vw;
}
.sync-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #aeaeb2; flex: none; }
.sync-dot.ok { background: #30d158; }
.sync-dot.busy { background: #ffcc00; animation: pulse 1.1s ease-in-out infinite; }
.sync-dot.warn { background: #ff9f0a; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .55; } }
.bar-nav { display: none; gap: 2px; margin: 0 6px; }
.bar-nav a { padding: 7px 12px; border-radius: 999px; font-size: 14px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.bar-nav a:hover { background: rgba(0, 0, 0, .05); }
.bar-nav a[aria-current="page"] { background: rgba(0, 102, 204, .1); color: var(--teal); font-weight: 600; }
@media (min-width: 900px) { .bar-nav:not([hidden]) { display: flex; } }
.bar-avatar {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--teal); color: #fff;
  font-weight: 600; font-size: 15px; cursor: pointer; flex: none;
}
.bar-avatar:active { background: var(--teal-ink); }
body.auth .bar { display: none; }

/* ---------- Views ---------- */
.view { max-width: 1040px; margin: 0 auto; padding: 16px 16px calc(110px + var(--safe-bottom)); outline: none; }
.view.enter { animation: viewIn .26s cubic-bezier(.2,.7,.2,1); }
.view.enter-back { animation: viewBack .26s cubic-bezier(.2,.7,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateX(18px); } }
@keyframes viewBack { from { opacity: 0; transform: translateX(-18px); } }

h1, h2, h3 { margin: 0; letter-spacing: -.015em; line-height: 1.15; }
h1 { font-size: 30px; font-weight: 600; letter-spacing: -.025em; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-weight: 500; font-size: 15px; cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  user-select: none; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn svg { flex: none; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:active { background: var(--teal-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn:not(.primary):not(.dark):hover { background: #fafafc; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Auctions list ---------- */
.home-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 2px 18px; }
.home-head p { margin: 6px 0 0; }
.auction-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.auction {
  display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: var(--r-lg);
  background: var(--card); box-shadow: var(--shadow); text-decoration: none; color: inherit;
  border: 1px solid transparent; transition: border-color .15s ease;
}
.auction:hover { border-color: var(--line); }
.auction .cover { width: 64px; height: 64px; border-radius: 12px; background: #e6e9ef center/cover no-repeat; flex: none; }
.auction .name { font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auction .meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.auction .count { font-variation-settings: "wdth" 120; font-weight: 800; font-size: 22px; color: var(--ink-2); text-align: right; line-height: 1; }
.auction .count small { display: block; font-variation-settings: "wdth" 100; font-weight: 500; font-size: 11px; color: var(--muted); margin-top: 3px; }

.empty {
  text-align: center; padding: 44px 22px; border-radius: var(--r-lg); background: var(--card);
  border: 1.5px dashed var(--line);
}
.empty h2 { margin: 14px 0 6px; }
.empty p { margin: 0 auto 18px; max-width: 34ch; color: var(--muted); }

/* ---------- The lot tag (signature element) ---------- */
.tag {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 30px; background: var(--tag); color: var(--tag-ink);
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
  border-radius: 0 6px 6px 0; transform-origin: 8px 50%;
}
.tag::before {
  content: ""; position: absolute; left: 11px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px;
  border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--tag-edge);
}
.tag .tag-label { font-size: 12px; font-weight: 600; opacity: .8; }
.tag .tag-num { font-variation-settings: "wdth" 125; font-weight: 800; font-size: 26px; line-height: 1; font-feature-settings: "tnum"; }
.tag.big .tag-num { font-size: 40px; }
.tag.small { padding: 4px 10px 4px 22px; clip-path: polygon(9px 0, 100% 0, 100% 100%, 9px 100%, 0 calc(100% - 9px), 0 9px); }
.tag.small::before { left: 7px; width: 7px; height: 7px; margin-top: -3.5px; }
.tag.small .tag-num { font-size: 17px; }
.tag.swing { animation: swing .9s cubic-bezier(.3,1.6,.5,1); }
@keyframes swing { 0% { transform: rotate(-9deg); } 40% { transform: rotate(5deg); } 70% { transform: rotate(-2deg); } 100% { transform: rotate(0); } }

/* ---------- Auction view ---------- */
.auction-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 4px 2px 16px; }
.auction-head .stats { display: flex; gap: 18px; }
.stat b { display: block; font-variation-settings: "wdth" 120; font-weight: 800; font-size: 22px; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .btn { min-height: 40px; font-size: 14px; padding: 0 12px; flex: 1 1 auto; }
.toolbar .btn.ghost { flex: 0 0 auto; }
.lots { display: grid; gap: 8px; }
.lot-row {
  display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center;
  padding: 10px; border-radius: 14px; background: var(--card); text-decoration: none; color: inherit;
  border: 1px solid var(--line);
}
.lot-row .thumb { width: 58px; height: 58px; border-radius: 10px; background: #e6e9ef center/cover no-repeat; }
.lot-row .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lot-row .t.none { color: var(--muted); font-weight: 500; font-style: italic; }
.lot-row .m { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.lot-row .money { font-size: 12.5px; color: var(--muted); text-align: right; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #eef1f5; color: var(--muted); }
.pill.ok { background: #e6f4ea; color: var(--ok); }
.pill.up { background: #fdf3dc; color: var(--warn); }

.fab {
  position: fixed; right: 18px; bottom: calc(18px + var(--safe-bottom)); z-index: 15;
  display: inline-flex; align-items: center; gap: 10px; height: 58px; padding: 0 22px 0 18px;
  border-radius: 999px; border: 0; background: var(--teal); color: #fff; font-weight: 600; font-size: 16px;
  box-shadow: 0 10px 26px rgba(0, 102, 204, .3); cursor: pointer;
  transition: transform .1s ease;
}
.fab:active { transform: scale(.96); }

/* ---------- Lot view ---------- */
.lot-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.panel, .strip { min-width: 0; }
@media (min-width: 900px) {
  .lot-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
  .lot-side { position: sticky; top: 76px; }
}
.panel { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px; }
.lot-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x mandatory; }
.strip::-webkit-scrollbar { height: 4px; }
.strip::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.ph {
  position: relative; flex: none; width: 92px; height: 92px; border-radius: 12px; overflow: hidden;
  background: #e6e9ef center/cover no-repeat; scroll-snap-align: start; border: 0; padding: 0; cursor: pointer;
}
.ph.slot { background: repeating-linear-gradient(135deg, #f6f7f9 0 8px, #eef1f5 8px 16px); border: 1.5px dashed var(--line); color: var(--muted); font-size: 11px; display: grid; place-items: center; text-align: center; padding: 6px; }
.ph .n { position: absolute; left: 5px; top: 5px; padding: 0 6px; border-radius: 6px; background: rgba(29,36,51,.78); color: #fff; font-size: 11px; font-weight: 700; font-feature-settings: "tnum"; }
.ph .s { position: absolute; right: 5px; bottom: 5px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: rgba(255,255,255,.92); }
.ph .stk { position: absolute; left: 5px; bottom: 5px; padding: 0 5px; border-radius: 5px; background: var(--tag); color: var(--tag-ink); font-size: 10px; font-weight: 700; }
.ph.new { animation: drop .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes drop { from { transform: translateY(-14px) scale(.85); opacity: 0; } }

.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tools .btn { min-height: 44px; font-size: 14px; padding: 0 10px; }
.status { font-size: 13px; margin-top: 10px; min-height: 18px; color: var(--muted); }
.status.err { color: var(--danger); white-space: pre-line; }
.status.good { color: var(--ok); }
.thinking { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 6px; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); animation: think 1s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 50% { transform: translateY(-5px); opacity: .5; } }
.product { font-size: 13px; margin-top: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--teal-soft); color: var(--teal-ink); word-break: break-word; }
.product a { color: var(--teal-ink); font-weight: 600; }

.field { display: block; }
.field + .field { margin-top: 14px; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field-label small { font-weight: 500; color: var(--muted); font-feature-settings: "tnum"; }
.field-label small.over { color: var(--danger); }
.input, .textarea {
  width: 100%; border: 1px solid #d2d2d7; border-radius: var(--r-md); background: #fff;
  padding: 11px 12px; font-size: 16px; transition: border-color .15s ease, background .15s ease;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 102, 204, .2); }
.input:disabled { background: #f5f5f7; color: var(--muted); }
.textarea { min-height: 128px; resize: vertical; line-height: 1.5; }
.money-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.money-input { position: relative; }
.money-input span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.money-input .input { padding-left: 26px; font-feature-settings: "tnum"; }
.title-input { font-weight: 650; font-size: 17px; }
.flash-fill { animation: fill .9s ease; }
@keyframes fill { 0% { background: #fff6d6; } 100% { background: #fbfcfd; } }

.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.chip {
  min-height: 38px; padding: 4px 6px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .01em; cursor: pointer; line-height: 1.15;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .08s ease;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 10px 14px calc(10px + var(--safe-bottom));
  background: rgba(245, 245, 247, .85); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.savebar .inner { max-width: 1040px; margin: 0 auto; display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

/* ---------- Settings ---------- */
.settings { max-width: 720px; margin: 0 auto; }
.settings section { margin-bottom: 18px; }
.settings h2 { margin: 8px 2px 10px; }
.settings p.help { margin: -4px 2px 12px; font-size: 13.5px; color: var(--muted); }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--r-md); cursor: pointer; }
.opt + .opt { border-top: 1px solid var(--line); border-radius: 0; }
.opt input { margin-top: 3px; accent-color: var(--teal); width: 18px; height: 18px; flex: none; }
.opt b { display: block; font-weight: 650; }
.opt span { font-size: 13px; color: var(--muted); }
details.prov { border-top: 1px solid var(--line); }
details.prov:first-of-type { border-top: 0; }
details.prov summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 4px; cursor: pointer; font-weight: 650; }
details.prov summary::-webkit-details-marker { display: none; }
details.prov summary .chev { margin-left: auto; transition: transform .2s ease; color: var(--muted); }
details.prov[open] summary .chev { transform: rotate(90deg); }
details.prov .body { padding: 0 4px 14px; }
.set-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.set-dot.on { background: var(--ok); }
.seg { display: inline-grid; grid-auto-flow: column; background: #e8e8ed; border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 500; font-size: 14px; cursor: pointer; }
.seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- Toasts & dialogs ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(86px + var(--safe-bottom)); z-index: 60; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  max-width: 520px; padding: 12px 16px; border-radius: 14px; background: rgba(29, 29, 31, .92); color: #fff; font-size: 14.5px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toastIn .28s cubic-bezier(.2,1.2,.4,1); pointer-events: auto;
}
.toast.out { animation: toastOut .22s ease forwards; }
@keyframes toastIn { from { transform: translateY(16px) scale(.96); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(10px); opacity: 0; } }

.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(15, 20, 30, .5); display: grid; place-items: end center; animation: fade .2s ease; }
@media (min-width: 640px) { .scrim { place-items: center; } }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: min(560px, 100%); max-height: 88vh; overflow: auto; background: var(--card);
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(18px + var(--safe-bottom));
  animation: sheetUp .3s cubic-bezier(.2,1,.3,1);
}
@media (min-width: 640px) { .sheet { border-radius: 22px; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { margin-bottom: 14px; }
.sheet .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.viewer img { width: 100%; border-radius: 14px; max-height: 66vh; object-fit: contain; background: #111; }

/* ---------- Camera ---------- */
.cam { position: fixed; inset: 0; z-index: 70; background: #000; color: #fff; display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: 100%; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam .stage { position: relative; overflow: hidden; min-height: 0; }
.cam .top { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-top) + 10px) 14px 10px; background: linear-gradient(#000c, #0000); position: absolute; left: 0; right: 0; top: 0; z-index: 2; }
.cam .top .tag { transform: scale(.9); transform-origin: left center; }
.cam .bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 16px 22px calc(22px + var(--safe-bottom)); background: #000; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 5px; cursor: pointer; }
.shutter::after { content: ""; display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .1s ease; }
.shutter:active::after { transform: scale(.86); }
.cam .last { width: 54px; height: 54px; border-radius: 12px; background: #222 center/cover no-repeat; border: 2px solid #fff; justify-self: start; position: relative; }
.cam .last b { position: absolute; right: -8px; top: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--tag); color: var(--tag-ink); font-size: 12px; display: grid; place-items: center; }
.cam .done { justify-self: end; height: 46px; padding: 0 18px; border-radius: 14px; border: 0; background: var(--teal); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
.cam .close { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 20px; cursor: pointer; }
.cam .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 3; }
.cam .flash.go { animation: flash .28s ease-out; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }
.cam .fly { position: absolute; z-index: 4; border-radius: 12px; background: center/cover no-repeat; pointer-events: none; transition: all .45s cubic-bezier(.5,0,.2,1); }
.cam .hint { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; font-size: 13px; color: #ffffffcc; z-index: 2; }
.scanline { position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; background: #4ade80; box-shadow: 0 0 14px #4ade80; animation: scan 1.6s ease-in-out infinite alternate; z-index: 2; }
.scanbox { position: absolute; left: 10%; right: 10%; top: 32%; bottom: 32%; border: 2px solid #ffffffaa; border-radius: 16px; z-index: 2; }
@keyframes scan { from { transform: translateY(-60px); } to { transform: translateY(60px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Phones: keep the photo tools compact so Title and Condition sit close to the top. */
@media (max-width: 600px) {
  .view { padding-top: 12px; }
  .panel { padding: 12px; }
  .lot-top { margin-bottom: 8px; }
  .tag.big .tag-num { font-size: 30px; }
  .ph { width: 76px; height: 76px; }
  .tools .btn { min-height: 42px; }
}

/* ---------- Sign in and admin sign in ---------- */
.auth-wrap { min-height: calc(100vh - 40px); display: grid; place-items: center; padding: 12px 0 40px; }
.auth-card { width: min(420px, 100%); background: var(--card); border-radius: 22px; padding: 30px 26px 22px; box-shadow: var(--shadow); text-align: center; }
.auth-card h1 { font-size: 28px; margin-top: 14px; }
.auth-logo { margin: 0 auto; border-radius: 16px; }
.auth-badge { width: 64px; height: 64px; margin: 0 auto; display: grid; place-items: center; border-radius: 16px; background: var(--ink); color: #fff; }
.auth-sub { margin: 6px 0 18px; }
.auth-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-bottom: 18px; }
.auth-card form { text-align: left; }
.auth-card .btn.block { margin-top: 16px; min-height: 48px; }
.link-btn { margin-top: 12px; border: 0; background: none; color: var(--teal); font-size: 14px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.form-error { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r-md); background: #fff1f0; color: var(--danger); font-size: 14px; text-align: left; }
.preview-note { margin-top: 18px; padding: 12px 14px; border-radius: var(--r-md); background: var(--paper); color: var(--muted); font-size: 13px; text-align: left; }
.preview-note b { color: var(--ink); font-weight: 600; }
.preview-note code { font-size: 12.5px; background: #fff; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink); word-break: break-all; }
.auth-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
.auth-foot a { color: var(--teal); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.auth-foot a:hover { text-decoration: underline; }

/* ---------- Account menu ---------- */
.drawer { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, 0); transition: background .22s ease; }
.drawer.open { background: rgba(0, 0, 0, .32); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 88vw);
  display: flex; flex-direction: column; padding: calc(var(--safe-top) + 14px) 14px calc(14px + var(--safe-bottom));
  background: rgba(250, 250, 252, .94); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border-left: 1px solid rgba(0, 0, 0, .08); transform: translateX(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.drawer.open .drawer-panel { transform: none; }
.m-head { display: flex; align-items: center; gap: 12px; padding: 4px 4px 14px; }
.m-name { font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-mail { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .06); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.avatar { display: grid; place-items: center; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 600; flex: none; }
.avatar.lg { width: 46px; height: 46px; font-size: 19px; }
.avatar.xl { width: 72px; height: 72px; font-size: 30px; }
.m-plan { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 10px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; text-decoration: none; }
.m-list { display: grid; gap: 2px; margin-bottom: 8px; }
.m-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 12px; border-radius: var(--r-md); border: 0; background: transparent; color: var(--ink); font-size: 16px; text-align: left; text-decoration: none; cursor: pointer; }
.m-item span { flex: 1; }
.m-item .ico:last-child:not(:first-child) { color: #aeaeb2; }
.m-item:hover { background: rgba(0, 0, 0, .05); }
.m-item[aria-current="page"] { background: rgba(0, 102, 204, .1); color: var(--teal); font-weight: 600; }
.m-item.out { margin-top: auto; color: var(--danger); border-top: 1px solid var(--line); border-radius: 0 0 var(--r-md) var(--r-md); }

/* ---------- Account pages ---------- */
.page { max-width: 720px; margin: 0 auto; display: grid; gap: 16px; }
.page .panel h2 { font-size: 19px; margin-bottom: 12px; }
.page .panel .row h2, .page .panel.plan-now h2 { margin-bottom: 0; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head p { margin: 2px 0 8px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kv:first-of-type { margin-top: 8px; }
.meter { margin-top: 12px; font-size: 14px; }
.bar-track { height: 8px; border-radius: 99px; background: #e8e8ed; margin-top: 8px; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 99px; background: var(--teal); }
.bar-track i.hot { background: #ff9f0a; }
.plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.plan { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px 18px 18px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); }
.plan.featured { border: 2px solid var(--teal); }
.plan.current { background: #fafafc; }
.plan-flag { position: absolute; top: -11px; left: 16px; padding: 2px 10px; border-radius: 99px; background: var(--teal); color: #fff; font-size: 12px; font-weight: 600; }
.price { font-size: 32px; font-weight: 600; letter-spacing: -.03em; }
.price small { font-size: 14px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.plan ul { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 8px; font-size: 14px; flex: 1; }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li .ico { color: var(--teal); flex: none; margin-top: 1px; }
.tip { display: flex; gap: 14px; align-items: flex-start; }
.tip .ico { color: var(--teal); flex: none; margin-top: 2px; }
.tip p { margin: 2px 0 0; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile { padding: 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); }
.tile-v { font-size: 30px; font-weight: 600; letter-spacing: -.03em; margin: 2px 0; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cell-mail { word-break: break-all; }
.table th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
@media (min-width: 900px) { .page { max-width: 880px; } }

/* ---------- Download sheet ---------- */
.dl-opts { display: grid; gap: 8px; }
.dl-opt { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
.dl-opt:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.dl-opt input { accent-color: var(--teal); width: 20px; height: 20px; flex: none; }
.dl-opt b { display: block; font-weight: 600; }
.dl-opt span { font-size: 13px; color: var(--muted); }
.link-row { text-decoration: none; color: inherit; align-items: center; }
.link-row b { color: #aeaeb2; display: inline-flex; }
select.input { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236e6e73' stroke-width='2'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; }
.auth-foot .link-btn { margin: 0; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Floating assistant ---------- */
.assist-btn {
  position: fixed; right: 16px; bottom: calc(16px + var(--safe-bottom)); z-index: 40; display: none;
  width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; cursor: pointer;
  place-items: center; box-shadow: 0 8px 24px rgba(0, 102, 204, .35); transition: transform .12s ease;
}
.assist-btn:active { transform: scale(.94); }
body.signed-in:not(.auth) .assist-btn { display: grid; }
body.on-lot .assist-btn { bottom: calc(86px + var(--safe-bottom)); }
body:not(.on-lot).signed-in .fab { bottom: calc(86px + var(--safe-bottom)); }
.assist-panel {
  position: fixed; right: 12px; bottom: calc(86px + var(--safe-bottom)); z-index: 45;
  width: min(380px, calc(100vw - 24px)); height: min(520px, calc(100vh - 150px)); display: flex; flex-direction: column;
  background: #fff; border-radius: 22px; border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .22); overflow: hidden;
  animation: sheetUp .22s cubic-bezier(.2, 1, .3, 1);
}
body.on-lot .assist-panel { bottom: calc(154px + var(--safe-bottom)); height: min(520px, calc(100vh - 220px)); }
.assist-panel[hidden] { display: none; }
.assist-panel header { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); background: #fafafc; }
.assist-panel header b { display: block; font-weight: 600; font-size: 16px; }
.assist-panel header span { font-size: 12.5px; color: var(--muted); }
.assist-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.assist-msg { max-width: 86%; padding: 9px 13px; border-radius: 18px; font-size: 14.5px; line-height: 1.4; word-break: break-word; }
.assist-msg.bot { align-self: flex-start; background: #f0f0f3; border-bottom-left-radius: 6px; }
.assist-msg.user { align-self: flex-end; background: var(--teal); color: #fff; border-bottom-right-radius: 6px; }
.assist-msg.typing { color: var(--muted); animation: pulseText 1s ease-in-out infinite; }
@keyframes pulseText { 50% { opacity: .4; } }
.assist-chips { display: grid; gap: 6px; margin-top: 4px; }
.assist-chips button { text-align: left; padding: 9px 13px; border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--teal); font-size: 14px; cursor: pointer; }
.assist-chips button:hover { background: var(--teal-soft); }
.assist-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.assist-form .input { border-radius: 999px; padding: 9px 14px; }
.assist-send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }

/* ---------- Auction setup popup ---------- */
.sheet.setup { width: min(620px, 100%); display: flex; flex-direction: column; max-height: 92vh; }
.setup-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-bottom: 14px; }
.setup-tabs button { padding: 8px 4px; font-size: 13.5px; }
.setup-body { flex: 1; overflow-y: auto; min-height: 300px; padding: 2px 2px 6px; }
.setup .actions { margin-top: 14px; }
.setup-hint { margin: 10px 0 8px; }
.setup-body > .setup-hint:first-child { margin-top: 0; }
.frows { display: grid; gap: 8px; margin: 4px 0 12px; }
.frow { display: grid; grid-template-columns: 24px 1fr 32px; gap: 10px; align-items: start; }
.frow > input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--teal); margin-top: 11px; }
.fcol { min-width: 0; }
.fcap { display: block; font-size: 12px; color: var(--muted); margin: 3px 2px 0; }
.frow .icon-btn { margin-top: 6px; }
.file-opts { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.tpl-info { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--paper); font-size: 14px; }
.tpl-info p { margin: 0 0 6px; }
.tpl-info ul { margin: 6px 0 8px; padding-left: 18px; display: grid; gap: 4px; }
.fhead { padding: 8px 12px; font-size: 15px; }
.fhead:disabled { opacity: .5; }
.icon-btn.ghost-slot { background: none; pointer-events: none; }
.add-row { display: flex; gap: 8px; margin-top: 8px; }
.add-row .input { flex: 1; }
.name-row { display: flex; align-items: center; gap: 8px; }
.name-row .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }
.ext { color: var(--muted); font-size: 15px; }
.tagrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; }
.tagrow .chip { min-height: 48px; font-weight: 500; font-size: 13px; letter-spacing: 0; }
.tagrow .chip code { font-size: 12px; color: var(--teal); }
.chips.edit { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.chip.tagchip { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 6px 4px 10px; cursor: default; }
.chip.tagchip span { overflow-wrap: break-word; text-align: left; }
.chips.editing { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.ph.slot { font-size: 10.5px; overflow-wrap: anywhere; }
.chip.tagchip button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: #e8e8ed; color: var(--ink); font-size: 15px; line-height: 1; cursor: pointer; flex: none; }
.chip-add { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 4px; }
.chip-add .input { flex: 1; padding: 8px 12px; font-size: 15px; }
.chip-add .btn { min-height: 40px; }
.mini-btn { border: 0; background: none; color: var(--teal); font-size: 14px; font-weight: 500; cursor: pointer; padding: 0 2px; }
.mini-btn:hover { text-decoration: underline; }

/* ---------- Brand ---------- */
.bar-logo { width: 28px; height: 28px; border-radius: 7px; margin-left: 4px; flex: none; }
.bar-logo + .bar-title { padding-left: 2px; }
.auth-logo { height: auto; max-width: 70%; }
.auth-card .auth-logo { margin-bottom: 2px; }
.auth-card h1 { margin-top: 8px; }

/* ---------- Auction card menu ---------- */
.auction-wrap { position: relative; }
.auction-wrap .auction { padding-right: 52px; height: 100%; }
.dots { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.dots:hover, .dots[aria-expanded="true"] { background: rgba(0, 0, 0, .06); color: var(--ink); }
.pop-menu { position: absolute; top: 46px; right: 8px; z-index: 12; min-width: 170px; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0, 0, 0, .16); animation: fade .12s ease; }
.pop-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-radius: 9px; background: none; font-size: 15px; text-align: left; cursor: pointer; color: var(--ink); }
.pop-menu button:hover { background: var(--paper); }
.pop-menu button.danger { color: var(--danger); }

/* ---------- Lot fields (follow the CSV columns) ---------- */
.lot-fields { display: grid; gap: 14px; }
.lot-fields > * { margin-top: 0 !important; }

/* ---------- Home welcome ---------- */
.hello { margin: 4px 2px 14px; }
.hello .muted { font-size: 15px; }
.hello-name { font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: var(--teal); }
.hello-card { margin: 4px 0 18px; padding: 18px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); }
.hello-card h2 { font-size: 20px; }
.hello-card p { margin: 6px 0 12px; }
.cam .cam-top-right { display: flex; gap: 8px; }
.cam-error { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; gap: 16px; padding: 28px; text-align: center; background: #111; color: #fff; }
.cam-error p { margin: 0 auto; max-width: 34ch; font-size: 16px; line-height: 1.5; }
.cam-error-actions { display: grid; gap: 10px; justify-content: center; }
.cam-error .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }

.ai-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 16px; border-radius: var(--r-lg); background: #fff4e5; border: 1px solid #f5d29a; color: var(--ink); text-decoration: none; }
.ai-banner b { font-size: 17px; }
.ai-banner span:not(.btn) { flex: 1 1 220px; color: var(--muted); font-size: 14px; }
.ai-banner.on { background: #e9f6ec; border-color: #b9e0c3; }
.ai-banner .ico { color: #aeaeb2; }
