/* NetSheet.org — the calculator (shared by try-it.html and logged-in/netsheet-calculator.html)
   Markup comes from js/netsheet-calc.js. Loaded after css/site.css (public) or css/app.css (app);
   both define the same tokens (--ink, --rule, --green, --highlight, ...). Everything the calculator
   draws is styled here so the two pages look and behave the same. */

.nsc {
  container-type: inline-size;
  container-name: nsc;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
}
.nsc *, .nsc *::before, .nsc *::after { box-sizing: border-box; }

/* ------------------------------------------------------------- layout */

.calc-workspace {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(20rem, 5fr);
  grid-template-areas: "form result" "after result";
  gap: 0 clamp(1.75rem, 3.5vw, 3rem);
  align-items: start;
}
.calc-form { grid-area: form; min-width: 0; }
.calc-result { grid-area: result; min-width: 0; align-self: stretch; }
.calc-after { grid-area: after; min-width: 0; }
.result-sticky { position: sticky; top: 1.5rem; isolation: isolate; }

@container nsc (max-width: 900px) {
  .calc-workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "form" "result" "after"; }
  .calc-result { margin-top: 2rem; }
  .result-sticky { position: static; }
}

/* ------------------------------------------------------ seller / buyer */

/* Equal-width segments with even padding all round (symmetric pill) */
.seg {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; gap: 4px; max-width: 100%;
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 999px;
}
/* .seg .seg-item so the margin reset outranks `.nsc label` below */
.seg .seg-item { position: relative; cursor: pointer; margin: 0; min-width: 0; }
.seg-item input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.seg-item span {
  display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 1.1rem;
  border-radius: 999px; font-weight: 600; font-size: 0.95rem; color: var(--ink-2); white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.seg-item:hover input:not(:checked) + span { background: var(--green-soft); color: var(--ink); }
.seg-item input:checked + span { background: var(--green); color: #fff; }
.seg-item input:focus-visible + span { outline: 3px solid var(--highlight); outline-offset: 2px; }

/* ------------------------------------------------------------- the form */

.nsc .form-section { padding: 1.5rem 0 0.4rem; margin: 0; background: none; border-top: 1px solid var(--rule); }
.nsc .form-section:first-of-type { border-top: 0; padding-top: 0; }
.nsc .form-section h2 {
  font-size: 1.25rem; font-weight: 650; line-height: 1.2; margin: 0 0 1rem; color: var(--ink);
  font-stretch: 90%; font-variation-settings: "wdth" 90; letter-spacing: -0.005em;
  display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap;
}
.nsc .form-section h2 .label-note { font-stretch: 100%; font-variation-settings: "wdth" 100; }
.nsc .section-note { color: var(--muted); font-size: 0.9rem; margin: -0.55rem 0 1rem; max-width: 62ch; }

.nsc .field { margin: 0 0 1.1rem; min-width: 0; }
.nsc .field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 1rem; }
.nsc label { display: block; font-weight: 600; font-size: 0.93rem; color: var(--ink); margin: 0 0 0.35rem; line-height: 1.35; }
.nsc .label-note { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.nsc .hint { display: block; font-size: 0.875rem; color: var(--muted); margin: 0.35rem 0 0; line-height: 1.4; }

.nsc-input {
  display: block; width: 100%; min-height: 46px; margin: 0;
  font: inherit; font-size: 1rem; line-height: 1.3; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem; box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.nsc-input::placeholder { color: #8a988f; opacity: 1; }
.nsc-input:hover { border-color: #9fb1a6; }
.nsc-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(30, 91, 66, 0.18); }
.nsc-input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(163, 49, 42, 0.12); }
select.nsc-input {
  appearance: none; -webkit-appearance: none; padding-right: 2.3rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%2333463c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 16px;
}
select.nsc-input.needs-value { border-color: #d9b84a; background-color: #fffbea; }
textarea.nsc-input { resize: vertical; min-height: 5rem; }
input[type="date"].nsc-input { appearance: none; -webkit-appearance: none; }
input[type="date"].nsc-input::-webkit-date-and-time-value { text-align: left; }
input[type="number"].nsc-input { -moz-appearance: textfield; appearance: textfield; }
input[type="number"].nsc-input::-webkit-outer-spin-button,
input[type="number"].nsc-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.nsc .money { font-variant-numeric: tabular-nums; }

.nsc .input-affix { position: relative; }
.nsc .input-affix .affix { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; line-height: 1; }
.nsc .input-affix .nsc-input { padding-left: 1.7rem; }
.nsc .input-affix .affix-end { left: auto; right: 0.8rem; }
.nsc .input-affix.has-end .nsc-input { padding-left: 0.8rem; padding-right: 2.2rem; }

.nsc .check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; font-size: 0.95rem; color: var(--ink-2); cursor: pointer; margin: 0 0 1rem; min-height: 28px; }
.nsc .check input[type="checkbox"] { -webkit-appearance: checkbox; appearance: auto; width: 18px; height: 18px; margin: 0.15rem 0 0; accent-color: var(--green); flex: none; }
.nsc .check .label-note { display: inline; }

.nsc .tag {
  display: inline-block; margin-left: 0.35rem; font-size: 0.75rem; font-weight: 600; line-height: 1.5;
  color: var(--green); background: var(--green-soft); padding: 0 0.5rem; border-radius: 999px; vertical-align: 0.08em;
}

.nsc .field-error { color: var(--danger); font-size: 0.875rem; font-weight: 500; margin: 0.35rem 0 0; }
.nsc .calc-error { margin-bottom: 1rem; }
.nsc .notice { border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; font-size: 0.95rem; line-height: 1.45; border: 1px solid; }
.nsc .notice-error { background: var(--danger-soft); border-color: #efc9c6; color: #6e1f1a; }

.nsc .btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 46px; }
.nsc .btn svg { width: 18px; height: 18px; flex: none; }
.nsc .btn-block { width: 100%; }
.nsc .btn.is-loading { opacity: 0.7; pointer-events: none; cursor: progress; }

/* Listing auto-fill */
.autofill-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem; }
.autofill-row .btn { white-space: nowrap; }
/* The address box with its Autofill button: the suggestion list must be able to overflow the row */
.address-row { align-items: start; }
.address-row .btn { align-self: stretch; }
.autofill-paste { margin-top: 0.7rem; }
.autofill-paste summary { cursor: pointer; color: var(--green); font-weight: 600; font-size: 0.93rem; width: fit-content; }
.autofill-paste[open] summary { margin-bottom: 0.6rem; }
.autofill-paste textarea { margin-bottom: 0.6rem; }
.autofill-status:empty { display: none; }
.autofill-status.is-error { color: var(--danger); }

/* Address combobox */
.combo { position: relative; z-index: 20; }
.combo-list {
  position: absolute; z-index: 1100; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 0.3rem;
  list-style: none; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm);
  box-shadow: 0 18px 36px -18px rgba(19, 36, 27, 0.45); max-height: min(22rem, 60vh); overflow-y: auto;
}
.combo-option {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 0.55rem; align-items: baseline;
  padding: 0.55rem 0.6rem; border-radius: 4px; cursor: pointer; min-height: 44px;
}
.combo-option svg { width: 16px; height: 16px; color: var(--muted); grid-row: span 2; align-self: center; }
.combo-option .combo-main { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-option .combo-sub { grid-column: 2; font-size: 0.85rem; color: var(--muted); }
.combo-option:hover, .combo-option.is-active { background: var(--green-soft); }
.combo-option.is-active svg { color: var(--green); }
.combo-credit { font-size: 0.72rem; color: var(--muted); padding: 0.35rem 0.6rem 0.15rem; text-align: right; }

.address-hint.is-located strong { color: var(--green); font-weight: 600; }
.address-hint.is-located::before {
  content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--green);
  margin-right: 0.45rem; vertical-align: 0.1em;
}

.address-map {
  height: 0; overflow: hidden; border-radius: var(--radius-sm); border: 1px solid var(--rule); margin-top: 0.6rem;
  opacity: 0; position: relative; transition: height 420ms cubic-bezier(.2, .8, .2, 1), opacity 300ms;
}
.address-map.is-open { height: 230px; opacity: 1; }
/* Map in NetSheet colors: soft green-grey land, brand green pin */
.address-map { background: #fff; border-radius: var(--radius, 10px); box-shadow: inset 0 0 0 1px rgba(30, 91, 66, 0.14); }
.address-map .leaflet-container { background: #fff; }
/* White-and-green basemap: no photo or terrain colours, just pale land, white roads and green-tinted lines */
/* Only white and brand green: tiles are recoloured by the #ns-map-duo SVG filter (netsheet-calc.js ensureDuotone) */
.address-map .leaflet-tile-pane { filter: url(#ns-map-duo); }
.address-map .leaflet-tile { transition: opacity 0.25s ease; }
.address-map::after { content: ""; position: absolute; inset: 0; z-index: 450; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(30, 91, 66, 0.14), inset 0 0 30px rgba(30, 91, 66, 0.10); }
.address-map .ns-pin { background: none; border: 0; }
/* Leaflet positions the marker with an inline transform, so the drop animation runs on the graphic inside it */
.address-map .ns-pin svg { width: 32px; height: 42px; display: block; filter: drop-shadow(0 4px 5px rgba(19, 36, 27, 0.35)); animation: ns-pin-drop 520ms cubic-bezier(.2, .8, .2, 1) both; }
.address-map .leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, 0.9); color: var(--green, #1E5B42); border-radius: 6px 0 0 0; padding: 1px 6px; }
.address-map .leaflet-control-attribution svg { display: none; } /* Leaflet's coloured flag */
.address-map .leaflet-control-attribution a { color: var(--green); }
/* Auto-fill preference under the address */
.nsc .auto-lookup { display: flex; font-weight: 400; line-height: 1.4; align-items: flex-start; gap: 0.55rem; margin: 0.7rem 0 0; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.nsc .auto-lookup input { margin-top: 0.2rem; width: 1rem; height: 1rem; accent-color: var(--green); flex: none; }
.nsc .auto-lookup strong { color: var(--ink); font-weight: 600; margin-right: 0.3rem; }
.address-map .leaflet-container { height: 100%; width: 100%; font: inherit; }
/* Pick the property on a map */
.nsc .map-pick-btn, .map-pick-btn {
  border: 0; background: none; padding: 0; margin: 0.45rem 0 0; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--green);
  cursor: pointer; display: inline-flex; gap: 0.35rem; align-items: center; min-height: 24px;
  text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px;
}
.map-pick-btn svg { width: 15px; height: 15px; flex: none; }
.map-pick-btn[aria-pressed="true"] { text-decoration: none; }
.map-pick-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }
.address-map.is-open.is-picking { height: 360px; }
.address-map.is-picking .leaflet-container { cursor: crosshair; }
.address-map.is-picking .leaflet-interactive { cursor: pointer; }
.address-map .leaflet-bar { border: 1px solid rgba(30, 91, 66, 0.25); box-shadow: 0 1px 4px rgba(30, 91, 66, 0.15); }
.address-map .leaflet-control-zoom a { color: var(--green, #1E5B42); background: #fff; border-color: rgba(30, 91, 66, 0.2); }
.address-map .leaflet-control-zoom a:hover { background: var(--green, #1E5B42); color: #fff; }
/* The home's outline draws itself in once the pin lands */
.address-map .ns-house { stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: ns-house-draw 900ms ease-out forwards, ns-house-fill 600ms ease-out 500ms both; }
@keyframes ns-house-draw { to { stroke-dashoffset: 0; } }
@keyframes ns-house-fill { from { fill-opacity: 0; } }
.leaflet-tooltip.parcel-tip { font-size: 0.78rem; font-weight: 600; color: var(--green, #1E5B42); border: 1px solid var(--rule, #dfe7e2); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); padding: 0.15rem 0.45rem; }
.leaflet-tooltip.parcel-tip::before { display: none; }
.address-map .map-caption.is-busy::before {
  content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.4rem; vertical-align: -0.1em;
  border: 2px solid rgba(30, 91, 66, 0.25); border-top-color: var(--green, #1E5B42); border-radius: 50%; animation: ns-spin 0.8s linear infinite;
}
@keyframes ns-spin { to { transform: rotate(360deg); } }
.address-map .map-caption {
  position: absolute; left: 0.6rem; bottom: 0.6rem; z-index: 500; max-width: calc(100% - 8.5rem);
  background: rgba(255, 255, 255, 0.96); border-radius: 999px; padding: 0.2rem 0.65rem;
  font-size: 0.8rem; font-weight: 600; color: var(--green); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* County / city / property block, shown once a state is chosen */
.nsc .jurisdiction {
  margin: 0 0 1.1rem; padding: 1rem 1rem 0.1rem;
  background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--leaf); border-radius: var(--radius-sm);
}
#county-help.is-required { color: #6b5208; }
.nsc .customs-note { margin: -0.2rem 0 0.95rem; font-size: 0.875rem; color: var(--ink-2); line-height: 1.45; }

/* Commission slider */
.nsc .commission-slide { margin-top: -0.4rem; }
.nsc .range { display: block; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.nsc .range:focus-visible { outline: 3px solid var(--highlight); outline-offset: -6px; border-radius: 8px; }
.nsc .range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--green) 0 var(--fill, 60%), #d5dfd9 var(--fill, 60%)); }
.nsc .range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--paper); border: 2px solid var(--green); box-shadow: 0 1px 3px rgba(19, 36, 27, 0.25); }
.nsc .range::-moz-range-track { height: 6px; border-radius: 999px; background: #d5dfd9; }
.nsc .range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--green); }
.nsc .range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--paper); border: 2px solid var(--green); }
.nsc .range-scale { display: flex; justify-content: space-between; margin-top: -0.55rem; font-variant-numeric: tabular-nums; }
.nsc .range-scale > span:nth-child(2) { color: var(--ink-2); font-weight: 600; }

/* Auto-filled fields */
.auto-field .label-line { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.35rem; min-height: 1.5rem; }
.auto-field .label-line label { margin: 0; min-width: 0; }
.auto-chip {
  flex: none; font-size: 0.72rem; font-weight: 600; line-height: 1; padding: 0.25rem 0.45rem; border-radius: 999px;
  color: var(--green); background: var(--green-soft); letter-spacing: 0.01em;
}
.auto-field.is-edited .auto-chip { color: #5a4608; background: var(--warn-soft, #fdf6dc); }
.info-btn {
  flex: none; width: 28px; height: 28px; margin: -4px 0 -4px -2px; padding: 0; border: 0; background: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer;
}
.info-btn svg { width: 16px; height: 16px; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--green); background: var(--green-soft); }
.auto-field:not(.is-edited) .nsc-input { background-color: #f6faf7; }
.auto-field:not(.is-edited) .nsc-input:focus { background-color: var(--paper); }
.auto-field.is-edited .nsc-input { border-color: #cdb35a; }
.auto-field.is-edited .nsc-input:focus { border-color: var(--green); }
.auto-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.6rem; margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--muted); line-height: 1.4; min-height: 1.2em; }
.auto-meta-text { min-width: 0; }
.reset-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--green); cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; min-height: 24px; }
.reset-btn:hover { color: var(--green-hover); }
.auto-info {
  margin-top: 0.5rem; padding: 0.7rem 0.8rem; font-size: 0.85rem; line-height: 1.45; color: var(--ink-2);
  background: #f7faf8; border: 1px solid var(--rule); border-radius: var(--radius-sm);
}
.auto-info p { margin: 0 0 0.4rem; }
.auto-info p:last-child { margin-bottom: 0; }
.auto-info .info-lines { list-style: none; margin: 0; padding: 0; }
.auto-info .info-lines li { padding: 0.35rem 0; border-top: 1px dashed var(--rule); display: grid; gap: 0.1rem; }
.auto-info .info-lines li:first-child { border-top: 0; padding-top: 0; }
.auto-info .info-head { display: flex; justify-content: space-between; gap: 0.75rem; }
.auto-info .info-head strong { font-weight: 600; color: var(--ink); }
.auto-info .info-basis, .auto-info .info-meta { color: var(--muted); }
.auto-info a { color: var(--green); font-weight: 600; }
.auto-info .info-line { margin-top: 0.45rem; }

/* "verify with your title company" — informational, not a warning */
.nsc .verify, .ledger .verify {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; color: #6b5a1c; font-weight: 500; line-height: 1.35;
}
.nsc .verify::before, .ledger .verify::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #c9a82c; flex: none; }

/* Custom fee rows */
.custom-fees { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
.custom-fees:empty { display: none; }
.custom-fee-item { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(6.5rem, 0.8fr) 46px; gap: 0.6rem; align-items: end; }
.custom-fee-item label { font-size: 0.85rem; }
.fee-remove {
  width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--paper); color: var(--muted); cursor: pointer;
}
.fee-remove:hover { color: var(--danger); border-color: var(--danger); }
.fee-remove svg { width: 18px; height: 18px; }
.nsc .btn-add { margin-bottom: 1rem; }

.more-options > summary { cursor: pointer; font-weight: 600; color: var(--green); margin-bottom: 0; padding: 0.2rem 0 0.9rem; list-style-position: outside; }
.more-options > summary .label-note { display: block; font-size: 0.85rem; margin-top: 0.1rem; }
.more-options[open] > summary { margin-bottom: 0.5rem; }

.nsc .form-submit { padding-top: 1.5rem; border-top: 1px solid var(--rule); margin-top: 0.5rem; }
.nsc .form-submit .btn { min-height: 52px; font-size: 1.05rem; }
.nsc .form-submit-row { display: flex; gap: 0.6rem; }
.nsc .form-submit-row .btn-block { flex: 1 1 auto; }
.nsc .form-submit-row .btn-secondary { flex: 0 0 auto; min-width: 7.5rem; }
.nsc .form-submit .hint { text-align: center; margin-top: 0.55rem; }

/* ------------------------------------------------------- the paper sheet */

.nsc .sheet { position: relative; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-sheet); border: 1px solid var(--rule); }
.nsc .sheet-stack::before {
  content: ""; position: absolute; inset: 10px -10px -10px 10px; z-index: -1;
  background: #e8eeea; border: 1px solid var(--rule); border-radius: var(--radius);
}
.nsc .result-sheet:focus { outline: none; }
.nsc .result-sheet + .result-sheet { margin-top: 1.75rem; }
.nsc .sheet-head { display: block; padding: 1.15rem 1.5rem 1rem; border-bottom: 1px solid var(--rule); }
.nsc .sheet-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.85rem; min-height: 32px; }
.nsc .sheet-brand { min-width: 0; display: flex; align-items: center; }
.nsc .sheet-logo { max-width: 160px; max-height: 44px; width: auto; height: auto; display: block; }
.nsc .brand-fallback { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 650; font-size: 0.98rem; color: var(--ink); }
.nsc .brand-fallback svg { width: 24px; height: 24px; flex: none; }
.nsc .brand-fallback .tld { color: var(--muted); font-weight: 500; }
.nsc .result-date { color: var(--muted); font-size: 0.875rem; margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nsc .sheet-title { font-size: 1.1rem; font-weight: 650; margin: 0; line-height: 1.3; font-stretch: 100%; font-variation-settings: "wdth" 100; letter-spacing: -0.005em; color: var(--ink); }
.nsc .sheet-sub { color: var(--muted); font-size: 0.9rem; margin: 0.15rem 0 0; overflow-wrap: anywhere; white-space: normal; }
.nsc .sheet-body { padding: 0.3rem 1.5rem 1.25rem; }
.nsc .sheet-foot { padding: 0.9rem 1.5rem 1.1rem; border-top: 1px solid var(--rule); }
.nsc .sheet-disclaimer { font-size: 0.85rem; color: var(--muted); margin: 0; }
.nsc .sheet-notice {
  margin: 0.75rem 0 0.25rem; padding: 0.55rem 0.75rem; font-size: 0.875rem; line-height: 1.45;
  color: #5a4608; background: #fdf6dc; border: 1px solid #eedc9a; border-radius: var(--radius-sm);
}

/* The ledger (also used by logged-in/netsheet-preview.html) */
.ledger { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ledger td { padding: 0.55rem 0; border-bottom: 1px dashed var(--rule); vertical-align: baseline; }
.ledger td:first-child { padding-right: 0.75rem; overflow-wrap: anywhere; }
.ledger td:last-child { text-align: right; white-space: nowrap; padding-left: 1rem; }
.ledger .line-label { font-weight: 500; }
.ledger .deduct td:last-child { color: var(--ink-2); }
.ledger .deduct td:last-child::before { content: "\2212\00a0"; color: var(--muted); }
.ledger .credit td:last-child::before { content: "+\00a0"; color: var(--muted); }
.ledger .lead td { font-weight: 650; }
.ledger .lead .line-label { font-weight: 650; }
.ledger .rate { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.35; margin-top: 0.15rem; font-weight: 400; }
.ledger .verify { display: flex; margin-top: 0.15rem; }
.ledger .line-tag {
  display: inline-block; margin-left: 0.4rem; font-size: 0.7rem; font-weight: 600; line-height: 1.5; padding: 0 0.4rem;
  border-radius: 999px; color: #5a4608; background: #fdf6dc; vertical-align: 0.1em;
}
.ledger .group td, .ledger .group td:last-child { text-align: left; }
.ledger .group td {
  padding: 1rem 0 0.3rem; border-bottom: 1px solid var(--rule-strong);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.ledger tfoot .subtotal td { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 600; padding-top: 0.65rem; }
.ledger .total td { border-bottom: 0; border-top: 1px solid var(--rule); padding-top: 0.9rem; font-weight: 650; font-size: 1.15rem; }
.ledger .total td:last-child span {
  background: linear-gradient(transparent 12%, var(--highlight) 12%, var(--highlight) 88%, transparent 88%);
  padding: 0 0.3rem; border-bottom: 3px double var(--ink);
}
.ledger-empty td { color: var(--muted); }
.ledger-empty td:last-child { color: #9aa8a0; }
.ledger-empty .total td { color: var(--ink-2); }
.ledger-empty .total td:last-child { color: #9aa8a0; font-weight: 400; }
.nsc .empty-note { font-size: 0.875rem; color: var(--muted); margin: 0.9rem 0 0.25rem; }

.nsc .assumptions { margin-top: 0.9rem; font-size: 0.875rem; color: var(--ink-2); }
.nsc .assumptions summary { cursor: pointer; font-weight: 600; color: var(--green); }
.nsc .assumptions ul { margin: 0.5rem 0 0 1.1rem; padding: 0; }
.nsc .assumptions li { margin-bottom: 0.3rem; }

/* ------------------------------------------------ small screens: net bar */

.calc-bar {
  position: fixed; left: 0; right: var(--nsa-inset-right, 0px); bottom: 0; z-index: 1020;   /* stops at the open assistant panel */
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--rule);
  box-shadow: 0 -10px 24px -18px rgba(19, 36, 27, 0.35);
  transform: translateY(110%); transition: transform 0.18s ease, visibility 0.18s; visibility: hidden;
  font-family: var(--font);
}
.calc-bar.is-shown { transform: none; visibility: visible; }
.calc-bar-net { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; background: none; border: 0; padding: 0.2rem 0; text-align: left; color: var(--ink); font: inherit; cursor: pointer; }
.calc-bar-net small { color: var(--muted); font-size: 0.8rem; }
.calc-bar-net strong { font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-bar .btn { min-height: 44px; flex: none; }
.calc-bar-actions { display: flex; gap: 0.4rem; flex: none; }
.calc-bar .calc-bar-icon { width: 44px; padding: 0; display: inline-grid; place-items: center; }
.calc-bar .calc-bar-icon svg { width: 20px; height: 20px; }
/* On phones the bar is the one place to save, email and download once there is a result: the page-head buttons step aside */
@media (max-width: 899px) { body.has-calc-bar .calc-head .actions { display: none; } }
body.has-calc-bar { padding-bottom: 4.5rem; }

/* Toasts */
.calc-toasts { position: fixed; top: 1rem; right: 1rem; z-index: 10000; display: grid; gap: 0.5rem; width: min(380px, calc(100vw - 2rem)); font-family: var(--font); }
.calc-toast {
  display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 0.5rem; align-items: center;
  padding: 0.5rem 0.5rem 0.5rem 0.9rem; min-height: 50px; border-radius: var(--radius-sm); border: 1px solid; font-size: 0.95rem; line-height: 1.45;
  box-shadow: 0 16px 30px -18px rgba(19, 36, 27, 0.45); animation: ns-toast-in 180ms ease-out;
  background: #eef3f6; border-color: #d3dfe6; color: #213845;
}
.calc-toast.is-success { background: var(--ok-soft); border-color: #c4dccd; color: #1c4a33; }
.calc-toast.is-error { background: var(--danger-soft); border-color: #efc9c6; color: #6e1f1a; }
.calc-toast-close { width: 32px; height: 32px; border: 0; background: none; color: inherit; opacity: 0.7; cursor: pointer; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.calc-toast-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.calc-toast-close svg { width: 16px; height: 16px; }
/* Address → Zillow lookup card (searching, found, done, empty) */
.listing-lookup { position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.75rem 0.85rem; align-items: start; margin-top: 0.7rem; padding: 0.85rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius, 10px); background: var(--paper, #fff); opacity: 0; transform: translateY(-6px); transition: opacity 0.28s ease, transform 0.28s cubic-bezier(.2, .8, .2, 1), border-color 0.28s ease, background 0.28s ease; }
.listing-lookup[hidden] { display: none; }
.listing-lookup.is-open { opacity: 1; transform: none; }
.listing-lookup .lookup-icon { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--green-soft); color: var(--green); flex: none; }
.listing-lookup .lookup-icon svg { width: 20px; height: 20px; }
.listing-lookup .lookup-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; font-size: 0.9rem; color: var(--muted); }
.listing-lookup .lookup-text strong { color: var(--ink); font-size: 0.97rem; }
.listing-lookup .lookup-price { color: var(--ink); font-size: 0.95rem; }
.listing-lookup .lookup-price b { font-size: 1.12rem; color: var(--green); font-variant-numeric: tabular-nums; }
.listing-lookup .lookup-facts { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.15rem; }
.listing-lookup .lookup-fact { padding: 0.12rem 0.55rem; border-radius: 999px; background: var(--page, #f2f5f3); border: 1px solid var(--rule); font-size: 0.8rem; color: var(--ink); animation: ns-pop 320ms cubic-bezier(.2, .8, .2, 1) both; }
.listing-lookup .lookup-fact:nth-child(2) { animation-delay: 60ms; } .listing-lookup .lookup-fact:nth-child(3) { animation-delay: 120ms; } .listing-lookup .lookup-fact:nth-child(4) { animation-delay: 180ms; } .listing-lookup .lookup-fact:nth-child(5) { animation-delay: 240ms; }
.listing-lookup .lookup-ask { margin-top: 0.3rem; color: var(--ink); font-weight: 600; }
.listing-lookup .lookup-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.listing-lookup .lookup-actions .btn { min-height: 42px; }
.listing-lookup.is-searching { border-color: var(--leaf, #8dbfa5); }
.listing-lookup.is-searching .lookup-icon { animation: ns-lookup-pulse 1.1s ease-in-out infinite; }
.listing-lookup .lookup-scan { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--green) 45%, var(--highlight, #f5dc5a) 55%, transparent); background-size: 200% 100%; animation: ns-lookup-scan 1.2s linear infinite; }
.listing-lookup.is-found { border-color: var(--green); box-shadow: 0 10px 28px -20px rgba(19, 36, 27, 0.55); }
.listing-lookup.is-found .lookup-icon { animation: ns-zoom-badge 420ms cubic-bezier(.2, .8, .2, 1); }
.listing-lookup.is-done { border-color: var(--leaf, #8dbfa5); background: var(--green-soft); }
.listing-lookup.is-done .lookup-icon { background: var(--green); color: #fff; animation: ns-zoom-badge 420ms cubic-bezier(.2, .8, .2, 1); }
.listing-lookup.is-empty { background: var(--page, #f2f5f3); }
.listing-lookup.is-empty .lookup-icon { background: var(--paper, #fff); color: var(--muted); }
@keyframes ns-lookup-pulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(30, 91, 66, 0.35); } 50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(30, 91, 66, 0); } }
@keyframes ns-lookup-scan { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .listing-lookup, .listing-lookup .lookup-icon, .listing-lookup .lookup-scan, .listing-lookup .lookup-fact { animation: none !important; transition: none; } }
@media (max-width: 520px) { .listing-lookup .lookup-actions .btn { flex: 1 1 auto; justify-content: center; } }

@keyframes ns-toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------------- animations */

@keyframes ns-fill-flash { 0% { box-shadow: 0 0 0 0 rgba(30, 91, 66, 0.5); background-color: var(--green-soft); } 100% { box-shadow: 0 0 0 8px rgba(30, 91, 66, 0); } }
.nsc-input.is-filled { animation: ns-fill-flash 800ms ease-out; }
@keyframes ns-pop { 0% { opacity: 0.4; transform: translateY(4px); } 100% { opacity: 1; transform: none; } }
.jurisdiction.is-located { animation: ns-pop 360ms cubic-bezier(.2, .8, .2, 1); }
@keyframes ns-zoom-badge { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.1); opacity: 1; } 100% { transform: none; } }
.tag.is-zoom { animation: ns-zoom-badge 460ms cubic-bezier(.2, .9, .3, 1.3); }
@keyframes ns-address-glow { 0% { box-shadow: 0 0 0 0 rgba(30, 91, 66, 0.4); } 100% { box-shadow: 0 0 0 10px rgba(30, 91, 66, 0); } }
#property-address.is-located { animation: ns-address-glow 700ms ease-out; }
@keyframes ns-pin-drop { 0% { transform: translateY(-30px); opacity: 0; } 70% { transform: translateY(3px); opacity: 1; } 100% { transform: none; } }

@keyframes ns-row-changed { 0% { background: #fff6c9; } 100% { background: transparent; } }
@keyframes ns-row-new { 0% { background: var(--green-soft); opacity: 0; } 35% { opacity: 1; } 100% { background: transparent; } }
.ledger tr.is-changed td { animation: ns-row-changed 1000ms ease-out; }
.ledger tr.is-new td { animation: ns-row-new 650ms ease-out; }

/* Optional unit / apartment number under the address */
.nsc .unit-field { margin-top: 0.85rem; }
.nsc .unit-field .nsc-input { max-width: 11rem; text-transform: uppercase; }
.nsc .unit-field .nsc-input::placeholder { text-transform: none; }
.nsc .unit-field .hint { margin-top: 0.35rem; }

/* One box per tax: a new box slides in when the property picks up another tax */
.nsc .field[hidden] { display: none; }
@keyframes ns-box-in { 0% { opacity: 0; transform: translateY(8px); } 60% { opacity: 1; } 100% { transform: none; } }
@keyframes ns-box-glow { 0% { box-shadow: 0 0 0 0 rgba(30, 91, 66, 0.45); border-color: var(--green); } 100% { box-shadow: 0 0 0 10px rgba(30, 91, 66, 0); } }
.auto-field.is-new { animation: ns-box-in 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.auto-field.is-new .nsc-input { animation: ns-box-glow 900ms ease-out both; }

@media (prefers-reduced-motion: reduce) {
  .nsc-input.is-filled, .jurisdiction.is-located, .tag.is-zoom, #property-address.is-located,
  .address-map .ns-pin svg, .address-map .ns-house, .ledger tr.is-changed td, .ledger tr.is-new td, .calc-toast, .auto-field.is-new, .auto-field.is-new .nsc-input { animation: none; }
  .address-map, .calc-bar, .seg-item span { transition: none; }
}

/* ------------------------------------------------------------ narrow */

@container nsc (max-width: 560px) {
  .nsc .field-row { grid-template-columns: minmax(0, 1fr); }
  .custom-fee-item { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 46px; padding-bottom: 0.75rem; border-bottom: 1px dashed var(--rule); }
  .custom-fee-item .fee-name { grid-column: 1 / -1; }
  .autofill-row { grid-template-columns: minmax(0, 1fr); }
  .nsc .sheet-head, .nsc .sheet-body, .nsc .sheet-foot { padding-inline: 1rem; }
  .nsc .sheet-stack::before { inset: 8px -6px -8px 6px; }
  .seg { display: grid; width: 100%; }
  .seg-item span { padding: 0 0.5rem; font-size: 0.9rem; }
  .address-map.is-open { height: 190px; }
  .address-map.is-open.is-picking { height: 300px; }
}
@media (max-width: 420px) {
  .seg-item span { font-size: 0.85rem; padding: 0 0.35rem; }
}

/* Find the home from a photo: the entry card, the candidates under the map, and the capture screen (js/photo-capture.js) */
.photo-entry {
  display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; align-items: center; justify-content: space-between;
  margin-top: 0.8rem; padding: 0.8rem 0.9rem; border: 1px solid var(--rule, #dfe7e2); border-radius: var(--radius-sm, 8px); background: #fff;
}
.photo-entry-text { flex: 1 1 14rem; min-width: 0; font-size: 0.86rem; color: var(--muted, #5b6b62); line-height: 1.4; }
.photo-entry-text strong { display: block; font-size: 0.95rem; color: var(--ink, #13241b); }
.photo-entry .photo-lock { font-size: 0.72rem; font-weight: 700; padding: 0.05rem 0.4rem; border-radius: 999px; background: rgba(30, 91, 66, 0.1); color: var(--green, #1E5B42); vertical-align: 0.08em; }
.photo-entry-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; flex: 0 1 auto; }
.nsc .photo-entry-btn, .photo-entry-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 44px; padding: 0.5rem 0.95rem; margin: 0;
  font: inherit; font-size: 0.92rem; font-weight: 600; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--green, #1E5B42); background: #fff; color: var(--green, #1E5B42);
  transition: background-color 150ms, color 150ms, transform 150ms, box-shadow 150ms;
}
.photo-entry-btn svg { width: 18px; height: 18px; flex: none; }
.photo-entry-btn.is-take, .photo-entry-btn.is-only { background: var(--green, #1E5B42); color: #fff; }
.photo-entry-btn:hover { box-shadow: 0 2px 8px rgba(30, 91, 66, 0.22); transform: translateY(-1px); }
.photo-entry-btn:active { transform: translateY(0); }
.photo-entry-btn:focus-visible { outline: 3px solid rgba(30, 91, 66, 0.4); outline-offset: 2px; }
@media (max-width: 520px) { .photo-entry-actions { width: 100%; } .photo-entry-btn { flex: 1 1 0; } }

.photo-candidates { margin-top: 0.55rem; padding: 0.7rem 0.8rem; border: 1px solid var(--rule, #dfe7e2); border-radius: var(--radius-sm, 8px); background: var(--paper, #f7faf8); animation: photo-rise 380ms cubic-bezier(.2, .8, .2, 1) both; }
.photo-candidates-head { display: flex; gap: 0.7rem; align-items: center; margin: 0 0 0.5rem; font-size: 0.9rem; font-weight: 600; color: var(--ink, #13241b); }
.photo-candidates .photo-estimated { display: block; margin-top: 0.15rem; font-size: 0.76rem; font-weight: 400; color: var(--muted, #5b6b62); }
.photo-candidates-foot { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; justify-content: space-between; margin: 0.55rem 0 0; font-size: 0.78rem; color: var(--muted, #5b6b62); }
.photo-candidates-foot button { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--green, #1E5B42); text-decoration: underline; cursor: pointer; min-height: 24px; }
/* On the map: the view cone fades open, the camera point pulses once, then the chosen home fills in,
   a ring spreads from it once, and its "This home" label pops up */
.address-map .photo-cone { animation: photo-cone 700ms ease-out both; }
.address-map .photo-cand { animation: photo-cand 520ms 450ms ease-out both; }
.address-map .photo-halo { animation: photo-halo 1100ms 700ms ease-out both; }
.leaflet-tooltip.photo-tip { font-size: 0.76rem; font-weight: 700; color: #fff; background: var(--green, #1E5B42); border: 0; border-radius: 999px; padding: 0.15rem 0.55rem; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22); animation: photo-pop 320ms 900ms cubic-bezier(.2, 1.4, .4, 1) both; }
.leaflet-tooltip.photo-tip::before { display: none; }
.address-map .photo-camera { animation: photo-camera 900ms ease-out both; }
@keyframes photo-cone { from { fill-opacity: 0; stroke-opacity: 0; } }
@keyframes photo-cand { from { fill-opacity: 0; stroke-opacity: 0; stroke-width: 7; } }
@keyframes photo-halo { 0% { stroke-opacity: 0.55; stroke-width: 3; } 100% { stroke-opacity: 0; stroke-width: 26; } }
@keyframes photo-camera { 0% { stroke-width: 14; stroke-opacity: 0.2; } 100% { stroke-width: 2; stroke-opacity: 1; } }
@keyframes photo-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes photo-pop { from { opacity: 0; transform: scale(0.4); } }

html.nsp-open { overflow: hidden; }
.nsp { position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center; padding: 1rem; background: rgba(12, 24, 18, 0.62); animation: nsp-fade 180ms ease-out both; }
.nsp-panel { position: relative; width: min(100%, 30rem); max-height: 100%; overflow: auto; background: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); color: #13241b; animation: nsp-in 260ms cubic-bezier(.2, .9, .3, 1) both; }
.nsp-panel.is-drop::after { content: "Drop the photo to upload it"; position: absolute; inset: 0.6rem; z-index: 5; display: grid; place-items: center; border: 2px dashed #1E5B42; border-radius: 12px; background: rgba(240, 247, 243, 0.94); color: #1E5B42; font-weight: 700; font-size: 1.05rem; pointer-events: none; }
.nsp-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1rem 0.2rem 1.2rem; }
.nsp-title { margin: 0; font-size: 1.08rem; font-weight: 700; }
.nsp-close { border: 0; background: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: inherit; cursor: pointer; }
.nsp-close svg { width: 20px; height: 20px; }
.nsp-close:hover, .nsp-close:focus-visible { background: rgba(30, 91, 66, 0.1); outline: none; }
.nsp-body { padding: 0.4rem 1.2rem 1.2rem; }
.nsp-body > * { animation: nsp-rise 260ms cubic-bezier(.2, .8, .2, 1) both; }
.nsp-intro, .nsp-message { margin: 0.3rem 0 1rem; font-size: 0.95rem; line-height: 1.45; }
.nsp-note { margin: 0.9rem 0 0; font-size: 0.8rem; line-height: 1.45; color: #5b6b62; }

/* First screen: two equal tiles, take it here or upload it */
.nsp-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.nsp-tiles.is-single { grid-template-columns: 1fr; }
.nsp-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; min-height: 9.2rem; padding: 1rem 0.7rem; text-align: center;
  font: inherit; color: #13241b; background: #f4f8f6; border: 2px solid #cfdcd5; border-radius: 14px; cursor: pointer;
  transition: border-color 160ms, background-color 160ms, transform 160ms, box-shadow 160ms;
}
.nsp-tile strong { font-size: 1.02rem; }
.nsp-tile-sub { font-size: 0.82rem; color: #5b6b62; }
.nsp-tile-icon { width: 52px; height: 52px; margin-bottom: 0.45rem; display: grid; place-items: center; border-radius: 50%; background: #1E5B42; color: #fff; transition: transform 200ms cubic-bezier(.2, 1.4, .4, 1); }
.nsp-tile-icon svg { width: 26px; height: 26px; }
.nsp-tile.is-upload { border-style: dashed; border-color: #1E5B42; background: #fff; }
.nsp-tile.is-upload .nsp-tile-icon { background: #fff; color: #1E5B42; box-shadow: inset 0 0 0 2px #1E5B42; }
.nsp-tiles.is-single .nsp-tile { min-height: 11rem; }
.nsp-tile:hover, .nsp-tile:focus-visible { border-color: #1E5B42; background: #eef5f1; box-shadow: 0 6px 18px rgba(30, 91, 66, 0.16); transform: translateY(-2px); outline: none; }
.nsp-tile:hover .nsp-tile-icon, .nsp-tile:focus-visible .nsp-tile-icon { transform: scale(1.08); }
.nsp-tile:active { transform: translateY(0); }
.nsp-tile.is-upload:hover .nsp-tile-icon { animation: nsp-nudge 700ms ease-in-out infinite; }

.nsp-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem; min-height: 48px; padding: 0.6rem 1rem; font: inherit; font-weight: 600; font-size: 0.98rem;
  border-radius: 10px; border: 1px solid rgba(30, 91, 66, 0.35); background: #fff; color: #1E5B42; cursor: pointer; text-decoration: none;
}
.nsp-btn-primary { background: #1E5B42; border-color: #1E5B42; color: #fff; }
.nsp-btn:focus-visible, .nsp-shutter:focus-visible, .nsp-link:focus-visible { outline: 3px solid rgba(30, 91, 66, 0.4); outline-offset: 2px; }
.nsp-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.nsp-actions > * { flex: 1 1 9rem; }
.nsp-mark { width: 52px; height: 52px; margin: 0.4rem auto 0.6rem; display: grid; place-items: center; border-radius: 50%; }
.nsp-mark svg { width: 28px; height: 28px; }
.nsp-mark.is-warn { background: #fdf0d5; color: #7a4b00; animation: nsp-shake 420ms ease-in-out both; }
.nsp-screen-message .nsp-message { text-align: center; }

/* Camera */
.nsp-view { position: relative; border-radius: 12px; overflow: hidden; background: #0c1812; aspect-ratio: 3 / 4; max-height: 52vh; margin: 0 auto; }
.nsp-video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* centre mark: the home that fills the middle of the frame is the one that is picked */
.nsp-cross { position: absolute; left: 50%; top: 50%; width: 46%; height: 38%; transform: translate(-50%, -50%); border: 2px solid rgba(255, 255, 255, 0.6); border-radius: 10px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.12); pointer-events: none; transition: border-color 250ms, width 250ms, height 250ms; }
.nsp-view.is-ready .nsp-cross { border-color: #8ff0bd; width: 50%; height: 41%; }
.nsp-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.nsp-view.is-flash .nsp-flash { animation: nsp-flash 260ms ease-out both; }
.nsp-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.7rem 0 0.3rem; }
.nsp-chip { font-size: 0.78rem; font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 999px; background: #eef2f0; color: #40524a; font-variant-numeric: tabular-nums; transition: background-color 250ms, color 250ms; }
.nsp-chip.is-good { background: rgba(30, 91, 66, 0.14); color: #1E5B42; }
.nsp-chip.is-weak { background: #fdf0d5; color: #7a4b00; }
.nsp-status { margin: 0.2rem 0 0; font-size: 0.88rem; min-height: 2.6em; }
.nsp-camera-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 0.4rem; }
.nsp-shutter { width: 68px; height: 68px; padding: 0; border-radius: 50%; border: 4px solid #1E5B42; background: #fff; display: grid; place-items: center; cursor: pointer; transition: transform 120ms, border-color 200ms; }
.nsp-shutter-ring { width: 50px; height: 50px; border-radius: 50%; background: #1E5B42; transition: background-color 200ms, transform 120ms; }
.nsp-shutter:not(:disabled):active .nsp-shutter-ring { transform: scale(0.86); }
.nsp-shutter:not(:disabled) { animation: nsp-ready 1.8s ease-in-out infinite; }
.nsp-shutter:disabled { border-color: #b9c9c1; cursor: default; }
.nsp-shutter:disabled .nsp-shutter-ring { background: #b9c9c1; }
.nsp-link { justify-self: end; display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; padding: 0 0.2rem; border: 0; background: none; font: inherit; font-size: 0.86rem; font-weight: 600; color: #1E5B42; cursor: pointer; }
.nsp-link svg { width: 18px; height: 18px; }

/* Working it out: the photo with a scan line, then a tick */
.nsp-shot { position: relative; border-radius: 12px; overflow: hidden; background: #0c1812; aspect-ratio: 4 / 3; max-height: 46vh; margin: 0 auto; }
.nsp-shot.is-portrait { aspect-ratio: 3 / 4; max-height: none; width: min(100%, calc(50vh * 3 / 4)); }
.nsp-shot img { width: 100%; height: 100%; object-fit: cover; display: block; animation: nsp-develop 500ms ease-out both; }
.nsp-shot.is-empty { background: linear-gradient(110deg, #e6eeea 30%, #f4f8f6 50%, #e6eeea 70%); background-size: 220% 100%; animation: nsp-shimmer 1.1s linear infinite; }
.nsp-shot.is-empty img { visibility: hidden; }
.nsp-frame { position: absolute; inset: 10%; border-radius: 8px; pointer-events: none;
  background: linear-gradient(#fff, #fff) left top / 22px 3px no-repeat, linear-gradient(#fff, #fff) left top / 3px 22px no-repeat,
              linear-gradient(#fff, #fff) right top / 22px 3px no-repeat, linear-gradient(#fff, #fff) right top / 3px 22px no-repeat,
              linear-gradient(#fff, #fff) left bottom / 22px 3px no-repeat, linear-gradient(#fff, #fff) left bottom / 3px 22px no-repeat,
              linear-gradient(#fff, #fff) right bottom / 22px 3px no-repeat, linear-gradient(#fff, #fff) right bottom / 3px 22px no-repeat;
  opacity: 0.9; animation: nsp-frame 1.2s ease-in-out infinite alternate; }
.nsp-scanline { position: absolute; left: 0; right: 0; top: 0; height: 28%; pointer-events: none; background: linear-gradient(to bottom, rgba(143, 240, 189, 0) 0%, rgba(143, 240, 189, 0.28) 85%, #8ff0bd 100%); border-bottom: 2px solid #8ff0bd; animation: nsp-scan 1.15s cubic-bezier(.45, 0, .55, 1) infinite alternate; }
.nsp-badge { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; display: grid; place-items: center; border-radius: 50%; background: #1E5B42; color: #fff; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35); opacity: 0; transform: scale(0.3); pointer-events: none; }
.nsp-badge svg { width: 40px; height: 40px; }
.nsp-badge svg path { stroke-dasharray: 30; stroke-dashoffset: 30; }
.nsp-shot.is-found .nsp-scanline, .nsp-shot.is-found .nsp-frame { animation: none; opacity: 0; transition: opacity 200ms; }
.nsp-shot.is-found::after { content: ""; position: absolute; inset: 0; background: rgba(12, 24, 18, 0.28); animation: nsp-fade 250ms ease-out both; }
.nsp-shot.is-found .nsp-badge { z-index: 1; animation: nsp-badge 420ms cubic-bezier(.2, 1.5, .4, 1) forwards; }
.nsp-shot.is-found .nsp-badge svg path { animation: nsp-tick 320ms 220ms ease-out forwards; }
.nsp-step { margin: 0.9rem 0 0; text-align: center; font-size: 1rem; font-weight: 600; min-height: 1.5em; }
.nsp-step.is-found { color: #1E5B42; font-size: 1.15rem; animation: nsp-rise 300ms cubic-bezier(.2, .8, .2, 1) both; }
.nsp-step-sub { margin: 0.15rem 0 0; text-align: center; font-size: 0.9rem; color: #40524a; min-height: 1.4em; }

@keyframes nsp-fade { from { opacity: 0; } }
@keyframes nsp-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
@keyframes nsp-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes nsp-nudge { 50% { transform: translateY(-4px); } }
@keyframes nsp-shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes nsp-flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
@keyframes nsp-ready { 50% { box-shadow: 0 0 0 7px rgba(30, 91, 66, 0.14); } }
@keyframes nsp-develop { from { opacity: 0; filter: brightness(1.8) saturate(0.4); transform: scale(1.04); } }
@keyframes nsp-shimmer { to { background-position: -220% 0; } }
@keyframes nsp-frame { from { inset: 10%; } to { inset: 7%; } }
@keyframes nsp-scan { from { transform: translateY(-100%); } to { transform: translateY(260%); } }
@keyframes nsp-badge { to { opacity: 1; transform: scale(1); } }
@keyframes nsp-tick { to { stroke-dashoffset: 0; } }
/* No movement for people who ask for less of it: everything simply appears */
@media (prefers-reduced-motion: reduce) {
  .nsp, .nsp-panel, .nsp-body > *, .nsp-shot img, .nsp-frame, .nsp-scanline, .nsp-shutter:not(:disabled), .nsp-mark.is-warn, .nsp-tile.is-upload:hover .nsp-tile-icon,
  .photo-candidates, .sheet-photo, .address-map .photo-cone, .address-map .photo-cand, .address-map .photo-camera, .address-map .photo-halo, .leaflet-tooltip.photo-tip { animation: none !important; }
  .nsp-scanline { display: none; }
  .nsp-shot.is-found .nsp-badge { animation: none; opacity: 1; transform: none; }
  .nsp-shot.is-found .nsp-badge svg path { animation: none; stroke-dashoffset: 0; }
  .nsp-tile, .photo-entry-btn { transition: none; }
}

/* The property photo: add it to the net sheet (calculator) */
.sheet-photo { animation: photo-rise 380ms cubic-bezier(.2, .8, .2, 1) both; display: flex; gap: 0.8rem; align-items: center; margin-top: 0.55rem; padding: 0.6rem 0.7rem; border: 1px solid var(--rule, #dfe7e2); border-radius: var(--radius-sm, 8px); background: #fff; }
.sheet-photo img { width: 88px; height: 66px; object-fit: cover; border-radius: 6px; flex: none; background: #eef2f0; }
.sheet-photo-body { min-width: 0; font-size: 0.9rem; }
.nsc .sheet-photo-check, .sheet-photo-check { display: flex; gap: 0.5rem; align-items: center; margin: 0; font-weight: 600; min-height: 28px; cursor: pointer; }
.sheet-photo-check input { width: 18px; height: 18px; flex: none; accent-color: var(--green, #1E5B42); }
.sheet-photo-note { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--muted, #5b6b62); }
.sheet-photo-remove { display: block; margin-top: 0.2rem; border: 0; background: none; padding: 0; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--green, #1E5B42); text-decoration: underline; cursor: pointer; min-height: 24px; }
.sheet-photo-remove:disabled { color: var(--muted, #5b6b62); cursor: default; }
