/* /sort (agent C2): the intro diptych, the deep water band with the mist floats, the ledger shore and the result sheet. */

/* ============ 1. intro ============ */
.sort-intro { padding-top: clamp(32px, 4vw, 72px); padding-bottom: clamp(32px, 4vw, 72px); }
.sort-intro__copy { align-self: center; padding-right: clamp(8px, 2vw, 48px); }
.sort-intro__copy .h2 { margin-bottom: clamp(20px, 2.4vw, 40px); }
.sort-intro__lead { margin: 0; max-width: none; }
.sort-intro__media { min-height: clamp(360px, 40vw, 720px); }
@media (max-width: 899.98px) { .sort-intro__media { min-height: 60vw; } .sort-intro__copy { padding-right: 0; } }

/* ============ 2. the water ============ */
.sort-water { overflow: hidden; }
.water { position: relative; height: clamp(600px, 78vh, 900px); user-select: none; -webkit-user-select: none; }
.water__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.water__line { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--mist); opacity: .38; transform: translateX(-.5px); pointer-events: none; }
.water__labels { position: absolute; top: clamp(20px, 2.4vw, 36px); left: var(--gutter); right: var(--gutter); pointer-events: none; }
.water__label { margin: 0; font-family: var(--font-head); font-weight: 500; font-size: clamp(1.125rem, 1.6vw, 1.75rem); font-variation-settings: "wdth" 88; line-height: 1.15; color: var(--mist); max-width: 80%; }
.water__label--b { margin-left: auto; text-align: right; }
.water__label::after { content: ''; display: block; width: 48px; height: 1px; background: var(--mist); opacity: .55; margin-top: 10px; }
.water__label--b::after { margin-left: auto; }
.water__wakes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.wake { position: absolute; width: 18px; height: 8px; margin: -4px 0 0 -9px; border-radius: 50%; border: 1px solid var(--rose); opacity: .9; animation: st-wake 1.3s var(--ease-slack) forwards; }
.wake::after { content: ''; position: absolute; inset: -6px -12px; border-radius: 50%; border: 1px solid rgba(181, 107, 255, .7); animation: st-wake2 1.3s var(--ease-slack) .1s forwards; }
@keyframes st-wake { to { transform: scale(7, 4); opacity: 0; } }
@keyframes st-wake2 { to { transform: scale(1.6); opacity: 0; } }

.floats { position: absolute; inset: 0; }
.float { position: absolute; left: 0; top: 0; list-style: none; cursor: grab; touch-action: none; will-change: transform; }
.float:focus-visible { outline: none; }
.float:focus-visible .float__body { outline: 2px solid var(--glow); outline-offset: 3px; box-shadow: 0 0 0 1px var(--iris); }
.float__body { display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px; background: var(--mist); color: var(--raven); border-radius: 999px 0 0 999px; box-shadow: 0 1px 0 rgba(237, 240, 243, .35), 0 12px 28px rgba(0, 0, 0, .28); white-space: nowrap; transition: transform var(--dur-base) var(--ease-slack), box-shadow var(--dur-fast); position: relative; }
.float__body::after { content: ''; position: absolute; right: -1px; top: 8px; bottom: 8px; width: 2px; background: var(--iris); opacity: 0; transition: opacity var(--dur-fast); }
.float[data-side="a"] .float__body::after { opacity: 1; }
.float__body .rc-ico { color: var(--slate); width: 20px; height: 20px; }
.float__text { display: grid; line-height: 1.15; }
.float__name { font-family: var(--font-head); font-weight: 500; font-size: .9375rem; }
.float__meta { font-size: .75rem; color: var(--slate); }
.float__meta .fig { font-weight: 500; color: var(--raven); }
/* the page's text hover: a hovered float tilts 3 degrees like a buoy taking a wave and settles */
.float:hover .float__body { transform: rotate(3deg); }
.float.is-held { cursor: grabbing; z-index: 20; }
.float.is-held .float__body { transform: rotate(-2deg) scale(1.04); box-shadow: 0 2px 0 rgba(237, 240, 243, .4), 0 22px 44px rgba(0, 0, 0, .38); }
.float.is-landed .float__body { animation: st-bob .7s var(--ease-slack); }
@keyframes st-bob { 0% { transform: translateY(-4px) rotate(2deg); } 60% { transform: translateY(2px) rotate(-1deg); } 100% { transform: none; } }
.float__taps { display: none; }
@media (max-width: 899.98px) {
  .water { height: auto; min-height: 0; padding: 0 var(--gutter) 28px; }
  .water__labels { position: static; }
  .water__labels.shores { row-gap: 0; }
  .water__label { max-width: none; text-align: left; padding-top: 22px; }
  .water__label--b { text-align: left; margin-left: 0; }
  .water__label--b::after { margin-left: 0; }
  .water__line { display: none; }
  .floats { position: static; display: grid; gap: 14px; margin-top: 12px; }
  .float { position: static; cursor: default; touch-action: auto; display: grid; gap: 8px; transition: transform var(--dur-base) var(--ease-slack); }
  .float__body { white-space: normal; }
  .float:hover .float__body { transform: none; }
  .float__taps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .float__tap { height: 40px; border: 1px solid var(--mist); background: transparent; color: var(--mist); font-family: var(--font-head); font-weight: 500; font-size: 14px; border-radius: 999px 0 0 999px; transition: background-color var(--dur-fast), color var(--dur-fast); }
  .float__tap:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; box-shadow: none; }
  .float[data-side="a"] { transform: translateX(-6px); }
  .float[data-side="b"] { transform: translateX(6px); }
  .float[data-side="a"] .float__tap[data-tap="a"], .float[data-side="b"] .float__tap[data-tap="b"] { background: var(--mist); color: var(--raven); }
  .float[data-side="a"] .float__body::after { opacity: 1; }
}

