/* Product Library — gallery-minimal look, inspired by tamenewyork.com
   (Sarah, Sep 2026): white, black, Poppins, uppercase micro-labels,
   hairline borders, squared corners, no card chrome. */
:root {
  --bg: #ffffff;
  --card: #ffffff;
  --panel: #fafafa;
  --text: #111111;
  --muted: #767676;
  --line: #e9e9e9;
  --line-strong: #d6d6d6;
  --accent: #111111;
  --green: #2e6b45;
  --green-soft: #eef4ef;
  --amber: #8a5a1f;
  --amber-soft: #f6f0e6;
  --red: #a3271e;
  --red-soft: #f9edec;
  --radius: 2px;
  --serif: "New York", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 1060px; margin: 0 auto; padding: 1.8rem 1.4rem 5rem; }
a { color: var(--text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { opacity: 0.6; }

h1 {
  font-size: 1.9rem;
  font-weight: 400;
  letter-spacing: -0.04em;
  margin: 0.8rem 0 1.4rem;
}
h1 a { text-decoration: none; }
h2 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text);
  margin: 2.6rem 0 0.9rem;
}
h2 .tag { letter-spacing: 0; }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand {
  font-family: var(--serif);
  font-weight: 500; font-size: 1.55rem; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none; line-height: 1;
}
.brand:hover { opacity: 1; }
.topbar-actions { display: flex; gap: 0.35rem; align-items: center; min-width: 0; }
.nav-tabs { display: flex; gap: 0.35rem; align-items: center; min-width: 0; }
.topbar-actions .btn {
  display: inline-flex; align-items: center; gap: 0.35rem; height: 30px;
  border: 1px solid var(--line-strong); background: none;
  padding: 0 0.7rem; border-radius: var(--radius);
  font-size: 0.66rem; font-weight: 600; line-height: 1;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text); box-shadow: none; white-space: nowrap;
}
.nav-icons {
  display: flex; align-items: center; gap: 0.3rem;
  margin-left: 0.45rem; padding-left: 0.55rem;
  border-left: 1px solid var(--line);
}
.topbar-actions .icon-btn { width: 30px; height: 30px; }
.topbar-actions .btn:hover { border-color: var(--text); opacity: 1; background: none; }
.topbar-actions .btn-primary,
.topbar-actions .btn-quiet { background: none; color: var(--text); }
.topbar-actions .btn-quiet { border-color: transparent; color: var(--muted); }
.topbar-actions .btn-quiet:hover { color: var(--text); }

/* flash messages */
.flash { max-width: 1060px; margin: 1rem auto 0; padding: 0 1.4rem; }
.flash p {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--text);
  border-radius: var(--radius);
  padding: 0.7rem 1rem; margin: 0.3rem 0;
  font-size: 0.86rem;
}

/* buttons */
.btn {
  display: inline-block; padding: 0.5rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--card); color: var(--text);
  font-family: inherit;
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  text-decoration: none; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease,
              opacity .15s ease;
}
.btn:hover { border-color: var(--text); }
.btn-primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn-primary:hover { background: #333; border-color: #333; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); background: var(--red-soft); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-quiet:hover { border-color: transparent; color: var(--text); }
.btn-small { padding: 0.3rem 0.75rem; font-size: 0.66rem; }
.btn-x {
  border: none; background: none; color: var(--muted); font-size: 1.05rem;
  cursor: pointer; padding: 0 0.3rem;
}
.btn-x:hover { color: var(--red); }

/* inputs */
input, select, textarea { font-family: inherit; accent-color: var(--text); }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible {
  outline: 1.5px solid var(--text);
  outline-offset: 1px;
}

/* filters */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  margin-bottom: 1.6rem;
}
.filters input[type="search"] { flex: 1 1 210px; }
.filters input, .filters select {
  padding: 0.5rem 0.75rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card); font-size: 0.85rem;
}
.filters input:hover, .filters select:hover { border-color: var(--line-strong); }
.date-field { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 0.3rem; }

