/* Gangplan leave-by alerts: the settings card, the "next up" banner, and alerts shown on screen. Author: Lee Alderman. */
/* Builds on app.css (tokens, .card, .btn, .link-btn, .label); only what is new lives here. */

/* ---------- settings card ---------- */
.card.al-card { position: relative; align-items: stretch; gap: 16px; padding: 18px 16px 16px; overflow: hidden; overflow: clip; isolation: isolate; }   /* clip: the glow must never make the card scroll sideways */
.al-card::before {
  content: ""; position: absolute; z-index: -1; right: -80px; top: -100px; width: 260px; height: 260px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--coral) 17%, transparent), transparent 66%);
}
.al-card[hidden], .al-card [hidden], .al-next[hidden] { display: none; }
.al-card h4 { margin: 0; }

.al-head { display: flex; align-items: center; gap: 13px; }
.al-badge {
  position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; flex: none; font-size: 1.3rem; color: #fff;
  background: linear-gradient(135deg, #f3b23e, #e8613c 62%, #cf4b27);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .32) inset, 0 8px 18px rgba(232, 97, 60, .3);
  transform: rotate(4deg);
}
.al-is-on .al-badge::after { content: ""; position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: #7fe6b0; box-shadow: 0 0 0 2.5px var(--surface); }
.al-head div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.card .al-head h3 { margin: 0; font-size: 1.3rem; letter-spacing: -.015em; font-variation-settings: "SOFT" 60; }
.al-head p { color: var(--muted); font-size: .92rem; }

.al-body, .al-settings, .al-part, .al-pitch { display: flex; flex-direction: column; min-width: 0; }
.al-body { gap: 14px; }
.al-status:empty, .al-wait:empty { display: none; }
.al-hint { font-size: .86rem; line-height: 1.4; color: var(--muted); }

/* a switch and its words */
.al-row { display: flex; align-items: center; gap: 14px; }
.al-row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.al-row-text strong { font-weight: 650; font-size: 1rem; line-height: 1.25; }
.al-body > .al-row { padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--surface-2) 55%, transparent); border: 1px solid var(--line); transition: background .3s, border-color .3s; }
.al-is-on .al-body > .al-row { background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 24%, var(--line)); }
.al-switch { position: relative; flex: none; width: 52px; height: 32px; padding: 0; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--faint) 62%, var(--surface-2)); transition: background .25s; }
.al-knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .28), 0 3px 8px rgba(0, 0, 0, .12); transition: transform .3s var(--ease); }
.al-switch[aria-checked="true"] { background: var(--accent); }
.al-switch[aria-checked="true"] .al-knob { transform: translateX(20px); }
.al-switch:active .al-knob { width: 30px; }
.al-switch[aria-checked="true"]:active .al-knob { transform: translateX(16px); }
.al-switch:disabled { cursor: default; }
.al-switch.al-busy .al-knob::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 2.2px solid #12747f; border-right-color: transparent; animation: al-spin .7s linear infinite; }
@keyframes al-spin { to { transform: rotate(360deg); } }

/* what an alert looks like */
.al-pitch { gap: 12px; }
.al-sample { display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px 13px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); transform: rotate(-.7deg); margin: 2px 4px 0; }
.al-sample img { border-radius: 9px; flex: none; }
.al-sample div { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: .86rem; color: var(--muted); line-height: 1.35; }
.al-sample-top { display: flex; gap: 6px; font-size: .74rem; color: var(--faint); }
.al-sample-top b { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.al-sample strong { font-size: .95rem; color: var(--ink); }

/* the settings, once alerts are on */
.al-settings { gap: 14px; }
.al-part { gap: 9px; padding-top: 14px; border-top: 1px solid var(--line); }
.al-part:first-child { padding-top: 2px; border-top: 0; }
.al-dev { display: flex; gap: 12px; align-items: flex-start; padding: 12px 13px; border-radius: 14px; background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.al-dev-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; font-size: 1rem; background: var(--surface); color: var(--muted); box-shadow: var(--shadow-1); }
.al-dev-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; font-size: .86rem; line-height: 1.4; color: var(--muted); }
.al-dev-text strong { font-size: .96rem; line-height: 1.3; color: var(--ink); }
.al-dev-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.al-dev-actions .btn { flex: 1 1 auto; padding: 11px 14px; }
.al-dev-actions .link-btn { font-size: .86rem; }
.al-dev.al-good { background: color-mix(in srgb, var(--good) 10%, var(--surface)); }
.al-dev.al-good .al-dev-ic { background: var(--good); color: var(--surface); box-shadow: none; }
.al-dev.al-good .al-dev-ic .icon { stroke-width: 3; }
.al-dev.al-good .al-dev-actions { margin-top: 2px; }
.al-dev.al-ask { background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
.al-dev.al-ask .al-dev-ic { color: var(--accent); }
.al-dev.al-warn { background: color-mix(in srgb, var(--sun) 17%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sun) 42%, var(--line)); }
.al-dev.al-warn .al-dev-ic { color: color-mix(in srgb, var(--sun) 55%, var(--ink)); }
.al-dev.al-warn .al-dev-text { color: color-mix(in srgb, var(--ink) 78%, transparent); }

