/* Ярлык — общее оформление. Системный шрифт, системные цвета, светлая и тёмная темы. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --page: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text2: #6e6e73;
  --text3: #86868b;
  --line: rgba(60, 60, 67, 0.18);
  --fill: rgba(120, 120, 128, 0.12);
  --accent: #0071e3;
  --accent-press: #0062c4;
  --good: #1f8a3b;
  --bad: #d70015;
  --warn: #b25000;
  --bar: rgba(255, 255, 255, 0.78);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --page: #000000;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --text2: #a1a1a6;
    --text3: #8e8e93;
    --line: rgba(84, 84, 88, 0.6);
    --fill: rgba(120, 120, 128, 0.24);
    --accent: #2997ff;
    --accent-press: #4aa8ff;
    --good: #30d158;
    --bad: #ff453a;
    --warn: #ff9f0a;
    --bar: rgba(22, 22, 23, 0.78);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 17px/1.47 var(--font);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.12;
  font-weight: 700;
}
p {
  margin: 0;
}
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
}

/* Шапка */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--line);
}
.top__in {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 52px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand:hover {
  text-decoration: none;
}
.brand svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  min-width: 0;
  font-size: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar {
  display: none;
}
.nav a {
  color: var(--text2);
  white-space: nowrap;
  padding: 6px 0;
  transition: color 0.2s var(--ease);
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

/* Заголовок страницы */
.hero {
  padding: 64px 0 36px;
}
.hero--home {
  padding: 96px 0 56px;
  text-align: center;
}
.eyebrow {
  font-size: 15px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 56px);
}
.hero--home h1 {
  font-size: clamp(40px, 7vw, 76px);
  letter-spacing: -0.035em;
}
.lead {
  margin-top: 16px;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.38;
  color: var(--text2);
  max-width: 660px;
}
.hero--home .lead {
  margin-left: auto;
  margin-right: auto;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: var(--text2);
}
.hero--home .facts {
  justify-content: center;
}
.facts li::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 9px 3px 0;
  border-radius: 50%;
  background: var(--text3);
}

/* Плитки инструментов на главной */
.tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-bottom: 72px;
}
.tool {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 26px 26px 22px;
  background: var(--card);
  border-radius: 22px;
  color: var(--text);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.tools--small {
  grid-template-columns: repeat(3, 1fr);
  margin-top: -56px;
}
.tools--small .tool {
  min-height: 0;
  padding: 20px 20px 18px;
  border-radius: 18px;
}
.tools--small .tool h2 {
  font-size: 18px;
  line-height: 1.2;
}
.tools--small .tool p {
  margin-top: 6px;
  font-size: 14px;
}
.tool:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.09);
}
.tool:active {
  transform: scale(0.985);
}
.tool svg {
  width: 34px;
  height: 34px;
  color: var(--accent);
  margin-bottom: 22px;
}
.tool h2 {
  font-size: 24px;
}
.tool p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.42;
  color: var(--text2);
}
.tool span {
  margin-top: auto;
  padding-top: 18px;
  font-size: 15px;
  color: var(--accent);
}
.tool span::after {
  content: " ›";
}

