/* Poster Tiler – the platform's dark look: neutral greys and one neon orange (#FF5707). No external fonts. */
:root {
  --bg: #0c0e11;
  --bg2: #111317;
  --panel: #171a1f;
  --panel2: #1c2026;
  --panel3: #23282f;
  --well: #0b0d10;
  --line: rgba(255, 255, 255, .075);
  --line2: rgba(255, 255, 255, .14);
  --text: #e7eaef;
  --dim: #aeb4be;
  --muted: #7f8792;
  --accent: #ff5707;
  --accent-h: #ff7128;
  --accent-t: #ff7a3d;
  --accent-soft: rgba(255, 87, 7, .13);
  --accent-line: rgba(255, 87, 7, .5);
  --on-accent: #140800;
  --danger: #ff3b6b;
  --danger-t: #ff8aa6;
  --green: #2fcf7c;
  --green-t: #63e29e;
  --warn: #ffd23f;
  --warn-t: #ffdf70;
  --blue: #4c9dff;
  --r: 12px;
  --r-sm: 8px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --side-w: 348px;
  --top-h: 56px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
::selection { background: var(--accent); color: var(--on-accent); }
a { color: var(--accent-t); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ic { width: 18px; height: 18px; flex: none; }

/* ---------------------------------------------------------------- frame */
.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  grid-template-rows: var(--top-h) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}
.top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px 0 10px;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 5;
}
.top::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, #ff3d00, #ff5707 55%, #ff9a1f);
  opacity: .55;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 28px; height: 28px; flex: none; }
.brand-t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-t b { font-size: 15px; letter-spacing: .01em; }
.brand-t span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.exit { flex: none; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  background: var(--panel2);
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--panel3); border-color: rgba(255, 255, 255, .22); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover { background: var(--panel2); color: var(--text); }
.btn.icon { width: 36px; padding: 0; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.sm.icon { width: 30px; padding: 0; }
.btn.sm .ic { width: 16px; height: 16px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-t); }
.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-t);
  cursor: pointer;
  font-weight: 600;
  font-size: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 122, 61, .4);
  text-underline-offset: 2px;
}
.link:hover { text-decoration-color: currentColor; }

.menu-wrap { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 280px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 12px;
  box-shadow: 0 18px 44px -12px rgba(0, 0, 0, .75);
  z-index: 30;
}
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-size: 13.5px;
}
.menu button:hover, .menu button:focus-visible { background: var(--panel3); }
.menu button .ic { color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }

