/* Unit engine u05 (attachment, compatibility, values). Tokens only, so dark mode works. Selectors start with .tool. */
.tool .u5-stage { display: flex; flex-direction: column; gap: 16px; }
.tool .u5-stage > * { display: flex; flex-direction: column; gap: 16px; }
.tool .u5-in { animation: u5-in .32s var(--ease-out) both; }
@keyframes u5-in { from { opacity: 0; transform: translateY(8px); } }
.tool .u5-h { font-size: 22px; line-height: 30px; font-weight: 900; letter-spacing: -.01em; color: rgb(var(--ink)); margin: 0; text-wrap: balance; outline: 0; }
.tool .u5-eyebrow { font-size: 13px; line-height: 18px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; color: var(--link); margin: 0; }
.tool .u5-lead { font-size: 16px; line-height: 24px; font-weight: 600; color: rgb(var(--ink) / .7); }
.tool .u5-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.tool .u5-facts span { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 16px; background: var(--surface); font-size: 14px; font-weight: 750; color: rgb(var(--ink) / .7); }
.tool .u5-facts .tool-icon { width: 16px; height: 16px; color: var(--link); }

/* Partner banner */
.tool .u5-banner { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; background: rgb(var(--accent) / .14); font-size: 15px; line-height: 22px; font-weight: 750; color: rgb(var(--ink)); }
.tool .u5-banner .tool-icon { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--link); }

/* Progress */
.tool .u5-progress { display: flex; flex-direction: column; gap: 8px; }
.tool .u5-qtop { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 8px; }
.tool .u5-count { font-size: 14px; font-weight: 800; color: rgb(var(--ink) / .55); font-variant-numeric: tabular-nums; }
.tool .u5-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 14px 0 6px; border-radius: 22px; font-size: 15px; font-weight: 800; color: rgb(var(--ink) / .6); background: transparent; transition: background-color .15s ease, transform .16s var(--ease-out); }
.tool .u5-back:hover { background: rgb(var(--ink) / .06); }
.tool .u5-back:active { transform: scale(.96); }
.tool .u5-back[disabled] { opacity: .35; }
.tool .u5-progress .tool-meter { height: 8px; }
.tool .u5-progress .tool-meter > span { transition: width .3s var(--ease-out); }

