:root {
  --navy: #14213d;
  --navy-2: #223254;
  --yellow: #ffd84d;
  --yellow-soft: #fff8d8;
  --pink: #ff5f9e;
  --pink-soft: #fff0f6;
  --ink: #172033;
  --muted: #6d7585;
  --canvas: #f5f7fb;
  --paper: #ffffff;
  --line: #dce2ec;
  --line-strong: #c8d0dd;
  --shadow: 0 18px 52px rgba(20, 33, 61, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 216, 77, 0.16), transparent 26rem),
    radial-gradient(circle at 94% 12%, rgba(255, 95, 158, 0.09), transparent 24rem),
    var(--canvas);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
button, input, select { font: inherit; }
button, label, select, input[type="range"] { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, label:has(input:focus-visible) {
  outline: 3px solid rgba(255, 95, 158, 0.28);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.site-header, .page-shell {
  width: min(1480px, calc(100% - 32px));
  margin-inline: auto;
}
.site-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  text-decoration: none;
}
.brand-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(20, 33, 61, 0.13);
}
.brand-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand strong {
  display: block;
  font-family: "BC Alphapipe", "Arial Rounded MT Bold", "Manrope", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.page-shell { margin-top: 0; margin-bottom: 12px; }
.intro {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(480px, 1.25fr) minmax(320px, 0.75fr);
  align-items: center;
  gap: 36px;
  padding: 6px 2px 12px;
}
.eyebrow {
  margin: 0 0 3px;
  color: #bb2f69;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.intro h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.7rem, 2.5vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.calculator {
  display: grid;
  grid-template-rows: 50px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
}
.mode-tabs {
  display: flex;
  align-items: end;
  gap: 4px;
  margin: 0;
  padding: 7px 18px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 253, 0.82);
}
.mode-tab {
  min-width: 136px;
  min-height: 36px;
  padding: 7px 15px;
  border: 0;
  border-radius: 11px 11px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}
.mode-tab.is-active {
  position: relative;
  background: white;
  color: var(--navy);
  box-shadow: 0 -1px 0 var(--line), 1px 0 0 var(--line), -1px 0 0 var(--line);
}
.mode-tab.is-active::after {
  content: "";
  position: absolute;
  right: 15px;
  bottom: 0;
  left: 15px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--pink);
}
.mode-tab:not(.is-active):hover { color: var(--navy); background: rgba(255, 216, 77, 0.18); }
.tab-icon {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  margin-right: 5px;
  border-radius: 6px;
  background: var(--yellow);
  color: var(--navy);
  font-size: 0.72rem;
  vertical-align: -1px;
}
.tab-icon i { font-size: 0.84rem; }

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(405px, 0.72fr) minmax(560px, 1.28fr);
}
.controls-panel {
  min-width: 0;
  padding: 18px 22px 20px;
  border-right: 1px solid var(--line);
  background: rgba(249, 250, 253, 0.72);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.control-section + .control-section { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 9px; }
.section-heading.compact { align-items: center; margin-bottom: 8px; }
.step-dot {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
}
.section-heading h2 { margin: 1px 0 0; color: var(--navy); font-size: 0.87rem; line-height: 1.3; }
.section-heading p { margin: 1px 0 0; color: var(--muted); font-size: 0.68rem; }

.tool-cards { display: grid; gap: 6px; }
.tool-card {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 60px;
  gap: 10px;
  padding: 7px 40px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.tool-thumb {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: block;
  border: 1px solid rgba(255, 95, 158, 0.12);
  border-radius: 12px;
  background: #fff1f5;
  object-fit: cover;
}
.tool-card-copy { min-width: 0; }
.tool-card:hover { border-color: #aeb8c8; }
.tool-card.is-selected { border-color: var(--navy); background: var(--yellow-soft); box-shadow: inset 3px 0 0 var(--yellow); }
.tool-card input { position: absolute; opacity: 0; pointer-events: none; }
.tool-card-copy strong, .tool-card-copy small { display: block; }
.tool-card-copy strong { color: var(--navy); font-size: 0.76rem; line-height: 1.25; }
.tool-card-copy small { margin-top: 1px; color: var(--muted); font-size: 0.62rem; line-height: 1.25; }
.radio-mark {
  position: absolute;
  right: 13px;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: white;
}
.tool-card.is-selected .radio-mark { border-color: var(--pink); }
.tool-card.is-selected .radio-mark::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--pink); }
.tool-static {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #ecd05b;
  border-radius: 12px;
  background: var(--yellow-soft);
}
.tool-static strong, .tool-static small { display: block; }
.tool-static strong { color: var(--navy); font-size: 0.74rem; }
.tool-static small { margin-top: 2px; color: var(--muted); font-size: 0.62rem; }
.tool-mini-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 800;
}
.tool-mini-icon i { font-size: 0.82rem; }

