@font-face {
  font-family: "Heebo";
  src: url("Heebo.ttf") format("truetype");
  font-weight: 100 900;
  font-display: block;
}

:root {
  --ink: #15324f;          /* тёмно-синий, как на макетах */
  --text: #1c1c1c;
  --muted: #5d6470;
  --bg: #eeedea;
  --card: #ffffff;
  --line: #d9d6d0;
  --accent: #15324f;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Heebo", system-ui, sans-serif;
}

.top { padding: 24px 16px 8px; }
.top h1 { margin: 0 0 6px; font-size: 26px; font-weight: 800; color: var(--ink); }
.hint { margin: 0; color: var(--muted); font-size: 14px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 16px 16px 48px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card h2 { margin: 6px 0 0; font-size: 17px; font-weight: 700; }
.card .url { margin: 0; color: var(--muted); font-size: 12px; direction: ltr; overflow-wrap: anywhere; }

.preview {
  display: flex;
  justify-content: center;
  background: #f6f5f2;
  border-radius: 12px;
  padding: 12px;
}
.preview .sticker {
  --mm: 0.68mm;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .16);
}

.controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.controls label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.controls input {
  width: 80px; padding: 8px 10px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px;
}
.print {
  font: inherit; font-weight: 700; font-size: 15px;
  background: var(--accent); color: #fff;
  border: 0; border-radius: 12px; padding: 10px 22px; cursor: pointer;
}
.print:active { transform: scale(.97); }

/* ── Наклейка: все размеры в единицах --mm, лист 100×100 ── */
.sticker {
  --mm: 1mm;
  width: calc(100 * var(--mm));
  height: calc(100 * var(--mm));
  background: #fff;
  color: #111;
  font-family: "Heebo", Arial, sans-serif;
  position: relative;
  overflow: hidden;
  flex: none;
}
.sticker .inner {
  position: absolute;
  inset: calc(3.5 * var(--mm));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: calc(1.2 * var(--mm));
}
.sticker.framed .inner {
  inset: calc(5 * var(--mm));
  border: calc(0.6 * var(--mm)) solid var(--ink);
  border-radius: calc(6 * var(--mm));
  padding: calc(4 * var(--mm));
  gap: calc(3 * var(--mm));
}

.sticker .logo { display: block; object-fit: contain; }
.sticker .logo-s { height: calc(11 * var(--mm)); }
.sticker .logo-m { height: calc(17 * var(--mm)); }

.sticker .qr svg { display: block; width: 100%; height: 100%; fill: var(--ink); }
.sticker .qr-m  { width: calc(40 * var(--mm)); height: calc(40 * var(--mm)); }
.sticker .qr-l  { width: calc(43 * var(--mm)); height: calc(43 * var(--mm)); }
.sticker .qr-xl { width: calc(58 * var(--mm)); height: calc(58 * var(--mm)); }

.sticker .t-kicker { font-weight: 700; font-size: calc(5.6 * var(--mm)); line-height: 1.1; }
.sticker .t-floor  { font-weight: 800; font-size: calc(12 * var(--mm)); line-height: 1; }
.sticker .t-title  { font-weight: 500; font-size: calc(8 * var(--mm)); line-height: 1.1; }
.sticker .t-title b { font-weight: 800; }
.sticker .t-big    { font-weight: 800; font-size: calc(10 * var(--mm)); line-height: 1.05; }
.sticker .t-sub    { font-size: calc(4 * var(--mm)); line-height: 1.2; }
.sticker .t-note   { font-size: calc(3.1 * var(--mm)); line-height: 1.25; }
.sticker .t-steps  { font-size: calc(2.6 * var(--mm)); line-height: 1.25; color: #333; }
.sticker .t-phone  { font-size: calc(3.2 * var(--mm)); color: #444; }
.sticker .t-phone-b { font-size: calc(4.2 * var(--mm)); color: #111; }
.sticker .t-phone-b b { font-weight: 800; }

#print-area { display: none; }

@page { size: 100mm 100mm; margin: 0; }

@media print {
  body { background: #fff; }
  .top, .grid { display: none !important; }
  #print-area { display: block; }
  #print-area .sticker { break-after: page; page-break-after: always; }
  #print-area .sticker:last-child { break-after: auto; page-break-after: auto; }
  /* Термопринтер печатает только чёрное: светло-золотой логотип иначе почти пропадает. */
  #print-area .logo { filter: grayscale(1) brightness(.45) contrast(1.5); }
}
