:root {
  color-scheme: dark;
  --background: #07111f;
  --background-deep: #030a13;
  --surface: #101d2d;
  --surface-soft: #15253a;
  --surface-raised: #192b40;
  --line: #2b3d53;
  --line-strong: #49627f;
  --text: #f5f8fb;
  --text-muted: #aab8ca;
  --cyan: #65dcff;
  --cyan-ink: #06202a;
  --gold: #ffd27a;
  --gold-ink: #2b1c03;
  --green: #6ee7a8;
  --green-strong: #a0f5c8;
  --green-ink: #052416;
  --danger: #ff929d;
  --warning: #ffd27a;
  --focus: #c1f9ff;
  --shadow: 0 30px 90px rgb(0 0 0 / 0.36);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 4%, rgb(101 220 255 / 0.12), transparent 30rem),
    radial-gradient(circle at 92% 65%, rgb(110 231 168 / 0.1), transparent 36rem),
    linear-gradient(145deg, var(--background-deep), var(--background));
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.09;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--green-ink);
  background: var(--green);
  box-shadow: 0 10px 30px rgb(110 231 168 / 0.2);
}

.tool-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.tool-nav-link {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.tool-nav-link:hover {
  color: var(--text);
  border-color: var(--line);
}

.tool-nav-link.is-active {
  color: var(--green-ink);
  background: var(--green);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-trigger {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  background: rgb(16 29 45 / 0.78);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 750;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.settings-trigger:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-soft);
}

.version {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.brand:focus-visible,
.tool-nav-link:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

main {
  padding: 8px 0 54px;
}

.planner {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgb(9 20 33 / 0.95);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.planner-intro {
  padding: 30px clamp(22px, 4vw, 50px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  background:
    radial-gradient(circle at 12% 0%, rgb(110 231 168 / 0.11), transparent 20rem),
    linear-gradient(120deg, rgb(18 35 51 / 0.82), rgb(9 20 33 / 0.82));
}

.eyebrow,
.section-kicker {
  margin: 0 0 7px;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--green);
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.intro-copy {
  max-width: 475px;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

#planner-form {
  padding: clamp(16px, 3vw, 30px);
  display: grid;
  gap: 20px;
}

.workspace-section {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.12);
}

.workspace-section::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
}

.current-section {
  background: linear-gradient(145deg, rgb(17 34 50 / 0.97), rgb(12 25 39 / 0.97));
}

.current-section::after {
  background: radial-gradient(circle at 0% 0%, rgb(101 220 255 / 0.1), transparent 23rem);
}

.levels-section {
  border-color: rgb(255 210 122 / 0.27);
  background: linear-gradient(145deg, rgb(38 32 25 / 0.92), rgb(16 26 39 / 0.98));
}

.levels-section::after {
  background: radial-gradient(circle at 0% 0%, rgb(255 210 122 / 0.11), transparent 22rem);
}

.proposal-section {
  border-color: rgb(110 231 168 / 0.3);
  background: linear-gradient(145deg, rgb(17 40 37 / 0.94), rgb(12 26 39 / 0.98));
}

.proposal-section::after {
  background: radial-gradient(circle at 0% 0%, rgb(110 231 168 / 0.12), transparent 24rem);
}

.section-marker,
.section-content {
  position: relative;
  z-index: 1;
}

.section-marker {
  padding-top: 27px;
  border-right: 1px solid var(--line);
  color: var(--cyan);
  font-size: 0.71rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  background: rgb(4 13 23 / 0.32);
}

.levels-section .section-marker {
  border-color: rgb(255 210 122 / 0.2);
  color: var(--gold);
}

.proposal-section .section-marker {
  border-color: rgb(110 231 168 / 0.2);
  color: var(--green);
}

.section-content {
  min-width: 0;
  padding: clamp(20px, 3vw, 30px);
}

.section-heading {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.section-kicker {
  color: var(--cyan);
}

.levels-section .section-kicker {
  color: var(--gold);
}

.proposal-section .section-kicker {
  color: var(--green);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  letter-spacing: -0.03em;
}

.section-description {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.text-button {
  padding: 8px 10px;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 750;
}

.text-button:hover {
  color: var(--text);
}

.setup-grid {
  margin-bottom: 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field label,
.compact-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.input-wrap,
.mini-input-wrap {
  position: relative;
}

input {
  width: 100%;
  min-height: 49px;
  padding: 11px 84px 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: #071321;
  font-size: 0.98rem;
  font-weight: 720;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

input::placeholder {
  color: #6d8196;
  opacity: 1;
}

input:hover {
  border-color: #6683a5;
}

input:focus {
  border-color: var(--cyan);
  background: #091827;
  box-shadow: 0 0 0 4px rgb(101 220 255 / 0.11);
}

input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgb(255 146 157 / 0.1);
}

input.is-derived {
  border-color: #3b566c;
  color: #bdd0df;
  background: #0c1b2a;
}

.input-unit {
  position: absolute;
  top: 50%;
  right: 11px;
  transform: translateY(-50%);
  padding: 4px 7px;
  border-radius: 7px;
  color: var(--text-muted);
  background: var(--surface-soft);
  font-size: 0.65rem;
  font-weight: 800;
  pointer-events: none;
}

.mix-heading {
  margin-bottom: 13px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.mix-heading h3 {
  margin-bottom: 4px;
  font-size: 0.98rem;
}

.mix-heading p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.mix-total,
.maximum-badge,
.proposal-mode {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text-muted);
  background: rgb(4 13 23 / 0.38);
  font-size: 0.68rem;
  font-weight: 750;
}

.mix-total {
  min-width: 128px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mix-total strong,
.maximum-badge strong {
  color: var(--text);
  font-size: 0.9rem;
}

.mix-total[data-state="valid"] {
  border-color: rgb(110 231 168 / 0.46);
  color: var(--green-strong);
  background: rgb(110 231 168 / 0.07);
}

.mix-total[data-state="invalid"] {
  border-color: rgb(255 146 157 / 0.45);
  color: var(--danger);
  background: rgb(255 146 157 / 0.07);
}

.current-columns,
.current-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(100px, 0.55fr) minmax(72px, 0.38fr) minmax(240px, 1.25fr);
  gap: 12px;
  align-items: center;
}

.current-columns,
.proposal-columns {
  padding: 0 13px 8px;
  color: #73889d;
  font-size: 0.63rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.current-list,
.proposal-list {
  display: grid;
  gap: 8px;
}

.current-card,
.proposal-card {
  padding: 12px 13px;
  border: 1px solid rgb(73 98 127 / 0.62);
  border-radius: 14px;
  background: rgb(5 15 27 / 0.55);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.current-card:focus-within {
  border-color: rgb(101 220 255 / 0.5);
  background: rgb(8 24 38 / 0.78);
}

.category-name,
.proposal-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-brands {
  flex: 0 0 auto;
  min-width: 34px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.brand-icon {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 0.5rem;
  font-style: normal;
  font-weight: 950;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-mastercard {
  border: 1px solid rgb(255 255 255 / 0.12);
  background: #f5f4ef;
}

.brand-mastercard i {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #eb001b;
}

.brand-mastercard i:first-child {
  left: 6px;
}

.brand-mastercard i:last-child {
  right: 6px;
  background: #f79e1b;
  mix-blend-mode: multiply;
}

.brand-visa {
  border: 1px solid rgb(29 62 143 / 0.22);
  color: #173b8f;
  background: linear-gradient(to bottom, #fff 0 75%, #f6b40e 75% 100%);
  font-size: 0.47rem;
  font-style: italic;
  letter-spacing: -0.05em;
}

.brand-image {
  flex: 0 0 auto;
  height: 22px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 6px;
  display: block;
  object-fit: contain;
  background: #fff;
}

.brand-bancomat {
  width: 38px;
}

.brand-amex {
  width: 32px;
}

.category-name h4 {
  margin-bottom: 2px;
  overflow-wrap: anywhere;
  font-size: 0.85rem;
}

.category-name p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.64rem;
}

.category-volume,
.proposal-volume,
.proposal-cost,
.minimum-rate {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.category-volume,
.proposal-cost {
  color: var(--text);
}

.compact-field label {
  display: none;
}

.mini-input-wrap input {
  min-height: 42px;
  padding: 9px 32px 9px 10px;
  border-radius: 10px;
  font-size: 0.86rem;
}

.mini-input-wrap > span {
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.69rem;
  font-weight: 800;
  pointer-events: none;
}

.current-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.field-or {
  color: #64798f;
  font-size: 0.64rem;
  font-weight: 800;
}

.current-summary {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 24px;
  align-items: center;
  background: rgb(5 15 27 / 0.44);
}

.current-summary div {
  display: grid;
  gap: 3px;
}

.current-summary span {
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 750;
}

.current-summary strong {
  font-size: 0.9rem;
}

.current-summary p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.73rem;
  text-align: right;
}

.current-summary[data-state="valid"] {
  border-color: rgb(101 220 255 / 0.3);
}

.current-summary[data-state="valid"] p {
  color: var(--cyan);
}

.current-summary[data-state="invalid"] p {
  color: var(--danger);
}

.maximum-badge {
  min-width: 148px;
  border-color: rgb(255 210 122 / 0.28);
  display: grid;
  gap: 3px;
  text-align: right;
}

.maximum-badge strong {
  color: var(--gold);
}

.plan-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

.plan-option {
  min-height: 126px;
  padding: 15px;
  border: 1px solid rgb(255 210 122 / 0.2);
  border-radius: 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "index copy"
    "value value";
  gap: 10px;
  color: var(--text);
  background: rgb(5 15 27 / 0.52);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.plan-option:not(:disabled):hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.plan-option.is-selected {
  border-color: var(--gold);
  background:
    radial-gradient(circle at 100% 0%, rgb(255 210 122 / 0.13), transparent 12rem),
    rgb(35 29 21 / 0.76);
  box-shadow: inset 0 0 0 1px rgb(255 210 122 / 0.14), 0 12px 30px rgb(0 0 0 / 0.15);
}

.plan-option:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.plan-index {
  grid-area: index;
  width: 29px;
  height: 29px;
  border: 1px solid rgb(255 210 122 / 0.26);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 900;
}

.plan-copy {
  grid-area: copy;
  display: grid;
  gap: 3px;
}

.plan-copy strong {
  font-size: 0.86rem;
}

.plan-copy small {
  color: var(--text-muted);
  font-size: 0.64rem;
}

.plan-value {
  grid-area: value;
  align-self: end;
  color: var(--gold);
  font-size: 1.07rem;
  font-weight: 850;
}

.proposal-mode {
  border-color: rgb(110 231 168 / 0.34);
  color: var(--green-strong);
  background: rgb(110 231 168 / 0.08);
}

.proposal-columns,
.proposal-card {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(100px, 0.65fr) minmax(80px, 0.45fr) minmax(115px, 0.58fr) minmax(100px, 0.62fr);
  gap: 12px;
  align-items: center;
}

.proposal-card {
  border-color: rgb(61 102 91 / 0.75);
}

.proposal-card:focus-within {
  border-color: rgb(110 231 168 / 0.55);
  background: rgb(7 28 28 / 0.7);
}

.proposal-name strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.minimum-rate {
  color: var(--green-strong);
}

.proposal-field input {
  border-color: rgb(110 231 168 / 0.42);
  color: var(--green-strong);
  background: rgb(110 231 168 / 0.05);
}

.proposal-field input:focus {
  border-color: var(--green);
  background: rgb(110 231 168 / 0.09);
  box-shadow: 0 0 0 4px rgb(110 231 168 / 0.1);
}

.proposal-field input.is-below-floor {
  border-color: var(--warning);
  color: var(--warning);
  background: rgb(255 210 122 / 0.06);
}

.rate-note {
  min-height: 12px;
  margin-top: 3px;
  display: block;
  color: var(--warning);
  font-size: 0.56rem;
  line-height: 1.15;
}

.result-panel {
  margin-top: 16px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  grid-template-columns: minmax(230px, 0.82fr) minmax(0, 1.45fr);
  gap: 28px;
  align-items: center;
  background: linear-gradient(145deg, #172638, #111d2c);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.result-panel[data-state="positive"] {
  border-color: rgb(110 231 168 / 0.58);
  background:
    radial-gradient(circle at 4% 20%, rgb(110 231 168 / 0.18), transparent 19rem),
    linear-gradient(145deg, #142b27, #101e29);
}

.result-panel[data-state="negative"] {
  border-color: rgb(255 146 157 / 0.56);
  background:
    radial-gradient(circle at 4% 20%, rgb(255 146 157 / 0.14), transparent 19rem),
    linear-gradient(145deg, #301b25, #171b29);
}

.result-panel[data-state="warning"] {
  border-color: rgb(255 210 122 / 0.54);
  background:
    radial-gradient(circle at 4% 20%, rgb(255 210 122 / 0.13), transparent 19rem),
    linear-gradient(145deg, #2c281d, #171d28);
}

.result-main p {
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-main strong {
  display: block;
  font-size: clamp(1.4rem, 3vw, 2.15rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.result-panel[data-state="positive"] .result-main strong {
  color: var(--green-strong);
}

.result-panel[data-state="negative"] .result-main strong {
  color: var(--danger);
}

.result-panel[data-state="warning"] .result-main strong {
  color: var(--warning);
}

.result-main > span {
  margin-top: 8px;
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.result-main .result-warning {
  width: fit-content;
  margin-top: 10px;
  padding: 6px 8px;
  border: 1px solid rgb(255 210 122 / 0.38);
  border-radius: 8px;
  color: var(--warning);
  background: rgb(255 210 122 / 0.07);
  font-size: 0.65rem;
  font-weight: 760;
}

.result-main .result-warning[hidden] {
  display: none;
}

.result-metrics {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.result-metrics div {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgb(255 255 255 / 0.07);
  border-radius: 11px;
  background: rgb(0 0 0 / 0.13);
}

.result-metrics dt {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 750;
}

.result-metrics dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  font-weight: 800;
}

.site-footer {
  padding: 0 12px 24px;
  color: rgb(170 184 202 / 0.58);
  text-align: center;
}

.site-footer small {
  font-size: 0.68rem;
  letter-spacing: 0.015em;
}

.settings-dialog {
  width: min(620px, calc(100% - 24px));
  max-height: min(720px, calc(100dvh - 24px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--text);
  background: linear-gradient(145deg, #142337, #0a1624);
  box-shadow: 0 34px 100px rgb(0 0 0 / 0.66);
}

.settings-dialog::backdrop {
  background: rgb(1 7 13 / 0.78);
  backdrop-filter: blur(8px);
}

.settings-dialog-card {
  padding: clamp(20px, 4vw, 30px);
}

.settings-dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.settings-dialog-header .section-kicker {
  color: var(--cyan);
}

.settings-dialog-header h2 {
  margin-bottom: 0;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  letter-spacing: -0.03em;
}

.dialog-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: rgb(255 255 255 / 0.03);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.settings-dialog-intro {
  margin: 14px 0 22px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

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

.settings-grid input {
  min-height: 45px;
  padding-right: 44px;
  font-size: 0.9rem;
}

.settings-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 0.7rem;
}

.settings-status[data-state="info"] {
  color: var(--green-strong);
}

.settings-dialog-actions {
  margin-top: 8px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-action-group {
  display: flex;
  gap: 8px;
}

.dialog-button {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 780;
}

.dialog-button-quiet {
  padding-left: 0;
  border-color: transparent;
  color: var(--text-muted);
  background: transparent;
}

.dialog-button-primary {
  border-color: var(--green);
  color: var(--green-ink);
  background: var(--green);
}

.dialog-button:hover {
  filter: brightness(1.08);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript-message {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 16px;
  border-radius: 12px;
  color: #3b1010;
  background: #ffd5d5;
  text-align: center;
  font-weight: 700;
}

@media (max-width: 980px) {
  .current-columns,
  .proposal-columns {
    display: none;
  }

  .current-card {
    grid-template-columns: minmax(170px, 1fr) minmax(95px, 0.58fr) 85px minmax(220px, 1.2fr);
  }

  .proposal-card {
    grid-template-columns: minmax(170px, 1fr) minmax(95px, 0.62fr) 75px 105px minmax(90px, 0.55fr);
  }

  .compact-field label {
    display: block;
  }

  .result-panel {
    grid-template-columns: 1fr;
    gap: 17px;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 18px, 680px);
  }

  .site-header {
    min-height: 58px;
    gap: 8px;
  }

  .brand span:last-child,
  .version {
    display: none;
  }

  .settings-trigger {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .settings-trigger-label {
    display: none;
  }

  .tool-nav {
    justify-content: flex-end;
  }

  .tool-nav-link {
    padding: 7px 9px;
    font-size: 0.72rem;
  }

  main {
    padding: 2px 0 16px;
  }

  .planner {
    border-radius: 18px;
  }

  .planner-intro {
    padding: 20px;
    display: block;
  }

  .intro-copy {
    margin: 10px 0 0;
    font-size: 0.86rem;
  }

  #planner-form {
    padding: 11px;
    gap: 12px;
  }

  .workspace-section {
    border-radius: 16px;
    grid-template-columns: 1fr;
  }

  .section-marker {
    padding: 9px 15px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }

  .section-content {
    padding: 16px;
  }

  .section-heading {
    margin-bottom: 17px;
  }

  .setup-grid {
    grid-template-columns: 1fr;
    margin-bottom: 22px;
  }

  .current-card {
    grid-template-columns: minmax(0, 1fr) 82px;
    grid-template-areas:
      "name mix"
      "volume volume"
      "current current";
    gap: 10px;
  }

  .category-name {
    grid-area: name;
  }

  .current-card .category-volume {
    grid-area: volume;
    padding-top: 7px;
    border-top: 1px solid rgb(73 98 127 / 0.34);
  }

  .current-card .category-volume::before {
    content: "Volume categoria  ";
    color: var(--text-muted);
    font-size: 0.62rem;
  }

  .mix-field {
    grid-area: mix;
  }

  .current-fields {
    grid-area: current;
  }

  .current-summary {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .current-summary p {
    grid-column: 1 / -1;
    text-align: left;
  }

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

  .plan-option {
    min-height: 0;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "index copy value";
    align-items: center;
  }

  .plan-value {
    align-self: center;
    text-align: right;
  }

  .proposal-card {
    grid-template-columns: minmax(0, 1fr) 105px;
    grid-template-areas:
      "name rate"
      "volume cost"
      "minimum minimum";
    gap: 9px 12px;
  }

  .proposal-name {
    grid-area: name;
  }

  .proposal-volume {
    grid-area: volume;
  }

  .proposal-volume::before {
    content: "Volume  ";
    color: var(--text-muted);
    font-size: 0.6rem;
  }

  .minimum-rate {
    grid-area: minimum;
    padding-top: 7px;
    border-top: 1px solid rgb(61 102 91 / 0.38);
  }

  .minimum-rate::before {
    content: "Minimo  ";
    color: var(--text-muted);
    font-size: 0.6rem;
  }

  .proposal-field {
    grid-area: rate;
  }

  .proposal-cost {
    grid-area: cost;
    text-align: right;
  }

  .proposal-cost::before {
    content: "Costo  ";
    color: var(--text-muted);
    font-size: 0.6rem;
  }

  .result-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.85rem;
  }

  .section-heading,
  .mix-heading {
    align-items: flex-start;
  }

  .section-description {
    font-size: 0.76rem;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid input {
    min-height: 41px;
  }

  .brand-icon {
    width: 29px;
    height: 20px;
  }

  .brand-image {
    height: 20px;
  }

  .settings-dialog {
    width: calc(100% - 18px);
    border-radius: 17px;
  }

  .settings-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-action-group {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
  }

  .dialog-button-quiet {
    width: fit-content;
  }

  .mix-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mix-total {
    min-width: 112px;
    padding: 8px 9px;
  }

  .current-card,
  .proposal-card {
    padding: 11px;
  }

  .category-name h4,
  .proposal-name strong {
    font-size: 0.8rem;
  }

  .current-fields {
    gap: 5px;
  }

  .mini-input-wrap input {
    min-height: 41px;
    font-size: 0.82rem;
  }

  .maximum-badge {
    min-width: 126px;
  }

  .plan-option {
    padding: 12px;
  }

  .plan-value {
    font-size: 0.92rem;
  }

  .proposal-mode {
    padding: 8px 9px;
    font-size: 0.62rem;
  }

  .result-metrics dd {
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
