/* ---- animated menus (header buttons, mobile dropdown, tabs, dialogs) ---- */
header .button,header .primary,header>div>button,.header-actions>a,.header-actions>button{position:relative;overflow:hidden;transition:translate .22s cubic-bezier(.2,.7,.2,1),scale .15s,background .2s,box-shadow .25s,color .2s}
header .button::after,header .primary::after,.header-actions>a::after,.header-actions>button::after{content:"";position:absolute;left:18px;right:18px;bottom:6px;height:2px;border-radius:2px;background:currentColor;opacity:.65;transform:scaleX(0);transform-origin:left center;transition:transform .3s cubic-bezier(.2,.7,.2,1)}
header .button:hover::after,header .primary:hover::after,header>div>button:hover::after,.header-actions>a:hover::after,.header-actions>button:hover::after,header .button:focus-visible::after,.header-actions>a:focus-visible::after{transform:scaleX(1)}
header .button:hover,header .primary:hover,header>div>button:hover,.header-actions>a:hover,.header-actions>button:hover{translate:0 -2px;box-shadow:0 8px 22px rgba(0,0,0,.28)}
header .button:active,header .primary:active,header>div>button:active,.header-actions>a:active,.header-actions>button:active{translate:0 0;scale:.97;box-shadow:none}
@keyframes menuIn{from{opacity:0;translate:0 -10px}to{opacity:1;translate:0 0}}
header .brand,header .mini-brand{animation:menuIn .5s cubic-bezier(.2,.7,.2,1) backwards}
header>div>*{animation:menuIn .5s cubic-bezier(.2,.7,.2,1) backwards}
header>div>*:nth-child(2){animation-delay:.06s}header>div>*:nth-child(3){animation-delay:.12s}header>div>*:nth-child(4){animation-delay:.18s}header>div>*:nth-child(5){animation-delay:.24s}
/* hamburger */
.menu-toggle{display:none;width:44px;height:44px;border-radius:12px;border:1px solid var(--line,#2b2d36);background:transparent;color:inherit;cursor:pointer;place-items:center;align-content:center;gap:4px;padding:0}
.menu-toggle i{display:block;width:18px;height:2px;border-radius:2px;background:currentColor;transition:transform .3s cubic-bezier(.2,.7,.2,1),opacity .2s}
.has-menu.open .menu-toggle i:nth-child(1){transform:translateY(6px) rotate(45deg)}.has-menu.open .menu-toggle i:nth-child(2){opacity:0;transform:scaleX(.2)}.has-menu.open .menu-toggle i:nth-child(3){transform:translateY(-6px) rotate(-45deg)}
@media(max-width:700px){
  header.has-menu{position:relative}
  .has-menu .menu-toggle{display:grid}
  header.has-menu>div{position:absolute;right:20px;top:calc(100% + 8px);z-index:40;display:flex;flex-direction:column;align-items:stretch;gap:6px;min-width:210px;padding:10px;border-radius:16px;background:color-mix(in srgb,var(--bg,#15161b) 94%,var(--accent,#888) 6%);border:1px solid var(--line,#2b2d36);box-shadow:0 22px 60px rgba(0,0,0,.45);opacity:0;visibility:hidden;transform:translateY(-8px) scale(.96);transform-origin:top right;transition:opacity .22s,transform .25s cubic-bezier(.2,.8,.2,1),visibility .22s}
  header.has-menu.open>div{opacity:1;visibility:visible;transform:none}
  header.has-menu>div>*{animation:none}
  header.has-menu.open>div>*{animation:menuIn .35s cubic-bezier(.2,.7,.2,1) backwards}
  header.has-menu.open>div>*:nth-child(2){animation-delay:.05s}header.has-menu.open>div>*:nth-child(3){animation-delay:.1s}header.has-menu.open>div>*:nth-child(4){animation-delay:.15s}
  header.has-menu>div .button,header.has-menu>div .primary,header.has-menu>div>a,header.has-menu>div>button{justify-content:center;width:100%}
}
/* tabs with a sliding pill */
.tabs{position:relative;display:inline-flex;flex-wrap:nowrap;gap:2px;padding:4px;border-radius:99px;background:#15161b;border:1px solid #2a2c34}
.tab-pill{position:absolute;left:0;top:0;border-radius:99px;background:#e4c5ad;pointer-events:none;opacity:0;transition:transform .38s cubic-bezier(.2,.8,.2,1),width .38s cubic-bezier(.2,.8,.2,1),height .38s,opacity .2s;z-index:0}
.tabs button{position:relative;z-index:1;background:transparent!important;border-color:transparent!important;transition:color .3s}
.tabs button[aria-selected="true"]{color:#25201d}.tabs button[aria-selected="true"] b{background:#25201d22;color:#25201d}
/* dialogs and toasts */
dialog.order[open]{animation:dlgIn .3s cubic-bezier(.2,.8,.2,1)}dialog.order[open]::backdrop{animation:backdropIn .3s ease}
@keyframes dlgIn{from{opacity:0;transform:translateY(16px) scale(.96)}to{opacity:1;transform:none}}@keyframes backdropIn{from{opacity:0}}
.toast{transition:opacity .25s,transform .3s cubic-bezier(.2,.8,.2,1)}
@media(prefers-reduced-motion:reduce){header *,header,.tab-pill,dialog.order,dialog.order::backdrop{animation:none!important;transition:none!important}.has-menu>div{transition:none!important}}

/* ---- shared visual polish (every page) ---- */
html{scroll-behavior:smooth}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
::selection{background:color-mix(in srgb,var(--accent,#e4c5ad) 45%,transparent);color:inherit}
:focus-visible{outline:2px solid var(--accent,#e4c5ad);outline-offset:3px;border-radius:6px}
button,a,input,select,textarea,summary{-webkit-tap-highlight-color:transparent}
button:not(:disabled),[role=button],a.button{cursor:pointer}
button:disabled{cursor:not-allowed}
input,select,textarea{transition:border-color .2s,box-shadow .25s,background .2s}
input:focus,select:focus,textarea:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent,#e4c5ad) 28%,transparent)}
*{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--accent,#888) 50%,transparent) transparent}
/* skeleton shimmer for placeholders */
.loading,.skeleton{position:relative;overflow:hidden}
.loading::after,.skeleton::after{content:"";position:absolute;inset:0;background:linear-gradient(100deg,transparent 20%,rgba(255,255,255,.1) 50%,transparent 80%);transform:translateX(-100%);animation:skel 1.4s ease-in-out infinite}
@keyframes skel{to{transform:translateX(100%)}}
/* friendlier empty states */
.empty{position:relative}
.empty::before{content:"";display:block;width:64px;height:64px;margin:0 auto 14px;border-radius:20px;background:color-mix(in srgb,var(--accent,#e4c5ad) 16%,transparent) center/30px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8l-9-5-9 5v8l9 5 9-5z'/%3E%3Cpath d='M3 8l9 5 9-5M12 13v8'/%3E%3C/svg%3E");animation:emptyBob 3.4s ease-in-out infinite}
@keyframes emptyBob{50%{transform:translateY(-5px)}}
/* back to top */
.to-top{position:fixed;right:18px;bottom:calc(18px + env(safe-area-inset-bottom));z-index:55;width:46px;height:46px;border-radius:50%;border:1px solid var(--line,#2b2d36);background:color-mix(in srgb,var(--bg,#15161b) 82%,var(--accent,#888) 18%);color:var(--text,#fff);display:grid;place-items:center;cursor:pointer;box-shadow:0 10px 28px rgba(0,0,0,.35);opacity:0;visibility:hidden;transform:translateY(14px) scale(.9);transition:opacity .25s,transform .3s cubic-bezier(.2,.8,.2,1),visibility .25s,background .2s;backdrop-filter:blur(10px)}
.to-top.show{opacity:1;visibility:visible;transform:none}
.to-top:hover{background:var(--accent,#e4c5ad);color:#111;transform:translateY(-3px)}
.to-top svg{width:20px;height:20px}
/* smooth page leave */
body.leaving{opacity:0;transition:opacity .22s ease}
