/* Likha Notify 1.0: the same file in every Likha project (see likha-notify.js). Each project sets its own look with these variables:
   --b-surface, --b-text, --b-muted, --b-line, --b-ok, --b-info, --b-warn, --b-danger, --b-urgent, --b-on-urgent, --b-accent,
   --b-on-accent, --b-font, --b-radius. The fallbacks are the browser's own colours, so a page without them still reads. */
.ln-region { position: fixed; z-index: 1000; top: calc(env(safe-area-inset-top, 0px) + 10px); left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
@media (min-width: 768px) { .ln-region { left: auto; right: max(20px, env(safe-area-inset-right, 0px)); top: calc(env(safe-area-inset-top, 0px) + 20px); width: 400px; } }
.ln-region:empty { display: none; }
.ln-toast, .ln-urgent { pointer-events: auto; box-sizing: border-box; width: 100%; max-width: 420px; font-family: var(--b-font, system-ui, sans-serif); color: var(--b-text, CanvasText); text-align: left; }
.ln-toast p, .ln-urgent p { margin: 0; }
.ln-toast { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 12px 10px 12px 14px; background: var(--b-surface, Canvas); border: 1px solid var(--b-line, GrayText); border-radius: var(--b-radius, 14px); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 16px 32px -16px rgb(0 0 0 / .4); --tone: var(--b-info, CanvasText); }
.ln-toast[data-tone="success"] { --tone: var(--b-ok, CanvasText); }
.ln-toast[data-tone="warning"] { --tone: var(--b-warn, CanvasText); }
.ln-toast[data-tone="error"] { --tone: var(--b-danger, CanvasText); border-color: var(--b-danger, GrayText); }
.ln-ic { color: var(--tone); display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px; }
.ln-text { min-width: 0; overflow-wrap: anywhere; }
.ln-title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.ln-body { font-size: 14px; line-height: 1.4; color: var(--b-muted, GrayText); margin-top: 2px !important; }
.ln-meta { font-size: 12px; margin-top: 4px !important; font-variant-numeric: tabular-nums; }
.ln-acts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ln-act { min-height: 44px; padding: 0 14px; border-radius: calc(var(--b-radius, 14px) - 4px); border: 1px solid var(--b-line, GrayText); background: transparent; color: inherit; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.ln-x { width: 44px; height: 44px; margin: -10px -6px -6px 0; border: 0; border-radius: 10px; background: transparent; color: var(--b-muted, GrayText); display: grid; place-items: center; cursor: pointer; }
.ln-x:hover, .ln-act:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.ln-x:focus-visible, .ln-act:focus-visible, .ln-pill:focus-visible, .ln-switch:focus-visible { outline: 2px solid var(--b-accent, Highlight); outline-offset: 2px; }
.ln-urgent { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 14px 14px 14px 16px; border-radius: var(--b-radius, 14px); background: var(--b-urgent, CanvasText); color: var(--b-on-urgent, Canvas); box-shadow: 0 18px 40px -16px rgb(0 0 0 / .55); }
.ln-urgent .ln-ic { color: inherit; position: relative; }
.ln-urgent .ln-ic::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: ln-ring 1.6s ease-out infinite; }
.ln-urgent .ln-title { font-size: 16px; }
.ln-urgent .ln-body, .ln-urgent .ln-meta { color: inherit; opacity: .88; }
.ln-urgent .ln-acts { grid-column: 1 / -1; margin-top: 10px; }
.ln-urgent .ln-act { flex: 1 1 140px; border-color: color-mix(in srgb, currentColor 45%, transparent); }
.ln-urgent .ln-act.ln-primary { background: var(--b-on-urgent, Canvas); color: var(--b-urgent, CanvasText); border-color: transparent; }

/* The sound pill and the two switches */
.ln-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--b-line, GrayText); background: var(--b-surface, Canvas); color: var(--b-text, CanvasText); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.ln-pill[data-state="locked"] { background: var(--b-accent, Highlight); color: var(--b-on-accent, HighlightText); border-color: transparent; }
.ln-pill[data-state="off"] { color: var(--b-muted, GrayText); }
/* The switches are one plain list with hairlines between rows, so they sit cleanly inside a page's own card or sheet */
.ln-switches { display: grid; }
.ln-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 10px 2px; border: 0; border-radius: 0; background: transparent; color: var(--b-text, CanvasText); font: inherit; text-align: left; cursor: pointer; }
.ln-switch + .ln-switch { border-top: 1px solid var(--b-line, GrayText); }
.ln-switch > span:first-child { display: grid; gap: 2px; }
.ln-sw-label { font-weight: 700; }
.ln-sw-hint { font-size: 13px; color: var(--b-muted, GrayText); }
.ln-track { flex: none; position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--b-line, GrayText); transition: background-color .18s; }
.ln-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--b-surface, Canvas); box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .18s cubic-bezier(.32, .72, 0, 1); }
.ln-switch[aria-checked="true"] .ln-track { background: var(--b-accent, Highlight); }
.ln-switch[aria-checked="true"] .ln-track::after { transform: translateX(18px); }

/* Motion: messages slide in for a fifth of a second; with reduced motion they only fade */
.ln-region .ln-toast, .ln-region .ln-urgent { animation: ln-in .22s cubic-bezier(.32, .72, 0, 1) both; }
.ln-region .ln-out { animation: ln-out .16s ease-in both !important; }
@keyframes ln-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes ln-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes ln-fade { from { opacity: 0; } }
@keyframes ln-ring { 0% { opacity: .7; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.6); } }
@media (prefers-reduced-motion: reduce) {
  .ln-region .ln-toast, .ln-region .ln-urgent { animation: ln-fade .2s ease both; }
  .ln-region .ln-out { animation: ln-fade .12s ease reverse both !important; }
  .ln-urgent .ln-ic::after { animation: none; }
  .ln-track, .ln-track::after { transition: none; }
}
@media (forced-colors: active) { .ln-toast, .ln-urgent, .ln-pill { border: 1px solid CanvasText; } }
