/* IBAN Validator, Country Parser & Batch Checker (/tools/iban-validator-parser/), 2026-11-30.
   Uses tokens from ft-shell-20261106.css and components from ft-tool-20261106.css.
   Pre-renders the GB82 WEST 1234 5698 7654 32 breakdown so CLS stays 0.000,
   keeps every interactive control >= 44px, and prevents horizontal scroll down to 320px. */

.ft-tool .ft-field,
.ft-tool fieldset,
.ft-tool .ft-panel,
.ft-tool .ft-stack,
.ft-tool .ft-btnrow {
  min-width: 0;
  max-width: 100%;
}

.ft-tool input:not([type="checkbox"]):not([type="radio"]),
.ft-tool select,
.ft-tool textarea,
.ft-tool .ft-input,
.ft-tool .ft-select,
.ft-tool .ft-textarea {
  font-size: max(16px, 1rem);
  min-height: 44px;
  max-width: 100%;
  box-sizing: border-box;
}

.ft-tool .ft-select {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ft-tool .ft-btn {
  min-width: 44px;
  min-height: 44px;
  height: auto;
  padding-block: 0.48rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Mode switcher */
.ibv-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), minmax(0, 1fr)));
  gap: 0.45rem;
}

.ibv-mode-btn[aria-pressed="true"] {
  border-color: var(--ft-accent);
  background: var(--ft-accent-soft);
  color: var(--ft-ink);
  font-weight: 650;
}

/* Monospace IBAN input & batch textarea */
.ibv-iban-input {
  font-family: var(--ft-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-weight: 600;
  letter-spacing: 0.025em;
}

.ibv-batch-textarea {
  width: 100%;
  font-family: var(--ft-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  line-height: 1.45;
  resize: vertical;
}

/* Presets */
.ibv-presets {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-2);
}

.ibv-presets__label {
  margin: 0;
  color: var(--ft-ink);
  font-size: var(--ft-text-sm);
  font-weight: 650;
}

.ibv-presets__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), minmax(0, 1fr)));
  gap: 0.45rem;
}

.ibv-preset {
  justify-content: flex-start;
  text-align: left;
  font-size: var(--ft-text-sm);
  line-height: 1.3;
}

.ibv-preset[aria-pressed="true"] {
  border-color: var(--ft-accent);
  background: var(--ft-accent-soft);
  color: var(--ft-ink);
  font-weight: 650;
}

.ibv-country-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-2);
}

/* Verdict card */
.ibv-verdict {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-3);
  padding: var(--ft-space-3);
  border: 1px solid color-mix(in srgb, var(--ft-accent) 45%, var(--ft-line));
  border-radius: var(--ft-radius);
  background: color-mix(in srgb, var(--ft-surface) 88%, var(--ft-accent-soft));
  min-width: 0;
}

.ibv-verdict--invalid {
  border-color: rgba(217, 119, 6, 0.6);
  background: color-mix(in srgb, var(--ft-surface) 90%, rgba(245, 158, 11, 0.16));
}

.ibv-pillbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0;
  font-size: var(--ft-text-xs);
  min-width: 0;
}

.ibv-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  border: 1px solid var(--ft-line);
  background: var(--ft-surface);
  color: var(--ft-ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.ibv-pill--ok {
  border-color: color-mix(in srgb, var(--ft-accent) 55%, var(--ft-line));
  background: var(--ft-accent-soft);
  color: var(--ft-ink);
}

.ibv-pill--warn {
  border-color: rgba(217, 119, 6, 0.6);
  background: color-mix(in srgb, var(--ft-surface) 82%, rgba(245, 158, 11, 0.24));
  color: var(--ft-ink);
}

.ibv-headline {
  margin: 0;
  color: var(--ft-ink);
  font-family: var(--ft-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: clamp(1.12rem, 2.2vw, 1.5rem);
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.ibv-summary {
  margin: 0;
  color: var(--ft-ink-2);
  font-size: var(--ft-text-sm);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Typo / transposition suggestions card */
.ibv-suggestions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-2);
  padding: var(--ft-space-3);
  border: 1px solid rgba(217, 119, 6, 0.55);
  border-radius: var(--ft-radius);
  background: color-mix(in srgb, var(--ft-surface) 92%, rgba(245, 158, 11, 0.14));
  min-width: 0;
}

.ibv-suggestions__title {
  margin: 0;
  color: var(--ft-ink);
  font-size: var(--ft-text-sm);
  font-weight: 700;
}

.ibv-suggestions__warn {
  margin: 0;
  padding: 0.48rem 0.65rem;
  border-radius: var(--ft-radius);
  border: 1px solid rgba(217, 119, 6, 0.45);
  background: var(--ft-surface);
  color: var(--ft-ink);
  font-size: var(--ft-text-xs);
  line-height: 1.45;
}

.ibv-suggestions__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.ibv-sug-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--ft-radius);
  border: 1px solid var(--ft-line);
  background: var(--ft-surface);
  min-width: 0;
}

.ibv-sug-item__info {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.ibv-sug-item__code {
  font-family: var(--ft-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--ft-text-sm);
  font-weight: 700;
  color: var(--ft-ink);
  overflow-wrap: anywhere;
}

.ibv-sug-item__reason {
  font-size: var(--ft-text-xs);
  color: var(--ft-ink-2);
  overflow-wrap: anywhere;
}

/* Section cards */
.ibv-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-2);
  padding: var(--ft-space-3);
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
  min-width: 0;
}

.ibv-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem var(--ft-space-2);
}