/* ---------------------------------------------------------------- sidebar */
.side {
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg2);
  border-right: 1px solid var(--line);
  padding: 10px 10px 0;
  scrollbar-width: thin;
  scrollbar-color: #2c323b transparent;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 10px;
}
.card-h {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  background: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .01em;
  text-align: left;
  color: var(--text);
}
.card-h > span:first-child { color: var(--accent-t); display: inline-flex; }
.card-h .ct { flex: 1; }
.card-h .chev { display: inline-flex; color: var(--muted); transition: transform .2s; }
.card-h[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.card-h[aria-expanded="false"] + .card-b { display: none; }
.card-b { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 11px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap6 { gap: 6px; }
.gap8 { gap: 8px; }
.center { justify-content: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; }
.lab { font-size: 12px; color: var(--dim); font-weight: 600; }
.hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }

select, input[type="text"], .num {
  height: 34px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: var(--well);
  color: var(--text);
}
select {
  width: 100%;
  padding: 0 30px 0 10px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aeb4be' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 15px;
  cursor: pointer;
}
select:hover, input[type="text"]:hover, .num:hover { border-color: rgba(255, 255, 255, .22); }
select:focus, input[type="text"]:focus, .num:focus-within { border-color: var(--accent-line); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
optgroup { color: var(--muted); font-weight: 600; }
option { color: var(--text); background: var(--panel); }
input[type="text"] { width: 100%; padding: 0 10px; }
.num {
  display: inline-flex;
  align-items: center;
  padding: 0 8px 0 0;
  min-width: 0;
}
.num input {
  width: 64px;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  padding: 0 4px 0 9px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  outline: none;
  -moz-appearance: textfield;
}
.num input::-webkit-outer-spin-button, .num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num .u { font-size: 12px; color: var(--muted); }
.num.wide { flex: 1; }
.num.wide input { width: 100%; }
.dims { display: flex; align-items: center; gap: 7px; }
.dims .x, .steppers .x { color: var(--muted); }

/* segmented buttons */
.seg {
  display: flex;
  padding: 3px;
  gap: 3px;
  background: var(--well);
  border: 1px solid var(--line2);
  border-radius: 10px;
}
.seg button {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--dim);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.seg button:hover { color: var(--text); background: var(--panel2); }
.seg button:disabled { opacity: .38; cursor: default; background: none; color: var(--muted); }
.seg button.on { background: var(--panel3); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-line); }
.seg button.on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.seg.small button { height: 28px; font-size: 12px; }
.seg.views button.on::before { display: none; }
.seg.views button.on { color: var(--accent-t); }

/* sliders */
.ctl { display: flex; flex-direction: column; gap: 4px; }
.ctl-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ctl-h label { font-size: 12.5px; font-weight: 600; color: var(--dim); }
.ctl-h .num { height: 28px; }
.ctl-h .num input { width: 58px; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: none;
  cursor: pointer;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), #2b3139 var(--p, 50%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: #2b3139; }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }

/* switches */
.switch { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw {
  flex: none;
  width: 36px; height: 20px;
  margin-top: 1px;
  border-radius: 10px;
  background: #2b3139;
  position: relative;
  transition: background .15s;
}
.switch .sw::after {
  content: "";
  position: absolute;
  left: 3px; top: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #c9ced6;
  transition: transform .15s, background .15s;
}
.switch input:checked + .sw { background: var(--accent); }
.switch input:checked + .sw::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .sw { box-shadow: 0 0 0 3px var(--accent-soft); outline: 2px solid var(--accent); }
.switch .lbl { display: flex; flex-direction: column; font-weight: 600; font-size: 13px; }
.switch small { font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 1px; }

details.sub { border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); }
details.sub > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--dim);
}
details.sub > summary::-webkit-details-marker { display: none; }
details.sub > summary::after { content: "▸"; margin-left: auto; color: var(--muted); transition: transform .15s; }
details.sub[open] > summary::after { transform: rotate(90deg); }
details.sub > summary .ic { width: 16px; height: 16px; color: var(--accent-t); }
details.sub[open] { padding-bottom: 10px; }
details.sub > :not(summary) { margin: 6px 10px 0; }

.colorin { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; border: 1px solid var(--line2); border-radius: 8px; background: var(--well); }
.colorin input[type="color"] { width: 26px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: none; cursor: pointer; }
.colorin input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.colorin input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(255, 255, 255, .25); border-radius: 5px; }
.colorin .hex { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; text-transform: uppercase; }

