/* App switcher (appswitch.js). Self-contained: every class starts with asw- so it never fights an app's own styles. */
.asw-btn, .asw {
  --asw-bg: #ffffff; --asw-text: #1d1b16; --asw-muted: #6b675b; --asw-line: rgba(0, 0, 0, .08); --asw-hover: rgba(0, 0, 0, .05);
  --asw-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 12px 32px rgba(20, 16, 8, .18);
}
@media (prefers-color-scheme: dark) {
  .asw-btn, .asw { --asw-bg: #1b1a17; --asw-text: #f2efe6; --asw-muted: #a39e8d; --asw-line: rgba(255, 255, 255, .09); --asw-hover: rgba(255, 255, 255, .06);
    --asw-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .5); }
}
/* the home page is always dark */
.home .asw { --asw-bg: #14172b; --asw-text: #f3f1ea; --asw-muted: #a3a6bf; --asw-line: rgba(255, 255, 255, .09); --asw-hover: rgba(255, 255, 255, .06); }

.asw-btn {
  flex: none; width: 40px; height: 40px; margin: 0 4px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 0; background: transparent; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.asw-btn:hover, .asw-btn[aria-expanded="true"] { background: color-mix(in srgb, currentColor 10%, transparent); }
.asw-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.asw-btn svg { width: 18px; height: 18px; fill: currentColor; opacity: .8; }
@media (pointer: coarse) { .asw-btn { width: 44px; height: 44px; margin: 0 2px; } }

.asw { position: fixed; inset: 0; z-index: 1000; font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--asw-text); }
.asw[hidden] { display: none; }
.asw-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0); transition: background .25s; }
.asw-panel {
  position: absolute; width: 320px; max-height: min(560px, calc(100vh - 80px)); overflow: auto; overscroll-behavior: contain;
  background: var(--asw-bg); border: 1px solid var(--asw-line); border-radius: 16px; box-shadow: var(--asw-shadow); padding: 8px;
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top left;
  transition: opacity .18s ease-out, transform .22s cubic-bezier(.16, 1, .3, 1);
}
.asw-open .asw-panel { opacity: 1; transform: none; }
.asw-grab { display: none; }

/* phones: bottom sheet within thumb reach */
.asw-phone .asw-panel {
  left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 82vh; border-radius: 20px 20px 0 0; border-bottom: 0;
  padding: 6px 12px calc(12px + env(safe-area-inset-bottom)); transform: translateY(100%); opacity: 1;
  transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}
.asw-phone.asw-open .asw-panel { transform: none; }
.asw-phone.asw-open .asw-scrim { background: rgba(0, 0, 0, .4); }
.asw-phone .asw-grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--asw-line); margin: 6px auto 4px; }
.asw-phone .asw-grab { background: color-mix(in srgb, var(--asw-text) 22%, transparent); }

.asw-h { margin: 10px 10px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--asw-muted); font-weight: 600; }
.asw-row {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 10px; border-radius: 12px;
  color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; transition: background .12s;
}
.asw-row:hover, .asw-row:focus-visible { background: var(--asw-hover); outline: none; }
.asw-row:active { background: var(--asw-hover); transform: scale(.99); }
.asw-mk {
  flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; color: #1a1408; background: var(--c);
}
.asw-txt { flex: 1; min-width: 0; display: grid; }
.asw-txt b { font-weight: 600; }
.asw-txt small { color: var(--asw-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asw-go { color: var(--asw-muted); font-size: 22px; line-height: 1; }
.asw-here { background: var(--asw-hover); }
.asw-here .asw-txt small { color: inherit; opacity: .75; }
.asw-foot { display: flex; gap: 4px; justify-content: space-between; margin-top: 6px; padding: 6px 4px 2px; border-top: 1px solid var(--asw-line); }
.asw-foot a { padding: 10px 8px; min-height: 44px; display: inline-flex; align-items: center; color: var(--asw-muted); text-decoration: none; font-size: 14px; border-radius: 8px; }
.asw-foot a:hover { color: var(--asw-text); background: var(--asw-hover); }

html.asw-lock { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .asw-panel, .asw-scrim { transition: none !important; } }

.asw-lg { background: none; }
.asw-lg img { width: 100%; height: 100%; object-fit: contain; }
.asw-lg .on-light { display: none; }
@media (prefers-color-scheme: light) { .asw-lg .on-dark { display: none; } .asw-lg .on-light { display: block; } }