/* gallery grid — chrome-less, like a lookbook */
.grid {
  display: grid; gap: 1.6rem 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.card {
  background: none; border: none; border-radius: 0;
  overflow: visible; text-decoration: none; color: var(--text);
  box-shadow: none;
}
.card-photo {
  aspect-ratio: 4 / 5; background: var(--panel); overflow: hidden;
  border-radius: var(--radius);
}
.card-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .4s ease, opacity .3s ease;
}
.card:hover .card-photo img { transform: scale(1.03); }
.no-photo {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.8rem; min-height: 120px;
}
.card-body { padding: 0.6rem 0.1rem 0; }
.card-brand {
  margin: 0; font-size: 0.62rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.card-name {
  margin: 0.2rem 0 0; font-size: 0.74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-name a { color: inherit; text-decoration: none; }
.card-name a:hover { opacity: 0.6; }
.card-date { margin: 0.3rem 0 0; font-size: 0.72rem; color: var(--muted); }

.empty {
  text-align: center; color: var(--muted); padding: 4rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
}

/* forms */
.form { display: flex; flex-direction: column; gap: 0.9rem; max-width: 540px; }
.form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.form input, .form textarea, .form select {
  padding: 0.55rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 0.92rem; font-weight: 400; background: var(--card);
  text-transform: none; letter-spacing: normal;
}
.form-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.form-row label { flex: 1 1 150px; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 0.3rem; align-items: center; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 0.83rem; }
.hint a { color: var(--muted); }

/* product detail */
.detail-header { display: flex; gap: 2rem; margin-top: 1rem; }
.detail-photo { flex: 0 0 260px; }
.detail-photo img, .detail-photo .no-photo {
  width: 260px; height: 325px; object-fit: cover; border-radius: var(--radius);
  border: none; background: var(--panel);
}
.detail-info h1 { margin: 0 0 0.4rem; font-size: 1.5rem; }
/* reference links (TikTok listing, brand page) — small, quiet, side by side */
.detail-refs {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  margin: 0.5rem 0 0.2rem; align-items: center;
}
.detail-refs form { display: flex; margin: 0; }
.detail-refs .btn { padding: 0.34rem 0.7rem; line-height: 1.3; }
/* link + its copy icon travel together when the row wraps */
.ref-pair { display: inline-flex; align-items: center; gap: 0.25rem; }
.refs-label {
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--muted);
}
/* asked only right after she pastes a link we don't recognise */
.promote-ask {
  margin: 0.7rem 0; padding: 0.8rem 1rem;
  border: 1px solid var(--text); border-radius: var(--radius);
  background: var(--panel);
}
.promote-ask p { margin: 0 0 0.35rem; font-size: 0.87rem; }
.promote-ask .form-actions { display: flex; gap: 0.4rem; margin-top: 0.6rem; }

/* product actions: equal buttons that fill the row and fold to 2x2 when
   the column gets narrow — never a ragged wrap */
.detail-actions {
  display: grid; gap: 0.5rem; margin-top: 1.1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));   /* tidy 2x2 by default */
  align-items: stretch;
}
.detail-actions form { display: flex; margin: 0; }
.detail-actions .btn {
  width: 100%; text-align: center; padding: 0.5rem 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap;
}
/* wide screens have room for one clean row of four */
@media (min-width: 1100px) {
  .detail-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.notes { color: var(--muted); font-size: 0.86rem; white-space: pre-wrap; }

/* link lists */
.link-list { list-style: none; padding: 0; margin: 0.3rem 0 0.6rem; }
.link-list li {
  display: flex; align-items: center; gap: 0.55rem; padding: 0.5rem 0.1rem;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.link-list li:last-child { border-bottom: none; }
.link-list li a { word-break: break-all; font-size: 0.86rem; }
.link-list form { margin-left: auto; }

.tag {
  display: inline-block; background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.1rem 0.5rem; font-size: 0.64rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text); line-height: 1.7;
}
.tag-platform { background: var(--panel); color: var(--text); text-decoration: none; }
.tag-platform:hover { border-color: var(--text); opacity: 1; }
.tag-featured { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.tag-shopmy { background: var(--green-soft); border-color: transparent; color: var(--green); }
.tag-amazon { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.tag-todo { background: var(--red-soft); border-color: transparent; color: var(--red); }
.tag-soldout { background: var(--text); border-color: var(--text); color: #fff; }

.inline-form { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.45rem; align-items: center; }
.inline-form input, .inline-form select {
  padding: 0.45rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 0.85rem; background: var(--card);
}
.inline-form input[type="url"] { flex: 1 1 220px; }

/* shares / generic cards */
.share-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: none;
  padding: 1rem 1.1rem; margin: 0.8rem 0;
}
.share-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.share-actions { margin-left: auto; display: flex; gap: 0.35rem; }
.share-actions form { display: inline; }
.share-chosen { margin: 0.4rem 0 0; font-size: 0.83rem; word-break: break-all; }
.share-platforms { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.55rem; }
.add-share { margin-top: 1rem; }
.add-share summary {
  cursor: pointer; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.add-share summary:hover { opacity: 0.6; }
.add-share .form { margin-top: 0.9rem; }

/* post engagement stats */
.post-stats { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--muted); }
.stats-platform {
  display: inline-block; font-weight: 600; color: var(--text);
  margin-right: 0.35rem; text-transform: uppercase; font-size: 0.68rem;
  letter-spacing: 0.08em;
}
.stats-when { margin-left: 0.4rem; font-size: 0.72rem; opacity: 0.75; }

/* post lineup */
.lineup-row { display: flex; gap: 1rem; align-items: flex-start; }
.lineup-thumb {
  width: 76px; height: 95px; object-fit: cover; border-radius: var(--radius);
  border: none; background: var(--panel); flex: none;
  display: flex; align-items: center; justify-content: center;
}
.lineup-info { flex: 1; min-width: 0; }
.lineup-actions { display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-end; }
.dm-preview {
  width: 100%; max-width: 600px; font-family: inherit; font-size: 0.9rem;
  line-height: 1.6;
  padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--text); resize: vertical;
  transition: border-color .15s ease;
}
.dm-preview:hover { border-color: var(--line-strong); }

/* manual review — zone panels */
.review-zone {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.review-zone.zone-done {
  background: transparent;
  border-style: dashed;
  opacity: 0.65;
}
.zone-head {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.55rem;
}
.zone-title {
  font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--text);
}
.zone-actions {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
  margin-top: 0.6rem;
}
.zone-paste { display: flex; gap: 0.4rem; align-items: center; flex: 1 1 300px; }
.zone-paste input {
  flex: 1; min-width: 0;
  padding: 0.45rem 0.75rem; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 0.85rem; background: var(--card);
}
.zone-actions > form:last-child { margin-left: auto; }

/* manual review */
.badge {
  display: inline-block; background: var(--text); color: #fff;
  border-radius: 999px; padding: 0 0.45rem; font-size: 0.68rem; font-weight: 600;
  margin-left: 0.25rem; letter-spacing: 0;
}
.review-original { flex: 0 0 175px; }
.review-photo {
  width: 155px; height: 194px; object-fit: cover; border-radius: var(--radius);
  border: none; background: var(--panel);
}
.review-candidates { display: flex; gap: 0.8rem; flex-wrap: wrap; flex: 1; }
.review-candidate {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.6rem; width: 176px; background: var(--card);
  display: flex; flex-direction: column;
  transition: border-color .15s ease;
}
.review-candidate:hover { border-color: var(--text); }
.review-candidate .review-photo { width: 100%; height: 172px; }
.review-candidate .card-name { font-size: 0.7rem; }
.review-candidate .hint { font-size: 0.75rem; }
.review-candidate p { margin: 0.3rem 0 0; }
.review-candidate > p:nth-last-child(2) { margin-top: auto; padding-top: 0.4rem; }
.review-candidate .form-actions {
  margin-top: 0.35rem; display: grid; gap: 0.28rem;
}
.review-candidate .form-actions form { display: flex; }
.review-candidate .form-actions .btn { width: 100%; }
.pending-row { display: flex; gap: 0.9rem; align-items: center; flex-wrap: wrap; }
.pending-flags { margin-left: auto; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.route-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0 1.2rem; }

/* small screens */
/* phone: compact top bar, collapsible filters, tighter grid */
@media (max-width: 700px) {
  .topbar {
    padding: 0.6rem 0.8rem;
    flex-wrap: wrap; gap: 0.5rem 0.4rem;
  }
  .brand { font-size: 1.05rem; flex: none; margin-right: 0.3rem; }
  .topbar-actions {
    gap: 0.25rem; flex: 1 1 100%; min-width: 0; flex-wrap: nowrap;
  }
  /* the tabs scroll; the icons stay put so Stats and Guide are always
     one tap away on a phone */
  .nav-tabs {
    flex: 1 1 auto; min-width: 0; overflow-x: auto; gap: 0.25rem;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding-bottom: 0.15rem;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-icons { flex: none; }
  .topbar-actions .btn {
    height: 28px; padding: 0 0.55rem; font-size: 0.58rem;
    letter-spacing: 0.05em; flex: none;
  }
  .topbar-actions .icon-btn { width: 28px; height: 28px; flex: none; }
  .nav-icons { margin-left: 0.35rem; padding-left: 0.4rem; }
  /* phone: drop the rarely-used manual add (products import automatically) */
  .topbar-actions .btn-quiet { display: none; }
  .hide-phone { display: none; }              /* "broken" on the alert pill */
  .brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .badge { font-size: 0.6rem; padding: 0 0.35rem; }

  /* filters collapse into one tidy block */
  .filters {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem;
    margin-bottom: 1rem;
  }
  .filters input[type="search"] { grid-column: 1 / -1; }
  .filters .date-field { display: none; }   /* rarely used on a phone */
  .filters input, .filters select {
    width: 100%; font-size: 0.8rem; padding: 0.45rem 0.6rem;
  }
  .filters .btn { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  main { padding: 1.1rem 1rem 3.5rem; }
  h1 { font-size: 1.45rem; }
  /* photo beside the name instead of a full screen of it, so the links and
     actions start above the fold */
  .detail-header {
    display: grid; grid-template-columns: 108px 1fr;
    gap: 0.3rem 0.9rem; margin-top: 0.8rem;
  }
  .detail-info { display: contents; }
  .detail-info > * { grid-column: 1 / -1; }
  .detail-photo { grid-column: 1; grid-row: 1 / span 2; }
  .detail-photo img, .detail-photo .no-photo {
    width: 108px; height: 135px; aspect-ratio: auto;
  }
  .detail-photo .no-photo { font-size: 0.7rem; }
  .detail-info > .card-brand { grid-column: 2; grid-row: 1; align-self: end; margin: 0; }
  .detail-info > h1 { grid-column: 2; grid-row: 2; align-self: start; font-size: 1.25rem; }
  /* forms below stack full width instead of overflowing */
  .detail-info .inline-form { width: 100%; }
  .detail-info .inline-form input:not([type="checkbox"]),
  .detail-info .inline-form select { width: 100%; flex: 1 1 100%; }
  .detail-info .inline-form label { flex: 1 1 auto; }
  .detail-info .inline-form .btn { width: 100%; }
  /* phone: a tidy 2x2 block instead of a ragged wrap */
  .detail-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem;
  }
  /* the add-link / add-similar forms stack instead of wrapping raggedly */
  section .inline-form {
    display: grid; grid-template-columns: 1fr; gap: 0.4rem;
    align-items: stretch;
  }
  section .inline-form input,
  section .inline-form select,
  section .inline-form .btn { width: 100%; }
  section .inline-form input[type="checkbox"] { width: auto; }

  .detail-actions form, .detail-actions > .btn { width: 100%; }
  .detail-actions .btn { width: 100%; min-width: 0; padding: 0.55rem 0.5rem;
                         font-size: 0.62rem; letter-spacing: 0.06em; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.1rem 0.8rem; }
  .share-actions { margin-left: 0; width: 100%; }
  .lineup-row { flex-wrap: wrap; }
  .lineup-actions { align-items: stretch; width: 100%; }
  .topbar { padding: 0.75rem 1rem; }
  .topbar-actions { gap: 0.9rem; }
}

/* broken-link rows: the fix controls get their own line so the product
   name isn't squeezed into a sliver */
#broken .pending-row .zone-actions { flex: 1 1 100%; margin-top: 0.2rem; }
#broken .pending-row .lineup-info { flex: 1 1 260px; }

.btn-alert,
.topbar-actions .btn-alert {
  background: var(--red); border-color: var(--red); color: #fff;
}
.btn-alert:hover,
.topbar-actions .btn-alert:hover {
  background: var(--red); border-color: var(--red); opacity: 0.85;
}

/* ---- phone: manual review ----------------------------------------
   Desktop puts the TikTok listing beside the Amazon/ShopMy zones. On a
   phone that leaves two starved columns, so the listing becomes a header
   row across the top and the zones get the full width underneath. */
@media (max-width: 700px) {
  .review-group { padding: 0.9rem; }
  .review-group .lineup-row { flex-direction: column; gap: 0.9rem; }

  /* the TikTok listing: thumbnail left, name right, Skip on the end */
  .review-original {
    flex: 1 1 auto; width: 100%;
    display: grid; grid-template-columns: 84px 1fr auto;
    gap: 0.7rem; align-items: center;
    padding-bottom: 0.8rem; border-bottom: 1px solid var(--line);
  }
  .review-original .review-photo {
    width: 84px; height: 105px; grid-column: 1; grid-row: 1 / span 2;
  }
  .review-original .card-brand { grid-column: 2; grid-row: 1; margin: 0; align-self: end; }
  .review-original .card-name { grid-column: 2; grid-row: 2; margin: 0.15rem 0 0; align-self: start; }
  .review-original .hint { display: none; }        /* "Your TikTok listing" */
  .review-original form { grid-column: 3; grid-row: 1 / span 2; }

  /* candidates: two per row so photos stay comparable */
  /* minmax(0,…) so long product titles can't stretch the grid past the card */
  .review-candidates {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem; min-width: 0;
  }
  .review-group .lineup-row > div { min-width: 0; width: 100%; }
  .review-candidate { width: auto; min-width: 0; padding: 0.5rem; }
  .review-candidate .card-name, .review-candidate .hint,
  .review-candidate a { overflow-wrap: anywhere; }
  .review-candidate .review-photo { height: 150px; }
  .review-candidate .form-actions { display: grid; gap: 0.3rem; }
  .review-candidate .form-actions form,
  .review-candidate .form-actions .btn { width: 100%; }

  /* paste boxes and buttons go full width instead of squeezing */
  .review-zone { padding: 0.75rem 0.8rem; }
  .zone-actions { flex-direction: column; align-items: stretch; gap: 0.45rem; }
  .zone-paste { flex: 1 1 auto; width: 100%; }
  .zone-actions > form:last-child { margin-left: 0; }
  .zone-actions > form:last-child .btn { width: 100%; }

  /* pending list: stack the row, full-width link box (was overflowing) */
  .pending-row { align-items: flex-start; gap: 0.6rem; }
  .pending-row .lineup-info { flex: 1 1 60%; }
  .pending-row .inline-form,
  .pending-row form { width: 100%; margin-top: 0; }
  .pending-row .inline-form input { width: 100%; flex: 1 1 100%; }
  .pending-row .inline-form .btn,
  .pending-row > form .btn { width: 100%; }
  .pending-row .zone-actions { width: 100%; }

  .route-tabs { gap: 0.35rem; }
  .route-tabs .btn { font-size: 0.62rem; padding: 0.4rem 0.55rem; }
}

/* backend notices (things that happened while she was away) */
.notice {
  display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between;
  margin: 1rem 1.5rem 0; padding: 0.9rem 1.1rem;
  border: 1px solid var(--text); border-radius: var(--radius);
  background: var(--panel);
}
.notice-title { margin: 0; font-weight: 600; font-size: 0.9rem; }
.notice-body { margin: 0.3rem 0 0; font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.notice form { flex: none; }
@media (max-width: 700px) {
  .notice { margin: 0.8rem 1rem 0; flex-direction: column; gap: 0.6rem; }
  .notice form, .notice .btn { width: 100%; }
}

/* videos that can't post yet: visible, but clearly not finished */
.pending-row.not-ready { border-style: dashed; }
.pending-row.not-ready .lineup-thumb { opacity: 0.6; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* similar products (look-alikes) inside the composer */
.similar-summary {
  cursor: pointer; font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
}
.similar-summary:hover { color: var(--text); }
.similar-row {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0.4rem 0; font-size: 0.83rem;
}
.similar-row img {
  width: 34px; height: 42px; object-fit: cover; border-radius: var(--radius);
  background: var(--panel); flex: none;
}
.btn-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--muted); text-decoration: underline;
}
.btn-link:hover { color: var(--text); }

.link-chips { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.35rem 0 0.5rem; }
.pending-row .zone-paste { margin-top: 0.35rem; }

/* shown only if the browser refuses clipboard access */
.copy-reveal {
  flex: 1 1 100%; margin-top: 0.35rem;
  padding: 0.4rem 0.6rem; font-size: 0.8rem; font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--text);
}

/* small square icon button (copy, etc) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; flex: none;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--card); color: var(--muted);
  font-size: 0.8rem; font-family: inherit; cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--text); }
.icon-btn.copied { color: var(--green); border-color: var(--green); }

/* the keyword-stuffed TikTok title, on demand */
.full-title { margin: -0.15rem 0 0.35rem; }
.full-title summary {
  cursor: pointer; font-size: 0.64rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.full-title summary:hover { color: var(--text); }
.rename-form {
  display: grid; gap: 0.4rem; margin-top: 0.5rem; max-width: 34rem;
}
.rename-form input, .rename-form textarea {
  width: 100%; padding: 0.45rem 0.7rem; font-family: inherit;
  font-size: 0.85rem; line-height: 1.45;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--text); resize: vertical;
}
.rename-form .btn { justify-self: start; }
@media (max-width: 700px) { .rename-form .btn { justify-self: stretch; width: 100%; } }
.detail-info > .notes { font-size: 0.8rem; line-height: 1.5; }

/* composer: products in this video — a card each, photo first */
.lineup-cards { display: grid; gap: 0.6rem; margin: 0.6rem 0 1rem; }
.lineup-card {
  display: flex; gap: 0.85rem; align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card);
}
.lineup-card.is-featured { border-color: var(--line-strong); }
.lineup-card-photo {
  width: 68px; height: 85px; object-fit: cover; flex: none;
  border-radius: var(--radius); background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.75rem;
}
.lineup-card-body { flex: 1; min-width: 0; display: flex;
                    flex-direction: column; gap: 0.35rem; }
.lineup-card-name { margin: 0; font-size: 0.9rem; font-weight: 600; }
.lineup-card-name a { text-decoration: none; color: var(--text); }
.lineup-card-name a:hover { text-decoration: underline; }
.lineup-card .link-chips { margin: 0; }
.lineup-card .zone-paste { flex: 1 1 auto; }

/* look-alikes as a little strip of thumbnails */
.similar-strip { display: flex; align-items: center; gap: 0.4rem;
                 flex-wrap: wrap; margin-top: 0.1rem; }
.similar-strip-label {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.similar-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.45rem 0.2rem 0.2rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 0.72rem; text-decoration: none; color: var(--muted);
}
.similar-chip:hover { border-color: var(--text); color: var(--text); }
.similar-chip img { width: 24px; height: 30px; object-fit: cover;
                    border-radius: 1px; }

@media (max-width: 700px) {
  .lineup-card { padding: 0.65rem; gap: 0.6rem; }
  .lineup-card-photo { width: 56px; height: 70px; }
  .lineup-card .zone-paste { flex-wrap: wrap; }
  .lineup-card .zone-paste input { flex: 1 1 100%; }
  .lineup-card .zone-paste .btn { width: 100%; }
}

/* composer: the one place you add things to a video */
.add-box {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 0.9rem 1rem; margin-top: 0.4rem;
}
.add-box-title {
  margin: 0 0 0.7rem; font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.16em;
}
.add-row + .add-row {
  margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line);
}
.add-label {
  display: block; font-size: 0.82rem; font-weight: 600;
  margin-bottom: 0.35rem;
}
.add-row .hint { margin: 0.3rem 0 0; }
.add-row .zone-paste { flex: 1 1 auto; }

