:root {
  --ufh-warm: #e8650a;
  --ufh-warm-dark: #c85508;
  --ufh-warm-soft: #fff2e8;
  --ufh-cool: #2b79b9;
  --ufh-cool-soft: #eaf5fc;
  --ufh-ink: #1e2b3c;
  --ufh-line: #dfe3e7;
  --ufh-paper: #fbfaf7;
}

.ufh-page-hero {
  position: relative;
  overflow: hidden;
  padding-top: 38px;
  padding-bottom: 34px;
  isolation: isolate;
}

.ufh-page-hero::before,
.ufh-page-hero::after {
  position: absolute;
  z-index: -1;
  border: 2px solid rgba(255, 255, 255, .055);
  border-radius: 42%;
  content: '';
  pointer-events: none;
  transform: rotate(10deg);
}

.ufh-page-hero::before {
  width: 310px;
  height: 190px;
  right: -92px;
  top: -70px;
  box-shadow: inset 0 0 0 22px rgba(255, 255, 255, .018), inset 0 0 0 45px rgba(255, 255, 255, .018);
}

.ufh-page-hero::after {
  width: 230px;
  height: 145px;
  left: -95px;
  bottom: -82px;
  box-shadow: inset 0 0 0 20px rgba(232, 101, 10, .035), inset 0 0 0 42px rgba(232, 101, 10, .025);
}

.ufh-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 13px;
  padding: 5px 11px;
  border: 1px solid rgba(232, 101, 10, .44);
  border-radius: 999px;
  background: rgba(232, 101, 10, .13);
  color: #ffb37f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.ufh-hero-badge span {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  background: rgba(232, 101, 10, .19);
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

.ufh-page-hero p {
  max-width: 720px;
  line-height: 1.65;
}

.ufh-app {
  gap: 20px;
  padding-top: 24px;
}

.ufh-layout {
  display: grid;
  grid-template-columns: minmax(360px, .78fr) minmax(0, 1.22fr);
  gap: 20px;
  align-items: start;
}

.ufh-layout > * {
  min-width: 0;
}

.ufh-app .panel {
  border-color: #deddd8;
  border-radius: 15px;
  box-shadow: 0 8px 28px rgba(26, 36, 50, .055);
}

.ufh-app .panel__title {
  margin-bottom: 19px;
  color: #657080;
}

.ufh-app .panel__title svg {
  color: var(--c-accent);
}

.ufh-controls {
  min-width: 0;
}

.ufh-field-group {
  margin-bottom: 19px;
  padding-bottom: 18px;
  border-bottom: 1px solid #ebe9e4;
}

.ufh-group-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.ufh-group-heading > span {
  display: grid;
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  background: var(--ufh-warm-soft);
  color: var(--c-accent);
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(232, 101, 10, .12);
}

.ufh-group-heading > div {
  min-width: 0;
}

.ufh-group-heading strong,
.ufh-group-heading small {
  display: block;
}

.ufh-group-heading strong {
  color: var(--c-navy);
  font-size: 13px;
  line-height: 1.3;
}

.ufh-group-heading small {
  margin-top: 2px;
  color: #7a828c;
  font-size: 10px;
  line-height: 1.4;
}

.ufh-fields-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ufh-controls .field {
  min-width: 0;
  margin-bottom: 15px;
}

.ufh-controls .field:last-child {
  margin-bottom: 0;
}

