/* PT Accounts 2.0 — the playful layer: motion and feedback on top of Option A */

/* sliding tab indicator */
.tabs { position: relative; }
.tabs > a, .tab-more-btn { flex: none; }
.tabs > a { position: relative; z-index: 1; padding: 0 14px; font-size: 14.5px; }
.tabs > a.is-active { background: transparent !important; color: #fff; }
:root[data-theme="dark"] .tabs > a.is-active { color: #1f2221; }
.tab-ind { position: absolute; top: 0; left: 0; height: 40px; border-radius: 10px; background: #1f2221; z-index: 0; transition: transform .38s cubic-bezier(.34, 1.4, .64, 1), width .38s cubic-bezier(.34, 1.4, .64, 1), opacity .2s; opacity: 0; }
:root[data-theme="dark"] .tab-ind { background: #f2f1ef; }
.org.is-active { box-shadow: inset 0 0 0 1.5px var(--ink); }
.find { flex: none; }

/* backups toggle becomes a real switch */
.toggle { border: 0; background: none; cursor: pointer; padding: 0; font: inherit; color: var(--ink-3); }
.toggle i { transition: background-color .2s var(--ease); }
.toggle i::after { transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.toggle:not(.is-on) i { background: var(--line-2); }
.toggle:not(.is-on) i::after { transform: translateX(-16px); }

/* chart lines draw themselves, bars and rank bars grow */
.ch-line, .ch-area { animation: draw 1.1s var(--ease) both; }
.ch-line.s2 { animation-delay: .12s; }
@keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.rank-bar i { transform-origin: left; animation: grow .8s var(--ease) both; }
.rank-i:nth-child(2) .rank-bar i { animation-delay: .05s; } .rank-i:nth-child(3) .rank-bar i { animation-delay: .1s; } .rank-i:nth-child(4) .rank-bar i { animation-delay: .15s; } .rank-i:nth-child(5) .rank-bar i { animation-delay: .2s; } .rank-i:nth-child(n+6) .rank-bar i { animation-delay: .25s; }
@keyframes grow { from { transform: scaleX(0); } }
.ch-cursor { transition: opacity .15s, x1 .12s, x2 .12s; }
.ch-tip { transition: left .12s var(--ease); }

/* staggered entrance for cards, rows and list items */
.stat, .cell, .pay-row, .roster li, .tbl tbody tr { animation: pop .5s var(--ease) both; }
.stats .stat:nth-child(2), .dash-top .cell:nth-child(2) { animation-delay: .05s; }
.stats .stat:nth-child(3), .dash-top .cell:nth-child(3) { animation-delay: .1s; }
.stats .stat:nth-child(4) { animation-delay: .15s; }
.pay-row:nth-child(n+3), .roster li:nth-child(n+2), .tbl tbody tr:nth-child(n+2) { animation-delay: .04s; }
.pay-row:nth-child(n+5), .roster li:nth-child(n+4), .tbl tbody tr:nth-child(n+4) { animation-delay: .08s; }
.pay-row:nth-child(n+7), .roster li:nth-child(n+6), .tbl tbody tr:nth-child(n+6) { animation-delay: .12s; }
.tbl tbody tr:nth-child(n+9) { animation-delay: .16s; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }

/* hover play */
.stat { transition: transform .2s var(--ease), border-color .2s var(--ease); }
.stat:hover { transform: translateY(-3px); border-color: var(--line-2); }
.pay-row { transition: background-color .15s var(--ease), padding .2s var(--ease); border-radius: 12px; }
.pay-row:hover { background: var(--bg); padding: 0 8px; }
.pay-row .chip { transition: transform .2s cubic-bezier(.34, 1.56, .64, 1); }
.pay-row:hover .chip { transform: scale(1.05); }
.av { transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
tr:hover .av, .pay-row:hover .av, .roster li a:hover .av, .cell-party:hover .av { transform: rotate(-8deg) scale(1.1); }
.quick a span.q { transition: background-color .15s var(--ease), color .15s var(--ease), transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.quick a:hover span.q { transform: translateY(-3px) rotate(-6deg); }
.quick a:active span.q { transform: scale(.9); }
.btn { transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .2s cubic-bezier(.34, 1.56, .64, 1); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.96); }
.btn .i-plus { transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.btn:hover .i-plus { transform: rotate(90deg); }
.side-new .i-plus { transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.side-new:hover .i-plus { transform: rotate(90deg); }
.seg-b { transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s cubic-bezier(.34, 1.56, .64, 1); }
.seg-b:active { transform: scale(.94); }
.export { transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .2s var(--ease); }
.export:hover { transform: translateY(-2px); }
.export:hover .i-download { animation: nudge .6s var(--ease) infinite alternate; }
@keyframes nudge { to { transform: translateY(3px); } }

/* account cards tilt toward the cursor and shine */
.acct { transition: transform .25s var(--ease), box-shadow .25s var(--ease); transform-style: preserve-3d; will-change: transform; }
.acct::after { content: ''; position: absolute; inset: 0; background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .22), transparent 60%); opacity: 0; transition: opacity .25s; pointer-events: none; }
.acct:hover::after { opacity: 1; }
.acct:hover { box-shadow: 0 16px 32px rgba(53, 57, 56, .22); }

/* form total pops when it changes */
.form-total output.bump { animation: bump .35s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes bump { 50% { transform: scale(1.06); color: var(--accent-text); } }
.form-total output { display: inline-block; }

/* toast slides with a granule */
.toast { display: flex; align-items: center; gap: 10px; border-radius: 999px; padding: 10px 18px 10px 12px; }
.toast::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--green); box-shadow: inset -2px -3px 4px rgba(0, 0, 0, .2), inset 2px 2px 3px rgba(255, 255, 255, .5); }
.toast.is-on { animation: toastIn .45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes toastIn { from { transform: translate(-50%, 20px) scale(.9); } }

/* granule burst */
.granule { position: fixed; z-index: 200; width: 10px; height: 10px; border-radius: 50%; pointer-events: none; box-shadow: inset -2px -2px 3px rgba(0, 0, 0, .22), inset 1px 1px 2px rgba(255, 255, 255, .6); }

/* command palette */
.pal { position: fixed; inset: 0; z-index: 90; background: rgba(53, 57, 56, .3); display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; backdrop-filter: blur(2px); }
.pal.is-on { display: flex; animation: fadeIn .16s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }
.pal-box { width: min(600px, calc(100vw - 32px)); background: var(--surface); border-radius: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .22); overflow: hidden; animation: palIn .3s cubic-bezier(.34, 1.4, .64, 1); }
@keyframes palIn { from { transform: translateY(-10px) scale(.97); opacity: 0; } }
.pal-top { display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.pal-top input { flex: 1; height: 60px; border: 0; font-size: 17px; outline: none; background: transparent; color: var(--ink); }
.pal-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.pal-g { font-size: 12px; color: var(--ink-3); padding: 10px 12px 6px; }
.pal-i { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border-radius: 12px; font-size: 15px; }
.pal-i .i { color: var(--ink-3); }
.pal-i small { margin-left: auto; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.pal-i.is-sel { background: var(--ink); color: var(--bg); }
.pal-i.is-sel .i, .pal-i.is-sel small { color: inherit; opacity: .8; }
.pal-foot { display: flex; gap: 16px; padding: 10px 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; font: 500 11px/1 var(--font); color: var(--ink-3); background: var(--surface); margin-right: 4px; }

/* keyboard hint under the overview */
.hint { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 20px; font-size: 13px; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) { .tab-ind { transition: none; } }
