/* =====================================================================
   Pocket · Premium experience layer
   Loaded after pocketwise.css. Everything here is additive polish:
   motion, depth, touch ergonomics, phone-first tables, toasts, dialogs,
   the mobile tab bar and accessibility. No page works differently if
   this file (or premium.js) fails to load.
   ===================================================================== */

:root {
  --pw-ease: cubic-bezier(.22, 1, .36, 1);
  --pw-ease-soft: cubic-bezier(.4, 0, .2, 1);
  --pw-ring: 0 0 0 3px color-mix(in srgb, var(--pw-accent) 24%, transparent);
  --pw-safe-b: env(safe-area-inset-bottom, 0px);
  --pw-safe-t: env(safe-area-inset-top, 0px);
  --pw-tabbar-h: 64px;
  --pw-glass: color-mix(in srgb, var(--pw-surface) 80%, transparent);
}

/* ---------- Foundations ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; -webkit-tap-highlight-color: transparent; overflow-x: clip; }
a, button, input, select, textarea, summary, label { touch-action: manipulation; }
::selection { background: color-mix(in srgb, var(--pw-accent) 26%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--pw-border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--pw-border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--pw-faint); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }
html.pw-locked { overflow: hidden; }
img { -webkit-user-drag: none; }

/* Smooth theme switch (class is added by premium.js for a moment) */
html.pw-theming *, html.pw-theming *::before, html.pw-theming *::after {
  transition: background-color .35s var(--pw-ease-soft), border-color .35s var(--pw-ease-soft), color .35s var(--pw-ease-soft), box-shadow .35s var(--pw-ease-soft), fill .35s, stroke .35s !important;
}

/* Cross-page transitions (Chrome/Edge/Safari 18+): sidebar and top bar stay put, content cross-fades */
@view-transition { navigation: auto; }
.pw-sidebar { view-transition-name: pw-sidebar; }
.pw-topbar { view-transition-name: pw-topbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .24s; animation-timing-function: var(--pw-ease-soft); }
@media (max-width: 1023px) { .pw-sidebar { view-transition-name: none; } }

/* ---------- Skip link ---------- */
.pw-skip { position: fixed; left: 1rem; top: -4.5rem; z-index: 200; padding: .7rem 1.1rem; border-radius: 12px; background: var(--pw-accent); color: #fff; font-weight: 700; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); transition: top .25s var(--pw-ease); }
.pw-skip:focus { top: calc(.9rem + var(--pw-safe-t)); color: #fff; }

/* ---------- Page entrance ---------- */
@keyframes pw-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.pw-content > *:not(.pw-toast) { animation: pw-rise .55s var(--pw-ease) backwards; }
.pw-content > *:nth-child(2) { animation-delay: .04s; }
.pw-content > *:nth-child(3) { animation-delay: .08s; }
.pw-content > *:nth-child(4) { animation-delay: .12s; }
.pw-content > *:nth-child(5) { animation-delay: .16s; }
.pw-content > *:nth-child(6) { animation-delay: .2s; }
.pw-content > *:nth-child(n+7) { animation-delay: .24s; }
.pw-content > .columns > .column { animation: pw-rise .55s var(--pw-ease) backwards; }
.pw-content > .columns > .column:nth-child(2) { animation-delay: .06s; }
.pw-content > .columns > .column:nth-child(3) { animation-delay: .12s; }
.pw-content > .columns > .column:nth-child(4) { animation-delay: .18s; }
.pw-content > .columns > .column:nth-child(n+5) { animation-delay: .22s; }
.pw-content > .columns { animation: none !important; }

/* ---------- Top bar ---------- */
.pw-topbar { transition: box-shadow .25s var(--pw-ease-soft), border-color .25s, background-color .25s; padding-top: calc(.8rem + var(--pw-safe-t)); }
.pw-topbar.is-scrolled { box-shadow: 0 10px 30px -22px rgba(11,26,58,.55); border-bottom-color: var(--pw-border-strong); }
html[data-theme="dark"] .pw-topbar.is-scrolled { box-shadow: 0 12px 30px -20px rgba(0,0,0,.8); }
.pw-search { position: relative; }
.pw-search .input { padding-right: 2.9rem; transition: box-shadow .2s, border-color .2s, background-color .2s; }
.pw-kbd { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); display: inline-grid; place-items: center; min-width: 1.45rem; height: 1.45rem; padding: 0 .4rem; border-radius: 7px; border: 1px solid var(--pw-border-strong); border-bottom-width: 2px; background: var(--pw-surface-2); color: var(--pw-faint); font: 700 .72rem/1 var(--pw-display), sans-serif; pointer-events: none; transition: opacity .15s; }
.pw-search .input:focus ~ .pw-kbd { opacity: 0; }
@media (hover: none), (max-width: 1023px) { .pw-kbd { display: none; } }
.pw-top-actions .button.is-white, .pw-avatar { transition: transform .2s var(--pw-ease), box-shadow .2s, background-color .2s; }
@media (hover: hover) { .pw-top-actions .button.is-white:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(11,26,58,.45); } }
.pw-bell-dot { animation: pw-pulse 2.6s ease-in-out infinite; }
@keyframes pw-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pw-danger) 45%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
@media (max-width: 480px) { .pw-greet-date { display: none; } .pw-top-actions { gap: .4rem; } }

