/* Sole trader accounts: the opener's invoice and the "What can I claim?" set piece (includes/svc/set-sole.php). */

/* ---------- Opener document: the invoice writes itself ---------- */
.doc__inv li { justify-content: space-between; gap: 12px; padding: 6px 0; }
.doc__inv li span { transition: opacity .5s; }
.doc__inv li b { font-weight: 700; white-space: nowrap; transition: opacity .4s .35s, transform .4s .35s; }
/* Between loops the lines dim (never vanish), then darken in turn as the invoice is written up again */
.motion:not(.motion-fail) .doc__inv li:not(.is-on) span { opacity: .4; transition-duration: .25s; }
.motion:not(.motion-fail) .doc__inv li:not(.is-on) b { opacity: .35; transform: translateX(-6px); transition-delay: 0s; }

/* ---------- What can I claim? ---------- */
.cl { --cw: clamp(256px, 20vw, 306px); --cg: clamp(18px, 1.8vw, 28px); --edge: 20px; position: relative; overflow: clip; }
.cl__ruling { position: absolute; inset: 0; pointer-events: none; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, rgba(255,255,255,.035) 35px, rgba(255,255,255,.035) 36px); animation: so-drift-36 22s linear infinite; }
.cl__ruling::before { content: ''; position: absolute; top: 0; bottom: 0; left: clamp(20px, 4.4vw, 70px); width: 1px; background: rgba(163,24,62,.7); }
.cl__pin { position: relative; }
.cl__head { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 16px clamp(32px, 5vw, 90px); }
.cl__head h2 { margin: 0; color: #fff; white-space: nowrap; }
.cl__headr .lede { margin: 0 0 10px; }
/* The row of slips sits in a window the width of the page column (plus a small edge), so slips are clipped before the screen edge */
.cl__viewport { position: relative; width: calc(min(1320px, 100% - var(--gutter) * 2) + var(--edge) * 2); margin-inline: auto; padding: 36px var(--edge) 18px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--edge); scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.3) transparent; }
.cl__track { position: relative; z-index: 1; display: flex; align-items: stretch; gap: var(--cg); width: max-content; }
.cl__hint { display: flex; align-items: center; gap: 12px; margin: 0; font-weight: 700; color: var(--highlight); }
.cl__hint svg { width: 40px; flex: none; }
.motion .cl__hint svg { animation: cl-nudge 1.6s ease-in-out infinite; }
@keyframes cl-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(8px); } }
.cl__hint-d { display: none; }
.cl--pin .cl__hint-d { display: inline; }
.cl--pin .cl__hint-m { display: none; }

