/* Reverse Sales Tax Calculator — tool styles.
   Every value from a design token (§4.2). Scoped to .ftb-tool-rst. */

/* ------------------------------------------------------------------ tabs */

.ftb-tool-rst .ftb-rst-tabs{display:flex;flex-wrap:wrap;gap:var(--ftb-space-2);
  margin-bottom:var(--ftb-space-5);border-bottom:1px solid var(--ftb-border)}
.ftb-tool-rst .ftb-rst-tab{padding:var(--ftb-space-3) var(--ftb-space-4);
  min-height:var(--ftb-tap);font:inherit;font-size:var(--ftb-text-sm);
  font-weight:var(--ftb-fw-semi);color:var(--ftb-text-muted);background:none;
  border:none;border-bottom:3px solid transparent;margin-bottom:-1px;cursor:pointer}
.ftb-tool-rst .ftb-rst-tab:hover{color:var(--ftb-text)}
.ftb-tool-rst .ftb-rst-tab[aria-selected=true]{color:var(--ftb-primary);
  border-bottom-color:var(--ftb-primary)}
.ftb-tool-rst .ftb-rst-tab:focus-visible{outline:2px solid var(--ftb-primary);
  outline-offset:-2px;border-radius:var(--ftb-radius-sm)}

/* ---------------------------------------------------------------- inputs */

.ftb-tool-rst .ftb-rst-currency{max-width:18rem}
.ftb-tool-rst .ftb-rst-lede{margin:0 0 var(--ftb-space-5);
  font-size:var(--ftb-text-sm);line-height:var(--ftb-lh-snug);color:var(--ftb-text-muted)}

.ftb-tool-rst .ftb-rst-row{display:grid;gap:var(--ftb-space-4);
  grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr))}
.ftb-tool-rst .ftb-rst-row > *{min-width:0}
.ftb-tool-rst .ftb-rst-row .ftb-field{margin-bottom:0}

.ftb-tool-rst .ftb-rst-adv{margin:var(--ftb-space-5) 0;
  border:1px solid var(--ftb-border);border-radius:var(--ftb-radius);
  background:var(--ftb-surface)}
.ftb-tool-rst .ftb-rst-adv summary{padding:var(--ftb-space-3) var(--ftb-space-4);
  min-height:var(--ftb-tap);display:flex;align-items:center;cursor:pointer;
  font-size:var(--ftb-text-sm);font-weight:var(--ftb-fw-semi)}
.ftb-tool-rst .ftb-rst-adv summary:focus-visible{outline:2px solid var(--ftb-primary);
  outline-offset:-2px}
.ftb-tool-rst .ftb-rst-advbody{padding:0 var(--ftb-space-4) var(--ftb-space-4)}
.ftb-tool-rst .ftb-rst-advbody .ftb-tool-stat{margin:0 0 var(--ftb-space-4)}

.ftb-tool-rst .ftb-rst-splitbar{display:flex;flex-wrap:wrap;align-items:flex-end;
  gap:var(--ftb-space-4);margin-top:var(--ftb-space-4)}
.ftb-tool-rst .ftb-rst-stated{margin-bottom:0;min-width:min(100%,18rem)}

/* -------------------------------------------------------------- headline */

.ftb-tool-rst .ftb-rst-result{margin-top:var(--ftb-space-5)}
.ftb-tool-rst .ftb-rst-headline{padding:var(--ftb-space-5);
  margin-bottom:var(--ftb-space-5);background:var(--ftb-surface-2);
  border:1px solid var(--ftb-border);border-radius:var(--ftb-radius-lg);
  text-align:center}
.ftb-tool-rst .ftb-rst-headline-label{margin:0;font-size:var(--ftb-text-sm);
  color:var(--ftb-text-muted);text-transform:uppercase;letter-spacing:.06em}
/* Height reserved so the number arriving never shifts the page (§10, CLS). */
.ftb-tool-rst .ftb-rst-big{margin:var(--ftb-space-2) 0 0;min-height:1.2em;
  font-size:var(--ftb-text-3xl);font-weight:var(--ftb-fw-bold);line-height:1.15;
  letter-spacing:var(--ftb-ls-tight);font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere}
.ftb-tool-rst .ftb-rst-headline-sub{margin:var(--ftb-space-2) 0 0;min-height:1.4em;
  font-size:var(--ftb-text-sm);line-height:var(--ftb-lh-snug);color:var(--ftb-text-muted)}

/* --------------------------------------------------------------- tables */

.ftb-tool-rst .ftb-rst-table{width:100%;border-collapse:collapse;
  font-size:var(--ftb-text-sm);line-height:var(--ftb-lh-snug)}
