/* Sillmark calculators (/calculators/*). Palette and type follow the Sillmark
   marketing page (nailit/index.html .site tokens). Calculator-specific rules
   belong in that page, not here. */
:root {
  --ink: #1e1b17;
  --soft: #565849;
  --mute: #6b6d61;
  --line: #ecebe7;
  --panel: #f6f5f2;
  --field: #ffffff;
  --warn: #9a3412;
  --warn-bg: #fff4e5;
  --ok: #1f6f3a;
  --ok-bg: #e9f5ec;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family:
    'Plus Jakarta Sans',
    system-ui,
    -apple-system,
    sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* top bar */
.c-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.c-top img {
  display: block;
  height: 30px;
  width: auto;
}
.c-top nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14.5px;
  font-weight: 500;
}
.c-top nav a {
  text-decoration: none;
  color: #3e4038;
}
.c-get {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff !important;
  font-weight: 600;
}
@media (max-width: 560px) {
  .c-top .c-hide-sm {
    display: none;
  }
}

/* page column */
.c-main {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 64px;
}
.c-crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--mute);
}
.c-crumbs li + li::before {
  content: '/';
  margin-right: 6px;
  color: #b4b3ab;
}
.c-crumbs a {
  text-decoration: none;
}
.c-crumbs a:hover {
  color: var(--ink);
}
h1 {
  font-size: clamp(30px, 5.4vw, 46px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 12px 0 0;
}
.c-lead {
  font-size: 17px;
  color: var(--soft);
  margin: 8px 0 0;
  max-width: 62ch;
}

/* calculator: inputs and results side by side on wide screens */
.c-calc {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}
@media (min-width: 820px) {
  .c-calc {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: start;
  }
  .c-results {
    position: sticky;
    top: 72px;
  }
}
.c-form,
.c-results {
  background: var(--panel);
  border-radius: 22px;
  padding: 18px;
}
@media (min-width: 640px) {
  .c-form,
  .c-results {
    padding: 22px;
  }
}
.c-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.c-form legend,
.c-label {
  display: block;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--soft);
  margin-bottom: 6px;
}
.c-form > * + *,
.c-form fieldset > * + * {
  margin-top: 14px;
}
.c-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.c-field,
.c-field-wrap {
  display: block;
  min-width: 0;
}
.c-field > span:first-child {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--soft);
  margin-bottom: 6px;
}
.c-input,
.c-select {
  width: 100%;
  height: 46px;
  border: 1px solid #dddcd5;
  border-radius: 12px;
  background: var(--field);
  padding: 0 12px;
  font-size: 16px;
  outline: none;
}
.c-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b6d61' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.c-input:focus,
.c-select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(30, 27, 23, 0.1);
}
.c-input[aria-invalid='true'] {
  border-color: var(--warn);
}
.c-unit {
  position: relative;
  display: block;
}
.c-unit .c-input {
  padding-right: 42px;
}
.c-unit > i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 14px;
  color: var(--mute);
  pointer-events: none;
}
.c-hint {
  display: block;
  font-size: 12.5px;
  color: var(--mute);
  margin-top: 5px;
}
/* inline field error, filled by ui.mjs showErrors */
.c-err {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--warn);
  margin-top: 5px;
}
.c-err:empty {
  display: none;
}
/* fields shown together for one choice ([data-when]); .c-field-wrap holds a
   field with its hint and error */
.c-group > * + :is(.c-row, .c-field-wrap) {
  margin-top: 14px;
}
/* checkbox with its label on one row */
.c-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.c-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--ink);
}
/* repeatable area row card (ui.mjs initAreaRows) */
.c-form .c-area {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
}
.c-form .c-area + .c-area {
  margin-top: 10px;
}
.c-form .c-area legend {
  min-height: 36px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.c-form .c-area .c-area-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
}

