:root { --ink: #15130f; --muted: #857d70; --line: #e2dacd; --bg: #fbf9f5; --accent: #7b2230; --ok: #2f6f5e; }
@media (prefers-color-scheme: dark) { :root { --ink: #f1ece4; --muted: #9b9387; --line: #2e2b27; --bg: #121110; --accent: #d8727e; --ok: #6fbfa6; } }
* { box-sizing: border-box; }
body { margin: 0; padding: 10px 12px 40px; background: var(--bg); color: var(--ink); font: 13px/1.45 system-ui, sans-serif; }
button { font: inherit; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 4px; padding: 5px 9px; cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
button.danger { background: var(--accent); border-color: var(--accent); color: #fff; }
button:disabled { opacity: .45; cursor: default; }
kbd { font-size: 11px; opacity: .7; margin-left: 4px; }
input { font: inherit; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 3px; padding: 4px 6px; width: 100%; }
header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
header b { letter-spacing: .18em; text-transform: uppercase; font-size: 12px; margin-right: auto; }
.seg { display: inline-flex; }
.seg button { border-radius: 0; padding: 3px 8px; }
.seg button:first-child { border-radius: 4px 0 0 4px; }
.seg button:last-child { border-radius: 0 4px 4px 0; border-left: 0; }
.seg button.on { background: var(--ink); color: var(--bg); }
#target button.on[data-v="main"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.muted { color: var(--muted); font-size: 12px; }
section { margin: 10px 0; }
.tab { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
#tabLine { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 8px; }
.status { min-height: 18px; font-size: 12px; color: var(--muted); }
.item { border-top: 1px solid var(--line); padding: 8px 0; display: grid; gap: 6px; }
.item.sent { opacity: .55; }
.item.error { box-shadow: inset 3px 0 0 var(--accent); padding-left: 8px; }
.thumbs { display: flex; gap: 4px; overflow-x: auto; }
.th { position: relative; flex: none; cursor: pointer; }
.th img { display: block; width: 56px; height: 56px; object-fit: cover; border-radius: 3px; border: 2px solid transparent; opacity: .35; background: var(--line); }
.th.on img { opacity: 1; border-color: var(--ink); }
.th .n { position: absolute; left: 3px; top: 3px; font-size: 10px; line-height: 14px; min-width: 14px; text-align: center; border-radius: 7px; background: var(--ink); color: var(--bg); }
.th:first-child.on .n { background: var(--accent); color: #fff; }
.th .rm { position: absolute; right: 2px; top: 1px; font-style: normal; font-size: 13px; line-height: 13px; width: 15px; text-align: center; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; }

.line { display: grid; grid-template-columns: 14px 1fr 86px 24px; gap: 6px; align-items: center; }
.price { text-align: right; font-weight: 600; }
.del { border: 0; padding: 0; font-size: 16px; color: var(--muted); }
.meta { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--muted); }
.meta .st { white-space: nowrap; }
.st.sent { color: var(--ok); } .st.error { color: var(--accent); }
footer { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--ink); padding: 8px 0; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
summary { cursor: pointer; font-weight: 600; }
label { display: block; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
label input { margin-top: 2px; color: var(--ink); }
.row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
#channels div { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; }
#channels span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bellbar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bellbar label { margin: 0; color: var(--ink); font-size: 12.5px; display: flex; align-items: center; gap: 5px; }
.bellbar input { width: 56px; margin: 0; }
.bellbar #bellCalc { flex-basis: 100%; }
.line2 { display: grid; grid-template-columns: 1fr 1fr auto auto auto; gap: 4px; align-items: center; }
.line2 input { font-size: 12px; padding: 3px 6px; }
.bell { margin-right: 4px; }
label.check { display: flex; align-items: center; gap: 6px; color: var(--ink); }
label.check input { width: auto; margin: 0; }
.handle { cursor: grab; color: var(--muted); font-size: 16px; line-height: 1; user-select: none; text-align: center; }
.item.dragging { opacity: .35; }
.item.drop-before { box-shadow: inset 0 3px 0 var(--ink); }
.item.drop-after { box-shadow: inset 0 -3px 0 var(--ink); }
.mv { padding: 1px 7px; font-size: 12px; }
select.cat { font: inherit; font-size: 12px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 3px; padding: 3px 4px; min-width: 0; }
.line3 { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.line3 input { flex: 1; font-size: 12px; padding: 3px 6px; }
.line3 .sold { color: var(--muted); text-decoration: line-through; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.warn { color: var(--accent); font-weight: 600; white-space: nowrap; }
.item.few { box-shadow: inset 3px 0 0 var(--accent); padding-left: 8px; }
.item > * { min-width: 0; }                 /* a long line never widens the panel */
.meta .st.error { white-space: normal; }    /* error texts wrap */
.th.low img { outline: 2px dashed var(--accent); outline-offset: -2px; }
.th.low::after { content: attr(data-size); position: absolute; left: 2px; bottom: 2px; font-size: 9px; line-height: 12px; padding: 0 3px; border-radius: 3px; background: var(--accent); color: #fff; }
.lowph { color: var(--accent); font-weight: 600; }
textarea { font: inherit; font-size: 12px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 3px; padding: 4px 6px; width: 100%; margin-top: 2px; resize: vertical; }
.pricebar { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12.5px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pricebar label { margin: 0; color: var(--ink); font-size: 12.5px; display: flex; align-items: center; gap: 4px; }
.pricebar input { width: 64px; margin: 0; }
.pricebar label[hidden] { display: none; }
.sect { display: flex; gap: 8px; align-items: center; padding: 8px 0 6px; border-top: 2px solid var(--ink); margin-top: 6px; }
.sect b { font-size: 13px; }
.sect label { margin: 0 0 0 auto; color: var(--ink); font-size: 12.5px; display: flex; align-items: center; gap: 4px; }
.sect input { width: 64px; margin: 0; }
#zoom { position: fixed; z-index: 20; width: 168px; height: auto; max-height: 70vh; object-fit: contain; border-radius: 4px; background: var(--bg); box-shadow: 0 6px 24px rgba(0,0,0,.35); pointer-events: none; }
#zoom[hidden] { display: none; }
/* jump to the first / last item of a long queue: right end of the pinned footer, so it never covers an item's buttons */
#jump { display: flex; gap: 4px; margin-left: auto; }
#jump[hidden] { display: none; }
#jump button { width: 30px; height: 30px; padding: 0; border-radius: 50%; font-size: 16px; line-height: 1; }
