:root {
  color-scheme: light;
  --bg: #f7faf9;
  --surface: #ffffff;
  --surface-soft: #edf5f2;
  --ink: #10201c;
  --muted: #61716c;
  --line: #dbe5e1;
  --teal: #057c70;
  --teal-dark: #075b54;
  --amber: #d9941e;
  --red: #b64a42;
  --shadow: 0 18px 50px rgba(32, 53, 47, 0.1);
  --radius: 8px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1715;
  --surface: #16221f;
  --surface-soft: #20312d;
  --ink: #edf7f4;
  --muted: #a5b7b1;
  --line: #31433e;
  --teal: #19a896;
  --teal-dark: #7de0d2;
  --amber: #f1b84b;
  --red: #ff8d82;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .app-shell {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 58%, transparent), transparent 320px),
    radial-gradient(circle at 78px 72px, rgba(147, 105, 36, 0.08), transparent 170px),
    radial-gradient(circle at 84% 8%, rgba(27, 116, 106, 0.12), transparent 340px),
    var(--bg);
}

:root[data-theme="dark"] .input-group-heading h3::before {
  background: linear-gradient(180deg, #188f82, #a7772d);
}

:root[data-theme="dark"] .summary-card::after {
  border-color: rgba(25, 168, 150, 0.07);
}

:root[data-theme="dark"] .summary-card.primary {
  background:
    radial-gradient(circle at 95% 0%, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(135deg, #117366, #0b4b46);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .summary-card.primary::after {
  border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .payline-row.total,
:root[data-theme="dark"] .metric-row.total {
  border-color: #188f82;
  background: #117366;
}

:root[data-theme="dark"] .status-pill {
  border-color: rgba(25, 168, 150, 0.24);
  background: rgba(25, 168, 150, 0.09);
  color: #99d6cc;
}

:root[data-theme="dark"] .check-row input:checked + span::before {
  border-color: #188f82;
  background: #117366;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 72%, transparent), transparent 360px),
    radial-gradient(circle at 78px 72px, color-mix(in srgb, var(--amber) 18%, transparent), transparent 170px),
    radial-gradient(circle at 84% 8%, color-mix(in srgb, var(--teal) 18%, transparent), transparent 360px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1500px;
  margin: 0 auto 12px;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 8px 12px rgba(32, 53, 47, 0.16));
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.05;
  font-weight: 760;
}

.brand span span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
}

.site-nav,
.tool-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.tool-actions {
  max-width: 1500px;
  margin: -4px auto 12px;
}

.site-nav > a,
.tools-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 780;
  text-decoration: none;
  cursor: pointer;
}

.site-nav > a:hover,
.tools-menu[open] summary,
.tools-menu summary:hover {
  background: var(--surface-soft);
}

.tools-menu {
  position: relative;
}

.tools-menu summary {
  list-style: none;
  gap: 6px;
}

.tools-menu summary::-webkit-details-marker {
  display: none;
}

.tools-menu summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.tools-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  width: min(330px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 8px;
}

.tools-panel a {
  display: grid;
  gap: 3px;
  border-radius: var(--radius);
  color: inherit;
  padding: 10px;
  text-decoration: none;
}

.tools-panel a:hover,
.tools-panel a[aria-current="page"] {
  background: var(--surface-soft);
}

.tools-panel strong,
.tools-panel span {
  display: block;
}

.tools-panel strong {
  font-size: 13px;
}

.tools-panel span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  max-width: 1500px;
  margin: 0 auto;
}

.panel,
.summary-card {
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-card,
.payline-row,
.metric-row {
  contain: layout paint;
}

.inputs-panel {
  position: sticky;
  top: 84px;
  padding: 14px;
}

.panel-heading,
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-heading h2,
.results-header h1 {
  margin: 0;
}

.panel-heading h2 {
  font-size: 15px;
  font-weight: 760;
}

.panel-heading span,
.panel-heading p,
.privacy-note,
.results-header p,
.smallprint {
  color: var(--muted);
  font-size: 12px;
}

.panel-heading p {
  margin: 0;
  line-height: 1.45;
}

.results-header {
  align-items: end;
  min-height: 40px;
  padding-top: 0;
}

.results-header h1 {
  font-size: clamp(28px, 4.2vw, 52px);
  line-height: 1;
}

.results-header p {
  margin: 8px 0 0;
  max-width: 680px;
  font-size: 15px;
  line-height: 1.45;
}

.form-grid,
.input-group {
  display: grid;
  gap: 9px;
}

.input-group {
  grid-template-columns: 1fr 1fr;
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
}

.input-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.input-group:last-child {
  padding-bottom: 0;
}

.input-group-heading {
  grid-column: 1 / -1;
  display: grid;
  gap: 2px;
}

.input-group-heading h3,
.input-group-heading p {
  margin: 0;
}

.input-group-heading h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 820;
}

.input-group-heading h3::before {
  content: "";
  width: 7px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--teal), var(--amber));
}

