@font-face {
  font-family: "Druk Text Wide";
  src: url("/fonts/druktextwide-bold.woff2") format("woff2"),
       url("/fonts/druktextwide-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --pink: #FF5CBF;
  --pink-deep: #D92E98;
  --pink-soft: #FFEAF6;
  --orange: #FF9533;
  --gray-dot: #BDBDBD;
  --ink: #111111;
  --ink-2: #4D4D4D;
  --ink-3: #8C8C8C;
  --line: #ECECEC;
  --bg: #FFFFFF;
  --bg-2: #F5F5F5;
  --danger: #C62828;
  --radius: 14px;
  --font-head: "Druk Text Wide", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-appearance: none; appearance: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { display: block; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--pink-deep); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-3); }
.head { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .02em; }

/* ---------- header ---------- */
.top, .bar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: var(--safe-t);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.logo {
  font-family: var(--font-head); color: var(--pink);
  font-size: 22px; line-height: 1; white-space: nowrap;
  display: flex; align-items: baseline; gap: 6px;
}
.logo small { font-size: 9px; color: var(--ink); letter-spacing: .04em; }
.count { font-size: 13px; color: var(--ink-3); white-space: nowrap; }

.bar-inner { display: flex; align-items: center; gap: 10px; height: 56px; }
.icon-btn {
  flex: none; width: 40px; height: 40px; margin-left: -10px;
  display: grid; place-items: center; border-radius: 50%;
  border: 0; background: transparent;
}
.icon-btn svg { width: 22px; height: 22px; }
.bar-title {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 16px;
}
.bar-title span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title.head { font-size: 13px; font-weight: 400; }
.save-state { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* ---------- list: filters ---------- */
.filters { padding-top: 14px; }
.chips {
  display: flex; gap: 8px; overflow-x: auto;
  margin: 0 -16px; padding: 0 16px 2px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: baseline; gap: 5px;
  border: 1px solid var(--line); background: var(--bg);
  border-radius: 999px; padding: 9px 14px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip .n { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on .n { color: rgba(255, 255, 255, .6); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.pri-filter { display: flex; gap: 6px; }
.pri-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: #fff;
}
.pri-btn.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.sort select {
  -webkit-appearance: none; appearance: none;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 34px 7px 14px; background: #fff;
  font-size: 16px; font-weight: 600; color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
}

.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; }
.dot-high { background: var(--pink); }
.dot-medium { background: var(--orange); }
.dot-low { background: var(--gray-dot); }

/* ---------- list: grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 12px; padding: 16px 0 24px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 920px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 18px; } }

.card { display: block; min-width: 0; }
.card-img {
  position: relative; aspect-ratio: 1; overflow: hidden;
  background: var(--bg-2); border-radius: var(--radius);
  display: grid; gap: 2px;
}
.card-img > img { width: 100%; height: 100%; min-height: 0; object-fit: cover; background: var(--bg-2); }
/* 4-photo collage: 2 = side by side, 3 = one tall + two stacked, 4 = 2×2 */
.card-img.n-2, .card-img.n-3, .card-img.n-4 { background: #fff; grid-template-columns: 1fr 1fr; }
.card-img.n-3, .card-img.n-4 { grid-template-rows: 1fr 1fr; }
.card-img.n-3 > img:first-child { grid-row: span 2; }
.card-img .dot { position: absolute; top: 10px; left: 10px; width: 16px; height: 16px; box-shadow: 0 0 0 3px #fff, 0 1px 6px 2px rgba(0, 0, 0, .28); }
.card-noimg {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-head); font-size: 10px; color: #c4c4c4; letter-spacing: .04em;
}
.card-n {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(17, 17, 17, .6); color: #fff;
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
}
.card-name {
  margin-top: 9px; font-weight: 700; font-size: 15px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-name.is-empty { color: var(--ink-3); font-weight: 600; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.card.is-denied .card-img img { opacity: .4; filter: grayscale(1); }

.pill {
  display: inline-block; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 5px 8px; border-radius: 999px; white-space: nowrap;
}
.st-new { background: #F0F0F0; color: #555; }
.st-waiting { background: #FFF2CF; color: #7A5600; }
.st-quote { background: #E2EDFF; color: #1D4CA8; }
.st-sample { background: #EEE4FF; color: #5A2DB0; }
.st-approved { background: #DAF5E3; color: #126B37; }
.st-denied { background: #FBE2E2; color: #9E2A2A; }

.empty { grid-column: 1 / -1; text-align: center; padding: 64px 16px; color: var(--ink-2); }
.empty .head { font-size: 15px; color: var(--ink); margin-bottom: 10px; }

.skel { border-radius: var(--radius); aspect-ratio: 1; background: linear-gradient(90deg, #f3f3f3, #fafafa, #f3f3f3); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.foot { padding: 8px 0 calc(120px + var(--safe-b)); text-align: center; }
.link { border: 0; background: none; color: var(--ink-3); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 8px; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.nav-inner {
  max-width: 480px; margin: 0 auto; height: 64px; padding: 0 16px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.nav a {
  text-align: center; padding: 14px 0;
  font-family: var(--font-head); font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3);
}
.nav a.on { color: var(--ink); }
.nav-add {
  width: 60px; height: 60px; margin-top: -26px; border-radius: 50%;
  border: 4px solid #fff; background: var(--pink); color: var(--ink);
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(255, 92, 191, .45);
}
.nav-add svg { width: 26px; height: 26px; }

/* ---------- references ---------- */
.refs { columns: 2; column-gap: 8px; padding: 16px 0 24px; }
@media (min-width: 640px) { .refs { columns: 3; } }
@media (min-width: 920px) { .refs { columns: 4; column-gap: 12px; } }
.ref {
  display: block; width: 100%; margin: 0 0 8px; padding: 0; border: 0;
  break-inside: avoid; border-radius: 10px; overflow: hidden; background: var(--bg-2);
}
.ref img { width: 100%; height: auto; }
.ref-up { display: grid; place-items: center; aspect-ratio: 1; }

/* ---------- supplier page / new page ---------- */
.page { max-width: 720px; margin: 0 auto; padding: 8px 16px calc(40px + var(--safe-b)); }
.page.with-savebar { padding-bottom: calc(120px + var(--safe-b)); }
.section { padding: 20px 0; border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; }
.label {
  font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; margin-bottom: 12px;
  display: flex; align-items: baseline; gap: 6px;
}
.label .muted { font-family: var(--font-body); font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 500; }

.name-input {
  width: 100%; border: 0; padding: 2px 0; background: transparent; outline: none;
  font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em;
}
.name-input::placeholder { color: #C9C9C9; }
.hint { margin-top: 6px; font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; min-height: 18px; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 10px 15px; font-size: 14px; font-weight: 600; line-height: 1.1;
}
.choice.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice.on .dot { box-shadow: 0 0 0 2px #fff; }
.choices.need { animation: nudge .4s; }
@keyframes nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--ink); }
.input::placeholder { color: #BDBDBD; }
textarea.input { min-height: 140px; resize: vertical; line-height: 1.45; display: block; }
.input-wrap { position: relative; }
.input-wrap .prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 600; pointer-events: none; }
.input-wrap .input { padding-left: 32px; }

.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
@media (min-width: 640px) { .thumbs { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.thumb-btn { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; }
.thumb.is-card { outline: 3px solid var(--pink); outline-offset: -3px; }
.thumb.is-card img { opacity: .92; }
.card-badge {
  position: absolute; left: 4px; bottom: 4px; pointer-events: none;
  background: var(--pink); color: var(--ink); border-radius: 6px; padding: 3px 6px;
  font-family: var(--font-head); font-size: 9px; letter-spacing: .04em;
}
.card-hint { margin: -4px 0 12px; font-size: 13px; color: var(--ink-2); min-height: 18px; }
.card-hint .spin { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.card-hint b { color: var(--ink); }
.thumb video, .thumb-btn video { width: 100%; height: 100%; object-fit: cover; display: block; background: #222; pointer-events: none; }
.thumb.is-video { background: #222; }
.play-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 50%; pointer-events: none;
  background: rgba(17, 17, 17, .6); color: #fff; display: grid; place-items: center;
}
.play-badge svg { width: 13px; height: 13px; margin-left: 2px; }
.viewer-slide video { max-width: 100%; max-height: 100%; background: #000; }

/* "Uploading 3 of 14" — shown while a saved supplier's photos upload in the background */
#bgStatus {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(102px + var(--safe-b)); z-index: 35;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 24px rgba(17, 17, 17, .14);
  padding: 9px 14px; font-size: 13px; font-weight: 700; line-height: 1.25;
}
#bgStatus > span:last-child { display: flex; flex-direction: column; }
#bgStatus small { font-size: 11px; font-weight: 500; color: var(--ink-3); }
/* Supplier | Reference switch on the "Add new" screen */
.mode-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 12px 0 4px;
  padding: 4px; border-radius: 999px; background: var(--bg-2);
}
.mode-switch button {
  height: 42px; border: 0; border-radius: 999px; background: transparent;
  font-family: var(--font-head); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3);
}
.mode-switch button.on { background: var(--ink); color: #fff; }
#supplierOnly[hidden] { display: none; }
.ref { position: relative; }
.ph { color: var(--ink-3); }
.sep { color: var(--ink-3); }
.thumb-more span {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(17, 17, 17, .55); color: #fff; font-size: 18px; font-weight: 800;
}
.toggle-row { text-align: center; }
.toggle-row:empty { display: none; }
.toggle-row .link { margin-top: 6px; }

.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-head .label { margin-bottom: 0; }
.add-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 13px 7px 9px; font-size: 13px; font-weight: 700;
}
.add-btn svg { width: 15px; height: 15px; }
.sub-label { margin: 14px 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
textarea.input.notes { min-height: 110px; }

/* top of the supplier page */
.hero { padding-top: 16px; }
.hero-row { display: flex; align-items: flex-start; gap: 14px; }
.biz-mini {
  flex: none; width: 88px; aspect-ratio: 1; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2);
  display: grid; place-items: center;
}
.biz-mini img { width: 100%; height: 100%; object-fit: cover; }
.biz-add {
  border: 1.5px dashed #CFCFCF; background: #fff; color: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 700;
}
.biz-add svg { width: 18px; height: 18px; }
.hero-info { flex: 1; min-width: 0; }
.hero-name { font-size: 20px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
.hero-name.is-empty { color: var(--ink-3); }
.hero-meta { margin-top: 4px; font-size: 14px; color: var(--ink-2); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; background: var(--bg-2);
  font-size: 12px; font-weight: 700;
}
.tag .dot { width: 10px; height: 10px; }
.hero-edit { margin: -8px -10px 0 0; border: 1px solid var(--line); }
.hero-edit svg { width: 18px; height: 18px; }

/* edit panel */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(17, 17, 17, .45); animation: fade .2s; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 90vh; max-height: 90dvh;
  display: flex; flex-direction: column; background: #fff; border-radius: 20px 20px 0 0;
  animation: rise .25s ease-out;
}
@media (min-width: 640px) { .sheet-wrap { align-items: center; padding: 24px; } .sheet { border-radius: 20px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 4px 20px; }
.sheet-head .head { font-size: 14px; }
.sheet-head .icon-btn { margin: 0; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 20px; }
.sheet-body .field { margin: 14px 0 0; }
.sheet-body .label { margin: 22px 0 10px; }
.sheet-foot {
  display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
  padding: 12px 20px calc(12px + var(--safe-b)); border-top: 1px solid var(--line);
}
.sheet-foot .btn { height: 50px; }
.btn svg { width: 16px; height: 16px; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.thumbs.mt { margin-top: 12px; }
.thumb {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; overflow: hidden;
  border-radius: 10px; background: var(--bg-2);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.x {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; padding: 0; border-radius: 50%;
  border: 0; background: rgba(17, 17, 17, .65); color: #fff; display: grid; place-items: center;
}
.x svg { width: 14px; height: 14px; }
.thumb-pdf {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 8px; text-align: center; font-size: 11px; color: var(--ink-2); word-break: break-word;
  border: 1px solid var(--line); background: #fff;
}
.thumb-pdf b { font-family: var(--font-head); font-size: 13px; color: var(--pink-deep); }
.thumb-pdf span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.add-tile {
  aspect-ratio: 1; border-radius: 10px; border: 1.5px dashed #CFCFCF; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--ink-2); text-align: center; padding: 4px; line-height: 1.2;
}
.add-tile svg { width: 18px; height: 18px; }
.add-tile.wide { aspect-ratio: auto; width: 100%; min-height: 150px; font-size: 14px; }
.add-tile.busy { border-style: solid; border-color: var(--line); color: var(--ink-3); }

.biz { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.biz-photo { width: 100%; max-width: 380px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--bg-2); position: relative; }
.biz-photo img { width: 100%; height: auto; }
.biz-photo .x { position: absolute; top: 8px; right: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  font-size: 14px; font-weight: 700;
}
.btn-primary { background: var(--pink); border-color: var(--pink); color: var(--ink); height: 52px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); border-color: #F2D2D2; }
.btn:disabled { opacity: .55; cursor: default; }
.meta-small { margin-top: 12px; font-size: 12px; color: var(--ink-3); text-align: center; }

.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + var(--safe-b));
}
.savebar-inner { max-width: 688px; margin: 0 auto; }
.save-msg { font-size: 13px; color: var(--ink-2); text-align: center; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.save-msg:empty { display: none; }

.spin {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2.5px solid #E6E6E6; border-top-color: var(--pink);
  animation: spin .8s linear infinite;
}
.spin.sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: grid; place-items: center; padding: 80px 0; }

/* ---------- viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; }
.viewer-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + var(--safe-t)) 8px 8px 16px; color: #fff;
}
.viewer-count { font-size: 14px; font-weight: 600; }
.viewer-actions { display: flex; gap: 4px; }
.v-btn {
  height: 40px; min-width: 40px; padding: 0 12px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 600;
}
.v-btn svg { width: 18px; height: 18px; }
.viewer-track {
  flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain;
}
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-slide {
  flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto; padding-bottom: var(--safe-b);
}
.viewer-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-slide.tall { align-items: flex-start; }
.viewer-slide.tall img { max-height: none; width: 100%; max-width: 900px; margin: 0 auto; }
@media (hover: hover) {
  .v-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%; border: 0;
    background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center;
  }
  .v-nav svg { width: 22px; height: 22px; }
  .v-prev { left: 16px; }
  .v-next { right: 16px; }
}
@media (hover: none) { .v-nav { display: none; } }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 360px; text-align: center; }
.login .logo { justify-content: center; flex-direction: column; align-items: center; gap: 10px; font-size: 34px; margin-bottom: 36px; }
.login .logo small { font-size: 12px; }
.login form { display: grid; gap: 12px; }
.login .error { color: var(--danger); font-size: 14px; min-height: 20px; }

.center-msg { min-height: 60vh; display: grid; place-items: center; text-align: center; gap: 16px; padding: 24px; color: var(--ink-2); }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(158px + var(--safe-b)); z-index: 200;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 11px 18px; font-size: 14px; font-weight: 600;
  max-width: calc(100vw - 32px); text-align: center;
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

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

/* ---------- assistants ---------- */
/* list: assistant filter row with the Team button */
.who-chips { margin-top: 12px; }
.who-chips .chip { padding: 7px 12px; font-size: 13px; }
.chip.chip-team { align-items: center; gap: 6px; border-color: var(--pink); color: var(--pink-deep); }
.chip-team svg { width: 16px; height: 16px; }
.pill.who { display: inline-flex; align-items: center; gap: 3px; background: var(--pink-soft); color: var(--pink-deep); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pill.who svg { width: 11px; height: 11px; flex: none; }
.tag svg { width: 12px; height: 12px; flex: none; }
.tag-who { background: var(--pink-soft); color: var(--pink-deep); }

/* supplier page: who works on it + Assign */
.assign-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 10px 10px 10px 14px; border-radius: 12px; background: var(--bg-2);
}
.assign-who { font-size: 14px; color: var(--ink-2); line-height: 1.35; min-width: 0; overflow-wrap: anywhere; }
.assign-who b { color: var(--ink); }
.btn.btn-assign { flex: none; background: var(--pink); border-color: var(--pink); color: var(--ink); }
.choice .num {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--bg-2); color: var(--ink-2); font-size: 11px; font-weight: 800;
}
.choice.on .num { background: var(--pink); color: var(--ink); }
.sheet-hint { margin-top: 10px; font-size: 13px; color: var(--ink-3); line-height: 1.4; }
.link.inline { padding: 0; font-size: inherit; color: inherit; }

/* assistant's own pages */
.mine-intro { padding: 20px 0 0; }
.mine-intro .head { font-size: 15px; }
.mine-intro p { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.task-text {
  white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--pink-soft); border-radius: 12px; padding: 14px 16px;
  font-size: 16px; line-height: 1.5;
}

/* team page */
.team-intro { padding: 16px 0 8px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.team-intro b { display: block; margin-top: 8px; color: var(--ink); }
.team-card:first-child { border-top: 1px solid var(--line); }
.team-top { display: flex; align-items: center; gap: 12px; }
.team-num {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-family: var(--font-head); font-size: 13px;
}
.team-meta { margin: 10px 0 0 48px; font-size: 13px; color: var(--ink-3); }
.team-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0 48px; }

/* login: assistants paste their link */
.login .link { margin-top: 22px; }
.login-note { font-size: 14px; color: var(--ink-2); }
#joinForm { margin-top: 18px; }
#joinForm[hidden], #iAmAssistant[hidden] { display: none; }

/* ---------- notes for the assistant: questions about photos ---------- */
/* list: comment icon top-right of the card = this supplier has notes for the assistant */
.card-note {
  position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--ink);
  box-shadow: 0 1px 6px 1px rgba(0, 0, 0, .25);
}
.card-note svg { width: 15px; height: 15px; }

.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 8px; }
.sub-head .sub-label { margin: 0; }
.sub-label .muted { font-weight: 500; }
.asks { display: grid; gap: 12px; }
.asks + .sub-label { margin-top: 16px; }
.ask-empty { font-size: 13px; color: var(--ink-3); line-height: 1.4; }
.ask { position: relative; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: start; }
.ask-img {
  position: relative; width: 88px; aspect-ratio: 1; padding: 0; border: 0; overflow: hidden;
  border-radius: 10px; background: var(--bg-2);
}
.ask-img.is-video { background: #222; }
.ask-img img { width: 100%; height: 100%; object-fit: cover; }
.ask .ask-x { top: 4px; left: 56px; right: auto; }
.ask-body { display: grid; gap: 8px; min-width: 0; }
textarea.input.ask-note { min-height: 88px; padding: 10px 12px; line-height: 1.4; }
textarea.input.ask-a { min-height: 64px; }
.ask-q {
  background: var(--pink-soft); border-radius: 10px; padding: 10px 12px;
  font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.ask-answer {
  background: #E9F7EE; border-radius: 10px; padding: 8px 12px;
  font-size: 14px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere;
}
.ask-answer span {
  display: block; margin-bottom: 2px; color: #126B37;
  font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}

/* "Choose photos" sheet */
.sheet-hint.first { margin-top: 0; }
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.pick { position: relative; aspect-ratio: 1; padding: 0; border: 0; overflow: hidden; border-radius: 10px; background: var(--bg-2); }
.pick.is-video { background: #222; }
.pick img { width: 100%; height: 100%; object-fit: cover; }
.pick.on { outline: 3px solid var(--pink); outline-offset: -3px; }
.pick-check {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(17, 17, 17, .3); color: transparent;
  display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.pick.on .pick-check { background: var(--pink); color: var(--ink); }
.pick-check svg { width: 13px; height: 13px; }

/* files that are not photos: PDF, Excel, drafts… */
.thumb-pdf { padding: 0; }
.doc-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 8px; text-align: center; font-size: 11px; color: var(--ink-2); word-break: break-word;
}
.doc-btn b { font-family: var(--font-head); font-size: 13px; color: var(--pink-deep); }
.doc-btn span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thumb-pdf .x { top: 3px; right: 3px; width: 24px; height: 24px; }
.thumb-pdf .x svg { width: 12px; height: 12px; }
.doc-btn:has(+ .x) { gap: 3px; padding: 20px 6px 4px; line-height: 1.2; }

/* Assign panel: open tasks per assistant */
.choice .n { margin-left: 2px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.choice.on .n { color: rgba(255, 255, 255, .65); }
.label .muted { text-transform: none; }

/* Duplicate (same supplier, different task for another assistant) */
.dup-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 0;
  color: var(--ink-2); font-size: 13px; text-align: left;
}
.dup-link svg, .dup-btn svg { width: 16px; height: 16px; flex: none; }
.dup-btn { margin-bottom: 10px; }

/* ---------- language: assistants switch between English and Chinese ---------- */
.top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-right .count { overflow: hidden; text-overflow: ellipsis; }
.lang-btn {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 11px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--bg); color: var(--ink);
  font-size: 13px; font-weight: 700; line-height: 1;
}
.lang-btn svg { width: 15px; height: 15px; }
.lang-btn:active { background: var(--pink-soft); }
.login-lang { margin-top: 26px; }

/* the task translated automatically: small line above the notes */
.tr-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px;
  margin: -2px 0 10px; font-size: 12px; color: var(--ink-3);
}
.tr-bar svg { width: 14px; height: 14px; flex: none; }
.tr-bar .link.inline { color: var(--ink-2); }
.tr-partial { flex-basis: 100%; }

/* Chinese text: no letter spacing, slightly larger small labels */
html[lang="zh-CN"] .label { letter-spacing: .02em; font-size: 12px; }
html[lang="zh-CN"] .head { letter-spacing: .04em; }
html[lang="zh-CN"] .pill { letter-spacing: 0; }

/* assistant list: their name next to "Your suppliers" (the header has the language button) */
.mine-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mine-top .pill.who { flex: none; max-width: 45%; }

/* ---------- supplier communication guidelines (assistants) ---------- */
/* 📖 button at the top of every assistant page */
.guide-btn {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 12px 0 9px; border-radius: 999px; border: 0;
  background: var(--pink); color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1;
  box-shadow: 0 2px 10px rgba(255, 92, 191, .35);
}
.guide-btn-emoji { font-size: 15px; }
.guide-btn:active { transform: scale(.96); }
/* narrow phones: make room for the two buttons */
@media (max-width: 420px) {
  .top-asst .logo small { display: none; }
  .bar .guide-btn-text { display: none; }
  .bar .guide-btn { padding: 0 9px; }
}

.guide { display: grid; gap: 14px; }
.guide-hero {
  text-align: center; border-radius: 24px; padding: 24px 18px 20px;
  background: linear-gradient(165deg, #FFDDF0 0%, #FFF0F8 55%, #FFFFFF 100%);
  border: 1.5px solid #FFCFE9;
}
.guide-emoji { font-size: 44px; line-height: 1; margin-bottom: 12px; animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .guide-emoji { animation: none; } }
.guide-title {
  font-family: var(--font-head); color: var(--pink); font-size: 19px; line-height: 1.2;
  text-transform: uppercase; letter-spacing: .01em; text-wrap: balance;
}
.guide[lang="zh-CN"] .guide-title { font-size: 24px; letter-spacing: .06em; }
.guide-intro { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.guide-card {
  background: #fff; border: 1.5px solid #FFD9EE; border-radius: 22px; padding: 16px 16px 15px;
  box-shadow: 0 4px 16px rgba(255, 92, 191, .08);
}
.guide-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 16px; font-weight: 800; line-height: 1.3; }
.guide-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pink); color: var(--ink); font-family: var(--font-head); font-size: 11px;
}
.guide-ico { flex: none; font-size: 20px; line-height: 1; }
.guide-body { display: grid; gap: 9px; font-size: 15px; line-height: 1.55; color: var(--ink); }
.guide-body b { font-weight: 700; background: linear-gradient(transparent 58%, #FFD3EC 58%); padding: 0 1px; }
.guide-body .g-lead { font-weight: 700; margin-bottom: -3px; }
.guide-body ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.guide-body li { position: relative; padding-left: 28px; }
.guide-body li::before {
  content: '✓'; position: absolute; left: 0; top: 2px; width: 19px; height: 19px; border-radius: 50%;
  display: grid; place-items: center; background: var(--pink-soft); color: var(--pink-deep);
  font-size: 11px; font-weight: 900;
}
.g-callout {
  border-radius: 16px; padding: 11px 14px; text-align: center;
  background: var(--pink-soft); color: var(--pink-deep); font-weight: 700;
}
.g-tip { border-radius: 12px; padding: 8px 12px; background: var(--bg-2); font-size: 13px; color: var(--ink-2); }
.g-tip b { background: none; }

/* the first time: full page with "I understand" at the bottom */
.guide-page { padding-top: 18px; }
.guide-kicker { margin-bottom: 12px; text-align: center; font-size: 15px; font-weight: 700; }
.guide-bar .btn-primary { font-size: 17px; font-weight: 700; box-shadow: 0 6px 18px rgba(255, 92, 191, .4); }
.guide-later { margin-top: 8px; text-align: center; font-size: 12px; color: var(--ink-3); }

/* later: the 📖 panel */
.guide-sheet { max-width: 620px; }
.guide-sheet .sheet-body { padding-top: 8px; }
.guide-sheet-k { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.guide-sheet-r { display: flex; align-items: center; gap: 6px; }
.sheet-foot.guide-foot { grid-template-columns: 1fr; }

/* Team page */
.guide-preview { margin-top: 12px; }
.team-guide { margin: 6px 0 0 48px; font-size: 13px; color: var(--ink-3); }
.team-guide.ok { color: #1E7A43; }
.guide-page.with-savebar { padding-bottom: calc(150px + var(--safe-b)); }

/* assistants see only a name the owner gave them, never "Assistant 2" */
.pill.who[hidden] { display: none; }
/* Assign panel: two or more assistants on one card see each other's work */
.sheet-hint.shared-warn { background: #FFF6E0; color: #7A5200; border-radius: 12px; padding: 10px 12px; }
.sheet-hint.shared-warn[hidden] { display: none; }