/* Рабочая область инструмента */
.work {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 28px;
  align-items: start;
  padding-bottom: 56px;
}
.work__side {
  position: sticky;
  top: 72px;
}
.group {
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 26px;
  overflow: hidden;
}
.group__title {
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text2);
  margin: 0 0 8px 16px;
}
.group__note {
  font-size: 13px;
  line-height: 1.38;
  color: var(--text2);
  margin: -18px 16px 26px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  position: relative;
}
.row:not([hidden]) ~ .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  border-top: 0.5px solid var(--line);
}
.row > label,
.row > .row__label {
  flex: 0 0 auto;
  max-width: 58%;
  font-size: 16px;
}
.row small {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text2);
  letter-spacing: -0.01em;
  padding-bottom: 6px;
  margin-top: -2px;
}
.row input[type="text"],
.row input[type="number"],
.row input:not([type]),
.row select {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  text-align: right;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  font-variant-numeric: tabular-nums;
}
.row input::placeholder {
  color: var(--text3);
}
.row select {
  color: var(--accent);
  cursor: pointer;
  text-align-last: right;
  padding-right: 2px;
}
.row .unit {
  flex: 0 0 auto;
  color: var(--text2);
  font-size: 16px;
  min-width: 14px;
}
.row:focus-within {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.row--stack {
  display: block;
  padding: 12px 16px;
}
.row--stack textarea {
  display: block;
  width: 100%;
  min-height: 150px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--fill);
  color: var(--text);
  font: 13px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  resize: vertical;
  outline: none;
  tab-size: 4;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* Переключатель */
.switch {
  position: relative;
  margin-left: auto;
  width: 51px;
  height: 31px;
  flex: 0 0 auto;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: var(--fill);
  transition: background 0.25s var(--ease);
}
.switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  transition: transform 0.32s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.switch input:checked + i {
  background: #34c759;
}
.switch input:checked + i::after {
  transform: translateX(20px);
}
.switch input:focus-visible + i {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

/* Сегменты */
.seg {
  display: flex;
  padding: 2px;
  background: var(--fill);
  border-radius: 9px;
  margin-bottom: 26px;
}
.seg button {
  flex: 1;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.seg button[aria-pressed="true"] {
  background: var(--card);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
@media (prefers-color-scheme: dark) {
  .seg button[aria-pressed="true"] {
    background: #636366;
  }
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease), opacity 0.2s;
}
.btn:hover {
  background: var(--accent-press);
  text-decoration: none;
}
.btn:active {
  transform: scale(0.97);
}
.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}
.btn--wide {
  width: 100%;
}
.btn--quiet {
  background: var(--fill);
  color: var(--accent);
}
.btn--quiet:hover {
  background: color-mix(in srgb, var(--accent) 16%, var(--fill));
}
.btns {
  display: grid;
  gap: 10px;
}
.hint {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text2);
}
.error {
  color: var(--bad);
}

/* Итог расчёта */
.result {
  background: var(--card);
  border-radius: 22px;
  padding: 26px;
}
.result__label {
  font-size: 15px;
  color: var(--text2);
}
.result__big {
  margin-top: 2px;
  font-size: clamp(40px, 6vw, 54px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s var(--ease);
}
.result__big.is-good {
  color: var(--good);
}
.result__big.is-bad {
  color: var(--bad);
}
.kv {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.kv li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 0.5px solid var(--line);
  font-size: 16px;
}
.kv li span:first-child {
  color: var(--text2);
}
.kv li span:last-child {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.kv li.is-strong span:last-child {
  font-weight: 600;
}
.split {
  display: flex;
  height: 10px;
  margin-top: 22px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--fill);
}
.split i {
  display: block;
  height: 100%;
  min-width: 0;
  transition: width 0.45s var(--ease);
}
.split i + i {
  box-shadow: -1px 0 0 var(--card);
}
.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--text2);
}
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 2px;
}
.legend b {
  float: right;
  font-weight: 400;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Этикетка: просмотр */
.stage {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 28px 18px;
  margin-bottom: 14px;
  background: var(--card);
  border-radius: 22px;
  overflow: hidden;
}
.stage__scale {
  transform-origin: center;
  transition: transform 0.3s var(--ease);
}
.stage .lbl {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 12px 30px rgba(0, 0, 0, 0.14);
  border-radius: 1.2mm;
}
.stage .lbl.is-demo {
  opacity: 0.55;
}
.count {
  text-align: center;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 14px;
}

/* Этикетка: сама наклейка. Размеры в миллиметрах, шрифт задаётся от высоты. */
.lbl {
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #000;
  padding: 1.6mm 2mm 1.4mm;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  letter-spacing: 0;
  line-height: 1.16;
  overflow: hidden;
  text-align: center;
}
.lbl__name {
  font-weight: 700;
  font-size: 1.12em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.lbl__meta {
  margin-top: 0.3mm;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lbl__bars {
  flex: 1 1 0;
  min-height: 0;
  margin-top: 0.8mm;
  display: flex;
}
.lbl__bars svg {
  width: 100%;
  height: 100%;
  display: block;
}
.lbl__digits {
  font-size: 1.08em;
  letter-spacing: 0.06em;
  margin-top: 0.3mm;
  white-space: nowrap;
}
.lbl__foot {
  display: flex;
  align-items: flex-end;
  gap: 1.2mm;
  margin-top: 0.5mm;
  font-size: 0.82em;
  line-height: 1.12;
  text-align: left;
}
.lbl__foot div {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.lbl__eac {
  flex: 0 0 auto;
  height: 2.1em;
  width: auto;
}
.lbl--big {
  padding: 4mm 4mm 3mm;
}
.lbl--big .lbl__name {
  font-size: 2em;
  line-height: 1.12;
  -webkit-line-clamp: 5;
}
.lbl--big .lbl__meta {
  font-size: 1.35em;
  margin-top: 1.2mm;
}
.lbl--big .lbl__bars {
  flex: 0 0 32%;
  margin-top: auto;
}
.lbl--big .lbl__digits {
  font-size: 1.3em;
  margin-top: 0.8mm;
}
.lbl--big .lbl__foot {
  font-size: 1em;
  margin-top: 1.5mm;
}
.lbl--bad .lbl__bars {
  align-items: center;
  justify-content: center;
  color: #b00020;
  font-size: 0.95em;
  border: 0.2mm dashed #b00020;
}

/* Текст под инструментом */
.prose {
  max-width: 700px;
  padding: 20px 0 76px;
}
.prose h2 {
  font-size: 28px;
  margin: 44px 0 14px;
}
.prose h3 {
  font-size: 19px;
  margin: 28px 0 8px;
  line-height: 1.25;
}
.prose p,
.prose li {
  color: var(--text);
  margin-bottom: 12px;
}
.prose ul,
.prose ol {
  padding-left: 22px;
  margin: 0 0 12px;
}
.prose .note {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--fill);
  font-size: 15px;
  color: var(--text2);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
  font-size: 15px;
}
.prose th,
.prose td {
  text-align: left;
  padding: 10px 12px 10px 0;
  border-bottom: 0.5px solid var(--line);
  vertical-align: top;
}
.prose th {
  font-weight: 600;
  color: var(--text2);
  font-size: 13px;
}
.more {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.more a {
  display: block;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  transition: transform 0.25s var(--ease);
}
.more a:hover {
  text-decoration: none;
  transform: translateY(-2px);
}
.more a b {
  display: block;
  font-weight: 600;
}
.more a span {
  font-size: 14px;
  color: var(--text2);
}

/* Подвал */
.foot {
  border-top: 0.5px solid var(--line);
  padding: 22px 0 40px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text2);
}
.foot__in {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}
.foot a {
  color: var(--text2);
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.foot p {
  max-width: 620px;
}

/* Появление */
@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise 0.6s var(--ease) both;
  }
  .rise:nth-child(2) {
    animation-delay: 0.06s;
  }
  .rise:nth-child(3) {
    animation-delay: 0.12s;
  }
  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 860px) {
  .tools {
    grid-template-columns: 1fr;
  }
  .tools--small {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .tool {
    min-height: 0;
  }
  .work {
    grid-template-columns: minmax(0, 1fr);
  }
  .work__side {
    position: static;
    order: -1;
  }
  .work__side--after {
    order: 1;
  }
  .hero {
    padding: 40px 0 26px;
  }
  .hero--home {
    padding: 60px 0 40px;
  }
  .more {
    grid-template-columns: 1fr;
  }
  .nav {
    gap: 18px;
  }
  .top__in {
    gap: 16px;
  }
}

/* Печать этикеток: на бумагу идёт только лист печати. */
#print-root {
  display: none;
}
@media print {
  html,
  body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body > *:not(#print-root) {
    display: none !important;
  }
  #print-root {
    display: block;
  }
  #print-root.is-roll .lbl {
    break-after: page;
    page-break-after: always;
    border-radius: 0;
  }
  #print-root.is-roll .lbl:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  #print-root.is-sheet {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 2mm;
  }
  #print-root.is-sheet .lbl {
    break-inside: avoid;
    page-break-inside: avoid;
    outline: 0.1mm dashed #999;
  }
}

@media (max-width: 1020px) and (min-width: 861px) {
  .tools--small {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 860px) {
  .nav {
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    padding-right: 24px;
  }
}
@media (max-width: 480px) {
  .prose table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 14px;
  }
  .row > label,
  .row > .row__label {
    max-width: 64%;
    font-size: 15px;
  }
}

.foot__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 0.5px solid var(--line);
}
#instrumenty {
  scroll-margin-top: 68px;
}
.tools--small .tool {
  min-width: 0;
}
.tools--small .tool h2 {
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: anywhere;
}
@media (max-width: 860px) {
  .tools--small {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.next {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 0.5px solid var(--line);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text2);
}