/* ============ 3. the ledger shore and the result sheet ============ */
.sort-ledger { padding-top: clamp(48px, 6vw, 112px); }
.sort-controls { padding-right: clamp(8px, 2vw, 48px); }
.sort-controls .h3 { margin-bottom: 14px; }
.sort-controls__caption { margin: 0 0 clamp(20px, 2.4vw, 36px); color: var(--slate); max-width: none; }
.pcts { display: grid; gap: 6px; margin-bottom: clamp(24px, 3vw, 44px); }
.pcts:empty { margin-bottom: 0; }
.pct { display: grid; grid-template-columns: 1fr auto 1px auto; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.pct__cat { font-family: var(--font-head); font-weight: 500; font-size: 1.0625rem; }
.pct__side { display: inline-flex; align-items: center; gap: 8px; }
.pct__who { font-size: .8125rem; color: var(--slate); }
.pct__input { width: 74px; height: 44px; padding: 0 10px; background: var(--salt); border: 0; border-bottom: 1px solid var(--rule); border-radius: 4px 4px 0 0; font-family: var(--font-text); font-variant-numeric: tabular-nums lining-nums; font-weight: 500; font-size: 1.125rem; text-align: right; color: var(--raven); }
.pct__input:focus-visible { border-bottom-color: var(--iris); }
.pct__unit { font-size: .875rem; color: var(--slate); }
.pct__seam { width: 1px; height: 28px; background: var(--iris); }
.ask { border: 0; padding: 0; margin: 0 0 clamp(20px, 2.4vw, 32px); }
.ask__q { padding: 0; margin-bottom: 10px; font-family: var(--font-head); font-weight: 500; font-size: 1.0625rem; }
.ask__options { display: flex; flex-wrap: wrap; gap: 10px; }
.ask__opt { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px 0 12px; border: 1px solid var(--raven); border-radius: 999px 0 0 999px; cursor: pointer; font-family: var(--font-head); font-weight: 500; font-size: 15px; transition: background-color var(--dur-fast), color var(--dur-fast); }
.ask__opt input { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin: 0; border-radius: 50%; border: 1.5px solid var(--raven); background: transparent; transition: background-color var(--dur-fast), border-color var(--dur-fast); }
.ask__opt input:checked { background: var(--iris); border-color: var(--iris); box-shadow: 0 0 0 3px var(--iris-tint); }
.ask__opt:has(input:checked) { background: var(--raven); color: var(--mist); }
.ask__opt:has(input:checked) input { border-color: var(--mist); }
.ask__opt:has(input:focus-visible) { outline: 2px solid var(--iris-tint); outline-offset: 3px; box-shadow: 0 0 0 6px var(--iris); }

.sort-result { padding-left: clamp(8px, 2vw, 48px); }
.sort-result__empty { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; gap: clamp(20px, 3vw, 48px); align-items: center; }
.sort-result__phone { border-radius: 24px; box-shadow: 0 18px 40px rgba(18, 21, 25, .16); }
.sort-result__empty-line { margin: 0; font-family: var(--font-head); font-weight: 500; font-size: clamp(1.5rem, 2.2vw, 2.75rem); line-height: 1.12; font-variation-settings: "wdth" 88; }
.sheet { background: var(--salt); padding: clamp(20px, 2.4vw, 40px) clamp(18px, 2.2vw, 36px) clamp(22px, 2.6vw, 44px); border-radius: 6px 0 0 6px; position: relative; box-shadow: 0 1px 0 var(--rule); }
.sheet::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--iris); border-radius: 6px 0 0 6px; }
.sheet__progress { margin: 0 0 12px; font-family: var(--font-head); font-weight: 500; font-size: 1.0625rem; }
.sheet__rows { margin: 0 0 clamp(16px, 2vw, 28px); border-top: 1px solid var(--rule); }
.sheet__row { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: .9375rem; }
.sheet__row-name { font-family: var(--font-head); font-weight: 500; }
.sheet__row-cat { color: var(--slate); font-family: var(--font-text); font-weight: 400; }
.sheet__row-amt { text-align: right; }
.sheet__row-share { grid-column: 1 / -1; font-size: .8125rem; color: var(--slate); }
.sheet__row-share .fig { color: var(--raven); }
.sheet__totals { margin: 0 0 clamp(20px, 2.4vw, 36px); display: grid; gap: 0; }
.sheet__line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.sheet__line dt { font-family: var(--font-head); font-weight: 500; font-size: 1rem; }
.sheet__line dd { margin: 0; text-align: right; }
.sheet__line--total { display: block; padding: 14px 0 6px; }
.sheet__line--total dt { margin-bottom: 4px; }
.sheet__line--total dd { text-align: left; }
.sheet__line--total .fig--xl { font-size: clamp(3rem, 6.6vw, 96px); }
.sheet__plan-h { font-size: clamp(1.25rem, 1.6vw, 1.75rem); margin-bottom: 8px; }
.sheet__plan-line { margin: 0 0 18px; max-width: none; }
.sheet__actions { gap: 16px 28px; }
@media (max-width: 899.98px) {
  .sort-controls, .sort-result { padding-inline: 0; }
  .sort-result__empty { grid-template-columns: 1fr; }
  .sort-result__phone { max-width: 200px; }
  .pct { grid-template-columns: 1fr; gap: 8px; }
  .pct__seam { display: none; }
}
