/* ==========================================================================
   Мулине — конструктор схем для вышивки крестом
   Оформление: тёплая бумага, канва в фоне, спокойные акценты нитяных цветов.
   ========================================================================== */

:root {
  --paper:      #f5f0e7;
  --paper-2:    #e9e1d2;
  --surface:    #fffdf9;
  --surface-2:  #f6f1e7;
  --ink:        #241f18;
  --ink-soft:   #4f4638;
  --muted:      #8a7f6e;
  --line:       #e3dac9;
  --line-soft:  #eee7d9;
  --accent:     #b4453a;
  --accent-ink: #fffaf8;
  --accent-soft:#f8e7e3;
  --moss:       #47786a;
  --moss-soft:  #e4efe9;
  --gold:       #b0812a;
  --gold-soft:  #f6edd8;

  --shadow-sm:  0 1px 2px rgba(66, 52, 32, .06), 0 3px 10px rgba(66, 52, 32, .05);
  --shadow-md:  0 2px 6px rgba(66, 52, 32, .07), 0 14px 32px rgba(66, 52, 32, .10);
  --radius:     18px;
  --radius-sm:  12px;
  --sidebar-w:  352px;

  --font-ui:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-num:   ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper:      #17161a;
  --paper-2:    #201f25;
  --surface:    #201f25;
  --surface-2:  #27262d;
  --ink:        #f2ede4;
  --ink-soft:   #cec6b8;
  --muted:      #978d7f;
  --line:       #37343d;
  --line-soft:  #2c2b33;
  --accent:     #e07a6b;
  --accent-ink: #1b1013;
  --accent-soft:#392a2c;
  --moss:       #83b7a4;
  --moss-soft:  #26332f;
  --gold:       #d9a952;
  --gold-soft:  #2f2718;
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md:  0 2px 8px rgba(0, 0, 0, .35), 0 18px 38px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  /* Фон повторяет переплетение канвы — по нему сразу понятно, о чём приложение. */
  background-image:
    repeating-linear-gradient(90deg, rgba(120, 100, 70, .045) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(0deg, rgba(120, 100, 70, .045) 0 1px, transparent 1px 10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

[data-theme="dark"] body {
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 10px);
}

h1, h2, h3 { margin: 0; font-weight: 600; }
button, input, select { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ================================================================ шапка == */

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 20px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 36px; height: 36px; stroke: none; }
.brand-mark .mark-bg { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.3; opacity: .9; }
.brand-mark .mark-grid path { stroke: var(--accent); stroke-width: 1; opacity: .3; }
.brand-mark .mark-stitch { stroke: var(--accent); stroke-width: 3.4; stroke-linecap: round; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.brand-text span { font-size: 11.5px; color: var(--muted); letter-spacing: .03em; }

.topbar-actions { display: flex; align-items: center; gap: 9px; }

/* =============================================================== кнопки == */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s, border-color .16s, transform .12s, opacity .16s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn-lg { height: 44px; padding: 0 24px; font-size: 15px; }

.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 87%, #000); }

.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--ink-soft); }
.btn-ghost:hover:not(:disabled) { border-color: var(--muted); color: var(--ink); }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .16s, color .16s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
[data-theme="dark"] .icon-btn svg { transform: rotate(150deg); }

.linklike {
  border: 0; background: none; padding: 0;
  color: var(--accent);
  font: inherit; font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 38%, transparent);
  text-underline-offset: 3px;
}
.linklike:hover { text-decoration-color: var(--accent); }

/* ================================================================= меню == */

.menu-host { position: relative; }

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  min-width: 292px;
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 40;
  animation: pop .14s ease-out;
}
.menu button {
  display: block; width: 100%;
  padding: 9px 12px;
  text-align: left;
  border: 0; border-radius: 9px;
  background: none;
  cursor: pointer;
}
.menu button b { display: block; font-size: 13.5px; font-weight: 600; }
.menu button small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.menu button:hover { background: var(--accent-soft); }
.menu button:hover b { color: var(--accent); }
.menu-sep { height: 1px; margin: 6px 10px; background: var(--line-soft); }

