/* Tohar Brands — the management panel.

   The same panel the owner's other shop (Bisbas Brands) has, brought over here and
   dressed in this shop's colours: black ground, off-white type, and the gold of the
   opening ring for anything that can be acted on.

   Everything is scoped under `.tb-ad`. The panel itself is built by tb-admin.js and
   only enters the page when somebody asks for it, so a visitor who never opens it
   pays nothing for it but this stylesheet.

   It sits below the opening cover (2147483000) and above everything else. */

.tb-ad {
  --bg:      #0d0d0c;
  --card:    #151413;
  --field:   #1b1a18;
  --line:    rgba(244, 241, 236, .12);
  --line-2:  rgba(244, 241, 236, .07);
  --text:    #f4f1ec;
  --dim:     #8d8478;
  --gold:    #c2a35b;
  --gold-dim:rgba(194, 163, 91, .3);
  --red:     #a4302c;
  --green:   #4f7d5a;

  position: fixed;
  inset: 0;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2147482000;
  display: none;
  background: rgba(6, 6, 6, .72);
  direction: rtl;
  text-align: right;
  font-family: "Heebo", "Assistant", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.tb-ad.is-open { display: block }

.tb-ad__sheet {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(100%, 780px);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transform: translateX(30px);
  opacity: 0;
  transition: transform .3s cubic-bezier(.22, .61, .36, 1), opacity .3s ease;
}
.tb-ad.is-open .tb-ad__sheet { transform: none; opacity: 1 }

/* ---------------------------------------------------------------- head */

.tb-ad__head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.tb-ad__brand { min-width: 0 }
.tb-ad__eyebrow {
  margin: 0 0 3px;
  font-size: 9px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
}
.tb-ad__title {
  margin: 0;
  font-family: "Tohar Display", "Playfair Display", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.1;
}
.tb-ad__headbtns { display: flex; align-items: center; gap: 8px; flex: none }

.tb-ad__ghost {
  border: 1px solid var(--line);
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 11px;
  letter-spacing: .08em;
  padding: 7px 13px;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.tb-ad__ghost:hover { border-color: var(--gold-dim); color: var(--text) }

.tb-ad__x {
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  background: none;
  color: var(--dim);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.tb-ad__x:hover { border-color: var(--gold-dim); color: var(--text) }

/* ---------------------------------------------------------------- login */

.tb-ad__login { padding: 56px 28px; max-width: 420px; margin: 0 auto; width: 100%; box-sizing: border-box }
.tb-ad__login h2 {
  margin: 0 0 6px;
  font-family: "Tohar Display", "Playfair Display", Georgia, serif;
  font-size: 30px;
  font-weight: 500;
  text-align: center;
}
.tb-ad__login p {
  margin: 0 0 30px;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--dim);
  text-align: center;
}
.tb-ad__mark {
  font-size: 10px;
  letter-spacing: .42em;
  color: var(--gold);
  text-align: center;
  margin-bottom: 26px;
}

/* ---------------------------------------------------------------- fields */

.tb-ad__f { margin-bottom: 14px; min-width: 0 }
.tb-ad__f > label {
  display: block;
  font-size: 9.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 700;
  margin-bottom: 7px;
}
.tb-ad__f input[type="text"],
.tb-ad__f input[type="email"],
.tb-ad__f input[type="password"],
.tb-ad__f input[type="number"],
.tb-ad__f input[type="url"],
.tb-ad__f select,
.tb-ad__f textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 11px 13px;
  outline: none;
  border-radius: 0;
  transition: border-color .2s ease;
}
.tb-ad__f textarea { min-height: 76px; resize: vertical }
.tb-ad__f select { cursor: pointer }
.tb-ad__f input:focus,
.tb-ad__f select:focus,
.tb-ad__f textarea:focus { border-color: var(--gold-dim) }
.tb-ad__f input::placeholder, .tb-ad__f textarea::placeholder { color: rgba(141, 132, 120, .55) }
.tb-ad__hint { font-size: 10.5px; color: var(--dim); letter-spacing: .04em; margin-top: 6px; line-height: 1.6 }

.tb-ad__err {
  background: rgba(164, 48, 44, .13);
  border: 1px solid rgba(164, 48, 44, .38);
  color: #e08a86;
  font-size: 12px;
  padding: 10px 13px;
  margin-bottom: 14px;
  display: none;
  line-height: 1.6;
}
.tb-ad__err.show { display: block }

.tb-ad__go {
  width: 100%;
  background: var(--gold);
  color: #17140d;
  border: none;
  padding: 14px;
  font: inherit;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, opacity .2s ease;
  margin-top: 8px;
}
.tb-ad__go:hover { background: #d3b46b }
.tb-ad__go[disabled] { opacity: .5; cursor: default }
.tb-ad__go.narrow { max-width: 280px }

/* ---------------------------------------------------------------- body */

.tb-ad__dash { display: none; flex: 1; min-height: 0; flex-direction: column }
.tb-ad__dash.is-on { display: flex }

.tb-ad__tabs {
  flex: none;
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
  overflow-x: auto;
  background: var(--card);
}
.tb-ad__tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--dim);
  font: inherit;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .16em;
  padding: 15px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s ease, border-color .2s ease;
}
.tb-ad__tab:hover { color: var(--text) }
.tb-ad__tab.is-on { color: var(--text); border-bottom-color: var(--gold) }

