/* KnitSolution — Kalkulator przędzy v2.8.3 */

/* Повышенная специфичность через #ks-calculator-root */

#ks-calculator-root,
#ks-calculator-root * {
  box-sizing: border-box;
  font-family: 'DM Sans', sans-serif;
}

/* ─── CalcStrip ─────────────────────────────────────────────────────────────── */

#ks-calculator-root .ks-calc-strip {
  border: 1px solid rgba(28,28,28,0.12);
  background: rgba(28,28,28,0.02);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

#ks-calculator-root .ks-calc-strip__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

#ks-calculator-root .ks-calc-strip__eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #777777;
  margin-bottom: 3px;
}

#ks-calculator-root .ks-calc-strip__summary {
  font-size: 12px;
  color: #555555;
  line-height: 1.4;
}

#ks-calculator-root .ks-calc-strip__open {
  background: transparent;
  border: none;
  border-bottom: 1px solid #1C1C1C;
  padding: 2px 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #1C1C1C;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: opacity 220ms ease;
  border-radius: 0;
  white-space: nowrap;
}

#ks-calculator-root .ks-calc-strip__open:hover { opacity: 0.7; }

#ks-calculator-root .ks-calc-strip__metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 0 2px;
  border-top: 1px solid rgba(28,28,28,0.08);
}

@media (max-width: 520px) {
  #ks-calculator-root .ks-calc-strip__metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 8px;
  }
}

#ks-calculator-root .ks-calc-strip__metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#ks-calculator-root .ks-calc-strip__metric .ks-k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #777777;
  font-weight: 400;
}

#ks-calculator-root .ks-calc-strip__metric .ks-v {
  font-size: 15px;
  color: #1C1C1C;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

#ks-calculator-root .ks-calc-strip__note {
  font-size: 11px;
  color: #555555;
  line-height: 1.4;
  margin: 0;
}

/* ─── Drawer — вне #ks-calculator-root, крепится к body ─────────────────────── */

.ks-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
}

.ks-drawer-root.open { pointer-events: auto; }

.ks-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28,28,28,0);
  transition: background 320ms ease;
}

.ks-drawer-root.open .ks-drawer-backdrop {
  background: rgba(28,28,28,0.35);
}

.ks-drawer {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(600px, 100vw);
  background: #F4F4F2;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 360ms cubic-bezier(.2,.7,.2,1);
  box-shadow: -8px 0 40px rgba(28,28,28,0.06);
  font-family: 'DM Sans', sans-serif;
}

.ks-drawer-root.open .ks-drawer { transform: translateX(0); }

.ks-drawer * { box-sizing: border-box; font-family: 'DM Sans', sans-serif; }

.ks-drawer__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 28px 28px 20px;
  border-bottom: 1px solid rgba(28,28,28,0.1);
  gap: 16px;
  flex-shrink: 0;
}

.ks-drawer__eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #777777;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ks-drawer__eyebrow::before {
  content: "";
  width: 20px;
  height: 1px;
  background: #777777;
  display: block;
}

.ks-drawer__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  font-weight: 300;
  color: #1C1C1C;
  margin: 0;
  line-height: 1.1;
}

.ks-drawer__close {
  background: transparent;
  border: 1px solid rgba(28,28,28,0.1);
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1C1C1C;
  cursor: pointer;
  transition: border-color 220ms ease;
  flex-shrink: 0;
  border-radius: 0;
  padding: 0;
}

.ks-drawer__close:hover { border-color: #1C1C1C; }

.ks-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ks-drawer__foot {
  padding: 20px 28px;
  border-top: 1px solid rgba(28,28,28,0.1);
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
}

/* ─── Shared steps (drawer + standalone) ────────────────────────────────────── */

.ks-calc-step__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #777777;
  margin-bottom: 10px;
}

.ks-calc__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.ks-calc__cards--small {
  grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 480px) {
  .ks-calc__cards { grid-template-columns: repeat(2, 1fr); }
  .ks-calc__cards--small { grid-template-columns: repeat(3, 1fr); }
}

.ks-calc__card {
  background: transparent;
  border: 1px solid rgba(28,28,28,0.12);
  padding: 10px 8px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 200ms ease, background 200ms ease;
  border-radius: 0;
}

.ks-calc__card:hover { border-color: #1C1C1C; }

.ks-calc__card.active {
  background: #1C1C1C;
  border-color: #1C1C1C;
}

.ks-calc__card .ks-t {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1C1C1C;
  line-height: 1.3;
}

.ks-calc__card.active .ks-t { color: #ffffff; }

.ks-calc__card .ks-s {
  font-size: 10px;
  color: #777777;
  line-height: 1.3;
}

.ks-calc__card.active .ks-s { color: rgba(255,255,255,0.6); }

.ks-calc__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ks-calc__chip {
  background: transparent;
  border: 1px solid rgba(28,28,28,0.12);
  padding: 6px 12px;
  font-size: 12px;
  color: #1C1C1C;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ks-calc__chip:hover { border-color: #1C1C1C; }

.ks-calc__chip.active {
  background: #1C1C1C;
  border-color: #1C1C1C;
  color: #ffffff;
}

.ks-calc__hint {
  font-size: 11px;
  color: #777777;
  margin-top: 8px;
  font-style: italic;
}

/* ─── Drawer metrics / total / actions ──────────────────────────────────────── */

.ks-drawer__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ks-drawer__metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ks-drawer__metric .ks-k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #777777;
}

.ks-drawer__metric .ks-v {
  font-size: 18px;
  color: #1C1C1C;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ks-drawer__note {
  grid-column: 1 / -1;
  font-size: 11px;
  color: #555555;
  line-height: 1.4;
  margin: 0;
}

.ks-drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid rgba(28,28,28,0.1);
  border-bottom: 1px solid rgba(28,28,28,0.1);
  font-size: 13px;
  color: #555555;
}

.ks-drawer__total .ks-v {
  font-family: 'DM Sans', sans-serif;
  font-size: 24px;
  color: #1C1C1C;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ks-drawer__actions {
  display: flex;
  gap: 10px;
}

/* ─── Buttons (shared) ─────────────────────────────────────────────────────── */

.ks-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 220ms ease;
  border-radius: 0;
  flex: 1;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
}