/* product search with pictures */
.product-search { position: relative; }
.product-search-input {
  width: 100%; padding: 0.45rem 0.75rem; font-family: inherit;
  font-size: 0.85rem; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.product-search-results {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem; margin-top: 0.5rem;
  max-height: 320px; overflow-y: auto;
}
.ps-hit {
  display: flex; flex-direction: column; gap: 0.3rem; padding: 0.4rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); cursor: pointer; text-align: left;
  font-family: inherit; color: var(--text);
}
.ps-hit:hover { border-color: var(--text); }
.ps-hit img, .ps-hit .ps-nophoto {
  width: 100%; aspect-ratio: 4/5; object-fit: cover;
  border-radius: 1px; background: var(--panel);
}
.ps-hit .ps-brand {
  font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.ps-hit .ps-name { font-size: 0.72rem; line-height: 1.3; }
.ps-empty { font-size: 0.82rem; color: var(--muted); padding: 0.3rem 0; }

@media (max-width: 700px) {
  /* the add rows stack instead of squeezing three controls onto one line */
  .add-box .zone-paste { flex-wrap: wrap; gap: 0.4rem; }
  .add-box .zone-paste input { flex: 1 1 100%; max-width: none !important; }
  .add-box .zone-paste .btn { width: 100%; }
  .product-search-results { grid-template-columns: 1fr 1fr; }
}

.chips-label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-right: 0.1rem;
}