.input-group-heading p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.32;
}

label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

label span,
.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.field-block {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.full-span {
  grid-column: 1 / -1;
}

input,
select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 9px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(5, 124, 112, 0.14);
}

.money-input {
  display: grid;
  grid-template-columns: 42px 1fr;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.money-input:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(5, 124, 112, 0.14);
}

.money-input b {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--teal-dark);
  font-size: 11px;
}

.money-input input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.money-input.percent-input {
  grid-template-columns: 42px 1fr;
}

.time-input {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.time-input label {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 46%, transparent), transparent 78%),
    var(--surface);
  color: var(--muted);
  padding: 8px 10px 9px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.time-input label:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(5, 124, 112, 0.14);
}

.time-input label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.time-input input {
  min-width: 0;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  appearance: textfield;
  font-size: 24px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: left;
}

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

.check-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  cursor: pointer;
}

.check-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-row span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  transition: color 160ms ease;
}

.check-row span::before {
  content: "";
  width: 36px;
  height: 20px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--line);
  box-shadow: inset 0 0 0 1px rgba(16, 32, 28, 0.03);
  transition: background 160ms ease, border-color 160ms ease;
}

.check-row span::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(16, 32, 28, 0.22);
  transform: translateY(-50%);
  transition: transform 160ms ease;
}

.check-row input:checked + span {
  color: var(--ink);
}

.check-row input:checked + span::before {
  border-color: var(--teal);
  background: var(--teal);
}

.check-row input:checked + span::after {
  transform: translate(16px, -50%);
}

.check-row input:focus-visible + span::before {
  box-shadow: 0 0 0 3px rgba(5, 124, 112, 0.16);
}

[data-optional][hidden] {
  display: none;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  line-height: 1.35;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.results-area {
  display: grid;
  gap: 10px;
}

.results-area > * {
  min-width: 0;
}

.trust-strip,
.disclaimer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--teal) 24%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--surface) 84%, var(--surface-soft)), var(--surface));
  color: var(--muted);
  font-size: 13px;
}

.trust-strip strong,
.disclaimer strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid color-mix(in srgb, var(--teal) 32%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 10%, var(--surface));
  color: var(--teal-dark);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) repeat(3, minmax(150px, 1fr));
  gap: 9px;
}

.summary-card {
  position: relative;
  min-height: 106px;
  padding: 14px;
  overflow: hidden;
  box-shadow: none;
}

