/* DIAMDOR print: the sklad.diamdor.ru look (Manrope, light grey page, white panels with thin borders, square corners,
   dark primary buttons, orange accent). Tokens and component names follow sklad/app/static/styles.css. */
@font-face { font-family: 'Manrope'; font-weight: 400 800; font-display: swap; src: url('/static/fonts/manrope-v20-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 400 800; font-display: swap; src: url('/static/fonts/manrope-v20-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-weight: 400 800; font-display: swap; src: url('/static/fonts/manrope-v20-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alex Brush'; font-weight: 400; font-display: swap; src: url('/static/fonts/alexbrush-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2019, U+2014; }

:root {
  --bg: #f8f9fa; --fg: #1d2024; --card: #fff; --soft: #f1f2f4; --primary: #ef7a38; --muted: #6b7077; --border: #dfe2e6;
  --bad: #c8321f; --ok: #2f8f5b; --warn: #b7791f; --bar: #FF6A00;
  --ok-bg: #eaf7ee; --warn-bg: #fffaf0; --bad-bg: #fdf1ef; --primary-bg: #fff4ea;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --fs-sm: 13px; --fs-md: 15px;
  --ctl: 48px; --ctl-sm: 40px; --pad: 14px;
}
@media (hover: hover) and (pointer: fine) { :root { --ctl: 40px; --ctl-sm: 32px; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: var(--fs-md)/1.45 'Manrope', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; }
h1 { font-size: 20px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
h2 { font-size: var(--fs-md); font-weight: 700; margin: var(--s5) 0 var(--s2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
input::placeholder { color: #b3b6bb; opacity: 1; }

/* header: orange bar, brand word in Alex Brush */
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 32px; padding: env(safe-area-inset-top) var(--pad) 0; background: var(--bar); color: #fff; font-size: 12px; }
.appbar .brand { display: flex; align-items: center; color: #fff; white-space: nowrap; }
.appbar .brand b { font-weight: 800; letter-spacing: .16em; text-transform: uppercase; font-size: 12px; }
.hw { font-family: 'Alex Brush', cursive; font-weight: 400; -webkit-text-stroke: 0.035em currentColor; font-size: 26px; line-height: 1; letter-spacing: 0; text-transform: none; position: relative; top: -1px; margin-right: 9px; }
.appbar .who { display: flex; align-items: center; gap: var(--s3); min-width: 0; font-size: var(--fs-sm); }
.appbar .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.appbar .out { background: none; border: 0; padding: 0; min-height: 30px; color: #fff; font-size: var(--fs-sm); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.nav { display: flex; align-items: stretch; min-height: 46px; padding: 0 var(--pad); background: var(--bg); border-bottom: 1px solid var(--border); overflow-x: auto; position: sticky; top: 32px; z-index: 29; }
.nav a { display: inline-flex; align-items: center; padding: 0 var(--s4); font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.nav a:hover { color: var(--fg); }
.nav a.on { color: var(--fg); border-bottom-color: var(--primary); }

main { max-width: 1240px; margin: 0 auto; padding: var(--s4) var(--pad) 110px; }
main.narrow { max-width: 640px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; min-height: 40px; margin: 0 0 var(--s3); }
.back { display: inline-flex; align-items: center; min-height: var(--ctl-sm); margin-bottom: var(--s2); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.back:hover { color: var(--fg); }
.row { display: flex; gap: var(--s2); align-items: center; }
.row.wrap { flex-wrap: wrap; }
.sp { flex: 1 1 auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--ctl); padding: 0 var(--s4); border: 1px solid var(--fg); background: var(--fg); color: var(--bg); border-radius: 0; font-size: 14px; font-weight: 700; line-height: 1.2; text-align: center; white-space: nowrap; }
.btn:hover { opacity: .9; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.light { background: var(--card); color: var(--fg); border-color: var(--border); }
.btn.light:hover { border-color: var(--fg); opacity: 1; }
.btn.gold { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { background: var(--card); color: var(--bad); border-color: var(--bad); }
.btn.sm { min-height: var(--ctl-sm); padding: 0 var(--s3); font-size: var(--fs-sm); }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* fields */
.input { width: 100%; min-height: var(--ctl); padding: 0 var(--s3); border: 1px solid var(--border); background: var(--card); border-radius: 0; }
.input:focus { border-color: var(--fg); outline: none; }
.fld { display: grid; gap: 6px; margin-bottom: var(--s3); }
.fld > label, .fld > .lbl { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.seg { display: flex; border: 1px solid var(--border); background: var(--card); }
.seg button { flex: 1; min-height: var(--ctl); border: 0; border-right: 1px solid var(--border); background: transparent; font-size: 14px; font-weight: 600; color: var(--muted); padding: 0 var(--s2); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--fg); color: #fff; }
.stepper { display: flex; border: 1px solid var(--border); background: var(--card); }
.stepper button { width: var(--ctl); min-height: var(--ctl); border: 0; background: transparent; font-size: 20px; font-weight: 600; }
.stepper button:hover { background: var(--soft); }
.stepper input { flex: 1; min-width: 0; text-align: center; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); font-weight: 700; background: var(--card); }
.check { display: flex; align-items: center; gap: var(--s3); min-height: var(--ctl); font-size: 14px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--fg); margin: 0; }

/* panels, badges */
.panel { background: var(--card); border: 1px solid var(--border); padding: var(--s4); }
.panel + .panel { margin-top: var(--s3); }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 9999px; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.pri { background: var(--primary-bg); color: #c45a1d; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #c9ccd0; flex: none; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.err { padding: var(--s3); background: var(--bad-bg); color: var(--bad); font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--s3); }
.empty { padding: var(--s6) var(--s4); text-align: center; color: var(--muted); }
.spin { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }

/* thumbnails */
.thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.th { position: relative; background: var(--card); border: 1px solid var(--border); padding: var(--s2); display: grid; gap: var(--s2); align-content: start; }
.th .pic { position: relative; aspect-ratio: 210 / 297; background: var(--soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.th .pic.land { aspect-ratio: 297 / 210; }
.th .pic img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; box-shadow: 0 0 0 1px var(--border) inset; }
.th.off .pic img { opacity: .28; }
.th .num-tag { position: absolute; left: 6px; top: 6px; min-width: 24px; height: 24px; padding: 0 6px; background: rgba(29,32,36,.82); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.th .acts { display: flex; align-items: center; gap: 2px; }
.th .acts button { flex: 1; min-height: 36px; border: 0; background: var(--soft); display: flex; align-items: center; justify-content: center; color: var(--fg); }
.th .acts button:hover { background: #e6e8eb; }
.th .acts button svg { width: 18px; height: 18px; }
.th .sel { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; accent-color: var(--fg); margin: 0; z-index: 2; }
.th.picked { outline: 2px solid var(--primary); outline-offset: -1px; }
.th.dragover { outline: 2px dashed var(--primary); }
.th .acts .mv { display: none; }
@media (hover: none) { .th .acts .mv { display: flex; } }
.th[draggable=true] { cursor: grab; }

.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--card); border-top: 1px solid var(--border); padding: var(--s3) var(--pad) calc(var(--s3) + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: var(--s3); }
.sticky-bar .info { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; white-space: nowrap; }
.sticky-bar .btn { flex: 1; max-width: 420px; margin-left: auto; }

/* jobs list */
.jrow { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--s3); align-items: center; padding: var(--s3); background: var(--card); border: 1px solid var(--border); margin-bottom: -1px; }
.jrow .pic { width: 56px; height: 72px; background: var(--soft); display: flex; align-items: center; justify-content: center; }
.jrow .pic img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.jrow .t { font-weight: 700; overflow-wrap: anywhere; }
.jrow .meta { display: flex; gap: var(--s2) var(--s3); flex-wrap: wrap; align-items: center; font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.jrow .acts { display: flex; gap: var(--s2); grid-column: 1 / -1; }
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.chip { min-height: 34px; padding: 0 14px; border: 1px solid var(--border); background: var(--card); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); border-radius: 9999px; }
.chip.on { background: var(--fg); border-color: var(--fg); color: #fff; }

.job-grid { display: grid; gap: var(--s4); }
.qr-box { display: grid; justify-items: center; gap: var(--s3); text-align: center; }
.qr-box img { width: min(300px, 100%); height: auto; background: #fff; border: 1px solid var(--border); padding: var(--s2); }
.linkline { display: flex; gap: var(--s2); width: 100%; }
.linkline .input { font-size: var(--fs-sm); }
.big { font-size: 22px; font-weight: 800; }
.printer { display: flex; align-items: center; gap: var(--s3); }
.guest-state { display: grid; justify-items: center; gap: var(--s3); text-align: center; padding: var(--s6) var(--s4); }
.guest-state .ico { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--ok-bg); color: var(--ok); }
.guest-state .ico.bad { background: var(--bad-bg); color: var(--bad); }
.guest-state .ico svg { width: 34px; height: 34px; }
.dropzone { border: 2px dashed var(--border); background: var(--card); padding: var(--s6) var(--s4); display: grid; justify-items: center; gap: var(--s3); text-align: center; }
.dropzone.over { border-color: var(--primary); background: var(--primary-bg); }
.dropzone svg { width: 40px; height: 40px; color: var(--muted); }
.login { max-width: 360px; margin: 48px auto 0; }
.login h1 { margin-bottom: var(--s4); }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--fg); color: #fff; padding: 10px 16px; font-size: var(--fs-sm); font-weight: 600; z-index: 60; max-width: 90vw; }
.banner { background: var(--warn-bg); border: 1px solid #ecd9ae; padding: var(--s4); display: grid; gap: var(--s3); }
.banner b { font-size: 16px; }

@media (min-width: 900px) {
  main { padding-top: var(--s5); }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .job-grid { grid-template-columns: 1fr 340px; align-items: start; }
  .job-grid .side { position: sticky; top: 100px; }
  .jrow { grid-template-columns: 56px 1fr auto auto; }
  .jrow .acts { grid-column: auto; }
  .sticky-bar { display: none; }
  .only-sticky { display: none; }
  main { padding-bottom: 48px; }
}
@media (max-width: 899px) { .only-desk { display: none !important; } }
@media (min-width: 560px) and (max-width: 899px) { .thumbs { grid-template-columns: repeat(3, 1fr); } }

/* landing: logo and two big buttons */
.landing-body { min-height: 100vh; display: flex; }
.landing { margin: auto; width: 100%; max-width: 420px; padding: var(--s6) var(--pad); display: grid; justify-items: center; gap: var(--s5); text-align: center; }
.landing .logo { width: 190px; height: auto; max-width: 70vw; }
.landing h1 { font-size: 26px; font-weight: 800; }
.landing .choices { display: grid; gap: var(--s3); width: 100%; }
.big-btn { min-height: 60px; font-size: 17px; }
@font-face { font-family: 'DejaVu Sans'; font-weight: 400; src: url('/static/fonts/DejaVuSans.ttf') format('truetype'); }
@font-face { font-family: 'DejaVu Sans'; font-weight: 700; src: url('/static/fonts/DejaVuSans-Bold.ttf') format('truetype'); }
.fld .seg + .seg { margin-top: var(--s2); }
.fld input.input + .seg { margin-top: var(--s2); }
.seg button[disabled] { opacity: .4; }

/* pending guest jobs, counter, page badges */
.nav .cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 9999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; }
.jrow.pend { border-left: 3px solid var(--primary); background: var(--primary-bg); }
.gname { font-size: var(--fs-sm); color: var(--fg); margin-top: 2px; overflow-wrap: anywhere; }
.th .ed-tag { position: absolute; left: 6px; bottom: 6px; width: 24px; height: 24px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; }
.th .ed-tag svg { width: 14px; height: 14px; }

/* page editor */
body.noscroll { overflow: hidden; }
.editor { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; }
.ed-top { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--pad); background: var(--card); border-bottom: 1px solid var(--border); }
.ed-title { font-size: 15px; white-space: nowrap; }
.ed-tools { display: flex; align-items: center; gap: var(--s1); padding: var(--s2) var(--pad); background: var(--card); border-bottom: 1px solid var(--border); overflow-x: auto; }
.ed-tools .tool { display: inline-flex; align-items: center; gap: 6px; min-height: var(--ctl-sm); padding: 0 var(--s3); border: 1px solid var(--border); background: var(--card); font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; flex: none; }
.ed-tools .tool.on { background: var(--fg); border-color: var(--fg); color: #fff; }
.ed-tools .tool[disabled] { opacity: .35; }
.ed-tools .tool svg { width: 18px; height: 18px; }
.ed-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 var(--s1); flex: none; }
.ed-opts { display: flex; align-items: center; gap: var(--s4); padding: var(--s2) var(--pad); background: var(--card); border-bottom: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 600; }
.ed-opts input[type=range] { width: 160px; accent-color: var(--primary); }
.ed-opts .check { min-height: var(--ctl-sm); }
.ed-body { flex: 1; overflow: auto; padding: var(--s3) var(--pad) var(--s5); }
.ed-wrap { max-width: 860px; margin: 0 auto; }
.ed-stage { position: relative; width: 100%; background: #fff; box-shadow: 0 0 0 1px var(--border); user-select: none; -webkit-user-select: none; }
.ed-stage img, .ed-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ed-stage img { object-fit: fill; pointer-events: none; }
.ed-stage svg { cursor: crosshair; }
.ed-ta { position: absolute; min-width: 140px; max-width: 90%; padding: 0; margin: 0; border: 1px dashed var(--primary); background: rgba(255,255,255,.85); color: #000; font-family: 'DejaVu Sans', sans-serif; line-height: 1.2; resize: none; overflow: hidden; outline: none; }
@media (max-width: 520px) { .ed-tools .tool span:not(.keep) { display: none; } .ed-tools .tool { padding: 0 var(--s2); } .ed-opts input[type=range] { width: 110px; } }
@media (max-width: 520px) { .ed-top .ed-title { display: none; } .ed-top { gap: var(--s2); } }