/* ---------- Sidebar & mobile drawer ---------- */
.pw-sidebar { overscroll-behavior: contain; scrollbar-width: thin; transition: transform .35s var(--pw-ease), box-shadow .35s; }
.pw-nav a { transition: background-color .18s var(--pw-ease-soft), color .18s, transform .2s var(--pw-ease); }
.pw-nav a .pw-ni { transition: transform .25s var(--pw-ease); }
@media (hover: hover) { .pw-nav a:hover .pw-ni { transform: translateX(2px) scale(1.06); } }
.pw-brand-mark { transition: transform .4s var(--pw-ease); }
.pw-brand:hover .pw-brand-mark { transform: rotate(-6deg) scale(1.06); }
@media (max-width: 1023px) {
  .pw-sidebar { width: min(86vw, 320px); padding-top: calc(1.4rem + var(--pw-safe-t)); padding-bottom: calc(1.2rem + var(--pw-safe-b)); }
  .pw-backdrop.is-open { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: pw-fade .25s ease both; }
  .pw-menu-btn { width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 999px; }
}
@keyframes pw-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Cards, depth, stat tiles ---------- */
.pw-card { position: relative; transition: box-shadow .25s var(--pw-ease-soft), border-color .25s, transform .25s var(--pw-ease); }
.pw-card:not(.is-hero) { background-image: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 45%); }
html[data-theme="dark"] .pw-card:not(.is-hero) { background-image: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 40%); }
@media (hover: hover) {
  a.pw-card.pw-clickable:hover { transform: translateY(-3px); }
  a.pw-card.pw-clickable:active { transform: translateY(-1px) scale(.992); }
}
.pw-stat-icon { position: relative; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 16%, transparent); transition: transform .3s var(--pw-ease); }
.pw-stat-icon .pw-svg { width: 1.45rem; height: 1.45rem; stroke-width: 1.6; }
.pw-stat-icon .pw-svg .d, .pw-stat-icon .pw-svg .f { fill-opacity: .24; }
.pw-card.is-hero .pw-stat-icon .pw-svg .d { fill-opacity: .3; }
@media (hover: hover) { a.pw-card:hover .pw-stat-icon, .pw-card.pw-stat:hover .pw-stat-icon { transform: rotate(-6deg) scale(1.08); } }
.pw-list-item { border-radius: 12px; margin-inline: -.5rem; padding-inline: .5rem; transition: background-color .18s var(--pw-ease-soft); }
@media (hover: hover) { a.pw-list-item:hover { background: var(--pw-surface-2); } }
.pw-empty { background-image: radial-gradient(60% 80% at 50% 0%, color-mix(in srgb, var(--pw-accent) 7%, transparent), transparent 70%); }
.pw-empty-art { width: 84px; height: 84px; border-radius: 26px; animation: pw-float 5s ease-in-out infinite; box-shadow: 0 18px 36px -20px var(--pw-accent), inset 0 0 0 1px color-mix(in srgb, var(--pw-accent) 18%, transparent); }
.pw-empty-art .pw-svg { width: 2.3rem; height: 2.3rem; stroke-width: 1.5; }
.pw-empty-art .pw-svg .d { fill-opacity: .24; }
@keyframes pw-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.pw-chart-card { overflow: hidden; }