.ufh-optional {
  color: #8a9098;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.ufh-number-stepper {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  min-height: 48px;
  overflow: hidden;
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  background: var(--c-bg);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.ufh-number-stepper:focus-within {
  border-color: var(--c-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(232, 101, 10, .1);
}

.ufh-number-stepper > button {
  display: grid;
  min-width: 0;
  place-items: center;
  border: 0;
  background: #eeede8;
  color: #536071;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  transition: background .16s ease, color .16s ease;
}

.ufh-number-stepper > button:first-child {
  border-right: 1px solid var(--c-border);
}

.ufh-number-stepper > button:last-child {
  border-left: 1px solid var(--c-border);
}

.ufh-number-stepper > button:hover:not(:disabled) {
  background: #e5e2db;
  color: var(--c-accent);
}

.ufh-number-stepper > button:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.ufh-input-wrap {
  position: relative;
  min-width: 0;
}

.ufh-input-wrap .inp {
  height: 100%;
  min-height: 45px;
  border: 0;
  border-radius: 0;
  padding: 10px 43px 10px 12px;
  background: transparent;
  color: var(--c-navy);
  font-size: 15px;
  font-weight: 700;
  outline: 0;
  box-shadow: none;
  appearance: textfield;
}

.ufh-input-wrap .inp::-webkit-outer-spin-button,
.ufh-input-wrap .inp::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.ufh-input-wrap > span {
  position: absolute;
  right: 11px;
  top: 50%;
  color: #7a8490;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  transform: translateY(-50%);
  white-space: nowrap;
}

.ufh-number-stepper--error,
.ufh-number-stepper:has(.inp--error),
.ufh-number-stepper:has([aria-invalid='true']) {
  border-color: var(--c-red);
  box-shadow: 0 0 0 3px rgba(217, 48, 37, .08);
}

.ufh-controls .field-hint {
  margin-top: 7px;
  color: #79818b;
  font-size: 10px;
  line-height: 1.5;
}

.ufh-choice-field {
  margin: 0 0 16px;
  border: 0;
  padding: 0;
}

.ufh-choice-field legend {
  display: block;
  width: 100%;
  margin-bottom: 7px;
  color: var(--c-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.ufh-choice-field legend span {
  color: #90959b;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.ufh-diameter-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.ufh-diameter-options button {
  min-width: 0;
  min-height: 52px;
  border: 1.5px solid var(--c-border);
  border-radius: 9px;
  background: var(--c-bg);
  color: #68727e;
  transition: border-color .17s ease, background .17s ease, box-shadow .17s ease, transform .17s ease;
}

.ufh-diameter-options button:hover {
  border-color: #efb087;
  transform: translateY(-1px);
}

.ufh-diameter-options strong,
.ufh-diameter-options small {
  display: block;
}

.ufh-diameter-options strong {
  color: var(--c-navy);
  font-size: 15px;
}

.ufh-diameter-options small {
  margin-top: 1px;
  font-size: 9px;
}

.ufh-diameter-options button.active {
  border-color: var(--c-accent);
  background: var(--ufh-warm-soft);
  box-shadow: inset 0 0 0 1px var(--c-accent), 0 4px 13px rgba(232, 101, 10, .09);
  color: var(--c-accent);
}

.ufh-diameter-options button.active strong {
  color: var(--c-accent-h);
}

.ufh-quick-spacing {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}

.ufh-quick-spacing button {
  min-width: 0;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: #fff;
  padding: 6px 3px;
  color: #69737f;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}

.ufh-quick-spacing button:hover,
.ufh-quick-spacing button.active {
  border-color: var(--c-accent);
  background: var(--ufh-warm-soft);
  color: var(--c-accent-h);
}

.ufh-pattern-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ufh-pattern-options > button {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 72px;
  overflow: hidden;
  border: 1.5px solid var(--c-border);
  border-radius: 11px;
  background: var(--c-bg);
  padding: 9px;
  color: #6b7581;
  text-align: left;
  transition: border-color .17s ease, background .17s ease, box-shadow .17s ease, transform .17s ease;
}

.ufh-pattern-options > button:hover {
  border-color: #efb087;
  transform: translateY(-1px);
}

.ufh-pattern-options > button.active {
  border-color: var(--c-accent);
  background: linear-gradient(145deg, #fff8f3, #fff1e7);
  box-shadow: inset 0 0 0 1px var(--c-accent), 0 5px 15px rgba(232, 101, 10, .08);
}

.ufh-pattern-options strong,
.ufh-pattern-options small {
  display: block;
}

.ufh-pattern-options strong {
  color: var(--c-navy);
  font-size: 12px;
}

.ufh-pattern-options small {
  margin-top: 3px;
  font-size: 9px;
  line-height: 1.3;
}

.ufh-pattern-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #e0ded7;
  border-radius: 9px;
  background: #fff;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  font-size: 27px;
  line-height: 1;
  filter: saturate(.82);
}

.ufh-pattern-options button.active .ufh-pattern-icon {
  border-color: #f0b590;
  background: #fff8f3;
}

.ufh-pattern-options > button > .ufh-pattern-icon,
.ufh-pattern-options > button > .ufh-pattern-copy {
  transition: opacity .18s ease, filter .18s ease, transform .18s ease;
}

.ufh-pattern-options > button.is-auto-switched {
  border-color: #e29a5d;
  background: #fff8f1;
  box-shadow: inset 0 0 0 1px rgba(232, 101, 10, .2);
}

.ufh-pattern-options > button.is-auto-switched > .ufh-pattern-icon,
.ufh-pattern-options > button.is-auto-switched > .ufh-pattern-copy {
  opacity: .16;
  filter: blur(2px);
  transform: scale(.98);
}

.ufh-auto-switch-overlay {
  position: absolute;
  z-index: 2;
  inset: 4px;
  display: none;
  align-content: center;
  justify-items: center;
  border-radius: 8px;
  padding: 5px 7px;
  color: #7c3912;
  text-align: center;
  pointer-events: none;
}

.ufh-pattern-options > button.is-auto-switched .ufh-auto-switch-overlay {
  display: grid;
}

.ufh-auto-switch-overlay strong {
  color: #7c3912;
  font-size: 10px;
  line-height: 1.25;
}

.ufh-auto-switch-overlay small {
  max-width: 170px;
  margin-top: 3px;
  color: #875b3c;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.25;
}

.ufh-pattern-options > button.is-auto-result {
  border-color: #59a98a;
  background: #f1faf6;
  box-shadow: inset 0 0 0 1px rgba(23, 128, 91, .18), 0 5px 15px rgba(23, 128, 91, .08);
}

.ufh-pattern-options > button.is-auto-result .ufh-pattern-icon {
  border-color: #8bc8b1;
  background: #f7fffb;
}

.ufh-advanced {
  margin-top: 17px;
  overflow: hidden;
  border: 1px solid #dfe2e5;
  border-radius: 11px;
  background: #fafaf8;
}

.ufh-advanced summary {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 42px 13px 14px;
  color: var(--c-navy);
  cursor: pointer;
  list-style: none;
}

.ufh-advanced summary::-webkit-details-marker {
  display: none;
}

.ufh-advanced summary::after {
  position: absolute;
  right: 15px;
  top: 50%;
  color: var(--c-accent);
  content: '+';
  font-size: 20px;
  line-height: 1;
  transform: translateY(-50%);
}

.ufh-advanced[open] summary::after {
  content: '−';
}

.ufh-advanced summary span {
  font-size: 12px;
  font-weight: 700;
}

.ufh-advanced summary small {
  color: #7b8490;
  font-size: 9px;
  line-height: 1.35;
}

.ufh-advanced-body {
  padding: 15px 14px 14px;
  border-top: 1px solid #e5e5e1;
  background: #fff;
}

.ufh-calculation-note {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 13px;
  border-radius: 10px;
  background: #f1f4f7;
  color: #5d6876;
}

.ufh-calculation-note > span {
  display: grid;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: var(--c-navy);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.ufh-calculation-note p {
  margin: 0;
  font-size: 10px;
  line-height: 1.55;
}

.ufh-calculation-note strong {
  color: var(--c-navy);
}

.ufh-controls > .field-error {
  min-height: 17px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
}

.ufh-results {
  position: sticky;
  top: 78px;
  min-width: 0;
  overflow: hidden;
}

.ufh-results-content {
  transition: filter .2s ease, opacity .2s ease, transform .2s ease;
}

.ufh-results--blocked .ufh-results-content {
  filter: blur(5px);
  opacity: .4;
  pointer-events: none;
  transform: scale(.993);
  user-select: none;
}

.ufh-result-error {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(245, 244, 240, .7);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.ufh-result-error[hidden] {
  display: none;
}

.ufh-result-error__card {
  width: min(100%, 340px);
  padding: 24px 22px;
  border: 1px solid rgba(194, 66, 50, .28);
  border-radius: 14px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 18px 45px rgba(31, 43, 60, .16);
  text-align: center;
}

.ufh-result-error__card > span {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 50%;
  background: #fff0ed;
  color: #c64030;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 0 0 6px rgba(198, 64, 48, .07);
}

.ufh-result-error__card strong {
  display: block;
  color: var(--c-navy);
  font-size: 17px;
  line-height: 1.3;
}

.ufh-result-error__card p {
  margin: 8px 0 0;
  color: #5f6975;
  font-size: 12px;
  line-height: 1.55;
}

.ufh-plan-card {
  overflow: hidden;
  border: 1px solid #d9dfe4;
  border-radius: 13px;
  background: #f8fafb;
}

.ufh-plan-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #dfe4e8;
  background: #fff;
}

.ufh-plan-toolbar > div {
  min-width: 0;
}

.ufh-plan-toolbar strong,
.ufh-plan-toolbar span {
  display: block;
}

.ufh-plan-toolbar strong {
  overflow: hidden;
  color: var(--c-navy);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ufh-plan-toolbar span {
  margin-top: 2px;
  color: #74808d;
  font-size: 10px;
}

.ufh-plan-toolbar button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  border: 1px solid #d9dee4;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  color: #556170;
  font-size: 10px;
  font-weight: 700;
  transition: border-color .17s ease, color .17s ease, background .17s ease;
}

.ufh-plan-toolbar button:hover {
  border-color: var(--c-accent);
  background: var(--ufh-warm-soft);
  color: var(--c-accent-h);
}

.ufh-svg-wrap {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 315px;
  overflow: auto;
  place-items: center;
  background-color: #eef2f3;
  background-image: linear-gradient(rgba(67, 81, 96, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(67, 81, 96, .045) 1px, transparent 1px);
  background-position: center;
  background-size: 20px 20px;
}

.ufh-svg-wrap svg {
  display: block;
  width: 100%;
  min-width: 480px;
  height: auto;
  max-height: 610px;
  aspect-ratio: 21 / 13;
  font-family: var(--font-main);
}

.ufh-svg-wrap svg text {
  font-family: var(--font-main);
}

.ufh-svg-pipe {
  animation: ufh-pipe-reveal .72s ease both;
  animation-delay: var(--pipe-delay, 0ms);
}

@keyframes ufh-pipe-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ufh-plan-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 13px;
  min-height: 35px;
  padding: 9px 13px;
  border-top: 1px solid #dfe4e8;
  background: #fff;
  color: #677381;
  font-size: 9px;
}

.ufh-plan-legend > *,
.ufh-plan-legend .ufh-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ufh-plan-legend i,
.ufh-plan-legend .ufh-legend-color {
  display: inline-block;
  flex: 0 0 15px;
  width: 15px;
  height: 4px;
  border-radius: 999px;
}

.ufh-plan-legend .ufh-legend-pipe i {
  background: #243b53;
}

.ufh-plan-legend .ufh-legend-more {
  color: #475467;
  font-weight: 700;
}

.ufh-plan-legend .ufh-legend-warning {
  flex-basis: 100%;
  margin-top: 2px;
  color: #9a5518;
  font-weight: 700;
  line-height: 1.4;
}

.ufh-plan-disclaimer {
  margin: 0;
  padding: 9px 13px 11px;
  border-top: 1px solid #e4e7e9;
  background: #f8f8f6;
  color: #7c848c;
  font-size: 9px;
  line-height: 1.45;
}

.ufh-result-hero {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  padding: 17px 19px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c-navy), #2d435c);
  color: #fff;
  box-shadow: 0 8px 22px rgba(30, 43, 60, .13);
}

.ufh-result-hero::after {
  position: absolute;
  right: -46px;
  bottom: -64px;
  width: 160px;
  height: 160px;
  border: 22px solid rgba(255, 255, 255, .045);
  border-radius: 50%;
  content: '';
}

.ufh-result-hero span,
.ufh-result-hero strong,
.ufh-result-hero small {
  position: relative;
  z-index: 1;
  display: block;
}

.ufh-result-hero span {
  color: rgba(255, 255, 255, .64);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.ufh-result-hero strong {
  margin: 3px 0 1px;
  color: #ff9b56;
  font-size: clamp(28px, 4.4vw, 39px);
  line-height: 1.08;
  letter-spacing: -.04em;
}

.ufh-result-hero small {
  color: rgba(255, 255, 255, .7);
  font-size: 10px;
}

.ufh-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.ufh-stat-grid article {
  min-width: 0;
  padding: 11px;
  border: 1px solid #e1e3e3;
  border-radius: 10px;
  background: #fbfbf9;
}

.ufh-stat-grid span,
.ufh-stat-grid strong,
.ufh-stat-grid small {
  display: block;
}

.ufh-stat-grid span {
  min-height: 24px;
  color: #7a828b;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .035em;
  line-height: 1.35;
  text-transform: uppercase;
}

.ufh-stat-grid strong {
  margin: 4px 0 2px;
  overflow-wrap: anywhere;
  color: var(--c-navy);
  font-size: 17px;
  line-height: 1.2;
}

.ufh-stat-grid small {
  color: #8a9198;
  font-size: 8px;
  line-height: 1.35;
}

.ufh-breakdown {
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid #e1e3e3;
  border-radius: 10px;
  background: #fff;
}

.ufh-breakdown > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 42px;
  padding: 9px 12px;
  border-bottom: 1px solid #ececea;
}

.ufh-breakdown > div:last-child {
  border-bottom: 0;
}

.ufh-breakdown span {
  color: #6e7781;
  font-size: 10px;
  line-height: 1.35;
}

.ufh-breakdown strong {
  flex: 0 0 auto;
  color: var(--c-navy);
  font-size: 12px;
  text-align: right;
}

.ufh-subheading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.ufh-subheading h2 {
  margin: 0;
  color: var(--c-navy);
  font-size: 16px;
  line-height: 1.3;
}

.ufh-subheading p {
  margin: 3px 0 0;
  color: #747e89;
  font-size: 10px;
  line-height: 1.5;
}

.ufh-loop-section {
  margin-top: 16px;
}

.ufh-loop-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.ufh-loop-list:empty::before {
  grid-column: 1 / -1;
  padding: 13px;
  border: 1px dashed #d8dadd;
  border-radius: 9px;
  color: #8a929a;
  content: 'Kontūrai bus parodyti apskaičiavus duomenis.';
  font-size: 10px;
  text-align: center;
}

.ufh-loop-list > div,
.ufh-loop-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e1e3e4;
  border-radius: 9px;
  background: #fafaf8;
  color: #6d7782;
  font-size: 9px;
}

.ufh-loop-list i,
.ufh-loop-item__color {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.ufh-loop-list strong {
  color: var(--c-navy);
  font-size: 11px;
}

.ufh-loop-item > div {
  min-width: 0;
}

.ufh-loop-item strong,
.ufh-loop-item small {
  display: block;
}

.ufh-loop-item small {
  overflow: hidden;
  margin-top: 1px;
  color: #7b8490;
  font-size: 8px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ufh-loop-item > b {
  color: var(--c-navy);
  font-size: 10px;
  white-space: nowrap;
}

.ufh-loop-item--near-limit {
  border-color: rgba(217, 119, 6, .35);
  background: #fffaf2;
}

.ufh-comparison {
  padding: 20px 22px;
}

.ufh-table-wrap,
.ufh-static-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #dfe1e1;
  border-radius: 11px;
  background: #fff;
  scrollbar-width: thin;
}

.ufh-comparison-table,
.ufh-static-table {
  width: 100%;
  border-collapse: collapse;
  color: #616c78;
  font-size: 11px;
}

.ufh-comparison-table {
  min-width: 690px;
}

.ufh-static-table {
  min-width: 620px;
}

.ufh-comparison-table th,
.ufh-comparison-table td,
.ufh-static-table th,
.ufh-static-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e7e7e5;
  text-align: left;
  vertical-align: middle;
}

.ufh-comparison-table thead th,
.ufh-static-table thead th {
  background: #f3f4f3;
  color: #69737e;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ufh-comparison-table tbody tr:last-child > *,
.ufh-static-table tbody tr:last-child > * {
  border-bottom: 0;
}

.ufh-comparison-table tbody tr {
  transition: background .16s ease;
}

.ufh-comparison-table tbody tr:hover,
.ufh-comparison-table tbody tr.active {
  background: #fff7f1;
}

.ufh-comparison-table tbody tr.active > :first-child {
  box-shadow: inset 3px 0 var(--c-accent);
}

.ufh-comparison-table strong,
.ufh-static-table strong {
  color: var(--c-navy);
}

.ufh-current-tag {
  display: inline-block;
  margin-left: 7px;
}

.ufh-comparison-table button {
  border: 1px solid #efb58f;
  border-radius: 7px;
  background: #fff;
  padding: 6px 9px;
  color: var(--c-accent-h);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.ufh-comparison-table button:hover {
  background: var(--ufh-warm-soft);
}

.ufh-instructions {
  padding-bottom: 34px;
}

.ufh-instructions .steps {
  margin-bottom: 0;
}

.ufh-seo-section,
.ufh-faq,
.ufh-related {
  padding-top: 0;
}

.ufh-content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.ufh-content-grid--formula {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.35fr);
  align-items: stretch;
}

.ufh-content-card {
  position: relative;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(31, 43, 60, .035);
}

.ufh-content-card h3 {
  margin: 9px 0 7px;
  color: var(--c-navy);
  font-size: 14px;
  line-height: 1.35;
}

.ufh-content-card p {
  margin: 0;
  color: var(--c-muted);
  font-size: 12px;
  line-height: 1.7;
}

.ufh-content-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: var(--ufh-warm-soft);
  color: var(--c-accent);
  font-size: 18px;
  font-weight: 700;
}

.ufh-formula-card {
  overflow: hidden;
  border-color: #41546a;
  background: linear-gradient(145deg, var(--c-navy), #2d425a);
}

.ufh-formula-card::after {
  position: absolute;
  right: -42px;
  bottom: -55px;
  width: 150px;
  height: 150px;
  border: 20px solid rgba(255, 255, 255, .035);
  border-radius: 50%;
  content: '';
}

.ufh-formula-card h3,
.ufh-formula-card p {
  position: relative;
  z-index: 1;
}

.ufh-formula-card h3 {
  color: #fff;
}

.ufh-formula-card p {
  color: rgba(255, 255, 255, .67);
}

.ufh-formula-card p strong {
  color: #fff;
}

.ufh-card-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  border-radius: 999px;
  background: rgba(232, 101, 10, .18);
  padding: 4px 8px;
  color: #ffae76;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ufh-formula {
  position: relative;
  z-index: 1;
  margin-top: 17px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  color: #ffad74;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}

.ufh-table-note {
  margin: 9px 2px 0;
  color: #7b838c;
  font-size: 10px;
  line-height: 1.55;
}

.ufh-pattern-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ufh-pattern-guide article {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 17px;
  padding: 18px;
  border: 1px solid var(--c-border);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(31, 43, 60, .035);
}

.ufh-pattern-guide article > div:last-child > span {
  display: block;
  margin-bottom: 4px;
  color: var(--c-accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ufh-pattern-guide h3 {
  margin: 0 0 7px;
  color: var(--c-navy);
  font-size: 14px;
  line-height: 1.35;
}

.ufh-pattern-guide p,
.ufh-pattern-guide li {
  color: var(--c-muted);
  font-size: 11px;
  line-height: 1.65;
}

.ufh-pattern-guide ul {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.ufh-pattern-guide li {
  position: relative;
  padding-left: 15px;
}

.ufh-pattern-guide li::before {
  position: absolute;
  left: 0;
  top: .1em;
  color: var(--c-green);
  content: '✓';
  font-weight: 800;
}

.ufh-guide-visual {
  display: grid;
  min-height: 132px;
  place-items: center;
  border: 1px solid #dce2e5;
  border-radius: 10px;
  background-color: #eef2f3;
  background-image: linear-gradient(rgba(77, 91, 104, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(77, 91, 104, .05) 1px, transparent 1px);
  background-size: 14px 14px;
}

.ufh-guide-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  font-size: 42px;
  box-shadow: 0 9px 24px rgba(31, 43, 60, .1);
}

.ufh-diameter-table td:first-child,
.ufh-diameter-table td:nth-child(2) {
  white-space: nowrap;
}

.ufh-warning {
  display: flex;
  gap: 12px;
  margin-top: 13px;
  padding: 15px;
  border: 1px solid #f2d0ba;
  border-left: 4px solid var(--c-accent);
  border-radius: 10px;
  background: #fff7f1;
  color: #6e5a4e;
}

.ufh-warning > span {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--ufh-warm-soft);
  color: var(--c-accent);
  font-weight: 800;
}

.ufh-warning p {
  margin: 0;
  font-size: 11px;
  line-height: 1.65;
}

.ufh-warning strong {
  color: var(--c-navy);
}

.ufh-source-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 18px;
  padding: 21px;
  border: 1px solid #dce0e3;
  border-radius: 13px;
  background: linear-gradient(145deg, #fff, #f8f9f8);
  box-shadow: 0 7px 24px rgba(31, 43, 60, .04);
}

.ufh-source-card > div:first-child {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 13px;
  background: var(--c-navy);
  color: #ff9c59;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
}

.ufh-source-card h2 {
  margin-bottom: 8px;
}

.ufh-source-card p {
  color: var(--c-muted);
  font-size: 12px;
  line-height: 1.7;
}

.ufh-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 15px;
  margin-top: 14px;
}

.ufh-checklist span {
  display: flex;
  gap: 7px;
  color: #526171;
  font-size: 11px;
  line-height: 1.45;
}

.ufh-checklist span::first-letter {
  color: var(--c-green);
}

.ufh-source-line {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid #e2e3e2;
  font-size: 10px !important;
}

.ufh-source-line a {
  color: var(--c-accent-h);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(200, 85, 8, .3);
  text-underline-offset: 2px;
}

.ufh-source-line a:hover {
  text-decoration-color: currentColor;
}

.ufh-faq .faq {
  margin-bottom: 0;
}

.ufh-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.ufh-related-grid > a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--c-border);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(31, 43, 60, .035);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.ufh-related-grid > a:hover {
  border-color: var(--c-accent);
  box-shadow: 0 8px 24px rgba(232, 101, 10, .08);
  transform: translateY(-2px);
}

.ufh-related-grid > a > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: var(--ufh-warm-soft);
  color: var(--c-accent);
  font-size: 20px;
}

.ufh-related-grid strong {
  display: block;
  color: var(--c-navy);
  font-size: 13px;
}

.ufh-related-grid p {
  margin: 3px 0 0;
  color: var(--c-muted);
  font-size: 10px;
  line-height: 1.5;
}

.ufh-related-grid b {
  color: var(--c-accent);
  font-size: 18px;
}

.ufh-app button:focus-visible,
.ufh-related-grid a:focus-visible,
.ufh-source-line a:focus-visible {
  outline: 3px solid rgba(232, 101, 10, .26);
  outline-offset: 2px;
}

@media (max-width: 1000px) {
  .ufh-layout {
    grid-template-columns: 1fr;
  }

  .ufh-results {
    position: relative;
    top: auto;
  }

  .ufh-svg-wrap {
    min-height: 380px;
  }

  .ufh-content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ufh-content-grid--formula {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.35fr);
  }

  .ufh-pattern-guide article {
    grid-template-columns: 112px minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .ufh-page-hero {
    padding: 31px 14px 28px;
  }

  .ufh-page-hero h1 {
    line-height: 1.2;
  }

  .ufh-hero-badge {
    max-width: calc(100% - 8px);
    justify-content: center;
    text-align: center;
    white-space: normal;
  }

  .ufh-app {
    padding: 20px 12px 30px;
  }

  .ufh-app .panel {
    padding: 17px;
    border-radius: 13px;
  }

  .ufh-comparison {
    padding: 17px !important;
  }

  .ufh-svg-wrap {
    min-height: 320px;
  }

  .ufh-svg-wrap svg {
    min-width: 430px;
  }

  .ufh-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ufh-stat-grid span {
    min-height: 0;
  }

  .ufh-pattern-guide {
    grid-template-columns: 1fr;
  }

  .ufh-pattern-guide article {
    grid-template-columns: 126px minmax(0, 1fr);
  }

  .ufh-content-grid,
  .ufh-content-grid--formula {
    grid-template-columns: 1fr;
  }

  .ufh-source-card {
    padding: 18px;
  }

  .ufh-subheading h2 {
    font-size: 15px;
  }
}

@media (max-width: 500px) {
  .ufh-fields-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .ufh-diameter-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ufh-quick-spacing {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ufh-pattern-options {
    grid-template-columns: 1fr;
  }

  .ufh-pattern-options > button {
    min-height: 66px;
  }

  .ufh-plan-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .ufh-plan-toolbar button {
    justify-content: center;
    width: 100%;
  }

  .ufh-svg-wrap {
    min-height: 265px;
  }

  .ufh-svg-wrap svg {
    min-width: 390px;
  }

  .ufh-plan-legend {
    gap: 6px 10px;
  }

  .ufh-result-hero {
    padding: 16px;
  }

  .ufh-result-hero strong {
    font-size: 30px;
  }

  .ufh-stat-grid {
    gap: 7px;
  }

  .ufh-stat-grid article {
    padding: 10px;
  }

  .ufh-loop-list {
    grid-template-columns: 1fr;
  }

  .ufh-subheading {
    flex-direction: column;
    gap: 5px;
  }

  .ufh-pattern-guide article {
    grid-template-columns: 1fr;
  }

  .ufh-guide-visual {
    min-height: 145px;
  }

  .ufh-source-card {
    grid-template-columns: 1fr;
  }

  .ufh-source-card > div:first-child {
    width: 48px;
    height: 48px;
  }

  .ufh-checklist {
    grid-template-columns: 1fr;
  }

  .ufh-warning {
    padding: 13px;
  }

  .ufh-related-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ufh-svg-pipe {
    animation: none;
  }
  .ufh-number-stepper,
  .ufh-number-stepper > button,
  .ufh-diameter-options button,
  .ufh-quick-spacing button,
  .ufh-pattern-options > button,
  .ufh-plan-toolbar button,
  .ufh-results-content,
  .ufh-comparison-table tbody tr,
  .ufh-related-grid > a {
    scroll-behavior: auto;
    transition: none;
  }

  .ufh-pattern-options > button > .ufh-pattern-icon,
  .ufh-pattern-options > button > .ufh-pattern-copy {
    transition: none;
  }
}

@page {
  size: A4 portrait;
  margin: 11mm;
}

@media print {
  .ufh-controls,
  .ufh-comparison,
  .ufh-result-error,
  .ufh-plan-toolbar button {
    display: none !important;
  }

  .main-content,
  .ufh-app {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .ufh-layout {
    display: block !important;
  }

  .ufh-results {
    position: static !important;
    top: auto !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  .ufh-results-content {
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  html,
  body,
  main,
  .main-content,
  .ufh-app,
  .ufh-layout,
  .ufh-results,
  .ufh-results-content {
    background: #fff !important;
    background-image: none !important;
  }

  .ufh-results-content > .panel__title {
    display: none !important;
  }

  .print-settings {
    break-inside: avoid;
  }

  .ufh-plan-card {
    overflow: visible !important;
    border-color: #9c9c96 !important;
    break-inside: avoid;
    box-shadow: none !important;
  }

  .ufh-plan-toolbar {
    padding: 7px 10px !important;
  }

  .ufh-svg-wrap {
    min-height: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  .ufh-svg-wrap svg {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: 116mm !important;
  }

  .ufh-svg-pipe {
    animation: none !important;
  }

  .ufh-plan-legend,
  .ufh-plan-disclaimer {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  .ufh-result-hero,
  .ufh-stat-grid,
  .ufh-breakdown,
  .ufh-loop-section {
    break-inside: avoid;
  }

  .ufh-result-hero {
    margin-top: 10px !important;
    padding: 10px 14px !important;
  }

  .ufh-result-hero strong {
    font-size: 25px !important;
  }

  .ufh-stat-grid {
    gap: 5px !important;
    margin-top: 7px !important;
  }

  .ufh-stat-grid article {
    padding: 7px !important;
  }

  .ufh-breakdown > div {
    min-height: 0 !important;
    padding: 5px 9px !important;
  }

  .ufh-loop-section {
    margin-top: 10px !important;
  }

  .ufh-loop-list > div,
  .ufh-loop-item {
    padding: 6px 8px !important;
  }

  .print-footer-note {
    display: block !important;
    margin: 16px 0 0 !important;
    padding: 8px 0 0 !important;
    border: 0 !important;
    border-top: 1px solid #aaa !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #555 !important;
    font-size: 9px !important;
    line-height: 1.45 !important;
    text-align: left !important;
  }

  .print-footer-note::before,
  .print-footer-note::after {
    display: none !important;
    content: none !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
