﻿/* 25% Tax-Free Lump Sum Optimiser (UK) */

:root {
  --tfls-ink: #0b1220;
  --tfls-muted: #1e293b;
  --tfls-navy: #083141;
  --tfls-teal: #0f766e;
}

#tfls-root,
.tfls-app {
  width: 100%;
  max-width: 1120px;
  margin: 28px auto 0;
  padding: 0 8px;
  box-sizing: border-box;
  overflow-x: clip;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--tfls-ink);
}

#tfls-root *,
.tfls-app * {
  box-sizing: border-box;
}

.tfls-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 30px;
  border: 2px solid rgba(8, 49, 65, 0.18);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.1);
  background: #fff;
  width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.tfls-hero {
  border: 2px solid #083141;
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(152deg, #0c4a6e 0%, #083141 42%, #0f172a 100%);
  color: #fff;
  box-shadow: 0 12px 32px rgba(8, 49, 65, 0.2);
}

.tfls-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9fd4cf;
}

.tfls-title {
  margin: 0 0 10px;
  font-size: clamp(1.55rem, 3.6vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #fff;
}

.tfls-sub {
  margin: 0;
  color: #fff;
  font-weight: 600;
  line-height: 1.55;
  max-width: 720px;
}

.tfls-hero-note {
  margin: 14px 0 0;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
}

.tfls-panel {
  margin-top: 18px;
  padding: 0;
  border-radius: 18px;
  border: 2px solid rgba(8, 49, 65, 0.14);
  background:
    linear-gradient(180deg, #ffffff 0%, #f4f8fa 100%);
  box-shadow: 0 14px 36px rgba(8, 49, 65, 0.08);
  overflow: hidden;
}

.tfls-panel__head {
  padding: 18px 20px 16px;
  background:
    linear-gradient(120deg, rgba(12, 74, 110, 0.08) 0%, rgba(15, 118, 110, 0.06) 48%, rgba(255, 255, 255, 0) 100%),
    #eef6f7;
  border-bottom: 1px solid rgba(8, 49, 65, 0.1);
}

.tfls-panel__eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0f766e;
}

.tfls-panel__title {
  margin: 0;
  font-size: clamp(1.45rem, 3.2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--tfls-navy);
}

.tfls-panel__lead {
  margin: 8px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.45;
  max-width: 36rem;
}

.tfls-panel__body {
  padding: 18px 20px 20px;
}

.tfls-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  align-items: stretch;
}

@media (min-width: 640px) {
  .tfls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tfls-field--wide {
    grid-column: 1 / -1;
  }
}

.tfls-field {
  display: grid;
  grid-template-rows: auto minmax(2.4rem, auto) auto;
  gap: 6px;
  min-width: 0;
  align-content: start;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #d7e2e8;
  background: #fff;
  box-shadow: 0 1px 0 rgba(8, 49, 65, 0.04);
}

.tfls-label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tfls-navy);
  line-height: 1.25;
  min-height: 0;
}

.tfls-hint {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.35;
  min-height: 2.4rem;
}

.tfls-hint--empty {
  visibility: hidden;
}

.tfls-input {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid #c5d4dc;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tfls-ink);
  background: #f8fafc;
  min-height: 48px;
  font-variant-numeric: tabular-nums;
}

.tfls-input:focus {
  outline: 2px solid #0f766e;
  outline-offset: 1px;
  border-color: #0f766e;
  background: #fff;
}