.al-locnote { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; line-height: 1.4; color: var(--muted); }
.al-locnote .icon { margin-top: .15em; color: var(--faint); }
.al-locnote.al-good .icon { color: var(--good); }
.al-locnote.al-warn .icon { color: color-mix(in srgb, var(--sun) 60%, var(--ink)); }
.al-locnote .link-btn { font-size: .86rem; padding: 0; }
.al-card .link-btn:disabled { opacity: .55; cursor: default; text-decoration: none; }

.al-cushion-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.al-cushion-head strong { font-weight: 650; }
.al-unit { font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.al-cushions { display: grid; grid-template-columns: 1.35fr repeat(5, 1fr); gap: 6px; }
.al-cushion {
  min-width: 0; height: 42px; padding: 0; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--muted);
  font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; transition: background .2s, color .2s, border-color .2s, transform .15s var(--ease), box-shadow .2s;
}
.al-cushion:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--ink); }
.al-cushion:active { transform: scale(.95); }
.al-cushion[aria-checked="true"] { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; color: var(--accent-ink); box-shadow: 0 5px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.al-test { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }

/* loading, trouble, offline */
.al-skel { display: flex; flex-direction: column; gap: 10px; padding: 0 0 4px; }
.al-skel span { display: block; border-radius: 12px; background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 45%, var(--surface)) 50%, var(--surface-2) 70%) 0 0 / 220% 100%; animation: al-shimmer 1.3s linear infinite; }
.al-skel-row { height: 74px; border-radius: 16px; }
.al-skel-line { height: 12px; width: 78%; }
.al-skel-line.short { width: 46%; }
@keyframes al-shimmer { to { background-position: -220% 0; } }
.al-notice { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 20px 16px 16px; border-radius: 18px; border: 1.5px dashed var(--line); background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.al-notice strong { font: 600 1.08rem/1.2 var(--display); }
.al-notice p { font-size: .9rem; color: var(--muted); max-width: 34ch; }
.al-notice .btn { margin-top: 10px; }
.al-bubble { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; margin-bottom: 4px; font-size: 1.15rem; color: var(--muted); background: var(--surface); box-shadow: var(--shadow-1); }
.al-banner { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 12px; font-size: .86rem; font-weight: 500; background: color-mix(in srgb, var(--sun) 20%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sun) 46%, var(--line)); color: color-mix(in srgb, var(--sun) 38%, var(--ink)); }
.al-banner .link-btn { color: inherit; text-decoration: underline; white-space: nowrap; font-size: .86rem; }
.al-card .btn:disabled { cursor: default; filter: saturate(.75); opacity: .78; }
.btn.al-loading .icon { display: none; }
.btn.al-loading::before { content: ""; width: 15px; height: 15px; flex: none; border-radius: 50%; border: 2.2px solid currentColor; border-right-color: transparent; animation: al-spin .7s linear infinite; }