.summary-card::after {
  content: "";
  position: absolute;
  right: -32px;
  bottom: -42px;
  width: 128px;
  height: 128px;
  border: 18px solid color-mix(in srgb, var(--teal) 12%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.summary-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  max-width: 100%;
  font-size: var(--summary-value-size, 38px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.summary-card small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.4;
}

.summary-card.primary {
  border-color: transparent;
  background:
    radial-gradient(circle at 95% 0%, rgba(255, 255, 255, 0.14), transparent 34%),
    linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  box-shadow: 0 24px 70px rgba(5, 124, 112, 0.24);
}

.summary-card.primary::after {
  border-color: rgba(255, 255, 255, 0.18);
}

.summary-card.primary span,
.summary-card.primary small {
  color: rgba(255, 255, 255, 0.78);
}

.tab-grid {
  display: grid;
  gap: 14px;
  align-items: start;
}

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

.tab-grid .panel,
.projection-panel,
.explain-panel,
.seo-panel,
.examples-panel,
.source-panel,
.faq-panel,
.related-tools {
  padding: 18px;
}

.payline-list,
.metric-list,
.steps-list {
  display: grid;
  gap: 8px;
}

.period-note {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.projection-note {
  margin: -2px 0 14px;
  max-width: 920px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.projection-column {
  min-width: 0;
}

.projection-column h3,
.projection-column p {
  margin: 0;
}

.projection-column h3 {
  font-size: 15px;
  font-weight: 780;
}

.projection-column p {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.payline-row,
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-soft));
  font-size: 13px;
}

.payline-row span,
.metric-row span {
  color: var(--muted);
  font-weight: 680;
}

.payline-row strong,
.metric-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.payline-row.total,
.metric-row.total {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.payline-row.total span,
.metric-row.total span {
  color: rgba(255, 255, 255, 0.78);
}

.payline-row.muted {
  border-color: color-mix(in srgb, var(--teal) 24%, var(--line));
}

.steps-list {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.steps-list li::marker {
  color: var(--teal-dark);
  font-weight: 800;
}

.seo-panel h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.seo-panel h3 {
  margin: 18px 0 6px;
  font-size: 16px;
}

.seo-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.seo-panel p + p {
  margin-top: 10px;
}

.review-note {
  border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: color-mix(in srgb, var(--teal) 9%, var(--surface));
  padding: 10px 12px;
  color: var(--ink) !important;
  font-weight: 700;
}

.examples-panel,
.source-panel {
  display: grid;
  gap: 14px;
}

.section-note,
.source-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.licence-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

caption {
  padding: 10px 12px;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  font-weight: 760;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
}

th {
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-soft));
  color: var(--ink);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid color-mix(in srgb, var(--teal) 24%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
  color: var(--teal-dark);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 780;
  text-decoration: none;
}

.source-links a:hover,
.source-links a:focus {
  border-color: var(--teal);
  text-decoration: underline;
}

.faq-panel h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.faq-list article {
  min-width: 0;
}

.faq-list h3,
.faq-list p {
  margin: 0;
}

.faq-list h3 {
  font-size: 15px;
  line-height: 1.3;
}

.faq-list p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.related-tools {
  box-shadow: var(--shadow);
}

.related-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.related-tool-grid a {
  display: grid;
  gap: 5px;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-soft));
  color: inherit;
  padding: 12px;
  text-decoration: none;
}

.related-tool-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.icon-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.icon-button svg,
.primary-button svg,
.secondary-button svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.secondary-button:hover,
.icon-button:hover,
.related-tool-grid a:hover {
  border-color: var(--teal);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 16px 2px;
  color: var(--muted);
  font-size: 12px;
}

.site-footer span {
  color: var(--ink);
  font-weight: 780;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
  color: var(--teal-dark);
  text-decoration: underline;
}

.ad-slot[hidden] {
  display: none;
}

.ad-slot:not([hidden]) {
  display: grid;
  place-items: center;
  min-height: 90px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-soft));
  color: var(--muted);
}

.ad-slot-leaderboard {
  max-width: 970px;
  margin: 0 auto 12px;
}

