/* Tax-Year End Allowance Optimiser (UK) */

:root {
  --tyeo-ink: #0f172a;
  --tyeo-muted: #475569;
  --tyeo-navy: #083141;
}

#tyeo-root.tyeo-app,
.tyeo-root.tyeo-app {
  width: auto;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 14px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.tyeo-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;
  color: var(--tyeo-ink);
}

.tyeo-hero {
  border: 1px solid rgba(8, 49, 65, 0.2);
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(135deg, #fff 0%, #f0f9ff 52%, #e0f2fe 100%);
}

.tyeo-title {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  font-weight: 950;
  color: var(--tyeo-navy);
}

.tyeo-sub {
  margin: 0;
  color: var(--tyeo-muted);
  font-weight: 650;
  line-height: 1.55;
}

.tyeo-hero-context {
  margin: 12px 0 0;
  color: #0c4a6e;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.5;
}

.tyeo-hero-example {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(14, 116, 144, 0.28);
  color: #334155;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.55;
}

.tyeo-hero-example-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0e7490;
}

.tyeo-card {
  margin-top: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  background: #fff;
}

.tyeo-card--inputs {
  border: 2px solid rgba(8, 49, 65, 0.2);
  border-left: 5px solid var(--tyeo-navy);
  background: linear-gradient(165deg, #f1f5f9 0%, #fff 42%);
}

.tyeo-h3 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 3px solid rgba(8, 49, 65, 0.2);
  font-size: 1.25rem;
  font-weight: 950;
  color: var(--tyeo-navy);
}

.tyeo-input-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tyeo-input-section {
  margin: 0;
  padding: 16px 16px 14px;
  border-radius: 14px;
  border: 2px solid rgba(8, 49, 65, 0.14);
  background: #fff;
  box-shadow: 0 4px 18px rgba(8, 49, 65, 0.06);
}

.tyeo-input-section--tax-year {
  border-left: 5px solid #0e7490;
  background: linear-gradient(145deg, #f0f9ff 0%, #fff 55%);
}

.tyeo-input-section--flags {
  margin-top: 4px;
  border-left: 5px solid var(--tyeo-navy);
  background: linear-gradient(145deg, #f8fafc 0%, #fff 60%);
}

.tyeo-input-section__title {
  margin: 0 0 6px;
  padding: 0 0 10px;
  border-bottom: 2px solid rgba(8, 49, 65, 0.12);
  font-size: 1rem;
  font-weight: 950;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--tyeo-navy);
}

.tyeo-input-section__lead {
  margin: 0 0 12px;
  font-size: 0.86rem;
  font-weight: 650;
  color: #64748b;
  line-height: 1.45;
}

.tyeo-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .tyeo-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.tyeo-field {
  display: grid;
  gap: 6px;
}

.tyeo-field--full {
  grid-column: 1 / -1;
}

.tyeo-label {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--tyeo-navy);
}

.tyeo-hint {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.4;
}

.tyeo-input {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(8, 49, 65, 0.2);
  border-radius: 12px;
  box-sizing: border-box;
  font-size: max(16px, 1rem);
}

.tyeo-input:focus {
  outline: none;
  border-color: rgba(14, 116, 144, 0.55);
  box-shadow: 0 0 0 5px rgba(14, 116, 144, 0.12);
}

.tyeo-scenario-options {
  margin-top: 4px;
  display: grid;
  gap: 12px;
}

@media (min-width: 640px) {
  .tyeo-scenario-options {
    grid-template-columns: 1fr 1fr;
  }
}

.tyeo-scenario-block {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(8, 49, 65, 0.16);
  background: #fff;
}

.tyeo-check-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  margin: 0;
}

.tyeo-check-card-input {
  flex-shrink: 0;
  width: 1.2rem;
  height: 1.2rem;
  margin: 2px 0 0;
  accent-color: #0e7490;
}

.tyeo-check-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tyeo-check-card-title {
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--tyeo-navy);
}

.tyeo-check-card-hint {
  font-size: 0.8rem;
  font-weight: 650;
  color: #64748b;
  line-height: 1.4;
}