/* ---------- next up: the banner on the Plan tab ---------- */
.al-next {
  --al-a: #0c4b53; --al-b: #12747f; --al-c: #1a9aa0; --al-ink: #fff; --al-glow: rgba(243, 178, 62, .5); --al-shade: rgba(14, 90, 99, .32);
  position: relative; isolation: isolate; overflow: hidden; overflow: clip; display: flex; flex-direction: column; gap: 9px; min-width: 0;
  padding: 15px 18px 15px; border-radius: 22px; color: var(--al-ink);
  background: linear-gradient(135deg, var(--al-a), var(--al-b) 55%, var(--al-c)); box-shadow: 0 14px 34px var(--al-shade);
}
.al-next::after { content: ""; position: absolute; z-index: -1; right: -70px; top: -90px; width: 250px; height: 250px; border-radius: 50%; background: radial-gradient(circle, var(--al-glow), transparent 65%); pointer-events: none; }
.al-next.al-soon { --al-a: #f8c860; --al-b: #f3b23e; --al-c: #ee9c2e; --al-ink: #33210a; --al-glow: rgba(255, 255, 255, .5); --al-shade: rgba(214, 148, 17, .34); }
.al-next.al-now { --al-a: #9e3518; --al-b: #c24422; --al-c: #dd5a34; --al-ink: #fff; --al-glow: rgba(243, 178, 62, .5); --al-shade: rgba(194, 68, 34, .4); animation: al-pulse 2.6s ease-in-out var(--al-sync, 0s) infinite; }
.al-next.al-late { --al-a: #7c1f12; --al-b: #ac3323; --al-c: #cf4b27; --al-ink: #fff; --al-glow: rgba(243, 178, 62, .45); --al-shade: rgba(184, 58, 42, .42); animation: al-pulse 2.6s ease-in-out var(--al-sync, 0s) infinite; }
.al-next.al-enter { animation: al-rise .6s var(--ease) backwards; }
.al-next.al-enter.al-now, .al-next.al-enter.al-late { animation: al-rise .6s var(--ease) backwards, al-pulse 2.6s ease-in-out var(--al-sync, 0s) infinite; }
@keyframes al-rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes al-pulse { 50% { box-shadow: 0 14px 34px var(--al-shade), 0 0 0 7px color-mix(in srgb, var(--al-c) 26%, transparent); } }

.al-top { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.al-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .86; }
.al-pill { flex: none; padding: 5px 12px; border-radius: 999px; font-size: .88rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; background: color-mix(in srgb, currentColor 14%, transparent); border: 1px solid color-mix(in srgb, currentColor 24%, transparent); }
.al-now .al-pill, .al-late .al-pill { background: #fff; border-color: transparent; color: var(--al-a); }
.al-big { font: 600 clamp(1.62rem, 7.4vw, 2.05rem)/1.06 var(--display); letter-spacing: -.028em; font-variation-settings: "SOFT" 50; text-wrap: balance; }
.al-sub { display: flex; gap: 8px; align-items: flex-start; font-size: .95rem; font-weight: 500; line-height: 1.35; }
.al-sub .icon { margin-top: .12em; opacity: .85; }
.al-sub span { min-width: 0; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.al-foot { font-size: .8rem; opacity: .9; margin-top: -3px; }

/* the little road: dotted while you wait, solid for the trip there, the marker is now */
.al-road { --at: 0%; --leave: 100%; position: relative; height: 28px; padding: 0 30px 0 13px; }
.al-road-track { position: relative; height: 100%; }
.al-road-line, .al-road-go, .al-road-done { position: absolute; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px; }
.al-road-line { left: 0; width: var(--leave); background: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 11px); opacity: .45; }
.al-road-go { left: var(--leave); right: 0; background: currentColor; opacity: .42; }
.al-road-done { left: 0; width: var(--at); background: currentColor; }
.al-road-tick { position: absolute; left: var(--leave); top: 50%; width: 3px; height: 13px; margin: -6.5px 0 0 -1.5px; border-radius: 2px; background: currentColor; }
.al-road-plain .al-road-tick, .al-road-plain .al-road-go { display: none; }
.al-road-car { position: absolute; left: var(--at); top: 50%; display: grid; place-items: center; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; font-size: .82rem; background: #fff; color: var(--al-a); box-shadow: 0 2px 8px rgba(0, 0, 0, .28); transition: left 1s linear; }
.al-soon .al-road-car { background: #33210a; color: #f8c860; }
.al-road-pin { position: absolute; right: 2px; top: 50%; display: grid; font-size: 1.25rem; transform: translateY(-58%); }

.al-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 3px; }
.al-next .al-btn { background: color-mix(in srgb, currentColor 13%, transparent); border-color: color-mix(in srgb, currentColor 26%, transparent); color: inherit; padding: 8px 13px; }
.al-next .al-btn:hover { background: color-mix(in srgb, currentColor 22%, transparent); }
.al-next.al-now .al-go, .al-next.al-late .al-go { background: #fff; border-color: transparent; color: var(--al-a); }
.al-next.al-now .al-go:hover, .al-next.al-late .al-go:hover { background: #fff; filter: brightness(.95); }
.al-next :focus-visible { outline-color: currentColor; }
.al-more-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: inherit; padding: 7px 2px; font-size: .86rem; font-weight: 600; opacity: .88; border-radius: 8px; }
.al-more-btn:hover { opacity: 1; }
.al-more-btn .icon { transition: transform .3s var(--ease); }
.al-more-btn[aria-expanded="true"] .icon { transform: rotate(180deg); }
.al-more { list-style: none; display: flex; flex-direction: column; gap: 9px; margin: 2px 0 0; padding: 11px 0 1px; border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.al-more-in { animation: al-rise .35s var(--ease); }
.al-more li { display: flex; align-items: center; gap: 11px; }
.al-more-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; flex: none; font-size: .95rem; background: color-mix(in srgb, currentColor 14%, transparent); }
.al-more-text { display: flex; flex-direction: column; min-width: 0; font-size: .84rem; line-height: 1.3; }
.al-more-text strong { font-size: .93rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-more-text span { opacity: .82; }
.al-say { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- alerts shown on screen while Gangplan is open ---------- */
.al-stack { position: fixed; z-index: 2400; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(94vw, 440px); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.al-toast {
  pointer-events: auto; display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; padding: 14px 14px 12px; border-radius: 22px;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-3); animation: al-drop .5s var(--ease) both; transition: opacity .25s, transform .25s var(--ease);
}
.al-toast-leave { background: linear-gradient(135deg, #9e3518, #c24422 58%, #dd5a34); color: #fff; }
.al-toast.al-out { opacity: 0; transform: translateY(-14px) scale(.97); }
@keyframes al-drop { from { opacity: 0; transform: translateY(-22px) scale(.96); } }
.al-toast-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; font-size: 1.15rem; background: color-mix(in srgb, currentColor 15%, transparent); }
.al-toast-leave .al-toast-ic { background: #fff; color: #9e3518; }
.al-toast-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .92rem; line-height: 1.4; overflow-wrap: anywhere; }
.al-toast-kicker { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .78; }
.al-toast-text strong { font: 600 1.14rem/1.2 var(--display); letter-spacing: -.01em; }
.al-toast-text > span:last-child { opacity: .9; }
.al-toast-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.al-toast-ok, .al-toast-open { border-radius: 999px; padding: 9px 20px; font-weight: 700; font-size: .93rem; transition: transform .15s var(--ease), filter .2s; }
.al-toast-ok { border: 0; background: var(--bg); color: var(--ink); }
.al-toast-leave .al-toast-ok { background: #fff; color: #9e3518; }
.al-toast-open { border: 1px solid color-mix(in srgb, currentColor 36%, transparent); background: none; color: inherit; font-weight: 600; }
.al-toast-ok:hover { filter: brightness(.94); }
.al-toast-ok:active, .al-toast-open:active { transform: scale(.96); }
.al-toast :focus-visible { outline-color: var(--sun); }

@media (prefers-color-scheme: dark) {
  .al-card::before { background: radial-gradient(circle, color-mix(in srgb, var(--coral) 12%, transparent), transparent 66%); }
  .al-switch.al-busy .al-knob::after { border-color: #0e5a63; border-right-color: transparent; }
  .al-dev.al-good .al-dev-ic { color: var(--accent-ink); }
  .al-next { --al-shade: rgba(0, 0, 0, .42); }
  .al-next.al-soon { --al-a: #f0bb52; --al-b: #e2a22c; --al-c: #d08e1c; --al-shade: rgba(0, 0, 0, .42); }
  .al-next.al-now, .al-next.al-late { --al-shade: rgba(0, 0, 0, .45); }
}
@media (max-width: 420px) {
  .al-next { padding: 14px 16px; }
  .al-cushions { gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .al-next, .al-toast, .al-more-in, .al-skel span, .al-road-car { animation: none; transition: none; }
}

/* The prompt on the home screen and the Plan tab, for someone who has not turned alerts on yet. */
.al-nudge { margin: 0 0 18px; max-width: 640px; }
.al-nudge[hidden] { display: none; }
.al-nudge .al-dev { box-shadow: var(--shadow-1); border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line)); }
.al-nudge .al-dev-actions { align-items: center; gap: 14px; }
.al-nudge .al-dev-actions .btn { flex: 0 1 auto; }