.ad-slot-result:not([hidden]) {
  min-height: 120px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal) 42%, transparent);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .workspace,
  .two-columns {
    grid-template-columns: 1fr;
  }

  .inputs-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    padding: 10px;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--surface) 82%, transparent), transparent 240px),
      var(--bg);
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 10px;
    padding: 4px 0 0;
  }

  .brand {
    width: 100%;
    gap: 10px;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .brand strong {
    font-size: 22px;
    line-height: 1.1;
  }

  .brand span span {
    max-width: 31rem;
    font-size: 12px;
    line-height: 1.35;
  }

  .site-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 7px;
    justify-content: stretch;
    width: 100%;
  }

  .site-nav > a,
  .tools-menu summary,
  .site-nav .icon-button {
    min-height: 40px;
  }

  .tools-menu {
    min-width: 0;
  }

  .tools-menu summary {
    justify-content: center;
    width: 100%;
  }

  .tools-panel {
    left: 0;
    right: auto;
    width: min(340px, calc(100vw - 20px));
  }

  .tool-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
    margin: 0 auto 10px;
  }

  .icon-button {
    min-width: 0;
    min-height: 42px;
    padding: 0 10px;
    gap: 6px;
    white-space: normal;
    line-height: 1.15;
    font-size: 12px;
  }

  .icon-button svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
  }

  .workspace {
    gap: 12px;
  }

  .inputs-panel,
  .results-area,
  .results-header,
  .trust-strip,
  .summary-grid,
  .panel,
  .summary-card,
  .site-footer {
    min-width: 0;
    width: 100%;
  }

  .inputs-panel,
  .tab-grid .panel,
  .projection-panel,
  .explain-panel,
  .seo-panel,
  .examples-panel,
  .source-panel,
  .faq-panel,
  .related-tools {
    padding: 14px;
  }

  .panel,
  .summary-card {
    box-shadow: 0 10px 24px rgba(32, 53, 47, 0.07);
  }

  .panel-heading,
  .results-header,
  .trust-strip,
  .disclaimer {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .results-header h1 {
    font-size: 31px;
  }

  .results-header p {
    font-size: 13px;
  }

  .input-group,
  .summary-grid,
  .projection-grid,
  .faq-list,
  .related-tool-grid {
    grid-template-columns: 1fr;
  }

  input,
  select {
    min-height: 42px;
    font-size: 16px;
  }

  .money-input {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .summary-card {
    min-height: 0;
    padding: 12px;
  }

  .summary-card::after {
    right: -54px;
    bottom: -62px;
    width: 118px;
    height: 118px;
  }

  .summary-card strong {
    --summary-value-size: 28px;
    overflow-wrap: anywhere;
  }

  .payline-row,
  .metric-row {
    align-items: flex-start;
    min-height: 42px;
    padding: 9px;
  }

  .payline-row strong,
  .metric-row strong {
    max-width: 48%;
    overflow-wrap: anywhere;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 420px) {
  .site-nav {
    grid-template-columns: 1fr 1fr;
  }

  .site-nav .icon-button {
    grid-column: 1 / -1;
  }

  .tool-actions {
    grid-template-columns: 1fr;
  }

  .time-input {
    grid-template-columns: 1fr;
  }

  .time-input input {
    font-size: 22px;
  }
}

@media print {
  @page {
    margin: 12mm;
  }

  * {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
  }

  body {
    background: #fff;
    color: #111;
    font-size: 10pt;
  }

  .app-shell {
    padding: 0;
    background: #fff;
  }

  .site-nav,
  .tool-actions,
  .inputs-panel,
  .site-footer a,
  .site-footer button {
    display: none !important;
  }

  .topbar {
    position: static;
    margin-bottom: 8mm;
    border-bottom: 1px solid #999;
    padding-bottom: 5mm;
  }

  .workspace,
  .two-columns {
    display: block;
    max-width: none;
  }

  .results-area {
    gap: 4mm;
  }

  .panel,
  .summary-card,
  .trust-strip,
  .disclaimer {
    break-inside: avoid;
    box-shadow: none;
    border-color: #999;
    background: #fff;
    margin-bottom: 4mm;
  }

  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3mm;
  }

  .summary-card.primary {
    background: #fff;
    color: #111;
    border-color: #111;
  }

  .summary-card.primary span,
  .summary-card.primary small,
  .payline-row.total span,
  .metric-row.total span {
    color: #444;
  }

  .payline-row.total,
  .metric-row.total {
    background: #fff;
    color: #111;
    border-color: #111;
  }
}