.tyeo-results {
  margin-top: 22px;
  padding: 22px 18px 14px;
  border-radius: 18px;
  background: #f1f5f9;
  border: 2px solid rgba(8, 49, 65, 0.16);
}

.tyeo-results-heading.tyeo-h3 {
  margin: 0 0 8px;
}

.tyeo-results-section {
  margin: 0 0 18px;
  padding: 18px 16px 16px;
  border-radius: 16px;
  border: 2px solid transparent;
  box-shadow: 0 6px 24px rgba(8, 49, 65, 0.07);
}

.tyeo-results-section--summary {
  padding: 14px;
  border-color: rgba(22, 163, 74, 0.25);
  background: #fff;
}

.tyeo-results-section--headroom {
  border-color: rgba(14, 116, 144, 0.35);
  border-left: 5px solid #0e7490;
  background: linear-gradient(145deg, #ecfeff 0%, #f0f9ff 42%, #fff 100%);
}

.tyeo-results-section--opportunities {
  border-color: rgba(217, 119, 6, 0.38);
  border-left: 5px solid #d97706;
  background: linear-gradient(145deg, #fffbeb 0%, #fff 55%);
}

.tyeo-results-section--pension {
  border-color: rgba(180, 83, 9, 0.38);
  border-left: 5px solid #d97706;
  background: linear-gradient(145deg, #fffbeb 0%, #fff 70%);
}

.tyeo-results-section--checklist {
  border-color: rgba(8, 49, 65, 0.28);
  border-left: 5px solid var(--tyeo-navy);
  background: linear-gradient(145deg, #f1f5f9 0%, #fff 60%);
}

.tyeo-section-head {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(8, 49, 65, 0.1);
}

.tyeo-section-kicker {
  display: block;
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tyeo-results-section--headroom .tyeo-section-kicker {
  color: #0e7490;
}

.tyeo-results-section--opportunities .tyeo-section-kicker {
  color: #b45309;
}

.tyeo-results-section--checklist .tyeo-section-kicker {
  color: var(--tyeo-navy);
}

.tyeo-results-section--pension .tyeo-section-kicker {
  color: #b45309;
}

.tyeo-section-title {
  margin: 0 0 6px;
  font-size: 1.12rem;
  font-weight: 950;
  color: var(--tyeo-navy);
}

.tyeo-section-lead {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
  color: #475569;
  line-height: 1.5;
}

.tyeo-summary-hero {
  margin: 0;
  padding: 18px 16px;
  border-radius: 14px;
  text-align: center;
  border: 2px solid rgba(22, 163, 74, 0.35);
  background: linear-gradient(145deg, #ecfdf5 0%, #fff 60%);
}

.tyeo-summary-hero-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.tyeo-summary-hero-amount {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.6rem, 4.5vw, 2.1rem);
  font-weight: 950;
  color: #15803d;
  font-variant-numeric: tabular-nums;
}

.tyeo-summary-hero-sub {
  margin: 10px auto 0;
  max-width: 40rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: #334155;
  line-height: 1.5;
}

.tyeo-usage-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 620px) {
  .tyeo-usage-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.tyeo-usage-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(8, 49, 65, 0.14);
  background: rgba(255, 255, 255, 0.9);
}

.tyeo-usage-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.tyeo-usage-card-label {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--tyeo-navy);
}

.tyeo-usage-card-figures {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0e7490;
  font-variant-numeric: tabular-nums;
}

.tyeo-usage-track {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.tyeo-usage-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0e7490, #155e75);
  min-width: 2px;
}

.tyeo-usage-pct {
  display: block;
  margin-top: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
}

.tyeo-usage-note {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.tyeo-results-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 620px) {
  .tyeo-results-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.tyeo-tile {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  border-top: 3px solid rgba(8, 49, 65, 0.2);
}

.tyeo-tile--headroom {
  border-top-color: #0e7490;
}

.tyeo-tile--opportunity {
  border-top-color: #d97706;
  background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
}

.tyeo-tile--advice {
  border-top-color: #dc2626;
  background: linear-gradient(135deg, #fff 0%, #fff7ed 100%);
}

.tyeo-tile-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.tyeo-tile-value {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  font-weight: 950;
  color: var(--tyeo-navy);
}

.tyeo-tile-note {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

.tyeo-pension-panel {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(180, 83, 9, 0.28);
  background: rgba(255, 255, 255, 0.75);
}

.tyeo-pension-warnings {
  margin: 8px 0 0;
  padding-left: 1.1rem;
  color: #78350f;
  font-size: 0.85rem;
  line-height: 1.45;
}

.tyeo-pension-warnings li {
  margin: 0 0 6px;
}

.tyeo-detail-panel {
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.tyeo-detail-summary {
  cursor: pointer;
  padding: 12px 16px;
  background: #f8fafc;
  font-weight: 850;
  color: var(--tyeo-navy);
}

.tyeo-table-wrap {
  overflow-x: auto;
}

.tyeo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.tyeo-table th,
.tyeo-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.tyeo-table thead th {
  background: #f1f5f9;
  color: var(--tyeo-navy);
}

.tyeo-deadline-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 8px 12px;
  margin: 0 0 18px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 2px solid rgba(14, 116, 144, 0.35);
  background: linear-gradient(145deg, #ecfeff 0%, #fff 60%);
  text-align: center;
}

.tyeo-deadline-banner__label {
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0e7490;
}

.tyeo-deadline-banner__days {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 950;
  color: var(--tyeo-navy);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.tyeo-deadline-banner__suffix {
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
}

.tyeo-results-header {
  margin: 0 0 18px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  border: 2px solid rgba(8, 49, 65, 0.2);
  background: #fff;
  box-shadow: 0 4px 16px rgba(8, 49, 65, 0.06);
}

.tyeo-results-header .tyeo-results-heading {
  margin: 0 0 8px;
  padding: 0;
  border: none;
}

.tyeo-results-lead {
  margin: 0;
  color: var(--tyeo-muted);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.55;
}

.tyeo-checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.tyeo-checklist-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #fff;
}

.tyeo-checklist-item--high {
  border-left: 5px solid #0e7490;
  background: linear-gradient(90deg, #ecfeff 0%, #fff 28%);
}

.tyeo-checklist-item--medium {
  border-left: 5px solid #d97706;
}

.tyeo-checklist-item--low {
  border-left: 5px solid #94a3b8;
}

.tyeo-checklist-item--advice {
  border-left: 5px solid #dc2626;
  background: linear-gradient(90deg, #fff7ed 0%, #fff 35%);
}

.tyeo-checklist-rank {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--tyeo-navy);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 950;
}

.tyeo-checklist-body {
  min-width: 0;
}

.tyeo-checklist-impact {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tyeo-checklist-item--high .tyeo-checklist-impact {
  background: #cffafe;
  color: #0e7490;
}

.tyeo-checklist-item--medium .tyeo-checklist-impact {
  background: #ffedd5;
  color: #c2410c;
}

.tyeo-checklist-item--low .tyeo-checklist-impact {
  background: #f1f5f9;
  color: #475569;
}

.tyeo-checklist-item--advice .tyeo-checklist-impact {
  background: #fee2e2;
  color: #b91c1c;
}

.tyeo-checklist-title {
  display: block;
  font-size: 1rem;
  font-weight: 950;
  color: var(--tyeo-navy);
  line-height: 1.3;
}

.tyeo-checklist-text {
  margin: 6px 0;
  font-size: 0.88rem;
  font-weight: 650;
  color: #334155;
  line-height: 1.5;
}

.tyeo-checklist-figure {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0e7490;
}

.tyeo-warning-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid rgba(180, 83, 9, 0.32);
  background: #fffbeb;
  font-size: 0.85rem;
  color: #78350f;
  line-height: 1.5;
}

.tyeo-warning-box p {
  margin: 8px 0 0;
}

.tyeo-results-error {
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid rgba(185, 28, 28, 0.45);
  background: #fef2f2;
  color: #991b1b;
  font-weight: 700;
}

.tyeo-export {
  margin-top: 20px;
  padding: 20px;
  border-radius: 16px;
  border: 2px solid rgba(21, 94, 117, 0.3);
  background: linear-gradient(135deg, #fff 0%, #ecfeff 100%);
  text-align: center;
}

.tyeo-export-title {
  margin: 0 0 8px;
  color: var(--tyeo-navy);
  font-size: clamp(1.22rem, 3.25vw, 1.58rem);
  font-weight: 950;
}

.tyeo-export-sub {
  margin: 0 auto 14px;
  max-width: 42rem;
  color: var(--tyeo-muted);
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.5;
}

.tyeo-export-btn {
  width: 100%;
  max-width: 420px;
  padding: 17px 18px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 950;
  font-family: inherit;
  background: linear-gradient(180deg, #0e7490 0%, #155e75 55%, #164e63 100%);
  box-shadow: 0 6px 0 #0c4a5f, 0 16px 34px rgba(21, 94, 117, 0.35);
}

.tyeo-export-btn:hover {
  filter: brightness(1.03);
}

.tyeo-export-btn:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 #0c4a5f, 0 8px 20px rgba(21, 94, 117, 0.28);
}

.tyeo-methodology {
  margin-top: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.tyeo-methodology-summary {
  cursor: pointer;
  padding: 12px 16px;
  background: #f8fafc;
  font-weight: 850;
  color: var(--tyeo-navy);
}

.tyeo-methodology-body {
  padding: 0 16px 12px;
}

.tyeo-methodology-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #334155;
  font-size: 0.85rem;
}

.tyeo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 16px;
  box-sizing: border-box;
}

.tyeo-modal {
  width: 100%;
  max-width: 560px;
  max-height: min(92vh, calc(100dvh - 32px));
  background: #fff;
  border: 3px solid var(--tyeo-navy);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tyeo-modal-header {
  padding: 22px;
  background: linear-gradient(135deg, var(--tyeo-navy), #0a4a5f);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tyeo-modal-header-text {
  flex: 1;
  min-width: 0;
}

.tyeo-modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.22rem, 4.2vw, 1.55rem);
  font-weight: 950;
}

.tyeo-modal-header-sub {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.875rem;
  line-height: 1.45;
}

.tyeo-modal-close {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.tyeo-modal-body {
  padding: 22px;
  overflow-y: auto;
}

.tyeo-modal-lead {
  margin: 0 0 14px;
  color: #1e293b;
  font-weight: 650;
  line-height: 1.55;
}

.tyeo-modal-label {
  display: block;
  margin: 10px 0 7px;
  font-weight: 900;
  color: #0f172a;
}

.tyeo-modal-input {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(8, 49, 65, 0.28);
  border-radius: 12px;
  box-sizing: border-box;
  font-size: max(16px, 1rem);
}

.tyeo-modal-error {
  margin-top: 10px;
  color: #b91c1c;
  font-weight: 700;
}

.tyeo-modal-footer {
  padding: 18px 22px;
  background: #ecfeff;
  border-top: 2px solid rgba(21, 94, 117, 0.22);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tyeo-modal-submit {
  flex: 1 1 auto;
  min-width: min(100%, 240px);
  min-height: 54px;
  border-radius: 14px;
  border: 2px solid #0c4a5f;
  background: linear-gradient(180deg, #0e7490 0%, #155e75 55%, #164e63 100%);
  color: #fff;
  font-weight: 950;
  font-family: inherit;
  cursor: pointer;
}

.tyeo-modal-secondary {
  border: 2px solid rgba(8, 49, 65, 0.25);
  background: #fff;
  color: var(--tyeo-navy);
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 850;
  font-family: inherit;
  cursor: pointer;
  min-height: 54px;
}

.tyeo-modal-success {
  margin: 0;
  text-align: center;
  color: #059669;
  font-weight: 800;
  font-size: 1.05rem;
}

@media (max-width: 520px) {
  .tyeo-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  .tyeo-export,
  .tyeo-modal-overlay {
    display: none !important;
  }
}