/* ---------- Buttons ---------- */
.button { position: relative; transition: transform .18s var(--pw-ease), box-shadow .22s var(--pw-ease-soft), background-color .2s, border-color .2s, color .2s; user-select: none; -webkit-user-select: none; }
.button.is-primary { background-image: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 55%); }
@media (hover: hover) {
  .button:not([disabled]):not(.is-loading):hover { transform: translateY(-1px); }
  .button.is-primary:not([disabled]):hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.26), 0 12px 24px -10px var(--pw-accent); }
}
.button:not([disabled]):active { transform: translateY(0) scale(.97); transition-duration: .08s; }
.button[disabled], .button.is-loading { cursor: not-allowed; }
.button.is-loading { cursor: progress; }
.button.is-small:not(.is-loading) { min-width: 2.1rem; }
.pw-row-actions .button.is-small { transition: transform .18s var(--pw-ease), background-color .15s, color .15s, border-color .15s; }
@media (hover: hover) {
  .pw-row-actions .button.is-small:hover { color: var(--pw-accent); border-color: var(--pw-accent); background: var(--pw-accent-soft); }
  .pw-row-actions .button.is-small[data-confirm]:hover { color: var(--pw-danger); border-color: var(--pw-danger); background: color-mix(in srgb, var(--pw-danger) 10%, transparent); }
}

/* ---------- Forms ---------- */
.label { font-weight: 650; font-size: .84rem; letter-spacing: -.005em; color: var(--pw-text); margin-bottom: .4rem; }
.input, .textarea, .select select { min-height: 2.6rem; transition: border-color .18s, box-shadow .2s var(--pw-ease-soft), background-color .18s; }
.input::placeholder, .textarea::placeholder { color: var(--pw-faint); opacity: 1; }
@media (hover: hover) { .input:not(:focus):not([disabled]):hover, .textarea:not(:focus):hover, .select select:not(:focus):hover { border-color: color-mix(in srgb, var(--pw-accent) 45%, var(--pw-border-strong)); } }
.input:focus, .textarea:focus, .select select:focus { box-shadow: var(--pw-ring); }
.textarea { resize: vertical; min-height: 6.5rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--pw-accent); width: 1.05rem; height: 1.05rem; cursor: pointer; vertical-align: -.15rem; }
.checkbox, .radio { cursor: pointer; }
.help { line-height: 1.45; }
:focus-visible { outline: 2px solid var(--pw-accent); outline-offset: 2px; border-radius: 6px; }
.input:focus-visible, .textarea:focus-visible, .select select:focus-visible { outline: none; }
.tag { transition: transform .15s var(--pw-ease); }
progress.progress { border-radius: 99px; overflow: hidden; }
progress.progress::-webkit-progress-value { transition: width .8s var(--pw-ease); border-radius: 99px; }

/* ---------- Tables ---------- */
.pw-table tbody tr { transition: background-color .15s var(--pw-ease-soft); }
@media (hover: hover) { .pw-table tbody tr:hover { background: color-mix(in srgb, var(--pw-accent) 5%, transparent); } }
.pw-table.table tbody tr:hover td { background: transparent; }
.pw-table .pw-cell { min-width: 0; }
.table-container { overscroll-behavior-x: contain; }