.ks-btn--primary {
  background: #1A1A1A;
  color: #ffffff;
  border: none;
}

.ks-btn--ghost {
  background: transparent;
  color: #1C1C1C;
  border: 1px solid #1C1C1C;
}

.ks-btn:hover { opacity: 0.8; }

/* Нитки — сетка 5 в ряд */
.ks-calc__chips--strands {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.ks-calc__chips--strands .ks-calc__chip {
  text-align: center;
  padding: 8px 4px;
  min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   STANDALONE — страница калькулятора
   ═══════════════════════════════════════════════════════════════════════════════ */

#ks-calculator-standalone,
#ks-calculator-standalone * {
  box-sizing: border-box;
  font-family: 'DM Sans', sans-serif;
}

.ks-sa {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Two-column layout ──────────────────────────────────────────────────────── */

.ks-sa__layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

.ks-sa__sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 768px) {
  .ks-sa__layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ks-sa__sidebar {
    position: static;
  }
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

.ks-sa__header {
  text-align: center;
  padding: 40px 0 16px;
}

.ks-sa__eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #777777;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.ks-sa__eyebrow::before,
.ks-sa__eyebrow::after {
  content: "";
  width: 24px;
  height: 1px;
  background: #777777;
  display: block;
}

.ks-sa__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 36px;
  font-weight: 300;
  color: #1C1C1C;
  margin: 0 0 8px;
  line-height: 1.1;
}

.ks-sa__subtitle {
  font-size: 14px;
  color: #555555;
  margin: 0;
  line-height: 1.5;
}

.ks-sa__disclaimer,
.ks-calc__disclaimer {
  font-size: 14px;
  line-height: 1.5;
  color: #777777;
  margin: 12px 0 0;
}

/* ── Body (steps) ────────────────────────────────────────────────────────────── */

.ks-sa__body {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 32px;
}

/* ── Tabs: input mode ─────────────────────────────────────────────────────── */

.ks-sa__tabs {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(28,28,28,0.12);
}

.ks-sa__tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #777777;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease;
  font-family: 'DM Sans', sans-serif;
  border-radius: 0;
}

.ks-sa__tab:hover { color: #1C1C1C; }

.ks-sa__tab.active {
  color: #1C1C1C;
  border-bottom-color: #1C1C1C;
}

/* ── Grubość grid (standalone) ──────────────────────────────────────────────── */

.ks-sa__grubosc-grid {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 600px) {
  .ks-sa__grubosc-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Manual input ───────────────────────────────────────────────────────────── */

.ks-sa__manual {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ks-sa__manual-label {
  font-size: 12px;
  color: #555555;
  font-weight: 500;
}

.ks-sa__manual-input {
  border: 1px solid rgba(28,28,28,0.2);
  background: #ffffff;
  padding: 10px 14px;
  font-size: 16px;
  color: #1C1C1C;
  width: 200px;
  font-family: 'DM Sans', sans-serif;
  font-variant-numeric: tabular-nums;
  border-radius: 0;
  outline: none;
  transition: border-color 200ms ease;
}

.ks-sa__manual-input:focus {
  border-color: #1C1C1C;
}

.ks-sa__manual-hint {
  font-size: 12px;
  color: #555555;
  line-height: 1.5;
}

.ks-sa__manual-hint a {
  color: #1C1C1C;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 200ms ease;
}

.ks-sa__manual-hint a:hover {
  opacity: 0.6;
}

.ks-sa__manual-hint strong {
  font-weight: 600;
  color: #1C1C1C;
}

/* ── Puszysta checkbox ──────────────────────────────────────────────────────── */

.ks-sa__puszysta-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1C1C1C;
  cursor: pointer;
  margin-top: 12px;
}

.ks-sa__puszysta-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1C1C1C;
  cursor: pointer;
}

.ks-sa__puszysta-hint {
  font-size: 11px;
  color: #777777;
}

/* ── Results ────────────────────────────────────────────────────────────────── */

.ks-sa__results {
  border: 1px solid rgba(28,28,28,0.12);
  background: rgba(28,28,28,0.02);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ks-sa__results-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(28,28,28,0.08);
}

.ks-sa__results-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #777777;
}

.ks-sa__results-summary {
  font-size: 13px;
  color: #555555;
  line-height: 1.4;
}

.ks-sa__results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.ks-sa__results-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ks-sa__results-metric .ks-k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #777777;
}

.ks-sa__results-metric .ks-v {
  font-size: 22px;
  color: #1C1C1C;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.ks-sa__results-note {
  font-size: 11px;
  color: #555555;
  line-height: 1.4;
  margin: 0;
}

.ks-sa__cta {
  text-align: center;
  padding: 14px 24px;
  font-size: 13px;
  flex: none;
}

/* Отступ снизу от layout до футера */
.ks-sa__layout {
  margin-bottom: 80px;
}

/* ── Responsive (mobile) ─────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .ks-sa__title {
    font-size: 28px;
  }

  .ks-sa__header {
    padding: 24px 0 20px;
  }

  .ks-sa__results {
    padding: 16px;
  }

  .ks-sa__results-metric .ks-v {
    font-size: 18px;
  }
}