.tb-ad__pane { display: none; padding: 24px 22px 40px; overflow-y: auto; flex: 1; min-height: 0 }
.tb-ad__pane.is-on { display: block }

.tb-ad__sect {
  font-size: 9px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
  margin: 0 0 18px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--gold-dim);
}
.tb-ad__sect.mt { margin-top: 30px }

.tb-ad__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }
.tb-ad__grid .full { grid-column: 1 / -1 }

/* ------------------------------------------------------- chips (cats, badges) */

.tb-ad__chips { display: flex; flex-wrap: wrap; gap: 7px }
.tb-ad__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  padding: 7px 12px;
  cursor: pointer;
  transition: all .18s ease;
  user-select: none;
}
.tb-ad__chip:hover { border-color: var(--gold-dim); color: var(--text) }
.tb-ad__chip.is-on { background: var(--gold); border-color: var(--gold); color: #17140d; font-weight: 700 }
.tb-ad__chip input { display: none }
.tb-ad__chipgroup { margin-bottom: 12px }
.tb-ad__chipgroup > span {
  display: block;
  font-size: 9.5px;
  letter-spacing: .2em;
  color: var(--dim);
  margin-bottom: 7px;
}

/* ------------------------------------------------------- sizes and stock */

.tb-ad__sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 7px }
.tb-ad__sz { border: 1px solid var(--line); background: var(--field) }
.tb-ad__sz-h {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  cursor: pointer;
  user-select: none;
}
.tb-ad__sz-h span { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--dim); flex: 1 }
.tb-ad__sz-h input { accent-color: var(--gold); width: 14px; height: 14px; cursor: pointer }
.tb-ad__sz-q {
  width: 100%;
  box-sizing: border-box;
  background: #111110;
  border: 0;
  border-top: 1px solid var(--line-2);
  color: rgba(141, 132, 120, .7);
  font: inherit;
  font-size: 12px;
  padding: 6px 9px;
  outline: none;
  text-align: center;
}
.tb-ad__sz.is-on { border-color: var(--gold-dim) }
.tb-ad__sz.is-on .tb-ad__sz-h span { color: var(--text) }
.tb-ad__sz.is-on .tb-ad__sz-q { background: var(--field); color: var(--text) }
.tb-ad__szbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px }
.tb-ad__szbar button {
  border: 1px solid var(--line);
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 10.5px;
  letter-spacing: .1em;
  padding: 5px 11px;
  cursor: pointer;
  transition: all .18s ease;
}
.tb-ad__szbar button:hover { border-color: var(--gold-dim); color: var(--text) }

/* ------------------------------------------------------- images */

.tb-ad__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed var(--gold-dim);
  padding: 24px 16px;
  cursor: pointer;
  text-align: center;
  transition: border-color .2s ease, background .2s ease;
  background: rgba(194, 163, 91, .03);
}
.tb-ad__drop:hover { border-color: var(--gold); background: rgba(194, 163, 91, .07) }
.tb-ad__drop b { font-size: 13px; font-weight: 700; color: var(--text) }
.tb-ad__drop small { font-size: 11px; color: var(--dim); line-height: 1.6 }
.tb-ad__drop .big { font-size: 30px; line-height: 1 }