/* segmented control: radios inside labels */
.c-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: #e9e8e3;
  border-radius: 14px;
  padding: 4px;
}
.c-seg label {
  flex: 1;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--soft);
  cursor: pointer;
}
.c-seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.c-seg label:has(input:checked) {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.c-seg label:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.c-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}
.c-btn.ghost {
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px #dddcd5;
}
.c-btn.sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}

/* results */
.c-results h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: 0;
}
.c-results h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--mute);
  margin: 14px 0 0;
}
.c-big {
  background: var(--ink);
  color: #fff;
  border-radius: 16px;
  padding: 14px 16px;
}
.c-big small {
  display: block;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.72;
}
.c-big b {
  display: block;
  font-size: 32px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.c-stats {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.c-stats li {
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  min-width: 0;
}
.c-stats small {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mute);
}
.c-stats b {
  display: block;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.c-checks {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.c-checks li {
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  background: var(--ok-bg);
  color: var(--ok);
}
.c-checks li.fail {
  background: var(--warn-bg);
  color: var(--warn);
}
.c-msg {
  font-size: 14px;
  color: var(--mute);
  margin: 10px 0 0;
  overflow-wrap: anywhere;
}
.c-diagram {
  margin-top: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
}
.c-diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

/* soft CTA to the app */
.c-cta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 18px;
}
.c-cta p {
  margin: 0;
  font-size: 15px;
  color: var(--soft);
  max-width: 52ch;
}
.c-cta b {
  color: var(--ink);
}

/* explanatory content */
.c-content {
  max-width: 760px;
  margin-top: 48px;
}
.c-content h2,
.c-faq h2,
.c-related h2 {
  font-size: clamp(23px, 3.4vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 40px 0 10px;
}
.c-content h2:first-child {
  margin-top: 0;
}
.c-content h3 {
  font-size: 18px;
  margin: 24px 0 6px;
}
.c-content p,
.c-content li {
  font-size: 16.5px;
  color: #3e4038;
}
.c-content ul,
.c-content ol {
  padding-left: 22px;
}
.c-content li + li {
  margin-top: 6px;
}
.c-content a,
.c-faq a {
  font-weight: 600;
  text-underline-offset: 3px;
}
.c-formula {
  background: var(--panel);
  border-radius: 14px;
  padding: 12px 16px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 14.5px;
  overflow-x: auto;
  white-space: pre-wrap;
}
.c-example {
  border-left: 3px solid var(--ink);
  padding: 2px 0 2px 16px;
}
.c-table-wrap {
  overflow-x: auto;
}
.c-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.c-table th,
.c-table td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
}
.c-table th {
  font-size: 13px;
  color: var(--mute);
  font-weight: 600;
}

/* FAQ */
.c-faq {
  max-width: 760px;
}
.c-faq details {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.c-faq summary {
  list-style: none;
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.c-faq summary::-webkit-details-marker {
  display: none;
}
.c-faq summary::after {
  content: '+';
  font-weight: 400;
  color: var(--mute);
  font-size: 22px;
  line-height: 1;
}
.c-faq details[open] summary::after {
  content: '\2013';
}
.c-faq details p {
  margin: 10px 0 0;
  color: #3e4038;
  font-size: 16px;
}

/* related calculators */
.c-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.c-related a {
  display: block;
  height: 100%;
  background: var(--panel);
  border-radius: 16px;
  padding: 14px 16px;
  text-decoration: none;
}
.c-related a:hover {
  background: #efeee9;
}
.c-related b {
  display: block;
  font-size: 16px;
}
.c-related span {
  display: block;
  font-size: 14px;
  color: var(--mute);
  margin-top: 2px;
}

/* footer */
.c-foot {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--mute);
}
.c-foot img {
  display: block;
  height: 28px;
  width: auto;
}
.c-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.c-foot a {
  text-decoration: none;
}
.c-foot a:hover {
  color: var(--ink);
}

@media print {
  .c-top,
  .c-cta,
  .c-related,
  .c-faq,
  .c-foot {
    display: none;
  }
}