@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }

/* =============================================================== каркас == */

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 0;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  padding: 18px 16px 30px;
  overflow-y: auto;
  scrollbar-color: var(--line) transparent;
}

/* ================================================================= шаги == */

.steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px 17px;
  box-shadow: var(--shadow-sm);
  transition: opacity .2s, filter .2s;
}
.step.is-locked { opacity: .45; filter: saturate(.5); pointer-events: none; }

.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.step-num {
  flex: none;
  width: 25px; height: 25px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px; font-weight: 700;
  font-family: var(--font-num);
}
.step-head h2 { font-family: var(--font-display); font-size: 17.5px; letter-spacing: .01em; }

/* ============================================================== пресеты == */

.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.presets button {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 11px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.presets button:hover { border-color: var(--accent); transform: translateY(-1px); }
.presets button b { font-size: 13.5px; font-weight: 600; }
.presets button span { font-size: 11.5px; color: var(--muted); }
.presets button.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.presets button.is-active b { color: var(--accent); }
.presets-tight { margin-top: 12px; }

/* ============================================== раскрывающиеся настройки == */

.tune { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.tune > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  user-select: none;
}
.tune > summary::-webkit-details-marker { display: none; }
.tune > summary::before {
  content: "";
  width: 7px; height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg) translate(-1px, 1px);
  transition: transform .18s;
}
.tune[open] > summary { color: var(--accent); }
.tune[open] > summary::before { transform: rotate(45deg) translate(-1px, -1px); }
.tune > summary:hover { color: var(--ink); }
.tune-body { padding-top: 13px; animation: slide .18s ease-out; }
@keyframes slide { from { opacity: 0; transform: translateY(-4px); } }

.tune-group { margin-top: 15px; padding-top: 13px; border-top: 1px dashed var(--line); }
.tune-group-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px; font-weight: 500; color: var(--muted);
}

/* ================================================================= поля == */

.field { display: block; margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field.slim { margin-bottom: 11px; }

.field-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}
.field-label b { margin-left: auto; font-family: var(--font-num); font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.field-note { display: block; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.field-row { display: flex; align-items: center; gap: 11px; }

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 22px;
  background: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 4px;
  background: linear-gradient(var(--accent), var(--accent)) 0 / var(--fill, 50%) 100% no-repeat, var(--paper-2);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--accent);
  box-shadow: var(--shadow-sm);
  transition: transform .12s;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.14); }
input[type="range"]::-moz-range-track { height: 5px; border-radius: 4px; background: var(--paper-2); }
input[type="range"]::-moz-range-progress { height: 5px; border-radius: 4px; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--accent); }

.num {
  width: 66px; height: 34px;
  padding: 0 8px;
  text-align: center;
  font-family: var(--font-num);
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

select {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2) no-repeat right 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238a7f6e' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 11px;
  -webkit-appearance: none;
  appearance: none;
  font-size: 13.5px;
  cursor: pointer;
}

.seg {
  display: inline-flex;
  padding: 3px; gap: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
}
.seg-wide { display: flex; width: 100%; }
.seg button {
  flex: 1;
  min-width: 40px; height: 32px;
  padding: 0 12px;
  border: 0; border-radius: 8px;
  background: none;
  font-size: 13.5px; font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--ink); }
.seg button.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }

.switch { position: relative; display: flex; align-items: flex-start; gap: 11px; margin-top: 13px; cursor: pointer; }
.switch input {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.switch-track {
  flex: none;
  width: 38px; height: 22px;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: flex; align-items: center;
  transition: background .18s, border-color .18s;
}
.switch-dot {
  width: 16px; height: 16px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .18s;
}
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track .switch-dot { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-text { font-size: 13.5px; line-height: 1.3; }
.switch-text small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }

/* Подсказка «что это такое» */
.help {
  width: 16px; height: 16px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px; font-weight: 700; line-height: 1;
  cursor: help;
  position: relative;
}
.help:hover, .help:focus-visible { color: var(--accent); border-color: var(--accent); }
.help::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: 214px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11.5px; font-weight: 400; line-height: 1.4;
  text-align: left;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 30;
  box-shadow: var(--shadow-md);
}
.help:hover::after, .help:focus-visible::after { opacity: 1; }