.units-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -31px 0 9px auto;
  width: max-content;
}
.field-label { color: var(--muted); font-size: 0.68rem; font-weight: 600; }
.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}
.segment {
  min-width: 49px;
  min-height: 26px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}
.segment.is-active { background: var(--navy); color: white; }
.dimensions-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; }
.range-control { min-width: 0; display: grid; gap: 3px; }
.padding-control { grid-column: 1 / -1; }
.range-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.range-label-row label { color: var(--navy); font-size: 0.69rem; font-weight: 700; }
.number-wrap { position: relative; display: flex; align-items: center; }
.number-wrap input {
  width: 77px;
  min-height: 31px;
  padding: 5px 27px 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: right;
}
.input-unit { position: absolute; right: 8px; color: var(--muted); font-size: 0.59rem; font-weight: 700; pointer-events: none; }
input[type="range"] { width: 100%; height: 17px; margin: 1px 0 0; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink) 0 var(--range-progress, 50%), #dfe4ec var(--range-progress, 50%) 100%);
}
input[type="range"]::-moz-range-track { height: 5px; border-radius: 999px; background: #dfe4ec; }
input[type="range"]::-moz-range-progress { height: 5px; border-radius: 999px; background: var(--pink); }
input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5.5px;
  appearance: none;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 1px rgba(20, 33, 61, 0.16), 0 2px 5px rgba(20, 33, 61, 0.2);
}
input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 1px rgba(20, 33, 61, 0.16), 0 2px 5px rgba(20, 33, 61, 0.2);
}
.range-scale { display: flex; justify-content: space-between; color: #8b93a2; font-size: 0.56rem; }
.hint-button {
  width: 17px;
  height: 17px;
  margin-left: 3px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: white;
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 800;
  cursor: help;
}
.output-settings select {
  width: 100%;
  min-height: 36px;
  padding: 7px 36px 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: white;
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 700;
}

.box-size-controls { display: grid; gap: 12px; }
[data-box-preset] { display: grid; gap: 12px; }
.box-size-controls fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.box-size-controls legend { margin-bottom: 6px; color: var(--navy); font-size: 0.7rem; font-weight: 700; }
.size-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.size-chip {
  min-width: 0;
  min-height: 44px;
  padding: 5px 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  cursor: pointer;
}
.hint-button i { display: block; font-size: 0.7rem; }
.size-chip strong, .size-chip small { display: block; }
.size-chip strong { color: var(--navy); font-size: 0.72rem; }
.size-chip small { margin-top: 1px; color: var(--muted); font-size: 0.56rem; }
.size-chip.is-selected { border-color: var(--navy); background: var(--yellow); box-shadow: inset 0 0 0 1px var(--navy); }
.box-note { margin: 0; color: var(--muted); font-size: 0.64rem; }

.results-panel {
  position: relative;
  min-width: 0;
  padding: 18px 24px 76px;
  background: white;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.youtube-button {
  position: absolute;
  right: 24px;
  bottom: 22px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid rgba(255, 95, 158, 0.35);
  border-radius: 999px;
  background: white;
  color: var(--navy);
  box-shadow: 0 10px 28px rgba(20, 33, 61, 0.1);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.youtube-button i { color: var(--pink); font-size: 1.05rem; }
.youtube-button:hover { transform: translateY(-2px); border-color: var(--pink); box-shadow: 0 14px 32px rgba(20, 33, 61, 0.14); }
.youtube-button:focus-visible { outline: 3px solid rgba(255, 95, 158, 0.28); outline-offset: 2px; }
.results-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 108px;
  height: 108px;
  border-radius: 0 0 0 108px;
  background: linear-gradient(135deg, rgba(255, 216, 77, 0.23), rgba(255, 95, 158, 0.1));
  pointer-events: none;
}
.result-header { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.result-header h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.05rem, 1.5vw, 1.45rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.result-eyebrow { margin-bottom: 2px; }
.native-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  border: 1px solid #efd45f;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--navy);
  font-size: 0.61rem;
  font-weight: 800;
}
.diagram-card {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(100%, 340px);
  height: auto;
  min-height: 0;
  aspect-ratio: 460 / 360;
  margin: 4px auto 18px;
  padding: 0;
}
.diagram-card svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  overflow: visible;
  filter: drop-shadow(0 10px 17px rgba(20, 33, 61, 0.08));
}
.score-line { stroke: #758095; stroke-width: 2; stroke-dasharray: 7 7; }
.diagonal-line { fill: none; stroke: var(--pink); stroke-width: 3; stroke-dasharray: 7 6; }
#card-label, #box-center-label { font-family: inherit; font-size: 14px; font-weight: 800; fill: var(--navy); }

.result-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.result-card {
  position: relative;
  min-width: 0;
  min-height: 92px;
  padding: 14px 34px 12px 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f9fc;
}
.result-paper { background: var(--yellow-soft); border-color: #f1df91; }
.result-score { background: var(--pink-soft); border-color: #f5bfd4; }
.result-extra { background: #f1f4f9; }
.result-icon {
  float: left;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin: 1px 0 0 -32px;
  border-radius: 7px;
  background: white;
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(20, 33, 61, 0.08);
  font-size: 0.68rem;
  font-weight: 800;
}
.result-icon i { font-size: 0.84rem; }
.result-card p, .result-card strong, .result-card small { display: block; overflow-wrap: anywhere; }
.result-card p { margin: 0 0 5px; color: var(--muted); font-size: 0.62rem; font-weight: 700; }
.result-card strong { color: var(--navy); font-size: clamp(1.05rem, 1.45vw, 1.3rem); line-height: 1.15; }
.result-card small { min-height: 11px; margin-top: 7px; color: var(--muted); font-size: 0.56rem; line-height: 1.25; }
.result-paper small { color: #596375; font-size: 0.75rem; font-weight: 700; }
.result-info {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 19px;
  height: 19px;
  margin: 0;
  border-color: rgba(20, 33, 61, 0.12);
  background: rgba(255, 255, 255, 0.74);
  cursor: help;
}
.result-info i { font-size: 0.72rem; }

.status-note {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #c9d4e6;
  border-radius: 10px;
  background: #f5f8fc;
}
.status-note.is-warning { border-color: #efd45f; background: var(--yellow-soft); }
.status-note.is-error { border-color: #f2a7c3; background: var(--pink-soft); }
.status-symbol {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--navy);
  color: white;
  font-size: 0.6rem;
  font-weight: 900;
}
.status-symbol i { font-size: 0.75rem; }
.is-warning .status-symbol { background: var(--yellow); color: var(--navy); }
.is-error .status-symbol { background: var(--pink); }
.status-note p { margin: 0; color: #515b6d; font-size: 0.63rem; line-height: 1.35; }
.details-strip { display: none; }

.info-dialog {
  width: min(560px, calc(100% - 28px));
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(20, 33, 61, 0.28);
}
.info-dialog::backdrop { background: rgba(20, 33, 61, 0.45); backdrop-filter: blur(4px); }
.info-dialog h2 { margin: 0 34px 14px 0; color: var(--navy); font-size: clamp(1.35rem, 4vw, 1.85rem); line-height: 1.12; letter-spacing: -0.03em; }
.info-dialog p, .info-dialog li { color: #596375; }
.info-dialog ul { display: grid; gap: 8px; margin-bottom: 0; padding-left: 20px; }
.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f8fb;
  color: var(--navy);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.tooltip {
  position: fixed;
  z-index: 50;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--navy);
  color: white;
  box-shadow: 0 8px 28px rgba(20, 33, 61, 0.2);
  font-size: 0.65rem;
  line-height: 1.4;
  pointer-events: none;
}

@media (min-width: 981px) {
  .calculator { height: calc(100dvh - 148px); min-height: 570px; max-height: 750px; }
}
@media (max-width: 1180px) and (min-width: 981px) {
  .workspace { grid-template-columns: minmax(385px, 0.8fr) minmax(500px, 1.2fr); }
  .controls-panel { padding-inline: 18px; }
  .results-panel { padding-inline: 18px; }
}
@media (max-width: 980px) {
  body { font-size: 15px; }
  .site-header, .page-shell { width: min(100% - 24px, 760px); }
  .intro { min-height: 0; grid-template-columns: 1fr; gap: 9px; padding: 15px 2px 18px; }
  .calculator { display: block; }
  .mode-tabs { min-height: 50px; }
  .workspace { display: block; }
  .controls-panel { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .results-panel { overflow: visible; }
  .diagram-card { width: min(100%, 340px); height: auto; }
}
@media (max-width: 600px) {
  .site-header { min-height: 62px; }
  .brand small { display: none; }
  .about-trigger { padding-inline: 11px; font-size: 0.7rem; }
  .intro h1 { font-size: 1.75rem; }
  .calculator { border-radius: 18px; }
  .mode-tabs { padding-inline: 10px; }
  .mode-tab { flex: 1; min-width: 0; }
  .controls-panel, .results-panel { padding: 18px 14px 22px; }
  .units-row { width: 100%; margin: 0 0 12px; }
  .dimensions-stack { grid-template-columns: 1fr; gap: 12px; }
  .padding-control { grid-column: auto; }
  .number-wrap input { width: 88px; }
  .diagram-card { width: min(100%, 300px); height: auto; min-height: 0; margin: 4px auto 16px; }
  .result-header { display: grid; }
  .native-badge { width: max-content; }
  .result-grid { grid-template-columns: 1fr; }
  .result-card { min-height: 70px; }
  .size-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-dialog { padding: 28px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Creatywniej — soft app-like visual direction */
:root {
  --pink: #f45f9f;
  --pink-soft: #fff3f8;
  --coral: #ff927f;
  --yellow: #ffd84d;
  --yellow-soft: #fff8d8;
  --line: rgba(255, 255, 255, 0.76);
  --line-strong: rgba(121, 130, 151, 0.2);
  --shadow: 0 24px 68px rgba(38, 46, 72, 0.11);
}

body {
  color: #253149;
  font-weight: 400;
  line-height: 1.5;
  background:
    radial-gradient(ellipse 48rem 26rem at -8% -12%, rgba(244, 95, 159, 0.18), transparent 72%),
    radial-gradient(ellipse 34rem 24rem at 104% 2%, rgba(255, 216, 77, 0.09), transparent 74%),
    radial-gradient(ellipse 46rem 28rem at 65% 112%, rgba(147, 166, 220, 0.09), transparent 72%),
    linear-gradient(145deg, #fffdfd 0%, #fafbfe 52%, #f4f7fb 100%);
  background-attachment: fixed;
}

.brand-mark {
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 8px 20px rgba(43, 50, 73, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.brand strong { color: var(--navy); font-weight: 700; }
.brand small { color: rgba(20, 33, 61, 0.62); font-weight: 500; }

.about-trigger {
  border-color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 8px 24px rgba(43, 50, 73, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  font-weight: 600;
  backdrop-filter: blur(18px) saturate(140%);
}

.about-trigger:hover {
  border-color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 26px rgba(112, 44, 83, 0.15);
}

.intro { grid-template-columns: 1fr; gap: 0; padding: 8px 4px 14px; }
.intro h1 { font-weight: 600; letter-spacing: -0.035em; }
.eyebrow { color: #b83b70; font-weight: 700; }

.calculator {
  border-color: rgba(255, 255, 255, 0.78);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(30px) saturate(145%);
  backdrop-filter: blur(30px) saturate(145%);
}

.mode-tabs {
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-bottom-color: rgba(255, 255, 255, 0.64);
  background: rgba(255, 255, 255, 0.3);
}

.mode-tab {
  min-height: 34px;
  border-radius: 999px;
  font-weight: 600;
}

.mode-tab.is-active {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 20px rgba(112, 44, 83, 0.13), inset 0 1px 0 white;
}

.mode-tab.is-active::after { display: none; }
.mode-tab:not(.is-active):hover { background: rgba(255, 255, 255, 0.42); }

.tab-icon {
  border-radius: 50%;
  background: linear-gradient(145deg, var(--yellow), #ffea8d);
  box-shadow: 0 3px 8px rgba(177, 126, 18, 0.18);
}

.workspace {
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.controls-panel,
.results-panel {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.62));
  box-shadow: 0 14px 34px rgba(43, 50, 73, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  backdrop-filter: blur(22px) saturate(135%);
}

.controls-panel { padding: 19px 24px 22px; overflow-y: auto; overflow-x: hidden; }
.results-panel { padding: 20px 28px 22px; }
.controls-panel { border-right: 1px solid rgba(255, 255, 255, 0.78); }
.control-section + .control-section { margin-top: 15px; padding-top: 15px; border-top-color: rgba(115, 125, 148, 0.15); }
.section-heading { gap: 10px; margin-bottom: 11px; }
.section-heading h2 { font-weight: 600; }
.section-heading p { line-height: 1.45; }

.step-dot {
  border-radius: 50%;
  background: linear-gradient(145deg, var(--pink), var(--coral));
  box-shadow: 0 5px 12px rgba(226, 66, 142, 0.17);
  font-weight: 700;
}

.tool-card,
.tool-static,
.number-wrap input,
.segmented,
.output-settings select,
.size-chip {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 7px 18px rgba(43, 50, 73, 0.045), inset 0 1px 0 rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.tool-cards { gap: 7px; }
.tool-card { min-height: 60px; padding-block: 7px; border-radius: 15px; }
.tool-card-copy strong { font-weight: 600; }
.tool-card-copy small { font-weight: 400; line-height: 1.35; }
.tool-card:hover { border-color: rgba(255, 93, 168, 0.45); }
.tool-card.is-selected {
  border-color: rgba(255, 93, 168, 0.48);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 237, 245, 0.78));
  box-shadow: 0 9px 22px rgba(43, 50, 73, 0.06);
}

.radio-mark { border-color: rgba(114, 84, 104, 0.28); }
.tool-card.is-selected .radio-mark { border-color: var(--pink); }
.tool-card.is-selected .radio-mark::after { background: linear-gradient(145deg, var(--pink), var(--coral)); }

.tool-static {
  border-color: rgba(255, 93, 168, 0.25);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 228, 239, 0.78));
}

.tool-mini-icon { background: linear-gradient(145deg, var(--pink), var(--coral)); color: white; }
.field-label,
.range-label-row label,
.segment,
.output-settings select,
.size-chip strong { font-weight: 600; }
.number-wrap input { font-weight: 600; }
.input-unit { font-weight: 500; }
.segment.is-active { background: linear-gradient(145deg, var(--pink), var(--coral)); color: white; box-shadow: 0 5px 12px rgba(226, 66, 142, 0.15); }

input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--pink) 0, var(--coral) var(--range-progress, 50%), rgba(203, 196, 207, 0.42) var(--range-progress, 50%), rgba(203, 196, 207, 0.42) 100%);
}

input[type="range"]::-moz-range-progress { background: linear-gradient(90deg, var(--pink), var(--coral)); }
input[type="range"]::-webkit-slider-thumb { background: linear-gradient(145deg, var(--pink), var(--coral)); }
input[type="range"]::-moz-range-thumb { background: linear-gradient(145deg, var(--pink), var(--coral)); }

.size-chip.is-selected {
  border-color: rgba(255, 93, 168, 0.52);
  background: linear-gradient(145deg, #ff78b4, #ff9b80);
  color: white;
  box-shadow: 0 8px 18px rgba(226, 66, 142, 0.2);
}

.size-chip.is-selected strong,
.size-chip.is-selected small { color: white; }

.results-panel { overflow-y: auto; overflow-x: hidden; }
.results-panel::before {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 102, 177, 0.12), rgba(255, 153, 129, 0.04) 58%, transparent 72%);
  transform: translate(34px, -48px);
}

.result-header { gap: 22px; }
.result-header h2 { font-weight: 600; }
.native-badge {
  border-color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 7px 18px rgba(43, 50, 73, 0.05), inset 0 1px 0 white;
  font-weight: 600;
}

.diagram-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 8% 1%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 126, 181, 0.11), rgba(255, 183, 197, 0.04) 52%, transparent 72%);
  filter: blur(8px);
}

.diagram-card svg { position: relative; z-index: 1; filter: drop-shadow(0 14px 22px rgba(43, 50, 73, 0.1)); }
.score-line { stroke: #b18199; }
.diagonal-line { stroke: var(--pink); }
#card-label,
#box-center-label { font-weight: 700; }

.result-grid { gap: 10px; }
.result-grid.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-card {
  min-height: 92px;
  border-color: rgba(255, 255, 255, 0.88);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 9px 22px rgba(43, 50, 73, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.result-card p { font-weight: 600; }
.result-card strong { font-weight: 600; }
.result-paper small { font-weight: 600; }

.result-paper { background: linear-gradient(145deg, rgba(255, 255, 255, 0.91), rgba(255, 229, 241, 0.82)); }
.result-score { background: linear-gradient(145deg, rgba(255, 232, 244, 0.9), rgba(255, 227, 218, 0.78)); }
.result-extra { background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(237, 240, 251, 0.78)); }

.result-icon {
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 14px rgba(112, 44, 83, 0.12);
}

.status-note {
  border-color: rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.status-note p { line-height: 1.45; }
.status-note strong { font-weight: 600; }

.status-note.is-warning { border-color: rgba(244, 196, 45, 0.46); background: rgba(255, 247, 207, 0.7); }
.status-note.is-error { border-color: rgba(255, 93, 168, 0.42); background: rgba(255, 228, 240, 0.76); }
.status-symbol { border-radius: 50%; background: linear-gradient(145deg, var(--pink), var(--coral)); }
.is-warning .status-symbol { background: linear-gradient(145deg, var(--yellow), #ffeb89); }

.info-dialog {
  border-color: rgba(255, 255, 255, 0.88);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 238, 246, 0.9));
  box-shadow: 0 28px 90px rgba(72, 26, 55, 0.3), inset 0 1px 0 white;
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

.dialog-close { border-color: rgba(255, 255, 255, 0.9); border-radius: 50%; background: rgba(255, 255, 255, 0.76); }

@media (max-width: 980px) {
  .workspace { padding: 8px; }
  .controls-panel { margin-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.78); }
  .controls-panel,
  .results-panel { padding: 20px; }
}

@media (max-width: 600px) {
  body {
    background:
      radial-gradient(circle at 8% 0%, rgba(244, 95, 159, 0.16), transparent 26rem),
      linear-gradient(155deg, #fffafb 0%, #fbfbfe 44%, #f4f7fb 100%);
  }
  .calculator { border-radius: 25px; }
  .workspace { padding: 6px; }
  .controls-panel,
  .results-panel { padding: 18px 14px 22px; border-radius: 19px; }
  .result-grid.is-two { grid-template-columns: 1fr; }
}

/* Stałe miejsce na odnośnik do filmu w obu trybach kalkulatora. */
.results-panel { padding-bottom: 76px; }

@media (max-width: 600px) {
  .results-panel { padding-bottom: 76px; }
  .youtube-button { right: 14px; bottom: 18px; }
}

.intro {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 4px 2px 10px;
}
.intro-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid rgba(255, 95, 158, 0.16);
  border-radius: 999px;
  background: rgba(255, 232, 242, 0.72);
  color: #a72d61;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.intro h1.intro-chip {
  min-height: 30px;
  margin: 0;
  color: #a72d61;
  font-size: 0.68rem;
  line-height: normal;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.about-tool {
  display: grid;
  grid-template-columns: minmax(210px, 0.58fr) minmax(0, 1fr);
  gap: 28px;
  margin: 18px 2px 0;
  padding: 22px 24px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}
.about-tool .eyebrow { margin-bottom: 5px; }
.about-tool h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.about-tool-copy { display: grid; gap: 9px; }
.about-tool-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.58;
}

.site-header { margin-bottom: 14px; }
.intro {
  min-height: 50px;
  padding: 0 2px 14px;
}

.site-footer {
  width: min(1480px, calc(100% - 32px));
  margin: 22px auto 0;
  padding: 18px 2px 24px;
  border-top: 1px solid rgba(255, 95, 158, 0.16);
  color: var(--muted);
}
.footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.footer-credit {
  margin: 0;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 600;
}
.social-links {
  display: flex;
  align-items: center;
  gap: 7px;
}
.social-links a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(20, 33, 61, 0.08);
  border-radius: 50%;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 18px rgba(20, 33, 61, 0.05);
  font-size: 1.08rem;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.social-links a:hover {
  border-color: rgba(255, 95, 158, 0.2);
  color: #b92e69;
  background: var(--pink-soft);
  transform: translateY(-2px);
}
.social-links a:focus-visible {
  outline: 3px solid rgba(255, 95, 158, 0.28);
  outline-offset: 2px;
}
.footer-note {
  max-width: 850px;
  margin: 10px 0 0;
  font-size: 0.72rem;
  line-height: 1.55;
}

@media (max-width: 600px) {
  .about-tool { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; padding: 18px; }
  .site-footer { margin-top: 16px; padding-bottom: 20px; }
  .footer-main { align-items: flex-start; flex-direction: column; gap: 12px; }
  .social-links { flex-wrap: wrap; }
  .social-links a { width: 38px; height: 38px; }
  .footer-note { margin-top: 12px; }
}