/* Buttons */
.tool .u5-send { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tool .u5-send .tool-icon { width: 20px; height: 20px; }
.tool .u5-iconbtn { position: relative; width: 56px; min-width: 56px; padding: 0; display: grid; place-items: center; }
.tool .u5-iconbtn > span { grid-area: 1 / 1; display: grid; place-items: center; transition: opacity .2s cubic-bezier(.2, 0, 0, 1), transform .2s cubic-bezier(.2, 0, 0, 1), filter .2s cubic-bezier(.2, 0, 0, 1); }
.tool .u5-iconbtn .u5-ic-b { opacity: 0; transform: scale(.25); filter: blur(4px); color: #1F9D62; }
.tool .u5-iconbtn.is-done .u5-ic-a { opacity: 0; transform: scale(.25); filter: blur(4px); }
.tool .u5-iconbtn.is-done .u5-ic-b { opacity: 1; transform: none; filter: none; }
.tool .u5-sharebar, .tool .tool-actions.u5-sharebar { flex-direction: row; flex-wrap: nowrap; }
.tool .u5-sharebar .btn.u5-send { flex: 1 1 auto; width: auto; min-width: 0; height: auto; min-height: 56px; padding: 8px 18px; }
.tool .u5-sharebar .btn.u5-iconbtn { flex: none; width: 56px; }
.tool .u5-sharebar { gap: 8px; }
.tool .u5-linkbtn { align-self: flex-start; min-height: 44px; padding: 0 4px; background: none; font-size: 15px; font-weight: 800; color: var(--link); text-decoration: underline; text-decoration-color: rgb(var(--accent) / .35); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Ring */
.tool .u5-ringwrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tool .u5-ring { position: relative; width: 168px; height: 168px; align-self: center; }
.tool .u5-ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tool .u5-ring-bg { fill: none; stroke: rgb(var(--ink) / .08); stroke-width: 10; }
.tool .u5-ring-fg { fill: none; stroke: rgb(var(--accent)); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .9s var(--ease-out); }
.tool .u5-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tool .u5-ring-num { font-size: 44px; line-height: 48px; font-weight: 950; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: rgb(var(--ink)); }
.tool .u5-ring-text span { font-size: 13px; font-weight: 800; color: rgb(var(--ink) / .55); }
.tool .u5-ring-sub { font-size: 15px; line-height: 22px; font-weight: 700; color: rgb(var(--ink) / .7); text-align: center; text-wrap: balance; }

/* Meters */
.tool .u5-meters { display: grid; gap: 12px; }
.tool .u5-meterrow { display: grid; gap: 6px; }
.tool .u5-meterlabel { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; line-height: 20px; font-weight: 750; color: rgb(var(--ink) / .8); }
.tool .u5-meterlabel b { font-variant-numeric: tabular-nums; color: rgb(var(--ink)); }
.tool .u5-meter > span { width: 2%; transition: width .7s var(--ease-out); }
.tool .u5-meter.is-them > span { background: rgb(var(--ink) / .4); }

/* Panels inside results */
.tool .u5-panel { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.tool .u5-panel .tool-list li { background: var(--surface-2); }
.tool .u5-panel-title { font-size: 18px; line-height: 24px; font-weight: 900; color: rgb(var(--ink)); margin: 0; }
.tool .u5-bul { display: grid; gap: 8px; }
.tool .u5-bul li { position: relative; padding-left: 20px; font-size: 16px; line-height: 24px; font-weight: 600; color: rgb(var(--ink) / .85); }
.tool .u5-bul li::before { content: ''; position: absolute; left: 4px; top: 9px; width: 7px; height: 7px; border-radius: 4px; background: rgb(var(--accent)); }
.tool .u5-prompts { display: grid; gap: 8px; counter-reset: p; }
.tool .u5-prompts li { counter-increment: p; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; background: var(--surface-2); font-size: 16px; line-height: 24px; font-weight: 750; color: rgb(var(--ink)); }
.tool .u5-prompts li::before { content: counter(p); flex: none; width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; background: rgb(var(--accent)); color: var(--surface); font-size: 13px; font-weight: 900; margin-top: -1px; }
.tool .u5-quote { position: relative; padding: 16px 56px 16px 16px; border-radius: 18px; background: var(--surface-2); font-size: 16px; line-height: 24px; font-weight: 700; color: rgb(var(--ink)); }
.tool .u5-quote .u5-iconbtn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 44px; min-width: 44px; height: 44px; min-height: 44px; border-radius: 22px; background: transparent; box-shadow: none; color: rgb(var(--ink) / .6); }
.tool .u5-quote .u5-iconbtn:hover { background: rgb(var(--ink) / .06); }
.tool .u5-quote .tool-icon { width: 20px; height: 20px; }

/* Segmented choices (used by setup screens) */
.tool .u5-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 20px; background: rgb(var(--ink) / .06); }
.tool .u5-seg button { min-height: 44px; border-radius: 16px; font-size: 15px; font-weight: 800; color: rgb(var(--ink) / .65); background: transparent; transition: background-color .15s ease, color .15s ease, box-shadow .15s ease; }
.tool .u5-seg button[aria-pressed="true"] { background: var(--surface); color: rgb(var(--ink)); box-shadow: 0 1px 4px rgb(0 0 0 / .08); }

@media (hover: hover) { .tool .u5-linkbtn:hover { text-decoration-color: rgb(var(--accent)); } }
@media (max-width: 599px) {
  .tool .u5-panel { padding: 16px; border-radius: 20px; }
  .tool .u5-h { font-size: 20px; line-height: 28px; }
}
@media (prefers-reduced-motion: reduce) { .tool .u5-in { animation: none; } .tool .u5-ring-fg, .tool .u5-meter > span { transition: none; } }

/* Toast, share note, image button */
.tool .u5-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 50; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 16px; background: rgb(var(--ink)); color: var(--surface); font-size: 15px; line-height: 20px; font-weight: 750; box-shadow: 0 8px 24px rgb(0 0 0 / .2); transition: opacity .2s ease, transform .2s var(--ease-out); }
.tool .u5-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.tool .u5-sharewrap { display: flex; flex-direction: column; gap: 8px; }
.tool .u5-sharenote { font-size: 14px; line-height: 20px; font-weight: 700; color: rgb(var(--ink) / .78); text-align: center; }
.tool .u5-sharenote:empty { display: none; }
.tool .u5-imgbtn .tool-icon { width: 20px; height: 20px; }

/* Two answers side by side */
.tool .u5-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool .u5-pair span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--surface); font-size: 15px; line-height: 20px; font-weight: 700; color: rgb(var(--ink) / .85); }
.tool .u5-pair b { font-size: 12px; line-height: 16px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; color: var(--link); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool .u5-pair span + span b { color: rgb(var(--ink) / .65); }
.tool .u5-talk { font-size: 16px; line-height: 24px; font-weight: 650; color: rgb(var(--ink) / .85); }
.tool .u5-talk b { color: rgb(var(--ink)); font-weight: 850; }

/* Contrast: muted text inside these tools never goes below .7 ink */
.tool .u5-stage .tool-note { color: rgb(var(--ink) / .7); }
.tool .u5-count { color: rgb(var(--ink) / .7); font-size: 15px; }
/* While answering, the soft CTA steps aside so the questions stay calm; it returns on the result. */
.tool.is-asking > .tool-cta { display: none; }
@media (prefers-reduced-motion: reduce) { .tool .u5-toast { transition: none; } }

.tool .u5-send-label { min-width: 0; white-space: normal; line-height: 20px; text-align: center; }
.tool .u5-seg button { color: rgb(var(--ink) / .78); }
.tool .u5-stage ~ .tool-cta { color: rgb(var(--ink) / .8); }
.tool .u5-linkbtn { min-height: 44px; }
.tool .u5-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; line-height: 18px; font-weight: 750; color: rgb(var(--ink) / .75); }
.tool .u5-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tool .u5-legend i { width: 10px; height: 10px; border-radius: 3px; }
.tool .u5-badge { align-self: flex-start; display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.tool .u5-badge.is-diff, .tool .u5-legend .is-diff { background: rgb(214 70 110 / .16); color: rgb(160 30 80); }
.tool .u5-badge.is-near, .tool .u5-legend .is-near { background: rgb(230 160 40 / .2); color: rgb(130 80 0); }
.tool .u5-badge.is-same, .tool .u5-legend .is-same { background: rgb(31 157 98 / .16); color: rgb(15 110 65); }
.tool .u5-legend i.is-diff { background: rgb(214 70 110 / .7); } .tool .u5-legend i.is-near { background: rgb(230 160 40 / .8); } .tool .u5-legend i.is-same { background: rgb(31 157 98 / .7); }
.tool .u5-more > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 20px; border-radius: 20px; background: var(--surface); cursor: pointer; list-style: none; font-size: 16px; font-weight: 850; color: rgb(var(--ink)); }
.tool .u5-more > summary::-webkit-details-marker { display: none; }
.tool .u5-more > summary::after { content: '+'; flex: none; width: 24px; text-align: center; font-size: 22px; font-weight: 700; color: var(--link); transition: transform .2s var(--ease-out); }
.tool .u5-more[open] > summary::after { transform: rotate(45deg); }
.tool .u5-more[open] > summary { margin-bottom: 12px; }
.tool .u5-more > div { display: flex; flex-direction: column; gap: 16px; }
@media (prefers-color-scheme: dark) {
  .tool .u5-badge.is-diff { color: rgb(255 170 200); } .tool .u5-badge.is-near { color: rgb(255 210 140); } .tool .u5-badge.is-same { color: rgb(150 235 190); }
  .tool .u5-stage .btn-secondary, .tool .u5-iconbtn { box-shadow: inset 0 0 0 1px rgb(var(--ink) / .32); }
}

.tool .tool-hint { font-size: 14px; line-height: 20px; color: rgb(var(--ink) / .75); }
.tool .u5-stage .tool-note { font-size: 14px; line-height: 20px; }
/* The soft Cupie line shows once, under a result, not before someone has played. */
.tool[data-mounted]:not(.is-result) > .tool-cta { display: none; }
/* While someone answers on a phone, the tool fills the screen so the article stays below the fold. */
@media (max-width: 599px) {
  .tool.is-asking { min-height: calc(100svh - 96px); }
  /* The answer controls sit low, in thumb reach; the question takes the free space above them. */
  .tool.is-asking .u5-stage, .tool.is-asking .u5-stage > * { flex: 1 1 auto; }
  .tool .u5-sharebar.has-img .u5-send > .tool-icon { display: none; }
  .tool .u5-sharebar.has-img .btn.u5-iconbtn { width: 52px; }
}