.ibv-subhead__title {
  margin: 0;
  color: var(--ft-ink);
  font-size: var(--ft-text-sm);
  font-weight: 650;
}

.ibv-subhead__note {
  margin: 0;
  color: var(--ft-ink-2);
  font-size: var(--ft-text-xs);
}

/* Color-coded character segments */
.ibv-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}

.ibv-seg {
  display: grid;
  gap: 0.16rem;
  padding: 0.48rem 0.65rem;
  border-radius: var(--ft-radius);
  border: 1.5px solid var(--ft-line);
  background: var(--ft-surface);
  min-width: 0;
  max-width: 100%;
}

.ibv-seg--country {
  border-color: color-mix(in srgb, #0284c7 55%, var(--ft-line));
  background: color-mix(in srgb, var(--ft-surface) 86%, rgba(2, 132, 199, 0.2));
}

.ibv-seg--check {
  border-color: color-mix(in srgb, #d97706 58%, var(--ft-line));
  background: color-mix(in srgb, var(--ft-surface) 86%, rgba(217, 119, 6, 0.2));
}

.ibv-seg--bank {
  border-color: color-mix(in srgb, var(--ft-accent) 60%, var(--ft-line));
  background: color-mix(in srgb, var(--ft-surface) 84%, var(--ft-accent-soft));
}

.ibv-seg--branch {
  border-color: color-mix(in srgb, #7c3aed 52%, var(--ft-line));
  background: color-mix(in srgb, var(--ft-surface) 87%, rgba(124, 58, 237, 0.2));
}

.ibv-seg--natcheck {
  border-color: color-mix(in srgb, #db2777 52%, var(--ft-line));
  background: color-mix(in srgb, var(--ft-surface) 87%, rgba(219, 39, 119, 0.2));
}

.ibv-seg--account {
  border-color: color-mix(in srgb, var(--ft-ink-2) 45%, var(--ft-line));
  background: color-mix(in srgb, var(--ft-surface) 92%, var(--ft-ink) 5%);
}

.ibv-seg__val {
  font-family: var(--ft-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--ft-text-md);
  font-weight: 750;
  letter-spacing: 0.04em;
  color: var(--ft-ink);
  overflow-wrap: anywhere;
}

.ibv-seg__label {
  font-size: var(--ft-text-xs);
  font-weight: 650;
  color: var(--ft-ink);
}

.ibv-seg__pos {
  font-size: 0.72rem;
  color: var(--ft-ink-2);
}

/* Rule checks bar */
.ibv-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ibv-check-chip {
  padding: 0.2rem 0.52rem;
  border-radius: 999px;
  border: 1px solid var(--ft-line);
  background: var(--ft-surface);
  font-size: var(--ft-text-xs);
  color: var(--ft-ink-2);
}

.ibv-check-chip--pass {
  border-color: color-mix(in srgb, var(--ft-accent) 50%, var(--ft-line));
  color: var(--ft-ink);
  font-weight: 600;
}

.ibv-check-chip--fail {
  border-color: rgba(220, 38, 38, 0.55);
  background: color-mix(in srgb, var(--ft-surface) 88%, rgba(220, 38, 38, 0.16));
  color: var(--ft-ink);
  font-weight: 650;
}

/* MOD 97-10 steps */
.ibv-steps {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.55rem;
  color: var(--ft-ink);
  font-size: var(--ft-text-xs);
  line-height: 1.45;
}

.ibv-steps li {
  overflow-wrap: anywhere;
}

.ibv-mono-box {
  display: block;
  margin-top: 0.22rem;
  padding: 0.36rem 0.52rem;
  border-radius: var(--ft-radius);
  border: 1px solid var(--ft-line);
  background: color-mix(in srgb, var(--ft-surface) 92%, var(--ft-ink) 3%);
  font-family: var(--ft-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--ft-text-xs);
  color: var(--ft-ink);
  overflow-wrap: anywhere;
}

/* 4-Tile Stats */
.ibv-stats {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.8rem), minmax(0, 1fr)));
}

/* Batch table */
.ibv-batch-note {
  margin: 0;
  padding: 0.45rem 0.65rem;
  border-radius: var(--ft-radius);
  border: 1px solid rgba(217, 119, 6, 0.5);
  background: color-mix(in srgb, var(--ft-surface) 90%, rgba(245, 158, 11, 0.14));
  color: var(--ft-ink);
  font-size: var(--ft-text-xs);
}

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

.ibv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ft-text-xs);
}

.ibv-table th,
.ibv-table td {
  padding: 0.46rem 0.58rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--ft-line);
  overflow-wrap: anywhere;
}

.ibv-table th {
  font-weight: 650;
  color: var(--ft-ink);
  background: color-mix(in srgb, var(--ft-surface) 88%, var(--ft-ink) 4%);
  white-space: nowrap;
}

.ibv-table tbody tr:last-child td {
  border-bottom: 0;
}

.ibv-table tr.is-invalid td {
  background: color-mix(in srgb, var(--ft-surface) 92%, rgba(245, 158, 11, 0.14));
}

.ibv-code-cell {
  font-family: var(--ft-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-weight: 650;
  color: var(--ft-ink);
}

.ibv-sub-cell {
  display: block;
  color: var(--ft-ink-2);
  font-weight: 400;
}

.ibv-after-example {
  margin-top: var(--ft-space-3);
}

@media (max-width: 480px) {
  .ibv-verdict,
  .ibv-card,
  .ibv-suggestions {
    padding: var(--ft-space-2);
  }
  .ibv-table th,
  .ibv-table td {
    padding: 0.38rem 0.45rem;
  }
}