.tb-ad__shots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px }
.tb-ad__shot {
  position: relative;
  width: 78px;
  height: 96px;
  background: #100f0e;
  border: 1px solid var(--line);
  overflow: hidden;
  flex: none;
}
.tb-ad__shot img { width: 100%; height: 100%; object-fit: cover; display: block }
.tb-ad__shot button {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border: 0;
  background: rgba(8, 8, 8, .78);
  color: #e08a86;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.tb-ad__shot .main {
  position: absolute;
  bottom: 0; right: 0; left: 0;
  background: var(--gold);
  color: #17140d;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .18em;
  text-align: center;
  padding: 2px 0;
}

/* ------------------------------------------------------- colour rows */

.tb-ad__col {
  display: grid;
  grid-template-columns: 40px 1fr 118px 34px;
  gap: 8px;
  align-items: center;
  background: var(--field);
  border: 1px solid var(--line);
  padding: 9px 10px;
  margin-bottom: 6px;
}
.tb-ad__col input[type="color"] {
  width: 40px; height: 32px;
  padding: 2px;
  border: 1px solid var(--line);
  background: #100f0e;
  cursor: pointer;
}
.tb-ad__col input[type="text"] {
  background: #100f0e;
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  padding: 7px 9px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.tb-ad__col label {
  font-size: 10.5px;
  color: var(--dim);
  border: 1px dashed var(--line);
  padding: 7px 6px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
}
.tb-ad__col label.has { border-style: solid; border-color: var(--gold-dim); color: var(--gold) }
.tb-ad__col button {
  border: 1px solid rgba(164, 48, 44, .3);
  background: none;
  color: rgba(224, 138, 134, .75);
  width: 30px; height: 30px;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.tb-ad__col button:hover { background: rgba(164, 48, 44, .12) }

.tb-ad__add {
  border: 1px solid var(--gold-dim);
  background: rgba(194, 163, 91, .08);
  color: var(--gold);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  padding: 6px 14px;
  cursor: pointer;
  transition: background .18s ease;
}
.tb-ad__add:hover { background: rgba(194, 163, 91, .18) }

/* ------------------------------------------------------- filter bar */

.tb-ad__bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tb-ad__bar input[type="search"],
.tb-ad__bar input[type="text"] {
  flex: 1 1 200px;
  min-width: 0;
  box-sizing: border-box;
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  border-radius: 0;
}
.tb-ad__bar input:focus { border-color: var(--gold-dim) }
.tb-ad__count { font-size: 11px; color: var(--dim); letter-spacing: .08em; margin: 0 2px 12px }
.tb-ad__count b { color: var(--gold); font-weight: 700 }

/* ------------------------------------------------------- product rows */

.tb-ad__rows { display: flex; flex-direction: column; gap: 8px }
.tb-ad__row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 108px auto;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 9px 11px;
  transition: border-color .2s ease;
}
.tb-ad__row.is-dirty { border-color: var(--gold-dim) }
.tb-ad__row.is-off { opacity: .48 }
.tb-ad__row > figure {
  margin: 0;
  width: 52px; height: 64px;
  background: #100f0e;
  border: 1px solid var(--line-2);
  overflow: hidden;
}
.tb-ad__row > figure img { width: 100%; height: 100%; object-fit: cover; display: block }
.tb-ad__who { min-width: 0 }
.tb-ad__who b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tb-ad__who small { display: block; font-size: 10px; color: var(--dim); letter-spacing: .06em; margin-top: 3px }
.tb-ad__money { display: flex; align-items: center; gap: 5px }
.tb-ad__money span { font-size: 13px; color: var(--dim); flex: none }
.tb-ad__money input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 9px;
  outline: none;
  text-align: center;
  border-radius: 0;
  -moz-appearance: textfield;
}
.tb-ad__money input::-webkit-outer-spin-button,
.tb-ad__money input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0 }
.tb-ad__money input:focus { border-color: var(--gold-dim) }
.tb-ad__money input.set { border-color: var(--gold-dim); color: var(--gold) }
.tb-ad__acts { display: flex; gap: 5px; flex: none }
.tb-ad__t {
  border: 1px solid var(--line);
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 11px;
  letter-spacing: .04em;
  padding: 7px 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s ease;
}
.tb-ad__t:hover { border-color: var(--gold-dim); color: var(--text) }
.tb-ad__t.on { background: var(--gold); border-color: var(--gold); color: #17140d; font-weight: 700 }
.tb-ad__t.warn.on { background: var(--red); border-color: var(--red); color: #fff }
.tb-ad__more {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line-2);
  margin-top: 2px;
  padding-top: 11px;
  display: none;
}
.tb-ad__row.is-open .tb-ad__more { display: block }

.tb-ad__empty { text-align: center; color: var(--dim); font-size: 13px; padding: 44px 10px; line-height: 1.8 }
.tb-ad__load { text-align: center; color: var(--dim); font-size: 12px; letter-spacing: .2em; padding: 40px 10px }

/* ------------------------------------------------------- sticky save bar */

.tb-ad__foot {
  flex: none;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  border-top: 1px solid var(--gold-dim);
  background: var(--card);
}
.tb-ad__foot.is-on { display: flex }
.tb-ad__foot p { margin: 0; font-size: 12px; color: var(--dim) }
.tb-ad__foot p b { color: var(--gold) }
.tb-ad__foot .tb-ad__go { width: auto; margin: 0; padding: 12px 26px }

/* ------------------------------------------------------- toast */

.tb-ad__toast {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 2147482100;
  background: var(--card);
  border: 1px solid var(--gold-dim);
  border-right: 3px solid var(--gold);
  color: var(--text);
  font-family: "Heebo", "Assistant", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  direction: rtl;
  padding: 12px 18px;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.tb-ad__toast.is-on { opacity: 1; transform: none }
.tb-ad__toast.bad { border-color: rgba(164, 48, 44, .5); border-right-color: var(--red) }

/* ------------------------------------------------------- phone */

@media (max-width: 640px) {
  .tb-ad__sheet { width: 100%; border-left: 0 }
  .tb-ad__head { padding: 14px 16px }
  .tb-ad__title { font-size: 19px }
  .tb-ad__pane { padding: 18px 14px 34px }
  .tb-ad__grid { grid-template-columns: 1fr }
  .tb-ad__row { grid-template-columns: 44px minmax(0, 1fr); row-gap: 9px }
  .tb-ad__row > figure { width: 44px; height: 54px }
  .tb-ad__money, .tb-ad__acts { grid-column: 1 / -1 }
  .tb-ad__money input { text-align: right }
  .tb-ad__acts { flex-wrap: wrap }
  .tb-ad__foot { padding: 10px 14px }
  .tb-ad__toast { left: 14px; right: 14px; bottom: 14px }
}

@media (prefers-reduced-motion: reduce) {
  .tb-ad__sheet, .tb-ad__toast { transition: none }
}

/* ---------------------------------------------------------------- shop side
   What the panel changes has to show on the shop itself. These few rules are
   the only ones that leave `.tb-ad`. */

.tb-sold {
  display: inline-block;
  background: #1c1a17;
  color: #d8cfbf;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  padding: 4px 9px;
  margin-bottom: 6px;
}
.tb-soon { opacity: .75; font-style: italic }
.tb-hidden-by-admin { display: none !important }

/* The shop's own stylesheet dresses `input[type="number"]` for the quantity box
   on a product page - white ground, dark border - and it reaches in here too.
   The panel states its own look plainly so nothing of the theme's leaks in. */

.tb-ad input,
.tb-ad select,
.tb-ad textarea,
.tb-ad button {
  border-radius: 0 !important;
  box-shadow: none !important;
  font-family: inherit !important;
  min-height: 0 !important;
  max-width: none !important;
  text-transform: none !important;
  letter-spacing: normal;
}
.tb-ad input[type="text"],
.tb-ad input[type="email"],
.tb-ad input[type="password"],
.tb-ad input[type="number"],
.tb-ad input[type="search"],
.tb-ad select,
.tb-ad textarea {
  background: var(--field) !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
  height: auto !important;
  line-height: 1.4 !important;
}
.tb-ad input:focus,
.tb-ad select:focus,
.tb-ad textarea:focus { border-color: var(--gold-dim) !important }
.tb-ad__money input.set { color: var(--gold) !important; border-color: var(--gold-dim) !important }
.tb-ad .tb-ad__go { background: var(--gold) !important; color: #17140d !important; border: none !important }
.tb-ad .tb-ad__go:hover { background: #d3b46b !important }
.tb-ad .tb-ad__chip.is-on,
.tb-ad .tb-ad__t.on { background: var(--gold) !important; border-color: var(--gold) !important; color: #17140d !important }
.tb-ad .tb-ad__t.warn.on { background: var(--red) !important; border-color: var(--red) !important; color: #fff !important }

/* A rule to paste into the Firebase console is code, and code reads left to
   right even on a page that runs the other way. */
.tb-ad__code {
  display: block;
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
  white-space: pre;
  overflow-x: auto;
  background: #100f0e;
  border: 1px solid var(--line);
  color: var(--gold);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 12px;
  margin-top: 10px;
}

/* A long press on the logo opens the panel, so the phone must not answer that
   press with its own link preview first. Nothing else about the logo changes. */
.logo a, .logo-wrapper a { -webkit-touch-callout: none }

/* ============================================================================
   Added 03/09/2026, when the panel grew from "change a price" into "run the
   shop": a full editor for one product, a form for a new one, and a drag mode
   for the order they appear in.
   ========================================================================= */

/* ------------------------------------------------------- list additions */

.tb-ad__tab.add { color: var(--gold) }
.tb-ad__t.edit { border-color: var(--gold-dim); color: var(--gold) }
.tb-ad__row.is-new { border-right: 2px solid var(--gold-dim) }
.tb-ad__bar .tb-ad__ghost { flex: none }
.tb-ad__bar .tb-ad__ghost.is-on {
  background: var(--gold);
  border-color: var(--gold);
  color: #17140d;
  font-weight: 700;
}

/* Drag mode: the row loses its controls, so it needs a different grid - and a
   grip wide enough to be caught with a thumb. */
.tb-ad__rows.is-drag .tb-ad__row {
  grid-template-columns: 34px 52px minmax(0, 1fr);
  cursor: default;
}
.tb-ad__grip {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--dim);
  font-size: 17px;
  letter-spacing: -2px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.tb-ad__grip:active { cursor: grabbing; color: var(--gold) }
.sortable-ghost { opacity: .35 }
.sortable-fallback { border-color: var(--gold-dim) !important }

/* ------------------------------------------------------- the editor */

.tb-ad__edit {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  background: rgba(6, 6, 6, .55);
}
.tb-ad__edit.is-on { display: block }

.tb-ad__esheet {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(100%, 560px);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.tb-ad__ehead {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.tb-ad__ehead h3 {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--text);
}
.tb-ad__ebody {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 18px 40px;
}
.tb-ad__lbl {
  display: block;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--dim);
  margin: 16px 0 8px;
}
.tb-ad__lbl small, .tb-ad__f label small { color: var(--dim); opacity: .7; letter-spacing: 0 }
.tb-ad__two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }

/* pictures */

.tb-ad__pics { display: flex; flex-wrap: wrap; gap: 8px }
.tb-ad__pic {
  position: relative;
  width: 84px; height: 105px;
  background: #100f0e;
  border: 1px solid var(--line);
  overflow: hidden;
  flex: none;
}
.tb-ad__pic img { width: 100%; height: 100%; object-fit: cover; display: block }
.tb-ad__pic > button {
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 6, 6, .78);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.tb-ad__pic > button:hover { background: var(--red); border-color: var(--red) }
.tb-ad__pic > span {
  position: absolute;
  bottom: 0; right: 0; left: 0;
  background: rgba(6, 6, 6, .8);
  color: var(--gold);
  font-size: 9px;
  letter-spacing: .12em;
  text-align: center;
  padding: 3px 0;
}
.tb-ad__pic.add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-style: dashed;
  color: var(--dim);
  cursor: pointer;
}
.tb-ad__pic.add:hover { border-color: var(--gold-dim); color: var(--gold) }
.tb-ad__pic.add b { font-size: 22px; font-weight: 300; line-height: 1 }
.tb-ad__pic.add small { font-size: 10px; letter-spacing: .08em }

/* in-out switch, checkbox, category chips */

.tb-ad__seg { display: flex; border: 1px solid var(--line); background: var(--field) }
.tb-ad__seg button {
  flex: 1;
  background: none;
  border: 0;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  padding: 9px 6px;
  cursor: pointer;
}
.tb-ad__seg button.on { background: var(--gold); color: #17140d; font-weight: 700 }
.tb-ad__seg button.on:first-child { background: var(--green); color: #f4f1ec }

.tb-ad__chk {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px 0 4px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.tb-ad__chk input { width: 16px; height: 16px; accent-color: var(--gold); flex: none }

.tb-ad__chips.tight { gap: 6px }
.tb-ad__chips.tight .tb-ad__chip { font-size: 11px; padding: 6px 11px }
.tb-ad__chip i { font-style: normal; opacity: .45; font-size: 9px }

/* delete */

.tb-ad__danger {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
}
.tb-ad__del {
  width: 100%;
  background: none;
  border: 1px solid rgba(164, 48, 44, .5);
  color: #d08a86;
  font: inherit;
  font-size: 13px;
  letter-spacing: .06em;
  padding: 12px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.tb-ad__del:hover { background: var(--red); border-color: var(--red); color: #fff }
.tb-ad__go.sm { width: auto; margin: 0; padding: 9px 18px; font-size: 12px }
.tb-ad__go.ghost {
  background: none !important;
  border: 1px solid var(--gold-dim) !important;
  color: var(--gold) !important;
}

/* ------------------------------------------------------- phone */

@media (max-width: 640px) {
  .tb-ad__esheet { width: 100%; border-left: 0 }
  .tb-ad__ebody { padding: 16px 14px 40px }
  .tb-ad__two { grid-template-columns: 1fr }
  .tb-ad__pic { width: 76px; height: 95px }
  .tb-ad__rows.is-drag .tb-ad__row { grid-template-columns: 30px 44px minmax(0, 1fr) }
}

/* ---------------------------------------------------------------- shop side
   Two more rules that leave `.tb-ad`, for what a product page shows when the
   owner has written a description or taken the product down. */

.tb-desc {
  margin: 16px 0 4px;
  font-size: 14px;
  line-height: 1.85;
  color: inherit;
}
.tb-desc p { margin: 0 0 10px }
.tb-desc p:last-child { margin-bottom: 0 }

.tb-gone {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid rgba(164, 48, 44, .35);
  background: rgba(164, 48, 44, .06);
}
.tb-gone b { display: block; font-size: 15px; margin-bottom: 6px }
.tb-gone a {
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------- hardening

   The theme dresses file inputs and textareas too, and the editor is full of
   both. Same treatment as the number boxes above. */

.tb-ad textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  padding: 10px 12px !important;
  font-size: 13px !important;
}
.tb-ad__f input[type="text"],
.tb-ad__f input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px !important;
  font-size: 13px !important;
}
.tb-ad__f label {
  display: block;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--dim);
  margin-bottom: 6px;
}
.tb-ad .tb-ad__del { border-radius: 0 !important }
.tb-ad__pics label { margin: 0 }

/* The gallery on a product whose pictures came from the panel.

   The theme's flexslider has already built its thumbnail strip by the time
   those pictures arrive over the network, so tb-admin.js replaces the gallery
   with this one instead of fighting it. It keeps the theme's outer classes, so
   the column it sits in is unchanged; only the inside is ours. */

.tb-gal {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  opacity: 1 !important;
}
.tb-gal__main { flex: 1 1 auto; min-width: 0 }
.tb-gal__main img { width: 100%; height: auto; display: block }
.tb-gal__thumbs {
  flex: 0 0 clamp(54px, 17%, 84px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.tb-gal .tb-gal__t {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: 1px solid rgba(0, 0, 0, .12) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  line-height: 0 !important;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .18s ease;
}
.tb-gal .tb-gal__t.on { border-color: rgba(0, 0, 0, .55) !important }
.tb-gal .tb-gal__t img { width: 100%; height: auto; display: block }

@media (prefers-reduced-motion: reduce) {
  .tb-gal .tb-gal__t { transition: none }
}

/* The email row is taken away when the panel is talking to the local server -
   there is no account there, only the one password. */
.tb-ad [hidden] { display: none !important }
