:root {
  color-scheme: dark;
  --page: #0b141f;
  --surface: #101d2a;
  --surface-raised: #142433;
  --line: #273b4d;
  --text: #edf5fb;
  --muted: #9eb4c5;
  --accent: #55e8ea;
  --green: #70ebba;
  --amber: #ffcd89;
  --red: #ff9aab;
  --radius: 18px;
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; background: var(--page); color: var(--text); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.025em; }
h1 { font-size: clamp(29px, 5vw, 42px); }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, :is(input,textarea,select):not(:disabled) { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.topbar { background: #0d1824; border-bottom: 1px solid #203345; }
.topbar-inner { width: min(100% - 36px, 1080px); height: 66px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; gap: 9px; align-items: center; font-size: 24px; letter-spacing: -.065em; white-space: nowrap; line-height: 1; }
.brand img { width: 36px; height: 36px; filter: hue-rotate(300deg) saturate(1.45); }
.brand strong { font-weight: 750; }
.brand span { color: var(--text); font-weight: 350; padding-bottom: 2px; }
.content { width: min(100% - 36px, 1080px); margin: 0 auto; padding: 24px 0 104px; }
.content:focus { outline: none; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 18px; }
.heading p { color: var(--muted); font-size: 14px; margin-top: 5px; }
.eyebrow { font-size: 11px; color: var(--accent); letter-spacing: .13em; font-weight: 750; text-transform: uppercase; }
.icon { display: inline-block; flex: 0 0 auto; width: 20px; height: 20px; background: currentColor; mask: var(--symbol) center / contain no-repeat; }
.icon-box { color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; background: #163440; border: 1px solid #285366; }
.icon-box.violet { color: #c3adff; background: #242747; border-color: #3a3b63; }
.icon-box.green { color: var(--green); background: #16382f; border-color: #2a5346; }
.icon-box .icon { width: 19px; height: 19px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; }
.subtle { color: var(--muted); font-size: 13px; }
.stack { display: grid; gap: 14px; }
.same-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.split-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-width: 0; }
.section-title { margin-bottom: 13px; }
.station {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  background: #0a2737 url("media/station-background.webp") right 42% / cover no-repeat;
  border: 1px solid #28556c;
  border-radius: var(--radius);
  min-height: 114px;
  padding: 15px;
  margin-bottom: 20px;
}
.station::before { content: ""; z-index: -1; position: absolute; inset: 0; background: linear-gradient(95deg, #0d2332 3%, #0c2635ed 42%, #0c263552 100%); }
.station .eyebrow { margin-bottom: 8px; }
.station strong { display: block; font-size: 20px; line-height: 1.15; letter-spacing: -.03em; overflow-wrap: anywhere; }
.station .subtle { margin-top: 4px; display: block; }
.station-side { display: grid; gap: 8px; justify-items: end; }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--green); font-size: 12px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.offline { color: var(--amber); }
.button, .icon-button {
  color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid #355064; background: #172a3a; border-radius: 11px;
  min-height: 43px; padding: 8px 13px; text-align: center; font-weight: 650; line-height: 1.22;
}
.button .icon { width: 17px; height: 17px; }
.button:hover, .icon-button:hover { background: #213b4d; border-color: #4a6f83; }
.button.primary { background: var(--accent); color: #08232a; border-color: var(--accent); font-weight: 750; }
.button.primary:hover { background: #a0f4f4; }
.button.danger { color: var(--red); }
.button.quiet { color: #d3e8f4; background: #10232ddf; font-size: 12px; min-height: 34px; padding: 6px 9px; }
.button.quiet .icon { width: 14px; height: 14px; }
.button:disabled, .icon-button:disabled { opacity: .48; cursor: default; }
.icon-button { min-width: 41px; min-height: 41px; padding: 8px; }
.dashboard-grid, .split-view { display: grid; align-items: start; gap: 18px; }
.tasks { display: grid; gap: 10px; }
.task { display: grid; gap: 11px; padding: 13px; background: #13202e; border: 1px solid #2a4052; border-radius: 13px; }
.task.main-task { background: #122734; border-color: #347181; }
.queue-summary { background: #171f33; border-color: #46446d; }
.queue-summaries:not(:empty) { margin-bottom: 12px; }
.queue-timing { display: grid; gap: 3px; font-variant-numeric: tabular-nums; }
.queue-timing strong { color: var(--text); font-weight: 700; }
.queue-groups { display: grid; gap: 7px; }
.queue-details { min-width: 0; background: #111b2b; border: 1px solid #2d3e53; border-radius: 9px; }
.queue-details summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 8px; align-items: center;
  min-height: 43px; gap: 10px; padding: 7px 12px; list-style: none; cursor: pointer; font-weight: 650;
}
.queue-details summary::-webkit-details-marker { display: none; }
.queue-details summary::after { content: ""; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1px 1px 0; transform: rotate(45deg); }
.queue-details[open] summary::after { transform: rotate(225deg); }
.queue-details summary strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.queue-details[open] summary { border-bottom: 1px solid #2d3e53; }
.queue-detail-content { display: grid; gap: 8px; padding: 8px; }
.queue-detail-content .button { justify-self: start; }
.queue-detail-content .task { padding: 9px; }
.queue-detail-content [data-queue-job] { border-radius: 13px; }
.publication-view { grid-template-areas: "queue" "send"; }
.publication-queue { grid-area: queue; }
.publication-view #publication-form { grid-area: send; }
.task h3 { overflow-wrap: anywhere; }
.task .subtle { margin-top: 3px; line-height: 1.35; }
.task-count { color: var(--accent); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.task-count small { color: var(--muted); font-size: 12px; font-weight: 600; }
.progress { width: 100%; height: 5px; border-radius: 99px; appearance: none; overflow: hidden; background: #233848; color: var(--accent); }
.progress::-webkit-progress-bar { background: #233848; }
.progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; transition: width .45s ease; }
.progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.progress.violet::-webkit-progress-value { background: #b49bff; }
.progress.violet::-moz-progress-bar { background: #b49bff; }
.progress.green::-webkit-progress-value { background: var(--green); }
.progress.green::-moz-progress-bar { background: var(--green); }
.task-foot { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.task-foot .icon { width: 14px; height: 14px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-card { display: grid; gap: 7px; align-content: start; padding: 12px; border-radius: 14px; background: var(--surface-raised); border: 1px solid var(--line); font-weight: 670; }
.action-card:hover { border-color: #438397; }
.action-card .subtle { font-weight: 500; line-height: 1.4; }
.section-title a { color: var(--accent); font-size: 13px; font-weight: 650; }
.art-card img { width: 100%; display: block; object-fit: cover; }
.tabs { position: fixed; z-index: 3; bottom: 0; left: 0; right: 0; padding-bottom: env(safe-area-inset-bottom); background: #101d29f7; border-top: 1px solid #2b4659; backdrop-filter: blur(12px); }
.tabs-inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 650px; margin: auto; padding: 6px 8px 7px; gap: 5px; }
.tab { display: flex; position: relative; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 50px; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 650; }
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: var(--accent); background: #153341; }
.tab-icon { position: relative; display: flex; }
.tab small { position: absolute; left: 14px; top: -5px; color: #0e2732; background: var(--accent); border-radius: 9px; padding: 0 4px; line-height: 13px; min-width: 13px; text-align: center; font-size: 9px; }

.form { display: grid; gap: 15px; }
.field { display: grid; gap: 6px; min-width: 0; font-weight: 650; }
.field input, .field textarea, .field select {
  width: 100%; min-width: 0; border: 1px solid #3a5368; border-radius: 11px; padding: 10px 12px;
  background: #0b1722; color: var(--text); font-weight: 450; font-size: 16px; min-height: 44px;
}
.field input::placeholder, .field textarea::placeholder { color: #8099ad; }
.field textarea { resize: vertical; min-height: 131px; }
.field .subtle { font-weight: 450; }
.check-row input { accent-color: var(--accent); flex: 0 0 auto; }
.file-btn { cursor: pointer; }
.file-btn:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-actions .primary { flex: 1; }
.file-line { flex-wrap: wrap; }
.segmented { display: flex; align-items: center; gap: 5px; overflow-x: auto; margin-bottom: 14px; }
.segment { color: var(--muted); background: #11202d; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; font-weight: 650; padding: 7px 10px; min-height: 42px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.segment .icon { width: 16px; height: 16px; }
.segment:hover { border-color: #4995a1; }
.segment[aria-pressed="true"] { color: var(--accent); border-color: #498d9f; background: #16313d; }
.batch-actions { margin-bottom: 14px; }
.selection-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
#content > .selection-bar { margin-bottom: 12px; }
.selection-bar .button { min-height: 40px; padding: 7px 10px; font-size: 13px; }
.selection-bar p { flex: 1 1 100%; }
.generation-products { min-width: 0; border: 0; padding: 0; margin: 0; }
.generation-products legend { margin-bottom: 8px; padding: 0; font-weight: 650; }
.generation-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 7px; }
.generation-options .check-row { min-height: 42px; font-size: 14px; }
.generation-products p { margin-top: 6px; }
.art-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.art-card { display: grid; align-content: start; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0; color: var(--text); text-align: left; min-width: 0; }
.art-card:hover { border-color: #4ba9b9; }
.art-card img { aspect-ratio: 1.43; height: auto; }
.art-info { display: grid; gap: 3px; padding: 10px; }
.art-info strong { line-height: 1.3; overflow-wrap: anywhere; }
.art-info small { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); padding: 10px 0; }
.check-list { display: grid; gap: 7px; max-height: 270px; overflow: auto; }
.check-row { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid #304a5e; background: #0f1e2d; border-radius: 10px; cursor: pointer; }
.check-row:has(:checked) { border-color: #4f9baa; }
.check-row span { overflow-wrap: anywhere; }
.check-row small { display: block; color: var(--muted); }
.queue-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.dialog {
  color: var(--text); background: #122231; border: 1px solid #3e6176; border-radius: 20px;
  width: min(100% - 24px, 490px); max-height: min(90dvh, 810px); overflow: auto; padding: 17px;
  box-shadow: 0 22px 65px #05090fb0;
}
.dialog::backdrop { background: #050b12b8; backdrop-filter: blur(5px); }
.dialog-head { margin-bottom: 14px; }
.dialog-head h2 { font-size: 23px; }
.dialog-head .subtle { margin-top: 4px; }
.preview-img-wrap img { display: block; width: 100%; height: auto; max-height: 290px; object-fit: contain; background: #0a1620; border: 1px solid #385567; border-radius: 12px; }
.toast { z-index: 8; position: fixed; inset: auto auto calc(78px + env(safe-area-inset-bottom)) 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); padding: 10px 15px; border: 1px solid #4d9d9f; border-radius: 12px; background: #163748; color: #e6fbff; box-shadow: 0 8px 25px #070b15aa; font-weight: 650; }
.toast.error { border-color: #b36576; background: #3a2433; }
.inline-error { padding: 8px 10px; color: #ffd1d8; background: #392330; border: 1px solid #7a4759; border-radius: 10px; }
.offline-note { padding: 10px 12px; border-radius: 11px; border: 1px solid #715941; color: #ffdcad; background: #302619; font-size: 13px; }
.station-recovery, .station-dialog-status { display: grid; gap: 9px; }
.station-recovery { margin-bottom: 16px; }
.station-recovery .button, .station-dialog-status .button { justify-self: start; }
.pairing { width: min(100%, 440px); margin: clamp(24px, 8vh, 68px) auto; }
.pairing h1 { font-size: clamp(27px, 5vw, 37px); }
.pairing > .icon-box { width: 44px; height: 44px; }
.pair-qr-preview {
  position: relative; overflow: hidden; aspect-ratio: 1.25; max-height: 52dvh;
  background: #080f18; border: 1px solid var(--line); border-radius: 12px;
}
.pair-qr-preview video { width: 100%; height: 100%; display: block; object-fit: cover; }
.pair-qr-preview::after {
  content: ""; position: absolute; inset: 14% 20%; border: 2px solid #61e9f2;
  border-radius: 11px; box-shadow: 0 0 0 90vw #050b1268; pointer-events: none;
}
.button[aria-busy="true"] { opacity: .7; }
.command-list { display: grid; gap: 8px; }
.command-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px;
  border-bottom: 1px solid var(--line); padding-bottom: 8px;
}
.command-line:last-child { padding-bottom: 0; border-bottom: 0; }
.command-line > p { grid-column: 1 / -1; overflow-wrap: anywhere; }
.command-line .state-failed { color: var(--red); }
.command-line .state-done { color: var(--green); }
.art-entry { min-width: 0; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.art-entry .art-card { width: 100%; background: transparent; border: 0; border-radius: 0; }
.art-entry .art-card:focus-visible { outline-offset: -3px; }
.art-entry:focus-within { border-color: #4ba9b9; }
.art-entry .check-row { border-radius: 0; border: 0; border-top: 1px solid var(--line); padding: 8px 10px; min-height: 43px; font-size: 13px; }
.art-no-image { display: grid; place-items: center; aspect-ratio: 1.43; width: 100%; background: #102130; color: var(--muted); line-height: 1.28; text-align: center; padding: 10px; }
.art-no-image .icon { width: 26px; height: 26px; color: #718da0; margin-bottom: 4px; }
.art-no-image > span { display: grid; justify-items: center; font-size: 12px; }
.preview-img-wrap .art-no-image { border-radius: 12px; }
.art-info small { overflow-wrap: anywhere; }
.products-list { margin-bottom: 14px; }
.warning-text { color: var(--amber); }
.list-progress { margin: 12px 0 0; }
.icon-grid { --symbol: url("media/icons/layout-grid.svg"); }
.icon-sparkles { --symbol: url("media/icons/sparkles.svg"); }
.icon-images { --symbol: url("media/icons/images.svg"); }
.icon-send { --symbol: url("media/icons/send.svg"); }
.icon-monitor { --symbol: url("media/icons/monitor.svg"); }
.icon-folder-check { --symbol: url("media/icons/folder-check.svg"); }
.icon-check { --symbol: url("media/icons/check.svg"); }
.icon-circle-check { --symbol: url("media/icons/circle-check.svg"); }
.icon-clock { --symbol: url("media/icons/clock.svg"); }
.icon-pause { --symbol: url("media/icons/pause.svg"); }
.icon-puzzle { --symbol: url("media/icons/puzzle.svg"); }
.icon-shirt { --symbol: url("media/icons/shirt.svg"); }
.icon-upload { --symbol: url("media/icons/upload.svg"); }
.icon-image { --symbol: url("media/icons/image.svg"); }
.icon-x { --symbol: url("media/icons/x.svg"); }
.icon-log-in { --symbol: url("media/icons/log-in.svg"); }

@media (min-width: 740px) {
  .topbar-inner { height: 73px; }
  .content { padding-top: 35px; }
  .heading { margin-bottom: 23px; }
  .station { min-height: 139px; padding: 20px 22px; background-size: min(73%, 750px) auto; background-color: #102738; }
  .station strong { font-size: 24px; }
  .station-side { display: flex; align-items: center; gap: 14px; }
  .station .button.quiet { min-height: 40px; padding: 8px 12px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
  .split-view { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .publication-view { grid-template-areas: "queue send"; }
  .panel { padding: 19px; }
  .art-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tabs-inner { gap: 9px; }
  .tab { gap: 8px; flex-direction: row; font-size: 13px; }
}

@media (max-width: 359px) {
  .topbar-inner, .content { width: calc(100% - 24px); }
  .station .icon-box { display: none; }
  .section-title h2 { font-size: 17px; }
  .segment { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
