/* 김머니: immediate contact, a short glide, and a quiet arrival. */
:root {
  --motion-touch:80ms;
  --motion-release:160ms;
  --motion-enter:180ms;
  --motion-sheet:220ms;
  --motion-ease:cubic-bezier(.2,0,0,1);
  --motion-arrive:cubic-bezier(.05,.7,.1,1);
}

/* Keep native touch/trackpad inertia. Only explicit navigation is animated. */
html { scroll-behavior:auto; scrollbar-color:#bdc5bb transparent; }
.view { animation:none; }
dialog,dialog>[id$="-content"],.asset-filters { overscroll-behavior:contain; }
button,summary,a.button { -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
:is(.button,.google-button,.icon-button,.text-button,.asset-filters button,.more-section-list>button,.more-section-list>a,.transaction-row,.mobile-nav button,.entry-type label,summary) {
  transition:background-color var(--motion-release) var(--motion-ease),border-color var(--motion-release) var(--motion-ease),box-shadow var(--motion-release) var(--motion-ease),transform var(--motion-release) var(--motion-ease);
}
:is(.button,.google-button,.icon-button,.asset-filters button):active:not(:disabled) {
  transform:scale(.975);transition-duration:var(--motion-touch);
}
.button:where(:not(.secondary):not(.soft):not(.danger):not(.apple-signin)):active:not(:disabled) {
  transform:translateY(1px);box-shadow:0 0 0 transparent;transition-duration:var(--motion-touch);
}
:is(.text-button,.more-section-list>button,.more-section-list>a,.transaction-row,.entry-type label,summary):active:not(:disabled) {
  transform:scale(.994);background-color:var(--wash);transition-duration:var(--motion-touch);
}
.mobile-nav button:active:not(:disabled) { transform:scale(.94);transition-duration:var(--motion-touch); }
body[data-view=home] .topbar-actions [data-action=add] { box-shadow:none; }
button:disabled { transform:none!important; }
button.is-saving,.native-app .sheet-submit-dock button.is-saving { cursor:progress; }
button.is-saving::before {
  content:'';display:inline-block;width:14px;height:14px;margin-right:8px;vertical-align:-2px;
  border:2px solid currentColor;border-right-color:transparent;border-radius:50%;
  animation:money-saving 700ms linear infinite;
}
.motion-saved { background-color:var(--accent-soft)!important;box-shadow:inset 3px 0 0 var(--accent); }
.toast:not([hidden]) { display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;pointer-events:auto; }
.toast-message { flex:1 1 160px; }
.toast-action { color:var(--accent);background:transparent;border:0;border-radius:8px;min-height:44px;padding:8px;font:inherit;font-weight:600;white-space:normal; }
.toast-action:hover { background:#ffffff16; }
.toast-action:focus-visible { outline-color:var(--accent); }
@keyframes money-saving { to { transform:rotate(360deg); } }

@media(prefers-reduced-motion:no-preference) {
  .mobile-nav .motion-nav-arrival .icon { animation:money-nav-arrive var(--motion-enter) var(--motion-arrive); }
  dialog[open]:not(.sheet-dragging):not(.sheet-settling):not(.sheet-interacted):not(#native-age-dialog) { animation:money-dialog-enter var(--motion-enter) var(--motion-arrive); }
  dialog[open]::backdrop { animation:money-backdrop-enter var(--motion-enter) var(--motion-ease); }
  @keyframes money-dialog-enter { from { opacity:0;transform:translateY(8px); } to { opacity:1;transform:translateY(0); } }
  @keyframes money-sheet-enter { from { opacity:.7;transform:translateY(18px); } to { opacity:1;transform:translateY(0); } }
  @keyframes money-backdrop-enter { from { opacity:0; } to { opacity:1; } }
  @keyframes money-nav-arrive { from { opacity:.65;transform:scale(.9); } to { opacity:1;transform:scale(1); } }
  @media(max-width:760px) {
    .native-app dialog[open]:not(.sheet-dragging):not(.sheet-settling):not(.sheet-interacted):not(#native-age-dialog) { animation-name:money-sheet-enter;animation-duration:var(--motion-sheet); }
  }
}
.native-app dialog[open].sheet-interacted { animation:none; }
@media(max-width:760px) {
  .toast { bottom:calc(5.5em + 16px + var(--app-safe-bottom));max-width:calc(100vw - 32px);width:max-content;min-width:0; }
}
@media(prefers-reduced-motion:reduce) {
  button,summary,a.button,.transaction-row,.entry-type label,.more-section-list>a,.motion-saved { transform:none!important;transition:none!important;animation:none!important; }
  button.is-saving::before { animation:none; }
}