.margins { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.margins .num { padding-left: 9px; }
.margins .side-l { font-size: 11.5px; color: var(--muted); width: 44px; flex: none; }
.margins .num input { width: 100%; text-align: right; }

.steppers { display: flex; align-items: flex-end; gap: 10px; }
.stepper { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.stepper > div { display: flex; align-items: center; height: 34px; border: 1px solid var(--line2); border-radius: 8px; background: var(--well); overflow: hidden; }
.stepper button { width: 34px; height: 100%; border: 0; background: none; cursor: pointer; font-size: 17px; color: var(--dim); }
.stepper button:hover { background: var(--panel3); color: var(--text); }
.stepper input { flex: 1; min-width: 0; width: 40px; height: 100%; border: 0; background: none; text-align: center; font-weight: 700; font-size: 15px; outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* picture card */
.pic { display: flex; gap: 11px; align-items: center; }
.pic-thumb {
  width: 76px; height: 76px;
  flex: none;
  border-radius: 9px;
  background: var(--well) repeating-conic-gradient(#1a1d22 0 25%, #121418 0 50%) 50% / 14px 14px;
  border: 1px solid var(--line2);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pic-thumb img { max-width: 100%; max-height: 100%; display: block; }
.pic-thumb img:not([src]), .pic-thumb img[src=""] { display: none; }
.pic-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pic-meta b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pic-meta span { font-size: 12px; color: var(--muted); }
.badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px !important;
  font-weight: 700;
  border: 1px solid var(--line2);
}
.badge.good { color: var(--green-t); border-color: rgba(47, 207, 124, .38); background: rgba(47, 207, 124, .1); }
.badge.ok { color: var(--accent-t); border-color: var(--accent-line); background: var(--accent-soft); }
.badge.low { color: var(--warn-t); border-color: rgba(255, 210, 63, .38); background: rgba(255, 210, 63, .08); }
.badge.bad { color: var(--danger-t); border-color: rgba(255, 59, 107, .45); background: rgba(255, 59, 107, .1); }

.result {
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--dim);
}
.result b { color: var(--text); }
.result .big { display: block; font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.result .err { color: var(--danger-t); }
.suggest { display: flex; flex-direction: column; gap: 6px; }
.suggest:empty { display: none; }
.suggest .sg-h { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.suggest button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--line2);
  border-radius: 9px;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--dim);
}
.suggest button:hover { border-color: var(--accent-line); border-style: solid; color: var(--text); background: var(--accent-soft); }
.suggest button b { color: var(--text); }
.suggest button .n { margin-left: auto; font-weight: 700; color: var(--accent-t); white-space: nowrap; }

.side-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 4px 12px;
  background: linear-gradient(180deg, rgba(17, 19, 23, 0), var(--bg2) 30%);
  font-size: 11.5px;
  color: var(--muted);
}
.side-foot nav { display: flex; gap: 12px; }
.side-foot a { color: var(--dim); text-decoration: none; }
.side-foot a:hover { color: var(--accent-t); }

/* ---------------------------------------------------------------- stage */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.stage-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
  flex-wrap: wrap;
}
.stage-bar .seg.views { flex: none; }
.stage-bar .seg.views button { flex: none; padding: 0 12px; }
.ov { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; min-width: 0; }
.ov button {
  flex: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ov button::before { content: ""; width: 8px; height: 8px; border-radius: 2px; border: 1.5px solid currentColor; }
.ov button.on { color: var(--text); background: var(--panel2); }
.ov button.on::before { background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); }
.ov button:hover { color: var(--text); }
.ov .sep { width: 1px; background: var(--line2); margin: 4px 3px; }
.ov .tool::before { display: none; }
.ov .tool .ic { width: 15px; height: 15px; }
.zoom { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.zoom-l {
  min-width: 58px;
  height: 30px;
  border: 0;
  background: none;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 7px;
}
.zoom-l:hover { background: var(--panel2); color: var(--text); }
.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .055) 1px, transparent 0) 0 0 / 22px 22px,
    radial-gradient(ellipse at 50% 30%, #151820, var(--bg) 70%);
}
.canvas-wrap canvas { position: absolute; left: 0; top: 0; display: block; touch-action: none; }
.status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 28px;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  background: var(--bg2);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}
#status-hint { overflow: hidden; text-overflow: ellipsis; }

