/* ==========================================================================
   Find my unit (#match): plain-words search above, four questions left,
   ranked matches right. Ash surfaces, no borders or shadows on containers;
   the accent ring marks a chosen answer and keyboard focus only.
   ========================================================================== */
#match .mt { display: grid; gap: clamp(40px, 6vw, 80px); }
#match .mt-head { margin-bottom: 0; }
.mt-vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Plain-words search ---------- */
.mt-search { display: grid; gap: 14px; padding: clamp(18px, 2.6vw, 32px); border-radius: var(--r-card); background: var(--ash); min-width: 0; }
.mt-search-l { font-size: 15px; font-weight: 600; color: var(--carbon); }
.mt-box { position: relative; display: flex; align-items: center; min-width: 0; border-radius: var(--r-btn); background: #fff; transition: box-shadow var(--t); }
.mt-box:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.mt-box > i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--pewter); pointer-events: none; }
.mt-box input { flex: 1; min-width: 0; height: 60px; padding: 0 56px 0 52px; border: 0; border-radius: inherit; background: transparent; color: var(--carbon); font-size: 18px; font-weight: 400; letter-spacing: -0.005em; outline: none; -webkit-appearance: none; appearance: none; }
.mt-box input::placeholder { color: var(--fog); }
.mt-box input::-webkit-search-cancel-button, .mt-box input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.mt-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-btn); background: transparent; color: var(--pewter); font-size: 18px; cursor: pointer; transition: background-color var(--t), color var(--t); }
.mt-try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.mt-try-l { font-size: 13px; color: var(--pewter); }
.mt-try .chips { gap: 6px; min-width: 0; }
.mt-try .chip { background: var(--canvas); color: var(--graphite); white-space: normal; text-align: left; line-height: 1.3; padding-top: 6px; padding-bottom: 6px; max-width: 100%; }

