/* Logo reference: predominant red #b82015. All theme colors live here. */
:root {
  color-scheme: light;
  --brand: #b82015;
  --accent: #b82015;
  --page: #f5f5f5;
  --surface: #ffffff;
  --text: #262626;
  --muted: #606060;
  --border: #dedede;
  --input-border: #858585;
  --soft: #fbefed;
  --hover: #f8e5e2;
  --focus: #b82015;
  --readonly: #efefef;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #ff998d;
  --page: #151515;
  --surface: #222222;
  --text: #f5f5f5;
  --muted: #bdbdbd;
  --border: #464646;
  --input-border: #828282;
  --soft: #352421;
  --hover: #49302b;
  --focus: #ff998d;
  --readonly: #303030;
}
:root {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--page);
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  height: 88px;
  padding: 0 max(24px, calc((100vw - 1200px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-family: Georgia, serif;
  color: var(--accent);
  font-size: 34px;
  letter-spacing: -1px;
}
.brand span {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  margin-top: 4px;
  color: var(--muted);
}
.badge,
.version {
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  background: var(--surface);
  white-space: nowrap;
}
main {
  max-width: 1248px;
  padding: 32px 24px;
  margin: auto;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.6px;
  font-weight: bold;
  color: var(--accent);
  margin: 0 0 10px;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.8px;
  margin: 0 0 12px;
}
p {
  line-height: 1.5;
  color: var(--muted);
  margin: 8px 0;
}
h2 {
  font-size: 19px;
  margin: 0;
}
h3 {
  font-size: 18px;
  margin: 0;
}
.notice {
  background: var(--soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  padding: 14px 18px;
  margin: 24px 0;
  line-height: 1.5;
  font-size: 14px;
  color: var(--text);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-title > span,
.hint {
  font-size: 14px;
  color: var(--muted);
}
.hint {
  margin: 12px 0 20px;
}
.item {
  display: grid;
  grid-template-columns:
    minmax(120px, 2fr) minmax(65px, 0.7fr) minmax(105px, 1fr)
    38px;
  gap: 10px;
  margin: 16px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.item label {
  font-size: 14px;
  color: var(--muted);
  display: block;
}
.item input {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  padding: 11px 10px;
  font: inherit;
  margin-top: 8px;
  background: var(--surface);
  color: var(--text);
  min-width: 0;
}
.item input[aria-invalid="true"] {
  border-color: var(--accent);
  background: var(--soft);
}
.line-total {
  grid-column: 1/-1;
  font-size: 14px;
  color: var(--muted);
  text-align: right;
}
.remove {
  align-self: start;
  margin-top: 24px;
  font-size: 23px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 42px;
  color: var(--accent);
  cursor: pointer;
}
button.secondary {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}
button:hover {
  background: var(--hover);
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.gross {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
  align-items: center;
}
.gross strong {
  font-size: 24px;
  white-space: nowrap;
}
#error {
  color: var(--accent);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 14px;
}
.recommendation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--brand);
  color: var(--text);
  border-radius: 10px;
  padding: 26px;
}
.recommendation p,
.recommendation .eyebrow {
  color: var(--muted);
}
.recommendation h2 {
  font-size: 25px;
}
.saving {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 22px;
}
.saving span {
  display: block;
  font-size: 14px;
}
.saving strong {
  display: block;
  font-size: 32px;
  margin: 8px 0;
}
.next {
  margin-top: 20px;
}
.next p {
  font-size: 14px;
  margin: 14px 0;
}
.tiers {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.tiers span {
  font-size: 12px;
  color: var(--muted);
}
.tiers strong {
  display: block;
  font-size: 20px;
  color: var(--accent);
  margin-top: 5px;
}
.comparison {
  margin-top: 30px;
}
.scenario-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}
.total {
  display: block;
  font-size: 30px;
  margin: 20px 0 10px;
}
.scenario-grid p {
  font-size: 14px;
}
footer {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  padding-top: 26px;
}
@media (max-width: 800px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .intro {
    align-items: flex-start;
  }
  .version {
    display: none;
  }
  h1 {
    font-size: 26px;
  }
  .scenario-grid {
    gap: 16px;
  }
  .panel {
    padding: 20px;
  }
}
@media (max-width: 480px) {
  header {
    padding: 0 18px;
  }
  .badge {
    font-size: 12px;
  }
  main {
    padding: 24px 16px;
  }
  .item {
    grid-template-columns: 1fr 1fr 38px;
  }
  .item label:first-child {
    grid-column: 1/3;
  }
  .remove {
    grid-column: 3;
    grid-row: 1;
  }
  .item label:nth-child(2) {
    grid-column: 1;
  }
  .item label:nth-child(3) {
    grid-column: 2/4;
  }
  .scenario-grid {
    grid-template-columns: 1fr;
  }
  .gross {
    align-items: flex-start;
    flex-direction: column;
  }
  .intro p {
    font-size: 14px;
  }
}
.line-result {
  grid-column: 1/-1;
  font-size: 14px;
  line-height: 1.7;
  background: var(--soft);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.line-result:empty {
  display: none;
}
.item input[readonly] {
  background: var(--readonly);
  color: var(--muted);
}
.section-title {
  flex-wrap: wrap;
}
.recommendation strong {
  overflow-wrap: anywhere;
}

/* Brand and theme controls */
header {
  min-height: 88px;
  height: auto;
  gap: 20px;
  padding-block: 16px;
  border-top: 4px solid var(--brand);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 28px;
  letter-spacing: -1px;
}
.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  flex: none;
}
.brand .brand-name {
  font-size: inherit;
  letter-spacing: inherit;
  color: inherit;
  margin: 0;
}
.brand .brand-caption {
  font-size: 9px;
  letter-spacing: 1.4px;
  color: var(--muted);
}
.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}
.theme-toggle .sun {
  display: none;
}
[data-theme="dark"] .theme-toggle .sun {
  display: block;
}
[data-theme="dark"] .theme-toggle .moon {
  display: none;
}
#final-total {
  color: var(--accent);
  font-size: 36px;
}
.line-result {
  border-left: 3px solid var(--brand);
}
.item input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.workspace > *,
.scenario-grid > * {
  min-width: 0;
}
.remove {
  min-height: 44px;
}
@media (max-width: 600px) {
  .header-actions > .badge {
    display: none;
  }
  .brand {
    gap: 8px;
    font-size: 23px;
  }
  .brand-logo {
    width: 44px;
    height: 44px;
  }
  .brand .brand-caption {
    font-size: 8px;
    letter-spacing: 0.6px;
  }
  header {
    gap: 10px;
    padding-inline: 16px;
  }
  .theme-toggle {
    font-size: 13px;
    padding-inline: 9px;
  }
}
.order-label { display: block; font-size: 19px; font-weight: bold; margin-bottom: 12px; }
#order-gross { width: 100%; min-width: 0; font: bold 32px Arial, sans-serif; padding: 18px; border: 2px solid var(--input-border); border-radius: 8px; color: var(--text); background: var(--surface); }
.progressive-card { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 12px; padding: 18px 0; border-top: 1px solid var(--border); align-items: center; }
.progressive-card p, .progressive-card label { font-size: 13px; color: var(--muted); }
.progressive-card input { display: block; width: 100%; font: inherit; font-size: 18px; margin-top: 6px; padding: 12px; color: var(--text); background: var(--surface); border: 1px solid var(--input-border); border-radius: 6px; }
.breakdown { font-size: 14px; line-height: 1.5; border-top: 1px solid var(--border); padding-top: 12px; }
.breakdown dt { color: var(--muted); margin-top: 12px; }
.breakdown dd { margin: 2px 0 0; font-weight: bold; }
@media(max-width: 380px) { .progressive-card { grid-template-columns: minmax(0, 1fr) 80px; } #order-gross { font-size: 26px; } }

.pix-option { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--soft); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.pix-option input { width: 20px; height: 20px; margin: 0; flex: 0 0 20px; accent-color: var(--accent); }
.pix-option input:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