.summary {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 270px;
  padding: 12px 13px;
  border-radius: 12px;
  background: rgba(17, 19, 23, .9);
  border: 1px solid var(--line2);
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .8);
  font-size: 12.5px;
  color: var(--dim);
  pointer-events: auto;
}
.summary .s-k { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.summary .s-big { font-size: 21px; font-weight: 700; color: var(--text); line-height: 1.2; margin: 2px 0 1px; font-variant-numeric: tabular-nums; }
.summary .s-sub { color: var(--muted); font-size: 12px; }
.summary .s-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.summary .s-row:first-of-type { margin-top: 8px; }
.summary .s-row b { color: var(--text); font-weight: 600; text-align: right; }
.summary .s-warn { display: flex; gap: 7px; margin-top: 8px; padding: 7px 8px; border-radius: 8px; background: rgba(255, 210, 63, .08); color: var(--warn-t); font-size: 12px; }
.summary .s-warn .ic { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.summary .s-err { color: var(--danger-t); }
.summary .s-toggle { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.summary .s-toggle:hover { background: var(--panel3); color: var(--text); }
.summary.min { width: auto; padding: 8px 40px 8px 12px; }
.summary.min .s-more { display: none; }
.summary .s-toggle .ic { width: 15px; height: 15px; transition: transform .2s; }
.summary.min .s-toggle .ic { transform: rotate(180deg); }

.sheet-info {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 300px;
  padding: 12px 13px;
  border-radius: 12px;
  background: rgba(17, 19, 23, .93);
  border: 1px solid var(--accent-line);
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .8);
  font-size: 12.5px;
  color: var(--dim);
}
.sheet-info h3 { margin: 0 0 2px; font-size: 16px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.sheet-info h3 .tag { font-size: 11px; font-weight: 700; color: var(--muted); }
.sheet-info .si-close { position: absolute; top: 6px; right: 6px; }
.sheet-info ul { margin: 8px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.sheet-info li { display: flex; gap: 8px; }
.sheet-info li .ic { width: 15px; height: 15px; margin-top: 1px; color: var(--accent-t); }
.sheet-info .row { gap: 6px; margin-top: 8px; }

.drop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 14, 17, .55);
  backdrop-filter: blur(2px);
}
.drop-card {
  width: min(560px, 100%);
  padding: 28px 28px 22px;
  border-radius: 18px;
  border: 1.5px dashed rgba(255, 255, 255, .2);
  background: rgba(17, 19, 23, .94);
  text-align: center;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .9);
}
.drop-ic { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-t); margin-bottom: 10px; }
.drop-ic .ic { width: 30px; height: 30px; }
.drop-card h1 { margin: 0 0 8px; font-size: 21px; }
.drop-card p { margin: 0 auto 18px; max-width: 460px; color: var(--dim); font-size: 13.5px; }
.steps3 { display: flex; gap: 10px; justify-content: center; margin: 20px 0 0; padding: 0; list-style: none; counter-reset: s; flex-wrap: wrap; }
.steps3 li { counter-increment: s; font-size: 12px; color: var(--muted); width: 150px; text-align: left; display: flex; gap: 8px; align-items: flex-start; }
.steps3 li::before { content: counter(s); flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--panel3); color: var(--accent-t); font-weight: 700; display: grid; place-items: center; font-size: 11px; }
.steps3 li > span { display: block; line-height: 1.35; }
.steps3 b { color: var(--dim); display: block; }

.busy {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(17, 19, 23, .92);
  border: 1px solid var(--line2);
  font-size: 12.5px;
  color: var(--dim);
}
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dragover {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(12, 14, 17, .75);
  pointer-events: none;
}
.dragover > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 26px 40px;
  border: 2px dashed var(--accent);
  border-radius: 20px;
  background: rgba(255, 87, 7, .08);
  font-size: 20px;
  font-weight: 700;
}
.dragover .ic { width: 30px; height: 30px; color: var(--accent); }

