/* Maddening QB Draft Analyzer. Everything is scoped to .mqa so theme styles don't leak in or out. */
.mqa {
  --mqa-navy: #0A1A44;
  --mqa-navy-2: #24356A;
  --mqa-royal: #1847C2;
  --mqa-royal-dark: #0F2A78;
  --mqa-gold: #F2A51A;
  --mqa-light: #EEF2FB;
  --mqa-line: #D5DCEE;
  --mqa-input: #B9C4E4;
  --mqa-ink: #0F1630;
  --mqa-muted: #4A5470;
  --mqa-half: #D9E3FB;
  --mqa-cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--mqa-ink);
  font-size: 16px;
  line-height: 1.45;
  text-align: left;
}
.mqa *, .mqa *::before, .mqa *::after { box-sizing: border-box; }
.mqa button, .mqa input, .mqa select { font: inherit; letter-spacing: normal; text-transform: none; margin: 0; box-shadow: none; }
.mqa button { cursor: pointer; }
.mqa button:focus-visible, .mqa input:focus-visible, .mqa select:focus-visible { outline: 3px solid var(--mqa-gold); outline-offset: 2px; }
.mqa h2, .mqa h3, .mqa p { margin: 0; }

/* Tabs (only shown with 2+ QBs) */
.mqa-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.mqa-tabs:empty { display: none; }
.mqa-tab { display: inline-flex; align-items: stretch; border: 2px solid var(--mqa-line); border-radius: 8px; background: #fff; overflow: hidden; }
.mqa-tab > button { border: 0; background: transparent; color: var(--mqa-ink); min-height: 44px; padding: 0 14px; font-weight: 600; }
.mqa-tab > button strong { color: var(--mqa-royal); margin-left: 6px; }
.mqa-tab .mqa-tab-x { padding: 0 12px; font-size: 20px; line-height: 1; color: var(--mqa-muted); border-left: 1px solid var(--mqa-line); }
.mqa-tab .mqa-tab-x:hover { color: #B3261E; }
.mqa-tab.is-active { border-color: var(--mqa-royal); background: var(--mqa-royal); }
.mqa-tab.is-active > button, .mqa-tab.is-active > button strong { color: #fff; }
.mqa-tab.is-active .mqa-tab-x { border-left-color: rgba(255,255,255,.3); color: #D6DEF5; }

/* Layout */
.mqa-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 28px; }
.mqa-form { flex: 999 1 560px; min-width: 0; background: #fff; border: 1px solid var(--mqa-line); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.mqa-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 960px) { .mqa-side { position: sticky; top: 24px; } }

.mqa-form-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.mqa-form-head h2 { font-family: var(--mqa-cond); font-style: italic; font-weight: 800; font-size: 32px; line-height: 1.1; text-transform: uppercase; color: var(--mqa-navy); }
.mqa-form-head span, .mqa-hint { font-size: 14px; color: var(--mqa-muted); }
.mqa-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.mqa-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.mqa-field { display: flex; flex-direction: column; gap: 6px; }
.mqa-field label, .mqa-label { font-weight: 600; font-size: 15px; }
.mqa-field label em { font-style: normal; font-weight: 400; color: var(--mqa-muted); }
.mqa-field input, .mqa-field select {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--mqa-input); border-radius: 8px;
  font-size: 16px; color: var(--mqa-ink); background: #fff; height: auto;
}
.mqa-block { display: flex; flex-direction: column; gap: 10px; }
.mqa-block-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.mqa-section { font-family: var(--mqa-cond); font-weight: 700; font-size: 17px; letter-spacing: 1px; text-transform: uppercase; color: var(--mqa-royal); }

.mqa-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.mqa-pill { min-height: 44px; padding: 0 16px; border-radius: 8px; border: 2px solid var(--mqa-line); background: #fff; color: var(--mqa-ink); font-weight: 500; font-size: 16px; }
.mqa-pill:hover { border-color: var(--mqa-royal); }
.mqa-pill.is-on { background: var(--mqa-royal); border-color: var(--mqa-royal); color: #fff; font-weight: 600; }

.mqa-grade-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 4px 0; border-bottom: 1px solid var(--mqa-light); }
.mqa-grade-label { font-size: 16px; min-width: 210px; }
.mqa-grade-val { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--mqa-light); color: var(--mqa-royal-dark); font-weight: 700; font-size: 14px; }
.mqa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mqa-chip { width: 48px; min-height: 40px; padding: 0; border-radius: 6px; border: 2px solid var(--mqa-line); background: #fff; color: #39425E; font-weight: 600; font-size: 16px; }
.mqa-chip:hover { border-color: var(--mqa-royal); }
.mqa-chip.is-on { background: var(--mqa-royal); border-color: var(--mqa-royal); color: #fff; font-weight: 700; }
.mqa-chip.is-half { background: var(--mqa-half); border-color: var(--mqa-royal); color: var(--mqa-royal-dark); font-weight: 700; }

.mqa-form-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 4px; }
.mqa-link { border: 0; background: none; padding: 6px 0; color: var(--mqa-royal); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.mqa-link:hover { color: var(--mqa-royal-dark); }

/* Result card */
.mqa-result { background: var(--mqa-navy); color: #fff; border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 20px; border-bottom: 6px solid var(--mqa-gold); }
.mqa-eyebrow { font-family: var(--mqa-cond); font-weight: 700; font-size: 16px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--mqa-gold); }
.mqa-result-name { font-weight: 700; font-size: 20px; margin-top: -18px; overflow-wrap: anywhere; }
.mqa-big { display: flex; align-items: flex-end; gap: 16px; }
.mqa-ovr { font-family: var(--mqa-cond); font-weight: 800; font-style: italic; font-size: 104px; line-height: .82; }
.mqa-ovr-sub { font-size: 16px; line-height: 1.45; color: #D6DEF5; padding-bottom: 6px; }
.mqa-chance { display: flex; flex-direction: column; gap: 8px; }
.mqa-chance-row { display: flex; justify-content: space-between; }
.mqa-bar { height: 10px; background: var(--mqa-navy-2); border-radius: 5px; overflow: hidden; }
.mqa-bar span { display: block; height: 100%; background: var(--mqa-gold); }
.mqa-stats { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--mqa-navy-2); }
.mqa-stat { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mqa-badge { font-weight: 700; padding: 4px 14px; border-radius: 999px; background: var(--mqa-navy-2); color: #fff; }
.mqa-badge.is-likely { background: var(--mqa-gold); color: var(--mqa-navy); }
.mqa-badge.is-maybe { background: #FFD27A; color: var(--mqa-navy); }
.mqa-notes { margin: 0; padding: 14px 0 0 18px; border-top: 1px solid var(--mqa-navy-2); display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: #D6DEF5; }
.mqa-result.is-empty { gap: 10px; }
.mqa-empty-title { font-family: var(--mqa-cond); font-style: italic; font-weight: 800; font-size: 34px; line-height: 1; text-transform: uppercase; }
.mqa-empty-text { color: #D6DEF5; }
.mqa-result .mqa-link { color: var(--mqa-gold); align-self: flex-start; }

.mqa-add { min-height: 52px; border-radius: 10px; border: 2px dashed var(--mqa-royal); background: #fff; color: var(--mqa-royal); font-family: var(--mqa-cond); font-weight: 700; font-size: 19px; letter-spacing: 1px; text-transform: uppercase; }
.mqa-add:hover { background: var(--mqa-light); }
.mqa-csv { min-height: 44px; border-radius: 10px; border: 2px solid var(--mqa-line); background: #fff; color: var(--mqa-navy); font-weight: 700; font-size: 16px; }
.mqa-csv:hover { border-color: var(--mqa-royal); color: var(--mqa-royal); }
.mqa-tip { margin: 0; padding: 12px 14px; border-radius: 10px; background: #FFF4DC; color: #39425E; font-size: 15px; line-height: 1.5; }
.mqa-tip strong { color: var(--mqa-navy); }
.mqa-foot-note { font-size: 15px; line-height: 1.5; color: var(--mqa-muted); }

/* Compare table */
.mqa-compare { background: #fff; border: 1px solid var(--mqa-line); border-radius: 12px; padding: 18px; }
.mqa-compare h3 { font-family: var(--mqa-cond); font-weight: 700; font-size: 18px; letter-spacing: 1px; text-transform: uppercase; color: var(--mqa-navy); margin-bottom: 8px; }
.mqa-table-wrap { overflow-x: auto; }
.mqa-compare table { width: 100%; border-collapse: collapse; margin: 0; border: 0; }
.mqa-compare th, .mqa-compare td { padding: 8px 6px; text-align: left; border: 0; border-bottom: 1px solid var(--mqa-light); font-size: 15px; background: transparent; white-space: nowrap; }
.mqa-compare thead th { font-family: var(--mqa-cond); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--mqa-muted); }
.mqa-compare tr.is-active th, .mqa-compare tr.is-active td { background: var(--mqa-light); }
.mqa-compare .mqa-link { padding: 0; text-align: left; white-space: normal; }

/* Mobile: keep the projection in view while filling in the form */
.mqa-mobilebar { display: none; }
@media (max-width: 959px) {
  .mqa-mobilebar:not(:empty) {
    display: flex; position: sticky; bottom: 0; z-index: 5; margin-top: 16px; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; background: var(--mqa-navy); color: #fff; border-radius: 10px; border-bottom: 4px solid var(--mqa-gold); font-size: 15px;
  }
  .mqa-mobilebar strong { font-family: var(--mqa-cond); font-style: italic; font-weight: 800; font-size: 26px; margin-right: 4px; }
  .mqa-mobilebar a { color: var(--mqa-gold); font-weight: 700; white-space: nowrap; }
  .mqa-side { scroll-margin-top: 16px; }
}

@media (max-width: 600px) {
  .mqa-form, .mqa-result { padding: 20px 16px; }
  .mqa-grade-label { min-width: 0; width: 100%; }
  .mqa-chips { width: 100%; justify-content: space-between; }
  .mqa-chip { flex: 1 1 0; width: auto; max-width: 60px; }
  .mqa-ovr { font-size: 88px; }
}