/* little ⓘ: the explanation without the paragraph */
.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 0.35rem; vertical-align: 1px;
  text-transform: none;   /* headings are uppercase; the glyph isn't */
  border: 1px solid var(--line-strong); border-radius: 50%;
  font-size: 0.58rem; font-weight: 700; font-style: italic;
  color: var(--muted); cursor: help; position: relative;
}
.info:hover, .info:focus { color: var(--text); border-color: var(--text); outline: none; }
.info.warn { color: var(--red); border-color: var(--red); font-style: normal; }
.info.warn:hover, .info.warn:focus { color: #fff; background: var(--red); }
.info.warn::after { background: var(--red); }
.info::after {
  content: attr(data-tip);
  position: absolute; left: 50%; top: calc(100% + 7px);
  transform: translateX(-50%);
  width: max-content; max-width: 250px;
  padding: 0.5rem 0.65rem;
  background: var(--text); color: #fff;
  font-size: 0.72rem; font-weight: 400; font-style: normal;
  letter-spacing: 0; line-height: 1.45; text-transform: none;
  border-radius: var(--radius);
  opacity: 0; visibility: hidden; transition: opacity .12s ease;
  z-index: 20; pointer-events: none;
}
.info:hover::after, .info:focus::after { opacity: 1; visibility: visible; }
@media (max-width: 700px) {
  .info::after { left: 0; transform: none; max-width: 78vw; }
}

/* scheduled page */
.sched-day + .sched-day { margin-top: 1.6rem; }
.sched-row {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.6rem 0.9rem; margin: 0.45rem 0;
}
.sched-time {
  flex: none; width: 5.2rem; font-size: 0.78rem; font-weight: 600;
  color: var(--muted); letter-spacing: 0.02em;
}
.sched-thumb { width: 42px; height: 53px; }
.sched-actions { display: flex; gap: 0.35rem; margin-left: auto; }
@media (max-width: 700px) {
  .sched-row { flex-wrap: wrap; gap: 0.5rem; }
  .sched-time { width: auto; order: -1; }
  .sched-actions { margin-left: 0; width: 100%; }
  .sched-actions form { flex: 1 1 45%; }
  .sched-actions .btn { width: 100%; }
}

.add-row select {
  padding: 0.45rem 0.6rem; font-family: inherit; font-size: 0.82rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--text); max-width: 15rem;
}
@media (max-width: 700px) { .add-row select { max-width: none; flex: 1 1 100%; } }