/* ---------- Dropdowns ---------- */
.dropdown.is-active .dropdown-menu { display: block; animation: pw-pop .2s var(--pw-ease) both; transform-origin: top right; }
@keyframes pw-pop { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
.dropdown-menu { min-width: 15rem; max-width: calc(100vw - 1.25rem); }
.pw-notes { width: min(22rem, calc(100vw - 1.25rem)); max-height: min(70vh, 30rem); overflow-y: auto; overscroll-behavior: contain; }
.dropdown-content { box-shadow: 0 24px 54px -18px rgba(11,26,58,.45), 0 0 0 1px var(--pw-border); }
.dropdown-item { transition: background-color .15s; }

/* ---------- Toasts ---------- */
.pw-toasts { position: fixed; z-index: 90; top: calc(.9rem + var(--pw-safe-t)); right: 1rem; width: min(27rem, calc(100vw - 2rem)); display: flex; flex-direction: column; gap: .6rem; pointer-events: none; }
.pw-toasts > * { pointer-events: auto; }
.pw-toasts .notification, .pw-toast-x { position: relative; margin: 0; padding: .85rem 2.6rem .85rem .9rem; border-radius: 16px; display: flex; gap: .7rem; align-items: flex-start; font-weight: 550; line-height: 1.45; overflow: hidden;
  background: var(--pw-surface); color: var(--pw-text); border: 1px solid var(--pw-border-strong); box-shadow: 0 24px 50px -20px rgba(11,26,58,.5), 0 2px 6px rgba(11,26,58,.08);
  animation: pw-toast-in .5s var(--pw-ease) both; }
.pw-toasts .notification.is-leaving, .pw-toast-x.is-leaving { animation: pw-toast-out .28s var(--pw-ease-soft) forwards; }
@keyframes pw-toast-in { from { opacity: 0; transform: translateX(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes pw-toast-out { to { opacity: 0; transform: translateX(24px) scale(.96); height: 0; padding-block: 0; margin-block: -.3rem; } }
.pw-toast-ico { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc, var(--pw-accent)) 16%, transparent); color: var(--tc, var(--pw-accent)); }
.pw-toast-ico svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pw-toast-body { min-width: 0; flex: 1; padding-top: .12rem; overflow-wrap: anywhere; }
.pw-toasts .notification .delete, .pw-toast-x .delete { position: absolute; top: .65rem; right: .65rem; }
.pw-toasts .is-success, .pw-toast-x.is-success { --tc: var(--pw-ok); }
.pw-toasts .is-danger, .pw-toast-x.is-danger { --tc: var(--pw-danger); }
.pw-toasts .is-warning, .pw-toast-x.is-warning { --tc: var(--pw-warn); }
.pw-toasts .is-info, .pw-toast-x.is-info { --tc: var(--pw-accent); }
.pw-toasts .notification::after, .pw-toast-x::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--tc, var(--pw-accent)); transform-origin: left; animation: pw-toast-timer var(--pw-toast-ms, 6s) linear forwards; opacity: .85; }
.pw-toasts .notification:hover::after, .pw-toast-x:hover::after { animation-play-state: paused; }
@keyframes pw-toast-timer { to { transform: scaleX(0); } }
@media (min-width: 1024px) { .pw-toasts { top: calc(4.9rem + var(--pw-safe-t)); } }
@media (max-width: 560px) { .pw-toasts { right: .75rem; left: .75rem; width: auto; } }

/* ---------- Confirm dialog ---------- */
.pw-dialog { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 2rem); width: 26rem; color: var(--pw-text); overflow: visible; }
.pw-dialog::backdrop { background: rgba(7, 14, 34, .55); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: pw-fade .2s ease both; }
.pw-dialog[open] .pw-dialog-card { animation: pw-dialog-in .38s var(--pw-ease) both; }
@keyframes pw-dialog-in { from { opacity: 0; transform: translateY(18px) scale(.95); } to { opacity: 1; transform: none; } }
.pw-dialog-card { background: var(--pw-surface); border: 1px solid var(--pw-border-strong); border-radius: 22px; padding: 1.6rem 1.5rem 1.3rem; text-align: center; box-shadow: 0 40px 90px -30px rgba(0,0,0,.65); }
.pw-dialog-ico { width: 3.6rem; height: 3.6rem; margin: 0 auto 1rem; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--dc, var(--pw-warn)) 14%, transparent); color: var(--dc, var(--pw-warn)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dc, var(--pw-warn)) 22%, transparent); }
.pw-dialog-ico svg { width: 1.7rem; height: 1.7rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-dialog.is-danger { --dc: var(--pw-danger); }
.pw-dialog h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 .4rem; font-family: var(--pw-display), sans-serif; }
.pw-dialog p { color: var(--pw-muted); margin: 0 0 1.3rem; line-height: 1.5; overflow-wrap: anywhere; }
.pw-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.pw-dialog-actions .button { height: 2.8rem; justify-content: center; font-weight: 700; }
.pw-dialog.is-danger .button.is-primary { background-color: var(--pw-danger); border-color: var(--pw-danger); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 10px 22px -10px var(--pw-danger); }