.cl__cards { display: flex; gap: var(--cg); margin: 0; padding: 0; list-style: none; }
.cl__card { flex: none; display: flex; width: var(--cw); scroll-snap-align: start; translate: 0 0; transition: translate .5s var(--ease); }
.cl__card:hover { translate: 0 -10px; }
.cl__paper { position: relative; flex: 1; display: flex; flex-direction: column; min-height: min(400px, 52vh); padding: 20px 22px 24px; background: #fff; color: var(--ink); border-top: 4px solid var(--crimson); box-shadow: 0 30px 60px rgba(0,0,0,.42); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 33px, #F2E6E9 33px, #F2E6E9 34px); background-position: 0 6px; transform-origin: 50% 120%; transition: border-color .4s; }
.cl__paper::after { content: ''; position: absolute; left: 0; right: 0; bottom: -7px; height: 8px; background: linear-gradient(-45deg, transparent 5px, #fff 0) 0 0 / 10px 8px repeat-x, linear-gradient(45deg, transparent 5px, #fff 0) 0 0 / 10px 8px repeat-x; }
.cl__card--no .cl__paper { border-top-color: var(--ink-blue); }
.cl--pin .cl__paper { transition: box-shadow .45s var(--ease); }
.cl--pin .cl__card.is-active .cl__paper { box-shadow: 0 38px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08); }
.cl__k { margin: 0; font-weight: 700; font-size: .92rem; color: var(--ink-soft); }
.cl__t { margin: 4px 0 12px; font-family: var(--serif); font-size: clamp(1.5rem, 1.85vw, 1.85rem); line-height: 1.1; }
.cl__lines { margin: 0 0 4px; }
.cl__lines li { position: relative; padding: 6px 0 6px 18px; border-bottom: 1px dashed #DCCBD0; font-weight: 600; font-size: 1rem; line-height: 1.35; }
.cl__lines li::before { content: ''; position: absolute; left: 0; top: .95em; width: 8px; height: 2px; background: var(--crimson); }
.cl__card--no .cl__lines li::before { background: var(--ink-blue); }
.cl__card--no .cl__lines li { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: rgba(19,32,47,.55); text-decoration-thickness: 1.5px; }
.cl__note { margin: 12px 0 0; padding-top: 10px; border-top: 2px solid var(--ink); font-size: .97rem; line-height: 1.45; color: var(--ink-soft); }
.cl__stamp { position: relative; flex: none; align-self: flex-end; margin: auto 4px 0 0; width: 150px; height: 88px; display: grid; place-content: center; text-align: center; border: 3px solid var(--crimson); outline: 1.5px solid var(--crimson); outline-offset: -9px; border-radius: 50%; color: var(--crimson); background: rgba(255,255,255,.78); transform: rotate(-11deg); pointer-events: none; }
.cl__stamp span { padding: 0 16px; font-family: var(--serif); font-size: 1.2rem; line-height: 1.05; text-transform: uppercase; letter-spacing: .05em; }
.cl__card--no .cl__stamp { border-color: var(--ink-blue); outline-color: var(--ink-blue); color: var(--ink-blue); transform: rotate(8deg); }
.cl__card--no .cl__stamp span { font-size: 1.02rem; }

/* Live: slips arrive unchecked, the stamp lands as each one reaches the oval */
.cl-live .cl__card:not(.is-stamped) .cl__stamp { opacity: 0; }
.cl-live .cl__card:not(.is-stamped) .cl__paper { border-top-color: #D9C9CE; }
.cl-live .cl__card:not(.is-stamped) .cl__lines li { color: var(--ink); text-decoration-color: transparent; }
.cl-live .cl__card .cl__lines li { transition: color .4s, text-decoration-color .4s; }

.cl__end { flex: none; align-self: center; width: min(420px, 32vw); margin-left: clamp(10px, 2vw, 30px); padding: 30px 30px 28px; border: 1.5px solid rgba(255,255,255,.3); background: rgba(255,255,255,.04); }
.cl__end-t { margin: 0 0 12px; font-family: var(--serif); font-size: clamp(1.6rem, 2.1vw, 2.1rem); line-height: 1.12; color: #fff; }
.cl__end p:not(.cl__end-t) { color: var(--on-dark-soft); margin-bottom: 22px; }

.cl__zone { display: none; }
.cl__bar { position: relative; display: flex; align-items: center; gap: 14px 28px; margin-top: 18px; }
.cl__count { margin: 0; min-width: 8.6em; font-weight: 700; color: #fff; }
.cl__count b { font-weight: 700; color: var(--highlight); }
.cl__progress { flex: 1 1 200px; height: 3px; background: rgba(255,255,255,.18); }
.cl__progress i { display: block; height: 100%; background: var(--highlight); transform-origin: left; }
.cl__tally { display: flex; gap: 10px; margin: 0; }
.cl__chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1.5px solid rgba(255,255,255,.4); font-weight: 700; font-size: .95rem; white-space: nowrap; }
.cl__chip b { min-width: 1.2em; font-weight: 700; font-size: 1.1rem; text-align: right; }
.cl__chip--yes b { color: var(--highlight); }
.cl__chip--no { border-style: dashed; }
.cl__small { position: relative; margin: 12px auto 0; font-size: .95rem; color: var(--on-dark-soft); }

/* Desktop: the stage pins and the slips travel past the oval */
.cl.cl--pin { padding-block: 0; }
.cl--pin .cl__pin { height: 100svh; min-height: 600px; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--head-h) + 6px) 0 20px; }
.cl--pin .cl__viewport { overflow-x: clip; overflow-y: visible; padding: 26px var(--edge) 22px; margin-top: 8px; }
.cl--pin .cl__viewport::before, .cl--pin .cl__viewport::after { content: ''; position: absolute; top: 0; bottom: 0; z-index: 2; width: calc(var(--edge) + 10px); pointer-events: none; }
.cl--pin .cl__viewport::before { left: 0; width: var(--edge); background: linear-gradient(90deg, var(--wine) 35%, rgba(34,9,15,0)); }
.cl--pin .cl__viewport::after { right: 0; background: linear-gradient(270deg, var(--wine) 35%, rgba(34,9,15,0)); }
.cl--pin .cl__track { will-change: transform; }
.cl--pin .cl__end { margin-left: clamp(30px, 4vw, 70px); }
.cl--pin .cl__card { transform-origin: 50% 100%; }
/* The checking oval sits round the second slot: slips are stamped as they pass through it */
.cl--pin .cl__zone { display: block; position: absolute; left: calc(var(--edge) + var(--cw) * 1.5 + var(--cg)); top: 50%; z-index: 0; width: calc(var(--cw) + 70px); height: 100%; transform: translate(-50%, -50%); overflow: visible; pointer-events: none; }
.cl__zone ellipse { fill: none; stroke: rgba(242,214,75,.22); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.cl__zone .dash { stroke: rgba(255,255,255,.22); stroke-dasharray: 3 11; animation: dash-turn 40s linear infinite; }
.cl__zone.is-hit ellipse:first-child { stroke: rgba(242,214,75,.7); }
.cl__zone ellipse:first-child { transition: stroke .5s; }

@media (min-width: 901px) and (max-height: 760px) {
  .cl--pin .cl__paper { min-height: 0; }
  .cl--pin .cl__lines li { padding-block: 4px; }
  .cl--pin .cl__headr .lede { font-size: 1.05rem; }
  .cl--pin .cl__small { display: none; }
}

/* Phones and tablets: a swipeable strip under the heading */
@media (max-width: 900px) {
  .cl__head { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .cl__head h2 { white-space: normal; }
  .cl__viewport { width: auto; overflow: visible; padding: 0; }
  .cl__track { display: block; width: auto; }
  .cl__cards { overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); padding: 30px var(--gutter) 22px; scrollbar-width: none; }
  .cl__card { scroll-snap-align: center; }
  .cl__cards::-webkit-scrollbar { display: none; }
  .cl__card { width: min(78vw, 300px); }
  .cl__card:hover { translate: 0 0; }
  .cl__paper { min-height: 380px; }
  .cl__end { width: auto; margin: 8px var(--gutter) 0; padding: 24px 22px; }
  .cl__bar { width: min(1320px, 100% - var(--gutter) * 2); flex-wrap: wrap; margin-top: 22px; }
  .cl__progress { order: 3; flex-basis: 100%; }
}
@media (max-width: 560px) {
  .cl__ruling::before { display: none; }
  .cl__tally { flex-wrap: wrap; }
  .cl__end .btn { flex: 1 1 100%; }
}