/* ---------------------------------------------------------------- dialogs */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 7, 9, .66);
  backdrop-filter: blur(3px);
}
.modal-card {
  width: min(520px, 100%);
  max-height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 16px;
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .9);
  overflow: hidden;
}
.modal-card.wide { width: min(1080px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 18px; }
.modal-h h2 { margin: 0; font-size: 17px; flex: 1; }
.modal-b { padding: 4px 18px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 13px; }
.modal-f { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--bg2); }
.modal-f .est { margin-right: auto; font-size: 12.5px; color: var(--muted); }
.lead { margin: 0; color: var(--dim); font-size: 13.5px; }
.note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.note b { color: var(--dim); }
.note .warn { color: var(--warn-t); }
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress .bar { height: 8px; border-radius: 4px; background: #262b33; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff3d00, #ff5707 55%, #ff9a1f); transition: width .2s; }
.progress span { font-size: 12.5px; color: var(--dim); }

.guide-b { flex-direction: row; gap: 22px; align-items: flex-start; }
.guide-page { flex: none; width: min(46%, 440px); background: #fff; border-radius: 6px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .8); overflow: hidden; }
.guide-page canvas { display: block; width: 100%; height: auto; }
.guide-text { flex: 1; min-width: 0; }
.guide-text ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 9px; }
.guide-text li { color: var(--dim); font-size: 13.5px; }
.guide-text li b { color: var(--text); display: block; }
.guide-explain { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.guide-explain h3 { margin: 0 0 8px; font-size: 14px; }
.guide-explain p { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.explain { width: 100%; max-width: 470px; display: block; }

.help { font-size: 13.5px; color: var(--dim); }
.help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.help h3 { margin: 4px 0 6px; font-size: 14.5px; color: var(--text); }
.help p { margin: 0 0 12px; }
.help ol, .help ul { margin: 0 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.help b { color: var(--text); }
.keys { border-collapse: collapse; width: 100%; font-size: 12.5px; margin-bottom: 10px; }
.keys td { padding: 4px 6px 4px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.keys td:first-child { white-space: nowrap; width: 1%; padding-right: 14px; }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line2); border-bottom-width: 2px; background: var(--panel2); font: 600 11.5px/1.5 var(--font); color: var(--text); text-align: center; }

.toasts { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: min(560px, calc(100vw - 30px));
  padding: 10px 14px;
  border-radius: 11px;
  background: #1f242b;
  border: 1px solid var(--line2);
  box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .85);
  font-size: 13px;
  color: var(--text);
  pointer-events: auto;
  animation: toastin .2s ease-out;
}
.toast .ic { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--accent-t); }
.toast.err .ic { color: var(--danger); }
.toast.ok .ic { color: var(--green); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

#print-root { display: none; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1180px) {
  :root { --side-w: 316px; }
  .brand-t span { display: none; }
  .top-actions .btn .t { display: none; }
  .top-actions .btn:not(.icon) { width: 36px; padding: 0; }
  .top-actions .btn.primary { width: auto; padding: 0 12px; }
  .top-actions .btn.primary .t { display: inline; }
  .summary { width: 240px; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 70vh auto; height: auto; min-height: 100vh; }
  .top { flex-wrap: wrap; padding: 8px 10px; gap: 8px; height: auto; }
  .stage { grid-row: 2; border-bottom: 1px solid var(--line); }
  .side { grid-row: 3; border-right: 0; overflow: visible; padding-bottom: 6px; }
  .exit { font-size: 12.5px; }
  .stage-bar { gap: 6px; padding: 6px 8px; }
  .stage-bar .seg.views { order: 1; }
  .stage-bar .seg.views .t { display: none; }
  .zoom { order: 2; }
  .ov { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 1px; }
  .ov::-webkit-scrollbar { display: none; }
  .summary { top: auto; bottom: 10px; left: 10px; right: auto; width: auto; max-width: calc(100% - 20px); }
  .sheet-info { width: auto; right: 10px; left: 10px; bottom: 10px; }
  .side-foot { position: static; background: none; padding-top: 4px; }
  .guide-b { flex-direction: column; }
  .guide-page { width: 100%; }
  .help-cols { grid-template-columns: 1fr; }
  .status { display: none; }
}
@media (max-width: 520px) {
  .brand-t { display: none; }
  .exit { padding: 0 10px; }
  .grid2 { grid-template-columns: 1fr; }
  .zoom .btn[data-act="zoom-in"], .zoom .btn[data-act="zoom-out"] { display: none; }
  .drop-card { padding: 20px 16px 16px; }
  .drop-card h1 { font-size: 18px; }
  .modal { padding: 8px; }
  .modal-f { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------- printing */
@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  body > * { display: none !important; }
  body.printing #print-root { display: block !important; }
  body:not(.printing)::before {
    content: "Please print with the Print or Export PDF button of Poster Tiler – they print every sheet at its exact size.";
    display: block;
    padding: 20mm;
    font: 14pt/1.4 Arial, sans-serif;
    color: #000;
  }
  .print-page { margin: 0; padding: 0; overflow: hidden; page-break-after: always; break-after: page; }
  .print-page:last-child { page-break-after: auto; break-after: auto; }
  .print-page img { display: block; margin: 0; }
}