/* ---------- Back to top ---------- */
.pw-totop { position: fixed; right: 1.1rem; bottom: 1.25rem; z-index: 31; width: 2.8rem; height: 2.8rem; border-radius: 50%; border: 1px solid var(--pw-border-strong); background: var(--pw-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--pw-text); display: grid; place-items: center; cursor: pointer; box-shadow: 0 14px 30px -14px rgba(11,26,58,.5); opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; transition: opacity .25s, transform .3s var(--pw-ease); }
.pw-totop.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.pw-totop svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .pw-totop:hover { color: var(--pw-accent); border-color: var(--pw-accent); } }

/* ---------- Mobile tab bar ---------- */
.pw-tabbar { display: none; }
@media (max-width: 1023px) {
  body.has-sidebar { padding-bottom: calc(var(--pw-tabbar-h) + 1.25rem + var(--pw-safe-b)); }
  .pw-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; position: fixed; left: max(.7rem, env(safe-area-inset-left)); right: max(.7rem, env(safe-area-inset-right)); bottom: calc(.7rem + var(--pw-safe-b)); z-index: 32; height: var(--pw-tabbar-h); padding: .35rem; border-radius: 24px;
    background: var(--pw-glass); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); border: 1px solid var(--pw-border-strong);
    box-shadow: 0 22px 48px -18px rgba(11,26,58,.55), 0 2px 8px rgba(11,26,58,.08); transition: transform .35s var(--pw-ease), opacity .25s; }
  html.pw-typing .pw-tabbar { transform: translateY(160%); opacity: 0; pointer-events: none; }
  .pw-tabbar > a, .pw-tabbar > button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 100%; border: 0; background: none; border-radius: 18px; color: var(--pw-muted); font: inherit; font-size: .68rem; font-weight: 650; letter-spacing: -.005em; cursor: pointer; text-decoration: none; transition: color .2s, background-color .2s, transform .15s var(--pw-ease); }
  .pw-tabbar > a:active, .pw-tabbar > button:active { transform: scale(.92); }
  .pw-tabbar .pw-svg { width: 1.4rem; height: 1.4rem; stroke-width: 1.6; }
  .pw-tabbar .pw-svg .d, .pw-tabbar .pw-svg .f { fill-opacity: .2; }
  .pw-tabbar .is-active { color: var(--pw-accent); background: var(--pw-accent-soft); }
  .pw-tabbar .is-active .pw-svg .d, .pw-tabbar .is-active .pw-svg .f { fill-opacity: .38; }
  .pw-tabbar .is-add { background: none !important; }
  .pw-tabbar .is-add .pw-fab { display: grid; place-items: center; width: 3.1rem; height: 3.1rem; margin-top: -1.35rem; border-radius: 18px; color: #fff;
    background: linear-gradient(145deg, color-mix(in srgb, var(--pw-btn) 78%, #fff), var(--pw-btn) 70%);
    box-shadow: 0 16px 30px -10px var(--pw-btn), inset 0 1px 0 rgba(255,255,255,.4), 0 0 0 4px var(--pw-bg); transition: transform .3s var(--pw-ease); }
  .pw-tabbar .is-add:active .pw-fab { transform: scale(.9) rotate(90deg); }
  .pw-tabbar .is-add .pw-svg { width: 1.5rem; height: 1.5rem; stroke-width: 2.2; }
  .pw-tabbar .is-add span:last-child { margin-top: -2px; }
  .pw-totop { bottom: calc(var(--pw-tabbar-h) + 1.5rem + var(--pw-safe-b)); }
  .pw-toasts { top: calc(.7rem + var(--pw-safe-t)); }
}
@media (max-width: 340px) { .pw-tabbar > a, .pw-tabbar > button { font-size: .6rem; } }

/* ---------- Phone-first tables: rows become cards ---------- */
@media (max-width: 720px) {
  .pw-card > .table-container > .pw-table, .pw-card > .table-container > .pw-table.is-stack { min-width: 0 !important; }
  .pw-table.is-stack, .pw-table.is-stack tbody, .pw-table.is-stack tr, .pw-table.is-stack td { display: block; width: 100%; }
  .pw-table.is-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .pw-table.is-stack tbody tr { position: relative; padding: .95rem 1.05rem; border-bottom: 1px solid var(--pw-border); }
  .pw-table.is-stack tbody tr:last-child { border-bottom: 0; }
  .pw-table.is-stack td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 0 !important; padding: .32rem 0 !important; text-align: right; min-height: 1.9rem; }
  .pw-table.is-stack td[data-label]:not([data-label=""])::before { content: attr(data-label); flex: none; font-size: .68rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--pw-faint); text-align: left; }
  .pw-table.is-stack td.is-title { display: block; text-align: left; padding-bottom: .5rem !important; }
  .pw-table.is-stack td.is-title .pw-name { align-items: center; }
  .pw-table.is-stack tr:has(td.is-check) td.is-title { padding-right: 2.4rem !important; }
  .pw-table.is-stack td.is-check { position: absolute; top: .95rem; right: 1.05rem; width: auto; padding: 0 !important; min-height: 0; }
  .pw-table.is-stack td.is-check input { width: 1.25rem; height: 1.25rem; }
  .pw-table.is-stack td.is-actions { display: block; text-align: left; margin-top: .45rem; padding-top: .7rem !important; border-top: 1px dashed var(--pw-border) !important; }
  .pw-table.is-stack .pw-row-actions { justify-content: flex-start; flex-wrap: wrap; gap: .4rem; }
  .pw-table.is-stack .pw-row-actions .button.is-small { width: 2.5rem; height: 2.5rem; }
  .pw-table.is-stack td[colspan] { display: block; text-align: left; }
  .pw-table.is-stack td .pw-cell { text-align: right; min-width: 0; }
  .pw-table.is-stack td.is-title::before { display: none !important; }
  .pw-bulk { flex-direction: column; align-items: stretch; }
  .pw-bulk .select, .pw-bulk .select select, .pw-bulk .button { width: 100%; }
}