.one-off-card { border-style: dashed; }
.one-off-card .lineup-card-photo {
  font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase;
  text-align: center; line-height: 1.4;
}
.similar-chip form { display: inline-flex; }

/* editable captions */
.caption-form { margin: 0.4rem 0 0; }
.caption-form .dm-preview { width: 100%; max-width: 640px; }
.caption-actions {
  display: flex; align-items: center; gap: 0.45rem; margin-top: 0.4rem;
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  .caption-actions .btn { flex: 1 1 45%; }
}

/* dropdown with a tiny picture beside each option */
.tsel { position: relative; flex: 0 0 auto; }
.tsel-btn, .tsel-opt {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.32rem 0.5rem; width: 100%;
  font-family: inherit; font-size: 0.8rem; text-align: left;
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
}
.tsel-btn { min-width: 15rem; }
.tsel-btn:hover, .tsel-opt:hover { border-color: var(--text); }
.tsel-btn img, .tsel-opt img,
.tsel-btn .tsel-nothumb, .tsel-opt .tsel-nothumb {
  width: 26px; height: 32px; object-fit: cover; flex: none;
  border-radius: 1px; background: var(--panel);
}
.tsel-btn span:not(.tsel-caret), .tsel-opt span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tsel-caret { margin-left: auto; color: var(--muted); font-size: 0.7rem; }
.tsel-menu {
  position: absolute; top: calc(100% + 3px); left: 0; z-index: 30;
  min-width: 100%; max-height: 260px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 3px;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.tsel-opt { border-color: transparent; }
/* display:flex above beats the browser's [hidden] rule, so say it here */
.tsel-menu[hidden] { display: none; }
@media (max-width: 700px) {
  .tsel { flex: 1 1 100%; }
  .tsel-btn { min-width: 0; }
}

/* approve straight from the composer */
.approve-bar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin: 1rem 0 1.4rem; padding: 0.85rem 1rem;
  border: 1px solid var(--text); border-radius: var(--radius);
  background: var(--panel);
}
.approve-bar.is-approved { border-color: var(--green); background: var(--green-soft); }
.approve-text { flex: 1 1 260px; font-size: 0.86rem; line-height: 1.5; }
.approve-actions { display: flex; gap: 0.4rem; margin-left: auto; }
@media (max-width: 700px) {
  .approve-actions { margin-left: 0; width: 100%; }
  .approve-actions form, .approve-actions .btn { flex: 1 1 45%; width: 100%; }
}

/* analytics */
.stat-row { display: grid; gap: 0.6rem; margin: 1rem 0 1.4rem;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat { border: 1px solid var(--line); border-radius: var(--radius);
        padding: 0.9rem 1rem; background: var(--card); }
.stat-n { display: block; font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.stat-l { display: block; margin-top: 0.25rem; font-size: 0.66rem;
          letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 110px;
         padding: 0.5rem 0; }
.spark-bar { position: relative; flex: 0 1 26px; height: 100%;
             display: flex; align-items: flex-end; }
.spark-fill { width: 100%; background: var(--line-strong); border-radius: 1px; }
.spark-clicks { position: absolute; left: 0; bottom: 0; width: 100%;
                background: var(--text); border-radius: 1px; opacity: 0.9; }

/* the product she just worked, when Review scrolls back to it */
.share-card:target {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--panel);
  scroll-margin-top: 80px;
}

/* small sort control */
.sort-bar { display: flex; align-items: center; gap: 0.4rem; margin: 0.9rem 0; }
.sort-bar label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.sort-bar select {
  padding: 0.3rem 0.5rem; font-family: inherit; font-size: 0.78rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--text);
}
.sort-bar select:hover { border-color: var(--line-strong); }
