/* Юр-калькуляторы NeiroLabs — изолированы префиксом .nl-calc, светлая тема сайта */
.nl-calc {
  --c-accent: #6d28d9;
  --c-grad: linear-gradient(135deg, #7c3aed, #2563eb);
  --c-text: #0f172a;
  --c-muted: #64748b;
  --c-line: #e2e8f0;
  --c-soft: #f8fafc;
  --c-ok: #047857;
  --c-warn: #b45309;
  --c-bad: #b91c1c;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--c-text);
  text-align: left;
  line-height: 1.5;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 1.25rem;
  box-shadow: 0 20px 45px -24px rgba(15, 23, 42, .28);
  padding: 1.25rem;
  margin: 1.5rem 0;
}
.nl-calc *, .nl-calc *::before, .nl-calc *::after { box-sizing: border-box; }
.nl-calc__title { font-weight: 700; font-size: 1.1rem; margin: 0 0 1rem; }

.nl-calc__grid { display: grid; gap: .9rem 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nl-calc__grid > .nl-calc__field:first-child, .nl-calc__grid > .nl-calc__field:nth-child(2) { grid-column: span 1; }
.nl-calc__extra { display: grid; gap: .6rem; margin-top: .9rem; }
.nl-calc__field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.nl-calc__field[hidden], .nl-calc__checkline[hidden] { display: none; }
.nl-calc__label { font-size: .8rem; font-weight: 600; color: #334155; }
.nl-calc__hint { font-size: .75rem; color: var(--c-muted); line-height: 1.4; }

.nl-calc__input {
  width: 100%;
  min-height: 2.9rem;
  border: 1px solid #cbd5e1;
  border-radius: .75rem;
  background: #fff;
  padding: .6rem .8rem;
  font: inherit;
  font-size: 1rem; /* 16px — iOS не зумит при фокусе */
  color: var(--c-text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.nl-calc__input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 4px rgba(124, 58, 237, .12); }
.nl-calc__select {
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2364748b' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  text-overflow: ellipsis;
}

.nl-calc__date { position: relative; display: flex; }
.nl-calc__date .nl-calc__input { padding-right: 2.8rem; }
.nl-calc__date-btn {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  width: 2.2rem; height: 2.2rem; border: 0; border-radius: .55rem; background: transparent;
  color: var(--c-muted); cursor: pointer; display: grid; place-items: center;
}
.nl-calc__date-btn:hover { background: var(--c-soft); color: var(--c-accent); }
.nl-calc__date-picker { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.nl-calc__seg { display: flex; background: #f1f5f9; border-radius: .8rem; padding: .25rem; gap: .25rem; }
.nl-calc__seg-btn {
  flex: 1; min-height: 2.4rem; border: 0; border-radius: .6rem; background: transparent;
  font: inherit; font-size: .88rem; font-weight: 600; color: #475569; cursor: pointer; padding: .4rem .5rem;
}
.nl-calc__seg-btn.is-on { background: #fff; color: var(--c-text); box-shadow: 0 1px 3px rgba(15, 23, 42, .15); }

.nl-calc__checkline { display: flex; gap: .55rem; align-items: flex-start; font-size: .85rem; color: #334155; cursor: pointer; }
.nl-calc__check { width: 1.1rem; height: 1.1rem; margin-top: .15rem; accent-color: #7c3aed; flex: none; }

.nl-calc__pays { display: grid; gap: .5rem; }
.nl-calc__pays:empty { display: none; }
.nl-calc__pay { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; align-items: center; }
.nl-calc__del {
  width: 2.4rem; height: 2.4rem; border: 1px solid var(--c-line); border-radius: .6rem; background: #fff;
  color: var(--c-muted); font-size: 1.2rem; cursor: pointer;
}
.nl-calc__del:hover { color: var(--c-bad); border-color: #fecaca; }
.nl-calc__link { align-self: flex-start; border: 0; background: none; padding: .2rem 0; font: inherit; font-size: .88rem; font-weight: 600; color: var(--c-accent); cursor: pointer; }
.nl-calc__link:hover { text-decoration: underline; }

.nl-calc__result {
  margin-top: 1.1rem;
  border-radius: 1rem;
  padding: 1.1rem 1.15rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, .07), rgba(37, 99, 235, .07));
  border: 1px solid rgba(124, 58, 237, .18);
}
.nl-calc__result[hidden] { display: none; }
.nl-calc__result.is-empty { background: var(--c-soft); border: 1px dashed #cbd5e1; }
.nl-calc__result.is-bad { background: #fef2f2; border-color: #fecaca; }
.nl-calc__result.is-warn { background: #fffbeb; border-color: #fde68a; }
.nl-calc__empty { color: var(--c-muted); font-size: .9rem; }
.nl-calc__kicker { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); }
.nl-calc__value { font-size: clamp(1.7rem, 5vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: .15rem 0 .3rem; font-variant-numeric: tabular-nums; }
.is-bad .nl-calc__value { color: var(--c-bad); }
.nl-calc__sub { font-size: .88rem; color: #334155; }
.nl-calc__warn { margin-top: .6rem; font-size: .85rem; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: .6rem; padding: .5rem .7rem; }

.nl-calc__details { margin-top: .8rem; border-top: 1px solid rgba(100, 116, 139, .2); padding-top: .6rem; }
.nl-calc__details summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--c-accent); list-style: none; }
.nl-calc__details summary::-webkit-details-marker { display: none; }
.nl-calc__details summary::before { content: '▸ '; }
.nl-calc__details[open] summary::before { content: '▾ '; }
.nl-calc__details-body { margin-top: .5rem; font-size: .88rem; color: #334155; }
.nl-calc__details-body p { margin: .4rem 0; }
.nl-calc__details-body ol { margin: .3rem 0; padding-left: 1.2rem; }
.nl-calc__table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nl-calc__table { width: 100%; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nl-calc__table th { text-align: left; font-weight: 600; color: var(--c-muted); padding: .35rem .5rem; border-bottom: 1px solid var(--c-line); }
.nl-calc__table td { padding: .35rem .5rem; border-bottom: 1px solid #f1f5f9; }
.nl-calc__table td:last-child, .nl-calc__table th:last-child { text-align: right; }
.nl-calc__table tr.is-muted td { color: #94a3b8; }

.nl-calc__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.nl-calc__cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: .7rem 1.2rem; border-radius: .8rem;
  background: var(--c-grad); color: #fff !important; font-weight: 700; font-size: .95rem;
  text-decoration: none !important; box-shadow: 0 10px 22px -10px rgba(91, 33, 182, .6);
  transition: transform .15s, box-shadow .15s;
}
.nl-calc__cta:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -10px rgba(91, 33, 182, .7); }
.nl-calc__ghost {
  min-height: 2.9rem; padding: .7rem 1rem; border-radius: .8rem; border: 1px solid #cbd5e1; background: #fff;
  font: inherit; font-weight: 600; font-size: .9rem; color: #334155; cursor: pointer;
}
.nl-calc__ghost:hover { border-color: #a78bfa; color: var(--c-accent); }
.nl-calc__ghost.is-done { border-color: #6ee7b7; color: var(--c-ok); }
.nl-calc__cta-note { margin-top: .55rem; font-size: .78rem; color: var(--c-muted); }

@media (max-width: 640px) {
  .nl-calc { padding: 1rem; border-radius: 1rem; }
  .nl-calc__grid { grid-template-columns: 1fr; }
  .nl-calc__actions > * { flex: 1 1 100%; }
  .nl-calc__pay { grid-template-columns: 1fr 1fr auto; }
}