/* ---------- Touch ergonomics ---------- */
@media (max-width: 768px) {
  .input, .textarea, .select select { font-size: 16px; }
  .button:not(.is-small) { min-height: 2.75rem; }
  .pw-nav a { padding-block: .7rem; }
  .pw-tabs a { padding-block: .6rem; }
  .pw-card.pw-stat { min-height: 88px; }
}
@media (hover: none) { .pw-card, .button, .pw-nav a { -webkit-touch-callout: none; } }

/* ---------- Auth screens ---------- */
.pw-auth-card { animation: pw-rise .6s var(--pw-ease) backwards; }
.pw-auth-hero .pw-statement { animation: pw-rise .8s .15s var(--pw-ease) backwards; }
.pw-statement-row { transition: transform .25s var(--pw-ease); }
@media (hover: hover) { .pw-statement-row:hover { transform: translateX(4px); } }

/* ---------- Print & reduced motion ---------- */
@media print { .pw-tabbar, .pw-toasts, .pw-totop, .pw-skip { display: none !important; } body.has-sidebar { padding: 0; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .pw-empty-art, .pw-bell-dot { animation: none !important; }
}

.pw-toast-body { white-space: pre-line; }
@media (max-width: 720px) { .pw-table.is-stack td.is-empty { display: none; } }
.pw-toasts .notification { background: var(--pw-surface) !important; color: var(--pw-text) !important; }
.pw-toasts .notification .delete { background: color-mix(in srgb, var(--pw-text) 14%, transparent); }
