/* «Η ίδια μέρα με δύο τρόπους» on the system pages (template-parts/swap.php, assets/js/swap.js).
   Drawings only move inside a panel marked .is-run; with reduced motion they show their finished state. */
.sw__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sw__tabs { display: inline-flex; padding: 4px; background: var(--bg-alt); }
.sw__tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 0; background: none; color: var(--muted); font: 600 15px var(--font-b); cursor: pointer; transition: background-color .2s, color .2s; }
.sw__tabs button svg { width: 17px; height: 17px; }
.sw__x { font-size: 19px; line-height: 1; }
.sw__tabs [aria-selected="true"][data-sw-tab="off"] { background: #fff; color: var(--navy); box-shadow: 0 1px 0 var(--line); }
.sw__tabs [aria-selected="true"][data-sw-tab="on"] { background: var(--navy); color: #fff; }
.sw__tabs button:focus-visible, .sw__pause:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sw__pause { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); background: #fff; color: var(--navy); font: 600 14px var(--font-b); cursor: pointer; }
.sw__pi { width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; box-sizing: border-box; }
.sw__pause[aria-pressed="true"] .sw__pi { width: 0; height: 0; border: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }

.sw__panel { padding: 24px; }
.sw__panel--off { background: var(--bg-alt); }
.sw__panel--on { background: var(--navy); }
.sw__panel.is-on { animation: sw-in .45s var(--ease) both; }
@keyframes sw-in { from { opacity: 0; transform: translateY(8px); } }
.sw__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.sw-c { display: grid; align-content: start; gap: 6px; padding: 16px 16px 20px; background: #fff; }
.sw__panel--on .sw-c { background: #fff; }
.sw-c > b { margin-top: 10px; color: var(--navy); font: 700 18px/1.25 var(--font-h); }
.sw-c > span { color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.sw-c__art { position: relative; height: 168px; padding: 14px; overflow: hidden; background: var(--bg-alt); box-sizing: border-box; font-size: 13px; color: var(--text); }
.sw__panel--on .sw-c__art { background: #eef3fe; }

/* meter */
.sw__meter { display: grid; grid-template-columns: auto auto minmax(120px, 1fr) auto; align-items: center; gap: 12px 28px; margin-top: 16px; padding: 14px 18px; background: #fff; }
.sw__panel--on .sw__meter { background: rgba(255, 255, 255, .08); }
.sw__m small { display: block; color: var(--muted); font-size: 12.5px; }
.sw__m .sw__u { display: inline; font: 600 14px var(--font-b); }
.sw__m b { font: 700 22px/1.2 var(--font-h); color: var(--navy); font-variant-numeric: tabular-nums; }
.sw__panel--on .sw__m small { color: #B9C9E4; }
.sw__panel--on .sw__m b { color: #fff; }
.sw__track { height: 8px; background: var(--hairline); }
.sw__panel--on .sw__track { background: rgba(255, 255, 255, .16); }
.sw__track i { display: block; height: 100%; width: var(--p); background: var(--bad); transition: width .4s linear; }
.sw__panel--on .sw__track i { background: #3ddc97; }
.sw__way { font-style: normal; font-size: 13px; color: var(--muted); }
.sw__panel--on .sw__way { color: #B9C9E4; }

/* ---------- drawings: the old way ---------- */
.swa-inbox { display: grid; gap: 8px; }
.swa-inbox span { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: center; padding: 8px 10px; background: #fff; border: 1px solid var(--line); }
.swa-inbox svg { width: 16px; height: 16px; color: var(--muted); }
.swa-inbox em { font-style: normal; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.swa-flag { position: absolute; right: 6px; top: -9px; padding: 2px 7px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 700; }

.swa-form { display: grid; gap: 6px; }
.swa-form label { display: grid; gap: 2px; }
.swa-form small { color: var(--muted); font-size: 11.5px; }
.swa-form label > span { display: block; height: 24px; padding: 0 8px; background: #fff; border: 1px solid var(--line-strong); line-height: 24px; white-space: nowrap; overflow: hidden; }
.swa-form s { position: relative; display: inline-block; text-decoration: none; }
.swa-form s::after { content: ""; position: absolute; right: -3px; top: 5px; width: 2px; height: 16px; background: var(--navy); opacity: 0; }

.swa-chat { display: grid; gap: 8px; }
.swa-chat span { max-width: 82%; padding: 7px 10px; font-size: 12.5px; line-height: 1.35; }
.swa-chat .is-us { justify-self: end; background: var(--navy); color: #fff; }
.swa-chat .is-them { justify-self: start; background: #fff; border: 1px solid var(--line); }

/* ---------- drawings: with the system ---------- */
.swa-order { display: grid; gap: 8px; padding: 12px; background: #fff; border-top: 3px solid var(--blue); }
.swa-order > b { font: 700 14px var(--font-h); color: var(--navy); }
.swa-order span { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: center; }
.swa-order i { display: grid; place-items: center; width: 18px; height: 18px; background: var(--ok); color: #fff; }
.swa-order i svg { width: 12px; height: 12px; }
.swa-ok { position: absolute; right: 22px; top: 22px; padding: 3px 8px; background: var(--ok); color: #fff; font: 700 11.5px var(--font-b); font-style: normal; }

.swa-list { display: grid; gap: 8px; }
.swa-list span { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 9px 10px; background: #fff; }
.swa-list em { font-style: normal; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.swa-list b { padding: 2px 7px; background: #e3f5ec; color: var(--ok); font-size: 11.5px; }

.swa-mail { display: grid; gap: 14px; padding: 12px; background: #fff; }
.swa-mail__h { display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: center; }
.swa-mail__h svg { width: 24px; height: 24px; padding: 4px; box-sizing: border-box; background: var(--blue); color: #fff; }
.swa-mail__h b { font: 700 13.5px/1.3 var(--font-h); color: var(--navy); }
.swa-mail ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 11.5px; color: var(--muted); }
.swa-mail li { display: grid; gap: 6px; }
.swa-mail li i { height: 6px; background: var(--hairline); }
.swa-mail li.is-done i, .swa-mail li i { transition: background-color .3s; }

.swa-print { display: grid; justify-items: center; }
.swa-print__head { position: relative; z-index: 1; width: 86%; height: 30px; background: var(--navy); }
.swa-print__head i { position: absolute; right: 10px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; }
.swa-print__feed { width: 74%; overflow: hidden; }
.swa-print__label { display: grid; gap: 4px; padding: 8px 10px 10px; background: #fff; border: 1px solid var(--line); border-top: 0; font-size: 11.5px; }
.swa-print__label b { font: 700 12px var(--font-h); color: var(--navy); }
.swa-print__label i { height: 24px; margin-top: 2px; background: repeating-linear-gradient(90deg, var(--navy) 0 2px, transparent 2px 4px, var(--navy) 4px 7px, transparent 7px 9px); }
.swa-print__label small { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- motion: only in the panel that is showing (.is-run restarts it) ---------- */
.is-run .swa-inbox span { animation: swa-pop 9s var(--ease) both infinite; animation-delay: calc(var(--i) * .7s); }
.is-run .swa-flag { animation: swa-flag 9s var(--ease) both infinite; animation-delay: 1.4s; }
.is-run .swa-form s { clip-path: inset(0 100% 0 0); animation: swa-type 9s steps(var(--n)) both infinite; animation-delay: calc(var(--i) * 2s); }
.is-run .swa-form s::after { animation: swa-cur 9s step-end both infinite; animation-delay: calc(var(--i) * 2s); }
.is-run .swa-chat span { animation: swa-pop 9s var(--ease) both infinite; animation-delay: calc(var(--i) * 1.5s); }
.is-run .swa-order span i { animation: swa-tick 9s cubic-bezier(.3, 1.4, .5, 1) both infinite; animation-delay: calc(.4s + var(--i) * .35s); }
.is-run .swa-ok { animation: swa-flag 9s var(--ease) both infinite; animation-delay: 1.5s; }
.is-run .swa-list span { animation: swa-pop 9s var(--ease) both infinite; animation-delay: calc(var(--i) * .25s); }
.is-run .swa-list b { animation: swa-flag 9s var(--ease) both infinite; animation-delay: calc(.5s + var(--i) * .25s); }
.is-run .swa-mail__h { animation: swa-pop 9s var(--ease) both infinite; }
.is-run .swa-mail li i { animation: swa-fill 9s var(--ease) both infinite; animation-delay: calc(.8s + var(--i) * .6s); }
.is-run .swa-print__label { animation: swa-print 9s var(--ease) both infinite; animation-delay: .3s; }
.is-run .swa-print__head i { animation: sw-blink 1.2s ease-in-out infinite; }
@keyframes swa-pop { 0% { opacity: 0; transform: translateY(8px); } 6%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes swa-flag { 0% { opacity: 0; transform: scale(1.3); } 5%, 90% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; } }
@keyframes swa-type { 0% { clip-path: inset(0 100% 0 0); } 18%, 92% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 100% 0 0); } }
@keyframes swa-cur { 0% { opacity: 1; } 20% { opacity: 0; } }
@keyframes swa-tick { 0% { opacity: 0; transform: scale(.4); } 4%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes swa-fill { 0% { background: var(--hairline); } 6%, 92% { background: var(--ok); } 100% { background: var(--hairline); } }
@keyframes swa-print { 0% { transform: translateY(-101%); } 14%, 90% { transform: none; opacity: 1; } 96% { opacity: 0; } 100% { transform: translateY(-101%); opacity: 0; } }
@keyframes sw-blink { 50% { opacity: .35; } }

/* the finished state, for reduced motion and before the first run */
@media (prefers-reduced-motion: reduce) {
	.sw [class*="swa-"], .sw [class*="swa-"] *, .sw__panel { animation: none !important; }
	.swa-mail li i { background: var(--ok); }
}
.a11y-nomotion .sw [class*="swa-"], .a11y-nomotion .sw [class*="swa-"] *, .a11y-nomotion .sw__panel { animation: none !important; }
.a11y-nomotion .swa-mail li i { background: var(--ok); }

@media (max-width: 860px) {
	.sw__grid { grid-template-columns: 1fr; }
	.sw__meter { grid-template-columns: 1fr 1fr; }
	.sw__track, .sw__way { grid-column: 1 / -1; }
	.sw__panel { padding: 16px; }
	.sw__tabs { width: 100%; }
	.sw__tabs button { flex: 1; justify-content: center; padding: 0 10px; }
}