/* ======================================================= зона загрузки == */

.drop { border-radius: var(--radius-sm); }
.drop.is-over, .empty-card.is-over {
  background: var(--accent-soft);
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
}

.drop-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 18px 12px;
  text-align: center;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--ink-soft);
}
.drop-empty svg { width: 28px; height: 28px; color: var(--muted); }
.drop-empty small { color: var(--muted); font-size: 11px; }

.thumb-row { display: flex; gap: 12px; align-items: center; }
.thumb-row img {
  width: 66px; height: 66px;
  object-fit: cover;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.thumb-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.thumb-meta strong { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb-meta span { color: var(--muted); font-family: var(--font-num); font-size: 11.5px; }
.thumb-meta button { align-self: flex-start; margin-top: 4px; font-size: 12.5px; }

/* =========================================== размер, масштаб, оценки  === */

.scale { margin-top: 14px; }

.scale-empty {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed var(--line);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.scale-figure {
  padding: 10px 12px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.scale-figure svg { display: block; width: 100%; max-width: 330px; height: auto; margin: 0 auto; }
.fig-fabric { fill: var(--surface); stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 2.5; opacity: .8; }
.fig-emb { fill: color-mix(in srgb, var(--accent) 26%, transparent); stroke: var(--accent); stroke-width: 1.3; }
.fig-a4 { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 2.5; opacity: .5; }
.fig-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.fig-key { display: inline-flex; align-items: center; gap: 5px; }
.fig-key::before {
  content: "";
  width: 11px; height: 9px;
  border-radius: 2px;
}
.fig-key-emb::before { background: color-mix(in srgb, var(--accent) 26%, transparent); border: 1.2px solid var(--accent); }
.fig-key-fabric::before { border: 1px dashed var(--muted); }
.fig-key-a4::before { border: 1px dashed var(--muted); opacity: .55; height: 12px; width: 9px; }

.scale-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  margin: 12px 0 0;
  font-size: 12.5px;
}
.scale-facts dt { color: var(--muted); }
.scale-facts dd { margin: 0; text-align: right; font-family: var(--font-num); font-size: 12px; color: var(--ink-soft); }

.gauge { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.gauge-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.gauge-head b { color: var(--ink); font-weight: 600; font-size: 12.5px; text-align: right; }
.gauge-bar { display: flex; gap: 3px; margin: 8px 0 7px; }
.gauge-bar i { flex: 1; height: 5px; border-radius: 3px; background: var(--paper-2); }
.gauge-bar i.is-on { background: var(--moss); }
.gauge-bar[data-score="1"] i.is-on { background: var(--accent); }
.gauge-bar[data-score="2"] i.is-on { background: var(--gold); }
.gauge p { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--ink-soft); }

.sidebar-foot { margin: 0 6px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }

/* ================================================================ сцена == */

.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.stage-head {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border: 0; border-radius: 10px;
  background: none;
  font-size: 13.5px; font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.tabs button svg { width: 16px; height: 16px; opacity: .8; }
.tabs button:hover { color: var(--ink); }
.tabs button.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }

.stage-tools { display: flex; align-items: center; gap: 15px; margin-left: auto; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; user-select: none; }
.chk input { accent-color: var(--accent); width: 15px; height: 15px; }

.zoom { display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.zoom button {
  min-width: 30px; height: 28px;
  border: 0; border-radius: 7px;
  background: none;
  font-size: 16px; line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}
.zoom button:hover { background: var(--surface); color: var(--accent); }
.zoom-value {
  min-width: 46px;
  padding: 0 4px;
  text-align: center;
  font-family: var(--font-num);
  font-size: 11.5px;
  color: var(--muted);
  user-select: none;
}
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }

.stage-body { position: relative; flex: 1; min-height: 0; overflow: hidden; }

.canvas-wrap {
  position: absolute; inset: 0;
  overflow: auto;
  padding: 24px;
  display: grid;
  place-items: start center;
  scrollbar-color: var(--line) transparent;
}
.canvas-wrap canvas {
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}

/* Подсказка по клетке под курсором */
.cell-tip {
  position: absolute;
  z-index: 6;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 2px 8px;
  width: 210px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}
.cell-tip i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .35); }
.cell-tip b { font-family: var(--font-num); font-size: 12.5px; }
.cell-tip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-tip small { grid-column: 1 / -1; opacity: .65; font-size: 11px; }

/* Полоса режима «показан один цвет» */
.focus-bar {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  padding: 8px 8px 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  box-shadow: var(--shadow-md);
}
.focus-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus-bar button {
  flex: none;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

/* ========================================================= пустой экран == */

.empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; overflow: auto; }

.empty-card {
  max-width: 470px;
  padding: 32px 38px 30px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  display: grid;
  justify-items: center;
  gap: 10px;
}
.empty-art svg { width: 156px; height: 118px; }
.empty-art .art-grid path { stroke: var(--line); stroke-width: 1.4; }
.empty-art .art-stitch path { stroke: var(--accent); stroke-width: 3.4; stroke-linecap: round; opacity: .9; }
.empty-art .art-stitch path:nth-child(2) { stroke: var(--moss); }
.empty-art .art-stitch path:nth-child(3) { stroke: var(--gold); }
.empty-card h2 { font-family: var(--font-display); font-size: 23px; }
.empty-card p { margin: 0; color: var(--ink-soft); font-size: 14px; max-width: 36ch; }
.empty-card .btn { margin-top: 8px; }
.empty-card small { color: var(--muted); font-size: 11.5px; }

.empty-steps {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 18px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line-soft);
  width: 100%;
  justify-content: space-between;
}
.empty-steps li {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted);
}
.empty-steps span {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px; font-weight: 700;
  font-family: var(--font-num);
}