.tfls-results {
  margin-top: 18px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.tfls-impact {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border-radius: 18px;
  border: 2px solid #083141;
  background: #fff;
  overflow: hidden;
  contain: inline-size;
}

.tfls-scoreboard {
  padding: 22px 20px 18px;
  background: linear-gradient(145deg, #0c4a6e 0%, #083141 55%, #0f172a 100%);
  color: #fff;
}

.tfls-scoreboard__top {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.tfls-scoreboard__main {
  min-width: 0;
}

.tfls-scoreboard__label {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9fd4cf;
}

.tfls-scoreboard__path {
  margin: 0 0 10px;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
}

.tfls-scoreboard__amount {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 3.7rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.92;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.tfls-scoreboard__amount-label {
  margin: 8px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #cbd5e1;
}

.tfls-scoreboard__score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  padding: 16px 18px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.tfls-scoreboard__score-num {
  font-size: clamp(2.85rem, 7vw, 3.6rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.05em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.tfls-scoreboard__score-den {
  margin-top: 2px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #cbd5e1;
}

.tfls-scoreboard__score-label {
  margin-top: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9fd4cf;
}

.tfls-score-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

@media (min-width: 720px) {
  .tfls-score-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tfls-score-metric {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tfls-score-metric--gain {
  background: rgba(15, 118, 110, 0.22);
  border-color: rgba(159, 212, 207, 0.35);
}

.tfls-score-metric__k {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.tfls-score-metric__v {
  display: block;
  margin-top: 5px;
  font-size: clamp(0.95rem, 2.2vw, 1.22rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tfls-score-metric--gain .tfls-score-metric__v {
  color: #c5ebe7;
}

.tfls-rank-panel {
  padding: 16px 16px 18px;
  background: #fff;
}

.tfls-rank-panel__head {
  margin: 0 0 12px;
}

.tfls-rank-panel__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--tfls-navy);
}

.tfls-rank-panel__lead {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.4;
}

.tfls-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.tfls-rank-table th {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 2px solid #083141;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f766e;
  white-space: nowrap;
}

.tfls-rank-table td {
  padding: 14px 8px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.tfls-rank-num {
  color: #64748b !important;
  font-weight: 800 !important;
  font-size: 1.05rem !important;
}

.tfls-rank-num--top {
  color: var(--tfls-teal) !important;
}

.tfls-rank-title {
  font-weight: 800 !important;
  color: var(--tfls-navy) !important;
  min-width: 10rem;
  font-size: 1.02rem !important;
}

.tfls-rank-cash,
.tfls-rank-wealth {
  font-size: 1.08rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: #083141 !important;
}

.tfls-rank-score__pill {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  min-width: 3.6rem;
  padding: 7px 10px;
  border-radius: 999px;
  background: #083141;
  color: #fff;
  font-weight: 800;
  line-height: 1;
}

.tfls-rank-score__num {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.tfls-rank-score__den {
  font-size: 0.72rem;
  color: #cbd5e1;
}

.tfls-rank-row {
  cursor: pointer;
}

.tfls-rank-row:hover td {
  background: #f4f7f8;
}

.tfls-rank-row--on td {
  background: #eef6f7;
}

.tfls-rank-row--best td:first-child {
  box-shadow: inset 3px 0 0 #0f766e;
}

.tfls-rank-row--on .tfls-rank-title {
  color: #0f766e !important;
}

.tfls-rank-row--on .tfls-rank-score__pill,
.tfls-rank-row--best .tfls-rank-score__pill {
  background: #0f766e;
  color: #fff;
}

.tfls-rank-row--on .tfls-rank-score__den,
.tfls-rank-row--best .tfls-rank-score__den {
  color: #d8eeec;
}

.tfls-selected-blurb {
  margin: 12px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .tfls-scoreboard__top {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .tfls-scoreboard__score {
    flex-direction: row;
    justify-content: flex-start;
    gap: 8px;
    align-items: baseline;
    min-width: 0;
  }

  .tfls-scoreboard__score-label {
    margin-top: 0;
    margin-left: auto;
  }
}

.tfls-impact__verdict {
  margin: 0;
  padding: 14px 20px 4px;
  font-size: clamp(1.15rem, 2.8vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tfls-navy);
  line-height: 1.25;
}

.tfls-bars {
  display: grid;
  gap: 14px;
  padding: 12px 20px 20px;
  width: 100%;
  min-width: 0;
}

.tfls-bar {
  min-width: 0;
}

.tfls-bar__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.tfls-bar__name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--tfls-navy);
}

.tfls-bar__cash {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--tfls-ink);
}

.tfls-bar__track {
  height: 12px;
  border-radius: 999px;
  background: #e8eef2;
  overflow: hidden;
}

.tfls-bar__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0e7490, #0f766e);
  min-width: 4px;
}

.tfls-bar--win .tfls-bar__fill {
  background: linear-gradient(90deg, #083141, #0f766e);
}

.tfls-bar--win .tfls-bar__name,
.tfls-bar--win .tfls-bar__cash {
  color: var(--tfls-navy);
}

.tfls-bar__meta {
  margin-top: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.tfls-insight-block {
  margin-top: 16px;
  padding: 16px 16px 18px;
  border-radius: 16px;
  border: 1px solid #d4dee5;
  background: #fff;
}

.tfls-insight-block--data {
  border-color: #c7dde0;
  border-left: 4px solid #0f766e;
  background: #fff;
}

.tfls-insight-block--caveats {
  border-style: dashed;
  border-color: #b8c5ce;
  background: #f4f7f8;
}

.tfls-insight-block__eyebrow {
  margin: 0 0 4px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f766e;
}

.tfls-insight-block--caveats .tfls-insight-block__eyebrow {
  color: #64748b;
}

.tfls-insight-block__title {
  margin: 0 0 10px;
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tfls-navy);
}

.tfls-insight-block--caveats .tfls-insight-block__title {
  color: #334155;
}

.tfls-insight-block__lead {
  margin: -4px 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.45;
}

.tfls-chips {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

@media (min-width: 720px) {
  .tfls-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .tfls-chips {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tfls-chips--caveats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tfls-chip {
  min-width: 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #d7e2e8;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 0 rgba(8, 49, 65, 0.04);
}

.tfls-insight-block--data .tfls-chip {
  border-color: #c7dde0;
  background: #f7fbfb;
}

.tfls-insight-block--caveats .tfls-chip {
  background: #fff;
  border-color: #d9e2e8;
  box-shadow: none;
}

.tfls-chip__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tfls-chip__emoji {
  font-size: 1.05rem;
  line-height: 1;
}

.tfls-chip__k {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0f766e;
  line-height: 1.3;
}

.tfls-insight-block--caveats .tfls-chip__k {
  color: #64748b;
}

.tfls-chip__v {
  font-size: clamp(1.05rem, 2.3vw, 1.28rem);
  font-weight: 800;
  color: var(--tfls-navy);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.tfls-insight-block--caveats .tfls-chip__v {
  font-size: clamp(0.98rem, 2vw, 1.12rem);
  font-weight: 700;
  color: #334155;
}

.tfls-chip__s {
  font-size: 0.86rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.4;
}

.tfls-insight-block--caveats .tfls-chip__s {
  color: #64748b;
}

.tfls-priority {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #d4dee5;
  background: #fff;
}

.tfls-priority__label {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tfls-navy);
}

.tfls-priority__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tfls-prio {
  appearance: none;
  border: 1.5px solid #c5d4dc;
  background: #f8fafc;
  color: var(--tfls-navy);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 11px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tfls-prio:hover {
  border-color: #0f766e;
  color: #0f766e;
}

.tfls-prio--on {
  border-color: #083141;
  background: #083141;
  color: #fff;
}

.tfls-section {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #d4dee5;
  background: #fff;
}

.tfls-section__title {
  margin: 0 0 6px;
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tfls-navy);
}

.tfls-section__lead {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--tfls-ink);
  line-height: 1.45;
}

.tfls-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 260px;
}

.tfls-chart-wrap canvas {
  max-width: 100%;
}

.tfls-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.tfls-toggle-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid #c5d4dc;
  background: #fff;
  color: var(--tfls-navy);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.tfls-toggle-btn--active {
  background: #083141;
  border-color: #083141;
  color: #fff;
}

.tfls-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tfls-result-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  font-size: 0.88rem;
}

.tfls-result-table th {
  background: #ebf2f4;
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
  color: var(--tfls-navy);
  font-weight: 800;
}

.tfls-result-table td {
  padding: 8px;
  border-bottom: 1px solid #dde4e8;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tfls-details {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid #d4dee5;
  background: #f8fafc;
  padding: 0 14px;
}

.tfls-details > summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 750;
  color: var(--tfls-navy);
}

.tfls-warning {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #d4dee5;
  background: #f4f7f8;
  color: var(--tfls-ink);
}

.tfls-warning__title {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--tfls-navy);
}

.tfls-warning__list {
  margin: 10px 0 0;
  padding: 0 0 0 1.15em;
  font-size: 0.92rem;
  font-weight: 600;
}

.tfls-warning__list li {
  margin: 0 0 6px;
}

.tfls-methodology {
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid #d4dee5;
  background: #fff;
  padding: 0 14px;
}

.tfls-methodology > summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 750;
  color: var(--tfls-navy);
}

.tfls-methodology ul {
  margin: 0 0 12px;
  padding-left: 1.15em;
  color: var(--tfls-ink);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
}

.tfls-export {
  margin-top: 20px;
  padding: 28px 22px;
  border-radius: 18px;
  border: 2px solid #083141;
  background:
    linear-gradient(145deg, rgba(12, 74, 110, 0.06) 0%, rgba(15, 118, 110, 0.08) 45%, #fff 100%);
  text-align: center;
  box-shadow: 0 14px 36px rgba(8, 49, 65, 0.08);
}

.tfls-export__badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #083141;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tfls-export__title {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tfls-navy);
}

.tfls-export__lead {
  margin: 0 auto 18px;
  max-width: 28rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.45;
}

.tfls-export__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 240px;
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  background: #083141;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(8, 49, 65, 0.35);
}

.tfls-export__btn:hover {
  background: #0f766e;
}

.tfls-export__fine {
  margin: 12px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}

.tfls-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 12px;
  border: 2px solid #083141;
  background: #083141;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

.tfls-btn:hover {
  background: #0f766e;
  border-color: #0f766e;
}

.tfls-btn:focus {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}

/* MailerLite modal */
.tfls-ml-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 49, 65, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 20px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--tfls-ink);
}

.tfls-ml-modal {
  background: #fff;
  border: 1px solid #d4dee5;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(8, 49, 65, 0.28);
}

.tfls-ml-head {
  padding: 18px 20px;
  background: linear-gradient(135deg, #0c4a6e, #083141);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.tfls-ml-head__text {
  flex: 1;
  min-width: 0;
}

.tfls-ml-head h3 {
  margin: 0;
  color: #fff;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.tfls-ml-sub {
  margin: 6px 0 0;
  font-size: 0.92rem;
  line-height: 1.4;
  color: #e2e8f0;
  font-weight: 500;
}

.tfls-ml-close {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.tfls-ml-body {
  padding: 18px 20px 16px;
  flex: 1;
  overflow-y: auto;
  background: #fff;
}

.tfls-ml-snapshot-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tfls-ml-snapshot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 16px;
}

.tfls-ml-snapshot-item {
  background: #e7f3f4;
  border: 1px solid #b7d0d3;
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
}

.tfls-ml-snapshot-key {
  font-size: 0.76rem;
  color: #3d4d58;
  font-weight: 700;
}

.tfls-ml-snapshot-val {
  font-size: 1.02rem;
  font-weight: 800;
  color: #083141;
  margin-top: 4px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tfls-ml-label {
  font-weight: 700;
  display: block;
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: #083141;
}

.tfls-ml-field {
  margin-top: 14px;
}

.tfls-ml-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #9aadb8;
  border-radius: 10px;
  font-size: 1rem;
  box-sizing: border-box;
  min-height: 48px;
  color: var(--tfls-ink);
  background: #fff;
}

.tfls-ml-input:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.tfls-ml-trust {
  background: #f4f7f8;
  border: 1px solid #d9e2e8;
  padding: 12px 14px;
  border-radius: 10px;
  margin-top: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #24323c;
  line-height: 1.45;
}

.tfls-ml-foot {
  padding: 16px 20px;
  border-top: 1px solid #d9e2e8;
  display: flex;
  gap: 10px;
  background: #f4f7f8;
}

.tfls-ml-submit {
  flex: 1;
  background: #083141;
  color: #fff;
  border: none;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  min-height: 48px;
}

.tfls-ml-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.tfls-ml-sec {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #9aadb8;
  padding: 14px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: #083141;
  min-height: 48px;
}

.tfls-ml-err {
  color: #9b2c2c;
  font-size: 0.9rem;
  margin-top: 8px;
  display: none;
  font-weight: 700;
}

.tfls-ml-err[data-show] {
  display: block;
}

.tfls-ml-ok {
  text-align: center;
  color: #0f6b4c;
  font-weight: 700;
  padding: 14px;
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

@media (max-width: 520px) {
  .tfls-shell {
    padding: 14px 12px 22px;
  }

  .tfls-toggle-group {
    flex-direction: column;
  }

  .tfls-toggle-btn {
    width: 100%;
    text-align: center;
  }

  .tfls-export {
    padding: 22px 16px;
  }

  .tfls-export__btn {
    min-width: 0;
    width: 100%;
    max-width: 320px;
  }

  .tfls-ml-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .tfls-ml-modal {
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    max-width: 100%;
  }

  .tfls-ml-foot {
    flex-direction: column;
  }

  .tfls-ml-submit,
  .tfls-ml-sec {
    width: 100%;
  }

  .tfls-ml-snapshot-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .tfls-export,
  .tfls-ml-overlay {
    display: none !important;
  }
}
