/* Unit u02 (trip, cost and visa planners): number fields, segmented control, city combobox, stepper, result card.
   Tokens only (--surface, --surface-2, --ink, --accent, --link), so dark mode in tools.css works. */
.tool .u2-num, .tool .u2-place { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tool .u2-box { position: relative; display: flex; align-items: center; }
.tool .u2-box input { padding-right: 52px; font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 800; }
.tool .u2-box.has-pre input { padding-left: 30px; }
.tool .u2-pre { position: absolute; left: 14px; font-size: 18px; font-weight: 800; color: rgb(var(--ink) / .45); pointer-events: none; }
.tool .u2-unit { position: absolute; right: 14px; font-size: 13px; font-weight: 800; color: rgb(var(--ink) / .45); pointer-events: none; white-space: nowrap; }
.tool .u2-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tool .u2-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tool .u2-grid3 .u2-box input { padding-left: 12px; padding-right: 8px; }
.tool .u2-grid3 .u2-box.has-pre input { padding-left: 26px; }
.tool .u2-grid3 .u2-pre { left: 12px; }
.tool .u2-box.pre-2 input, .tool .u2-grid3 .u2-box.pre-2 input { padding-left: 40px; }
.tool .u2-box.pre-3 input, .tool .u2-grid3 .u2-box.pre-3 input { padding-left: 52px; }
.tool .u2-grid3 .u2-unit { right: 10px; font-size: 12px; }
.tool .u2-grid3 .tool-label { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Segmented control with a sliding thumb */
.tool .u2-seg { --n: 2; --i: 0; position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .08); isolation: isolate; }
.tool .u2-seg::before { content: ''; position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n)); border-radius: 12px; background: rgb(var(--ink)); transform: translateX(calc(100% * var(--i))); transition: transform .32s var(--ease-out); }
.tool .u2-seg button { min-height: 44px; padding: 0 8px; border-radius: 12px; font-size: 14px; font-weight: 800; color: rgb(var(--ink) / .7); transition: color .2s ease; -webkit-tap-highlight-color: transparent; user-select: none; }
.tool .u2-seg button[aria-checked="true"] { color: var(--surface); }
.tool .u2-seg button:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 1px; }

/* City combobox */
.tool .u2-combo { position: relative; }
.tool .u2-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); padding: 6px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow), 0 0 0 1px rgb(var(--ink) / .08); display: grid; gap: 2px; }
.tool .u2-list li { padding: 10px 12px; border-radius: 12px; font-size: 16px; line-height: 22px; font-weight: 700; cursor: pointer; }
.tool .u2-list li[aria-selected="true"] { background: rgb(var(--accent) / .14); }
@media (hover: hover) and (pointer: fine) { .tool .u2-list li:hover { background: rgb(var(--accent) / .1); } }
.tool .u2-route { position: relative; display: flex; flex-direction: column; gap: 10px; }
.tool .u2-route .u2-place input { padding-right: 60px; }
.tool .u2-swap { position: absolute; z-index: 2; right: 8px; top: 50%; transform: translateY(-26%); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 22px; background: var(--surface); color: rgb(var(--ink) / .7); box-shadow: 0 2px 8px rgb(var(--ink) / .12), 0 0 0 1px rgb(var(--ink) / .08); transition: transform .3s var(--ease-out), color .2s ease; }
.tool .u2-swap.is-flipped { transform: translateY(-26%) rotate(180deg); }
.tool .u2-swap:active { scale: .92; }
.tool .u2-swap svg { width: 20px; height: 20px; }
@media (min-width: 600px) {
  .tool .u2-route { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); gap: 4px; align-items: end; }
  .tool .u2-route .u2-place input { padding-right: 16px; }
  .tool .u2-swap { position: static; transform: none; margin-bottom: 2px; }
  .tool .u2-swap.is-flipped { transform: rotate(180deg); }
  .tool .u2-swap svg { transform: rotate(90deg); }
}

/* Two columns on wide screens: inputs left, answer right */
.tool .u2-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 900px) {
  .tool .u2-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .tool .u2-cols .u2-route { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .tool .u2-cols .u2-route .u2-place input { padding-right: 60px; }
  .tool .u2-cols .u2-swap { position: absolute; margin: 0; transform: translateY(-26%); }
  .tool .u2-cols .u2-swap.is-flipped { transform: translateY(-26%) rotate(180deg); }
  .tool .u2-cols .u2-swap svg { transform: none; }
  .tool .u2-cols .u2-col:last-child { position: sticky; top: 96px; }
}

/* Stepper */
.tool .u2-step { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); }
.tool .u2-step-b { width: 42px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); font-size: 22px; font-weight: 800; color: rgb(var(--ink)); box-shadow: 0 1px 2px rgb(var(--ink) / .08); transition: transform .15s ease; }
.tool .u2-step-b:active { transform: scale(.94); }
.tool .u2-step-b:disabled { opacity: .35; }
.tool .u2-step-b svg { width: 18px; height: 18px; }
.tool .u2-step-v { min-width: 88px; white-space: nowrap; text-align: center; font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; }