/* ============================================================== легенда == */

.legend-pane { position: absolute; inset: 0; overflow: auto; padding: 24px 26px 32px; }

.legend-head { margin-bottom: 16px; }
.legend-head h2 { font-family: var(--font-display); font-size: 21px; }
.legend-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.table-scroll {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.legend-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 13.5px; }
.legend-table th {
  position: sticky; top: 0;
  padding: 10px 13px;
  text-align: left;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.legend-table td { padding: 8px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.legend-table tr:last-child td { border-bottom: 0; }
.legend-table tbody tr { cursor: pointer; }
.legend-table tbody tr:hover { background: var(--accent-soft); }
.legend-table .num-col { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend-table td.num-col { color: var(--ink-soft); }
.legend-table .code { font-family: var(--font-num); font-weight: 600; }
.legend-table canvas { display: block; border-radius: 6px; }

.swatch-cell { display: flex; align-items: center; gap: 10px; }
.swatch {
  width: 24px; height: 24px;
  flex: none;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.swatch-name { line-height: 1.25; }
.swatch-name small { display: block; color: var(--muted); font-size: 11px; }

.bar { position: relative; height: 4px; margin-top: 5px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.bar span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; }

/* ============================================================= загрузка == */

.busy {
  position: absolute; inset: 0;
  display: grid; place-items: center; align-content: center; gap: 13px;
  background: color-mix(in srgb, var(--paper) 76%, transparent);
  backdrop-filter: blur(2px);
  font-size: 13.5px; color: var(--ink-soft);
  z-index: 5;
}
.spinner {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================================== статус == */

.stats {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 22px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-size: 12.5px;
}
.stat { display: flex; align-items: baseline; gap: 7px; }
.stat-label { color: var(--muted); }
.stat-value { font-family: var(--font-num); font-weight: 600; color: var(--ink); }

/* ======================================================= сохранённые работы */

.badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
}

.sheet {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  max-height: min(80vh, 760px);
  padding: 26px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  overflow: auto;
}
.sheet::backdrop { background: rgba(36, 28, 18, .45); backdrop-filter: blur(3px); }
.sheet-close-form { position: absolute; top: 18px; right: 18px; margin: 0; z-index: 3; }
.sheet-close {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.sheet-close:hover { color: var(--accent); border-color: var(--accent); }
.sheet-title { font-family: var(--font-display); font-size: 22px; }
.sheet-sub { margin: 5px 0 18px; color: var(--muted); font-size: 13px; max-width: 52ch; }

.sheet-save { display: flex; gap: 10px; margin-bottom: 20px; }
.sheet-save input {
  flex: 1;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13.5px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.project-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color .15s, transform .12s;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.project-card.is-current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.project-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.project-open img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper-2);
}
.project-body { display: grid; gap: 2px; padding: 10px 12px 12px; }
.project-body strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-body span { font-size: 11.5px; color: var(--ink-soft); }
.project-body small { font-size: 11px; color: var(--muted); }
.project-remove {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 16, 12, .6);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}
.project-card:hover .project-remove { opacity: 1; }
.project-remove:hover { background: var(--accent); }

.print-range { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.print-range-all { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink-soft); }
.print-range-pair { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); }
.print-range-pair input {
  width: 62px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-family: var(--font-num);
  text-align: center;
}
.print-range-pair input:disabled { opacity: .45; }
.print-map-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.stored-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.noscript {
  margin: 0;
  padding: 16px 20px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.sheet-empty { margin: 0; padding: 22px 0; text-align: center; color: var(--muted); font-size: 13px; }

.sheet-transfer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.sheet-transfer-note { margin: 0; max-width: 44ch; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sheet-transfer-actions { display: flex; gap: 10px; }

.sheet-actions {
  position: sticky;
  bottom: -28px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding: 10px 0 12px;
  background: linear-gradient(to bottom, transparent, var(--surface) 45%);
}

/* --- настройка печати --- */

.print-setup { display: grid; grid-template-columns: 1fr 240px; gap: 24px; align-items: start; }
.print-options .field { margin-bottom: 16px; }
.print-options .seg button { flex-direction: column; height: auto; padding: 7px 10px; line-height: 1.2; }
.print-options .seg button small { display: block; font-size: 10.5px; opacity: .7; }

.print-map-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.print-map {
  display: grid;
  grid-template-columns: repeat(var(--across, 1), 1fr);
  gap: 4px;
  max-width: 100%;
}
.print-map-sheet {
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 600;
}
.print-map-note { margin: 12px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--ink-soft); }

@media (max-width: 640px) {
  .print-setup { grid-template-columns: 1fr; }
}

/* =========================================================== уведомление == */

.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translate(-50%, 14px);
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 17px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 90;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast[data-tone="error"] { background: var(--accent); color: #fff; }
.toast[data-tone="info"] { background: var(--ink); color: var(--paper); }

/* ================================================================ печать == */

.print-root { display: none; color: #1a1a1a; background: #fff; }
.print-page { padding: 0 0 18px; }
.print-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #ddd;
}
.print-head h1 { font-family: var(--font-display); font-size: 15pt; color: #1a1a1a; }
.print-head span { font-size: 9pt; color: #666; }
.print-cover { display: grid; gap: 16px; justify-items: center; }
.print-preview { max-width: 100%; max-height: 145mm; width: auto; display: block; }
.print-chart { max-width: 100%; height: auto; display: block; }
.print-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 9.5pt; color: #333;
}
.print-table { width: 100%; border-collapse: collapse; font-size: 9pt; }
.print-table th, .print-table td { border: 1px solid #ccc; padding: 3px 6px; text-align: left; }
.print-table th { background: #f2f2f2; }
.print-table .num-col { text-align: right; }
.print-table canvas { width: 16px; height: 16px; display: block; }
.print-dot { display: inline-block; width: 11px; height: 11px; border: 1px solid #999; vertical-align: -1px; }

@media print {
  @page { margin: 12mm; }
  body { overflow: visible; background: #fff; display: block; }
  .topbar, .layout, .toast { display: none !important; }
  .print-root { display: block; }
  .print-page { padding: 0; page-break-after: always; break-after: page; }
  .print-page:last-child { page-break-after: auto; break-after: auto; }
}

/* ============================================================== адаптив == */

@media (max-width: 1180px) {
  :root { --sidebar-w: 310px; }
  .tabs button { padding: 0 11px; }
  .tabs button svg { display: none; }
}

@media (max-width: 620px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .btn-label { display: none; }
  .btn { padding: 0 13px; }
  .menu { min-width: 244px; }
  .empty-card { padding: 26px 20px; }
  .empty-steps { flex-direction: column; align-items: flex-start; gap: 9px; }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .stage { min-height: 80vh; }
  .stage-head { flex-wrap: wrap; }
  .brand-text span { display: none; }
}

.legend-notes {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.legend-notes li {
  position: relative;
  padding: 10px 13px 10px 36px;
  border-radius: var(--radius-sm);
  background: var(--moss-soft);
  border: 1px solid color-mix(in srgb, var(--moss) 26%, transparent);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.legend-notes li::before {
  content: "!";
  position: absolute;
  left: 12px; top: 10px;
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--moss);
  color: var(--surface);
  font-size: 11px;
  font-weight: 700;
}

/* ------------------------------------------------- подготовка картинки -- */

.prep { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.prep .presets { margin-top: 9px; }

.prep-advice {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--moss-soft);
  border: 1px solid color-mix(in srgb, var(--moss) 26%, transparent);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------- кадр ----- */

.crop-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 12px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--ink-soft);
}
.crop-row-actions { display: flex; gap: 10px; flex: none; }
.crop-row-actions button { font-size: 12px; }

.sheet-wide { width: min(880px, calc(100vw - 32px)); }

.crop-stage {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  line-height: 0;
  user-select: none;
  touch-action: none;
}
/* Картинка не должна выдавливать кнопки диалога за край экрана: оставляем
   место под заголовок, пропорции и кнопки. */
.crop-stage img {
  display: block;
  max-width: 100%;
  max-height: max(160px, min(420px, calc(80vh - 330px)));
  width: auto;
  height: auto;
}

.crop-box {
  position: absolute;
  box-shadow: 0 0 0 9999px rgba(20, 14, 8, .58);
  outline: 2px solid var(--accent);
  cursor: move;
}
/* Клетки-направляющие: помогают ловить композицию */
.crop-box::before,
.crop-box::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-repeat: no-repeat;
}
.crop-box::before {
  background-image: linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
  background-size: 100% 33.33%, 33.33% 100%;
  background-position: 0 33.33%, 33.33% 0;
}
.crop-handle {
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid var(--accent);
  background: var(--surface);
  border-radius: 4px;
  z-index: 2;
}
.crop-handle[data-handle="nw"] { left: -9px; top: -9px; cursor: nwse-resize; }
.crop-handle[data-handle="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.crop-handle[data-handle="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.crop-handle[data-handle="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }

.crop-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 18px;
}
.crop-buttons { display: flex; gap: 8px; }
.crop-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }

@media (max-width: 640px) {
  .crop-tools { grid-template-columns: 1fr; align-items: stretch; }
  .crop-buttons { flex-wrap: wrap; }
}

/* --------------------------------------------------------- цвет канвы --- */

.fabric-field { margin-top: 14px; }
.fabric-row { display: flex; gap: 7px; flex-wrap: wrap; }
.fabric-swatch {
  width: 34px; height: 34px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .15s, transform .12s;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
}
.fabric-swatch:hover { transform: translateY(-1px); }
.fabric-swatch.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), inset 0 1px 2px rgba(0, 0, 0, .12); }

.legend-table .skip-cell { text-align: center; }
.legend-table .skip-cell input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.legend-table tr.is-skipped td:not(.skip-cell) { opacity: .45; }
.legend-table tr.is-skipped .swatch-name { text-decoration: line-through; }

.legend-table tr.is-contour { background: var(--accent-soft); cursor: default; }
.legend-table tr.is-contour:hover { background: var(--accent-soft); }
.legend-table tr.is-contour .skip-cell { color: var(--muted); }

.fabric-row-compact { gap: 5px; }
.fabric-row-compact .fabric-swatch { width: 24px; height: 24px; border-radius: 7px; border-width: 2px; }
.fabric-row-compact .fabric-swatch.is-active { box-shadow: 0 0 0 2px var(--accent-soft), inset 0 1px 2px rgba(0, 0, 0, .12); }

/* ------------------------------------------------- заметная настройка --- */

.feature {
  margin-top: 14px;
  padding: 12px 13px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.feature-head { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.feature-text { flex: 1; }
.feature-text b { display: block; font-size: 13.5px; font-weight: 600; }
.feature-text small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.feature-switch { margin-top: 2px; flex: none; }
.feature-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--ink-soft);
}
.feature-status i { width: 12px; height: 12px; flex: none; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .2); }
.feature .field { margin-top: 12px; }

.prep-main { margin-top: 14px; }
.prep-warning {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* --------------------------------------------------------- вид вышивки -- */

.prep-title { font-family: var(--font-display); font-size: 15px; }
.prep-lead { margin: 4px 0 12px; font-size: 12px; line-height: 1.45; color: var(--muted); }

.variants { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.variant {
  position: relative;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, transform .12s;
}
.variant:hover { border-color: var(--accent); transform: translateY(-1px); }
.variant.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.variant canvas {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper-2);
  image-rendering: pixelated;
}
.variant span {
  display: block;
  padding: 6px 8px 7px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}
.variant.is-active span { color: var(--accent); font-weight: 600; }
.variant-risk {
  position: absolute;
  top: 7px; right: 7px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface);
}
.variants-loading { grid-column: 1 / -1; padding: 18px 0; text-align: center; font-size: 12px; color: var(--muted); }

.prep-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.prep-head .linklike { font-size: 12px; }

.variants-tight { margin-top: 12px; }
.variants-big { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 4px; }
.variants-big .variant span { padding: 9px 10px 10px; font-size: 12.5px; }
.variants-big .variant-risk { width: 11px; height: 11px; top: 10px; right: 10px; }

/* -------------------------------------------------- врезка и лупа ------- */

.reveal {
  position: absolute;
  z-index: 6;
  line-height: 0;
  pointer-events: none;
  will-change: transform;
}
.reveal canvas { display: block; border-radius: 6px; box-shadow: var(--shadow-md); }

.loupe {
  position: absolute;
  z-index: 7;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 8px rgba(40, 30, 16, .3), 0 0 0 1px rgba(40, 30, 16, .18);
  line-height: 0;
  pointer-events: none;
}
.loupe canvas { display: block; }

.variant-plain {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 92px;
  padding: 10px 11px;
  text-align: left;
}
.variant-plain b { font-size: 13.5px; font-weight: 600; }
.variant-plain span { padding: 0; text-align: left; }
.variant-plain.is-active b { color: var(--accent); }

.fabric-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.fabric-count {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.fabric-count canvas {
  display: block;
  border-radius: 8px;
  border: 2px solid var(--line);
  transition: border-color .15s, transform .12s;
}
.fabric-count:hover canvas { transform: translateY(-1px); }
.fabric-count b {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.fabric-count.is-active canvas { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.fabric-count.is-active b { color: var(--accent); }

/* Кому движение мешает — тому его и не показываем. Плавный отъезд от пялец
   красив, но у части людей от такого кружится голова. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