.ftb-tool-rst .ftb-rst-table th,
.ftb-tool-rst .ftb-rst-table td{padding:var(--ftb-space-3);
  border-bottom:1px solid var(--ftb-border);vertical-align:top}
.ftb-tool-rst .ftb-rst-table thead th{text-align:left;
  font-weight:var(--ftb-fw-semi);color:var(--ftb-text-muted);white-space:nowrap}
.ftb-tool-rst .ftb-rst-table tbody th{text-align:left;font-weight:var(--ftb-fw-medium)}
.ftb-tool-rst .ftb-rst-table tbody td{text-align:right;white-space:nowrap;
  font-variant-numeric:tabular-nums}
.ftb-tool-rst .ftb-rst-table .ftb-rst-note{display:block;
  font-size:var(--ftb-text-sm);font-weight:var(--ftb-fw-normal);
  color:var(--ftb-text-muted);white-space:normal}
.ftb-tool-rst .ftb-rst-table tr[data-kind=total] th,
.ftb-tool-rst .ftb-rst-table tr[data-kind=total] td{font-weight:var(--ftb-fw-bold);
  border-top:2px solid var(--ftb-border-strong);border-bottom:none;
  font-size:var(--ftb-text-base)}
.ftb-tool-rst .ftb-rst-table tr[data-kind=sub] th,
.ftb-tool-rst .ftb-rst-table tr[data-kind=sub] td{font-weight:var(--ftb-fw-semi);
  background:var(--ftb-surface-2)}

/* The split-mode input grid needs left-aligned, full-width controls. */
.ftb-tool-rst .ftb-rst-input-table td{text-align:left;white-space:normal}
.ftb-tool-rst .ftb-rst-input-table input[type=text]{min-width:6rem}
.ftb-tool-rst .ftb-rst-input-table select{min-width:7rem}
.ftb-tool-rst .ftb-rst-input-table .ftb-rst-del{width:var(--ftb-tap);height:var(--ftb-tap);
  display:inline-flex;align-items:center;justify-content:center;
  color:var(--ftb-text-muted);background:none;border:1px solid var(--ftb-border-interactive);
  border-radius:var(--ftb-radius);cursor:pointer;font-size:var(--ftb-text-base)}
.ftb-tool-rst .ftb-rst-input-table .ftb-rst-del:hover{color:var(--ftb-error);
  border-color:var(--ftb-error)}

/* ----------------------------------------------------------- the band */

/* The honesty panel. Warning colours because it is a caveat, and these are
   the pairs core.css already contrast-checks in both themes. */
.ftb-tool-rst .ftb-rst-band{margin-top:var(--ftb-space-5);
  padding:var(--ftb-space-4) var(--ftb-space-5);
  background:var(--ftb-warning-soft);color:var(--ftb-warning);
  border:1px solid currentColor;border-left-width:4px;border-radius:var(--ftb-radius)}
.ftb-tool-rst .ftb-rst-band h3{margin:0;font-size:var(--ftb-text-base);
  letter-spacing:var(--ftb-ls-tight);color:inherit}
.ftb-tool-rst .ftb-rst-band p{margin:var(--ftb-space-2) 0 0;
  font-size:var(--ftb-text-sm);line-height:var(--ftb-lh-snug);color:var(--ftb-text)}

.ftb-tool-rst .ftb-rst-warnings{margin-top:var(--ftb-space-5);
  padding:var(--ftb-space-4) var(--ftb-space-5);background:var(--ftb-surface-2);
  border-radius:var(--ftb-radius)}
.ftb-tool-rst .ftb-rst-warnings ul{margin:0;padding-left:var(--ftb-space-5);
  font-size:var(--ftb-text-sm);line-height:var(--ftb-lh-snug);color:var(--ftb-text)}
.ftb-tool-rst .ftb-rst-warnings li + li{margin-top:var(--ftb-space-2)}

.ftb-tool-rst .ftb-tool-disclaimer{margin:var(--ftb-space-6) 0 0;
  padding:var(--ftb-space-5);background:var(--ftb-surface-2);
  border-radius:var(--ftb-radius);font-size:var(--ftb-text-sm);
  line-height:var(--ftb-lh-snug);color:var(--ftb-text-muted)}

/* ------------------------------------------------------------ narrow UI */

@media (max-width:479px){
  .ftb-tool-rst .ftb-rst-tab{flex:1 1 auto;padding:var(--ftb-space-3) var(--ftb-space-2);
    text-align:center}
  .ftb-tool-rst .ftb-rst-big{font-size:var(--ftb-text-2xl)}
  .ftb-tool-rst .ftb-rst-table th,
  .ftb-tool-rst .ftb-rst-table td{padding:var(--ftb-space-2)}
  .ftb-tool-rst .ftb-tool-actions .ftb-btn{flex:1 1 auto}
}