/* Result card */
.tool .u2-result { padding: 20px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.tool .u2-kicker { font-size: 13px; line-height: 18px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--link); margin: 0; }
.tool .u2-total { font-size: 52px; line-height: 56px; font-weight: 950; letter-spacing: -.035em; font-variant-numeric: tabular-nums; color: rgb(var(--ink)); margin: 0; }
.tool .u2-detail { font-size: 15px; line-height: 22px; font-weight: 650; color: rgb(var(--ink) / .6); margin: 0; }
.tool .u2-split { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid rgb(var(--ink) / .08); }
.tool .u2-each { color: rgb(var(--ink)); font-size: 28px; line-height: 32px; font-weight: 950; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 0; }
.tool .u2-each small { display: block; font-size: 13px; line-height: 18px; font-weight: 700; letter-spacing: 0; color: rgb(var(--ink) / .55); }
.tool .u2-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.tool .u2-stats > div { padding: 12px; border-radius: 16px; background: var(--surface-2); }
.tool .u2-stats b { display: block; font-size: 20px; line-height: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tool .u2-stats span { font-size: 13px; line-height: 18px; font-weight: 700; color: rgb(var(--ink) / .55); }
.tool .u2-verdict { padding: 14px 16px; border-radius: 16px; background: rgb(var(--accent) / .1); font-size: 16px; line-height: 24px; font-weight: 750; color: rgb(var(--ink)); margin: 0; }
.tool .u2-tick { animation: u2-tick .35s var(--ease-out); }
@keyframes u2-tick { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* Disclosure rows */
.tool .u2-disc-wrap { display: flex; flex-direction: column; gap: 12px; }
.tool .u2-disc { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; padding: 0 16px; border-radius: 16px; background: var(--surface); font-size: 16px; font-weight: 800; color: rgb(var(--ink)); text-align: left; box-shadow: inset 0 0 0 1px rgb(var(--ink) / .06); }
.tool .u2-disc svg { width: 20px; height: 20px; color: rgb(var(--ink) / .5); transition: transform .3s var(--ease-out); }
.tool .u2-disc[aria-expanded="true"] svg { transform: rotate(45deg); }
.tool .u2-panel { display: flex; flex-direction: column; gap: 12px; padding: 0 2px; }

/* Hints: darker than the shared default for 4.5:1 on the tinted tool background */
.tool .tool-hint, .tool .tool-note { color: rgb(var(--ink) / .78); font-size: 14px; line-height: 20px; }

/* Small inline chips for presets */
.tool .u2-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.tool .u2-presets button { min-height: 40px; padding: 0 12px; border-radius: 16px; font-size: 13px; font-weight: 800; background: var(--surface); color: rgb(var(--ink) / .7); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .08); transition: transform .15s ease; }
.tool .u2-presets button:active { transform: scale(.96); }
.tool .u2-presets button[aria-pressed="true"] { background: rgb(var(--accent) / .16); color: rgb(var(--ink)); box-shadow: inset 0 0 0 1.5px rgb(var(--accent) / .6); }

/* Saved items row */
.tool .u2-saved { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px; }
.tool .u2-saved::-webkit-scrollbar { display: none; }
.tool .u2-saved button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 6px 0 14px; border-radius: 18px; background: var(--surface); font-size: 14px; font-weight: 800; color: rgb(var(--ink)); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .08); }
.tool .u2-saved .u2-x { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 12px; color: rgb(var(--ink) / .45); }
.tool .u2-saved .u2-x svg { width: 14px; height: 14px; }

.tool .u2-icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tool .u2-icon-btn svg { width: 20px; height: 20px; }
.tool.u2-host { display: contents; }
.tool .u2-toast { position: fixed; z-index: 50; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); padding: 10px 18px; border-radius: 20px; background: rgb(var(--ink)); color: var(--surface); font-size: 14px; line-height: 20px; font-weight: 800; opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity .2s ease, transform .3s var(--ease-out); }
.tool .u2-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.tool .u2-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 599px) {
  .tool .u2-total { font-size: 46px; line-height: 50px; }
  .tool .u2-result { padding: 18px; }
}
@media (max-width: 360px) {
  .tool .u2-grid3 { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .tool .u2-seg::before, .tool .u2-disc svg { transition: none; }
  .tool .u2-tick { animation: none; }
}
@media (prefers-color-scheme: dark) {
  .tool .u2-seg button[aria-checked="true"] { color: #12061F; }
  .tool .u2-toast { color: #12061F; }
}

/* Answer strip: the total on the first phone screen, above the inputs. */
.tool .u2-strip { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 14px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 2px rgb(var(--accent) / .35); text-align: left; }
.tool .u2-strip-a { font-size: 14px; font-weight: 750; color: rgb(var(--ink) / .74); }
.tool .u2-strip-b { font-size: 22px; line-height: 28px; font-weight: 950; font-variant-numeric: tabular-nums; color: rgb(var(--ink)); white-space: nowrap; }
@media (min-width: 900px) { .tool .u2-strip { display: none; } }
.tool .u2-splitseg button { padding: 0 2px; }
.tool .u2-splitseg button:first-child { white-space: nowrap; }