.mt-sr { display: grid; gap: 12px; padding-top: 4px; min-width: 0; }
.mt-read { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.mt-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; max-width: 100%; padding: 6px 12px; border-radius: var(--r-btn); background: var(--carbon); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.35; }
.mt-chip i { flex: none; font-size: 15px; opacity: .75; }
.mt-count { font-size: 13px; color: var(--pewter); font-variant-numeric: tabular-nums; }
.mt-note { margin: 0; font-size: 14px; color: var(--graphite); }
.mt-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.mt-row { display: flex; align-items: stretch; min-width: 0; border-radius: 8px; background: var(--canvas); transition: background-color var(--t); }
.mt-row-main { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 2px 16px; padding: 12px 4px 12px 16px; border: 0; border-radius: 8px 0 0 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mt-row-main .u { font-size: 15px; font-weight: 600; color: var(--carbon); white-space: nowrap; }
.mt-row-main .a { font-size: 14px; color: var(--graphite); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mt-row-main .p { min-width: 88px; font-size: 15px; font-weight: 500; color: var(--carbon); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.mt-row-main .s { grid-column: 1 / 3; min-width: 0; font-size: 12.5px; color: var(--pewter); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-row-main .s3 { font-size: 12.5px; color: var(--pewter); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mt-row-main .s3.miss { color: var(--carbon); font-weight: 600; }
.mt-row.is-sold .u, .mt-row.is-sold .p { color: var(--fog); }
.mt-star { flex: none; width: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0 8px 8px 0; background: none; color: var(--fog); font-size: 18px; cursor: pointer; transition: color var(--t); }
.mt-star[aria-pressed="true"] { color: var(--accent); }
.mt-apply { justify-self: start; }

/* ---------- Two columns: questions and matches ---------- */
.mt-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 88px); align-items: start; }
.mt-wiz { display: grid; gap: 28px; min-width: 0; }
.mt-wiz-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mt-wiz-head h3 { font-size: 24px; font-weight: 300; letter-spacing: -0.02em; }
.mt-q { min-width: 0; margin: 0; padding: 0; border: 0; }
.mt-q legend { float: left; width: 100%; margin: 0 0 12px; padding: 0; font-size: 15px; font-weight: 600; color: var(--carbon); }
.mt-q legend small { margin-left: 6px; font-size: 12.5px; font-weight: 500; color: var(--fog); }
.mt-opts { clear: both; display: flex; flex-wrap: wrap; gap: 6px; }
.mt-opt { position: relative; display: inline-flex; max-width: 100%; }
.mt-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.mt-opt > span { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: var(--r-btn); background: var(--ash); color: var(--graphite); font-size: 13.5px; font-weight: 600; line-height: 1.3; transition: background-color var(--t), color var(--t), box-shadow var(--t); }
.mt-opt input:checked + span { background: #fff; color: var(--carbon); box-shadow: inset 0 0 0 2px var(--accent); }
.mt-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-opt i { flex: none; font-size: 17px; color: var(--pewter); transition: color var(--t); }
.mt-opt input:checked + span i { color: var(--accent); }
.mt-opt small { font-size: 12px; font-weight: 500; color: var(--fog); }
.mt-opt .n { font-size: 12px; font-weight: 500; color: var(--fog); font-variant-numeric: tabular-nums; }
.mt-opt .n:empty { display: none; }
.mt-jump { display: none; justify-self: start; }

.mt-res { display: grid; gap: 14px; min-width: 0; scroll-margin-top: calc(var(--topbar) + 16px); }
.mt-res:focus { outline: none; }
#mtResBody { display: grid; gap: 14px; min-width: 0; }
#mtResBody > .fine { margin: 0; max-width: 62ch; }
.mt-lead { margin: 0; font-size: 15px; line-height: 1.55; color: var(--graphite); }
.mt-lead b { font-weight: 600; color: var(--carbon); }
.mt-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mt-cards.mt-in > li { animation: mt-in .5s cubic-bezier(.2, .7, .1, 1) both; }
.mt-cards.mt-in > li:nth-child(2) { animation-delay: .06s; }
.mt-cards.mt-in > li:nth-child(3) { animation-delay: .12s; }
@keyframes mt-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Match cards: the best match leads, two quieter rows follow ---------- */
.mt-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 18px; padding: 14px; border-radius: var(--r-card); background: var(--ash); }
.mt-card.is-top { grid-template-columns: minmax(0, 236px) minmax(0, 1fr); gap: 24px; padding: 18px; }
.mt-plan { display: block; align-self: start; width: 100%; aspect-ratio: 2000 / 1708; padding: 6px; border: 0; border-radius: 8px; background: #fff; overflow: hidden; cursor: pointer; }
.mt-plan img { width: 100%; height: 100%; object-fit: contain; }
.mt-plan.err img { visibility: hidden; }
.mt-body { display: grid; gap: 12px; align-content: start; min-width: 0; container-type: inline-size; }
.mt-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mt-name { min-width: 0; }
.mt-kicker { display: block; margin-bottom: 2px; font-size: 13px; font-weight: 600; color: var(--pewter); }
.mt-title h4 { font-size: 22px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.15; }
.is-top .mt-title h4 { font-size: 34px; font-weight: 200; letter-spacing: -0.03em; }
.mt-type { margin-left: 2px; font-size: 13px; font-weight: 500; letter-spacing: normal; color: var(--pewter); white-space: nowrap; }
.mt-pct { flex: none; margin: 0; text-align: right; line-height: 1; }
.mt-pct b { display: block; font-size: 28px; font-weight: 200; letter-spacing: -0.03em; color: var(--carbon); font-variant-numeric: tabular-nums lining-nums; }
.is-top .mt-pct b { font-size: 44px; }
.mt-pct span { display: block; margin-top: 4px; font-size: 12px; color: var(--pewter); }
.mt-why { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; line-height: 1.45; color: var(--graphite); }
.mt-why li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; align-items: start; }
.mt-why i { margin-top: 2px; font-size: 15px; color: var(--carbon); }
.mt-why li.gap { color: var(--pewter); }
.mt-why li.gap i { color: var(--fog); }
.mt-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0; }
.mt-facts div { min-width: 0; padding: 8px 10px; border-radius: 8px; background: var(--canvas); }
.mt-facts dt { font-size: 11.5px; color: var(--pewter); }
.mt-facts dd { margin: 2px 0 0; font-size: 14px; font-weight: 500; color: var(--carbon); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums lining-nums; }
@container (max-width: 440px) { .mt-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mt-same { margin: -4px 0 0; }
.mt-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mt-card .btn { background: var(--canvas); }
.mt-card .btn.ghost { background: transparent; }
.mt-star-btn[aria-pressed="true"] i { color: var(--accent); }
.mt-loc.icon-btn { width: 32px; min-height: 32px; padding: 0; }
.mt-loc.icon-btn i { font-size: 17px; }
.mt-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-top: 6px; }
.mt-empty { display: grid; gap: 14px; justify-items: start; padding: 24px; border-radius: var(--r-card); background: var(--ash); }
.mt-empty p { margin: 0; max-width: 52ch; }
.mt-empty b { font-weight: 600; color: var(--carbon); }

/* Hover states only where a pointer can hover (no sticky taps on phones). */
@media (hover: hover) {
  .mt-clear:hover { background: var(--ash); color: var(--carbon); }
  .mt-try .chip:hover { background: #fff; color: var(--carbon); }
  .mt-row:hover { background: #fff; }
  .mt-star:hover { color: var(--carbon); }
  .mt-star[aria-pressed="true"]:hover { color: var(--accent-hover); }
  .mt-opt:hover > span { background: var(--ash-2); color: var(--carbon); }
  .mt-opt:hover input:checked + span { background: #fff; }
  .mt-card .btn:hover { background: #fff; }
  .mt-card .btn.ghost:hover { background: rgba(23, 26, 28, .06); }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .mt-grid { grid-template-columns: minmax(0, 1fr); }
  .mt-jump { display: inline-flex; }
}
@media (max-width: 760px) {
  .mt-rows { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .mt-box input { height: 54px; padding-left: 46px; font-size: 16px; }
  .mt-box > i { left: 15px; font-size: 19px; }
  .mt-card, .mt-card.is-top { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; }
  .mt-card:not(.is-top) .mt-plan { display: none; }
  .mt-card.is-top .mt-plan { max-height: 220px; }
  .is-top .mt-title h4 { font-size: 30px; }
  .is-top .mt-pct b { font-size: 38px; }
  .mt-row-main { padding-left: 14px; gap: 2px 12px; }
  .mt-row-main .p { min-width: 0; }
  .mt-foot .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .mt-cards.mt-in > li { animation: none; }
}
@media print {
  #match { display: none !important; }
}
