﻿/* My Hub: "bold neon" look. Dark arcade first, with a crisp "day" variant (strong colours, no glow blur).
   Animations use transform/opacity only (two small exceptions: the conic border angle on the one hovered tile, and the focused
   sign-in field) and pause when the tab is hidden (html.paused, set in js/theme.js). prefers-reduced-motion: static glow.
   Body text is solid off-white on dark panels; neon is only used for accents, headings, borders and icons.
   Text/background pairs were chosen for WCAG AA (4.5:1). System fonts only: works offline. */

/* ---------- theme variables ---------- */
:root {
  /* night (default): near-black, glowing neon */
  --bg: #05050a; --bg2: #0a0716;
  --glass: rgba(13, 11, 26, .86); --glass-strong: rgba(11, 9, 22, .96);
  --line: rgba(170, 150, 255, .26); --line-hi: rgba(34, 240, 255, .7);
  --text: #f5f5fc; --muted: #b9b9d4; --heading-to: #ff4fd8;
  --accent: #22f0ff; --accent-text: #02060a; --accent2: #ff2bd6; --violet: #a370ff;
  --danger: #ff8d9e; --chip: rgba(160, 130, 255, .18); --ok: #4dffa6;
  --glow: rgba(34, 240, 255, .5); --shadow: rgba(0, 0, 0, .6); --inner: rgba(255, 255, 255, .06);
  --grid: rgba(255, 43, 214, .5); --grid2: rgba(34, 240, 255, .28);
  --o-glow: .9; --scan: .22; --grain: .06; --gridop: .55;
  --on-glow: 1; /* 1 = glow on, 0 = off (day) */
  --radius: 18px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
  --font-head: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Segoe UI Variable Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-digit: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  /* module colours as r g b triplets: notes cyan, bills amber, lists lime, money green, health pink, docs violet, admin red-orange */
  --m-def: 34 240 255; --m-notes: 34 240 255; --m-bills: 255 176 0; --m-lists: 182 255 46; --m-money: 61 255 154;
  --m-health: 255 62 165; --m-docs: 163 112 255; --m-admin: 255 106 61; --m-messages: 41 121 255;
  color-scheme: dark;
}
/* day: white base, saturated neon accents as strong flat colours, no glow */
:root[data-theme="light"] {
  --bg: #f7f6fc; --bg2: #efedfa;
  --glass: rgba(255, 255, 255, .96); --glass-strong: #ffffff;
  --line: rgba(60, 40, 140, .22); --line-hi: rgba(0, 112, 160, .7);
  --text: #12102a; --muted: #4a4670; --heading-to: #c0007f;
  --accent: #006e9a; --accent-text: #ffffff; --accent2: #b0007f; --violet: #5b21d6;
  --danger: #b42318; --chip: rgba(91, 33, 214, .1); --ok: #047857;
  --glow: rgba(0, 0, 0, 0); --shadow: rgba(40, 30, 100, .16); --inner: rgba(255, 255, 255, .9);
  --grid: rgba(176, 0, 127, .22); --grid2: rgba(0, 110, 154, .16);
  --o-glow: 0; --scan: 0; --grain: .03; --gridop: .5; --on-glow: 0;
  --m-def: 0 110 154; --m-notes: 3 105 161; --m-bills: 180 83 9; --m-lists: 77 124 15; --m-money: 4 120 87;
  --m-health: 190 24 93; --m-docs: 109 40 217; --m-admin: 194 65 12; --m-messages: 29 78 216;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f6fc; --bg2: #efedfa;
    --glass: rgba(255, 255, 255, .96); --glass-strong: #ffffff;
    --line: rgba(60, 40, 140, .22); --line-hi: rgba(0, 112, 160, .7);
    --text: #12102a; --muted: #4a4670; --heading-to: #c0007f;
    --accent: #006e9a; --accent-text: #ffffff; --accent2: #b0007f; --violet: #5b21d6;
    --danger: #b42318; --chip: rgba(91, 33, 214, .1); --ok: #047857;
    --glow: rgba(0, 0, 0, 0); --shadow: rgba(40, 30, 100, .16); --inner: rgba(255, 255, 255, .9);
    --grid: rgba(176, 0, 127, .22); --grid2: rgba(0, 110, 154, .16);
    --o-glow: 0; --scan: 0; --grain: .03; --gridop: .5; --on-glow: 0;
    --m-def: 0 110 154; --m-notes: 3 105 161; --m-bills: 180 83 9; --m-lists: 77 124 15; --m-money: 4 120 87;
    --m-health: 190 24 93; --m-docs: 109 40 217; --m-admin: 194 65 12; --m-messages: 29 78 216;
    color-scheme: light;
  }
}
/* the current module's colour (--mt) drives its tile, header bar, icons, focus rings and checks */
[data-mod] { --mt: var(--m-def); }
[data-mod="notes"] { --mt: var(--m-notes); } [data-mod="bills"] { --mt: var(--m-bills); } [data-mod="lists"] { --mt: var(--m-lists); }
[data-mod="money"] { --mt: var(--m-money); } [data-mod="health"] { --mt: var(--m-health); } [data-mod="docs"] { --mt: var(--m-docs); }
[data-mod="admin"] { --mt: var(--m-admin); }
[data-mod="messages"] { --mt: var(--m-messages); }
html[data-mod]:root { --accent: rgb(var(--mt)); --accent2: rgb(var(--mt)); --line-hi: rgb(var(--mt) / .7); --heading-to: rgb(var(--mt)); }
:root:not([data-theme="light"])[data-mod] { --glow: rgb(var(--mt) / .5); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"])[data-mod] { --glow: rgba(0, 0, 0, 0); }
  :root:not([data-theme="dark"]):not([data-theme="light"])[data-mod] { --accent-text: #ffffff; }
}
:root[data-theme="light"][data-mod] { --glow: rgba(0, 0, 0, 0); --accent-text: #ffffff; }
/* @property lets the conic border angle animate where supported; elsewhere the border is simply static */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
/* no backdrop-filter support: panels are already near-solid, nothing else to do */

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { background: var(--bg); }
html, body { margin: 0; height: 100%; }
body {
  background: transparent; color: var(--text);
  font: 17px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.boot { padding: 2rem; color: var(--muted); }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--glow); }

/* ---------- neon arcade background ---------- */
/* layers: <i>1 = perspective grid floor (only its transform moves), <i>2/3 = static neon horizon glows,
   ::before = scanlines, ::after = film noise. All static except the grid. */
.aurora {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  transition: opacity .5s ease;
}
.aurora i { position: absolute; }
.aurora i:nth-child(1) {
  left: -50%; right: -50%; bottom: -35%; height: 90%; opacity: var(--gridop);
  background-image: linear-gradient(var(--grid) 2px, transparent 2px), linear-gradient(90deg, var(--grid2) 2px, transparent 2px);
  background-size: 64px 64px; transform-origin: 50% 0; will-change: transform;
  transform: perspective(380px) rotateX(66deg);
  animation: floor 4.5s linear infinite;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 40%); mask-image: linear-gradient(to bottom, transparent 0%, #000 40%);
}
.aurora i:nth-child(2) { left: -20%; right: -20%; bottom: 14%; height: 40%; opacity: var(--o-glow); background: radial-gradient(60% 100% at 50% 100%, rgba(255, 43, 214, .32), transparent); }
.aurora i:nth-child(3) { top: -30%; left: -30%; width: 90vmax; height: 90vmax; border-radius: 50%; opacity: var(--o-glow); background: radial-gradient(closest-side, rgba(110, 60, 255, .3), transparent); }
.aurora::before {
  content: ""; position: absolute; inset: 0; opacity: var(--scan);
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .55) 0 1px, transparent 1px 3px);
}
.aurora::after {
  content: ""; position: absolute; inset: 0; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* one grid cell (64px) per loop, so the loop is seamless */
@keyframes floor {
  from { transform: perspective(380px) rotateX(66deg) translate3d(0, 0, 0); }
  to { transform: perspective(380px) rotateX(66deg) translate3d(0, 64px, 0); }
}
/* the editor needs calm: dim and freeze the background while a note is open */
body:has(.editor) .aurora { opacity: .25; }
body:has(.editor) .aurora i { animation-play-state: paused; }
html.paused *, html.paused *::before, html.paused *::after { animation-play-state: paused !important; }

/* ---------- controls ---------- */
button {
  position: relative; min-height: 44px; min-width: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--glass); color: var(--text);
  box-shadow: inset 0 1px 0 var(--inner);
  transition: transform .15s ease, border-color .2s ease, background-color .2s ease;
  -webkit-tap-highlight-color: transparent;
}
button .icon { width: 22px; height: 22px; vertical-align: middle; }
button:hover { border-color: var(--line-hi); }
button:active { transform: scale(.94); }
button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--accent-text);
  border-color: transparent; font-weight: 650;
  box-shadow: 0 0 18px -2px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .4);
}
button.danger { color: var(--danger); }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 5px var(--glow); }
button[disabled] { opacity: .5; cursor: default; }
input[type=text], input[type=password], input[type=search], textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--glass); color: var(--text);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: border-color .2s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .9; }
input:focus, textarea:focus { border-color: var(--line-hi); }

/* ---------- frame ---------- */
.shell { max-width: 880px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.bar {
  display: flex; gap: 8px; align-items: center; padding: 8px 10px; margin: 8px 10px 4px;
  position: sticky; top: calc(8px + env(safe-area-inset-top)); z-index: 5; border-radius: 20px;
  background: var(--glass-strong); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 10px 30px -14px var(--shadow), inset 0 1px 0 var(--inner);
}
.bar h1 { font: 650 1.2rem/1.2 var(--font-head); margin: 0 8px 0 4px; letter-spacing: .01em; }
.bar .grow { flex: 1; min-width: 0; }
.bar button { border-color: transparent; background: transparent; box-shadow: none; }
.bar button:hover { background: var(--chip); }
.status { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); padding: 8px 18px 0; min-height: 1.4em; }
.status.bad { color: var(--danger); }
.status .chip { min-height: 44px; font-size: .8rem; }
.orb { width: 10px; height: 10px; border-radius: 50%; flex: none; position: relative; background: var(--muted); }
.orb::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: inherit; opacity: 0; }
.orb[data-state="synced"], .orb[data-state="saved"] { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.orb[data-state="syncing"] { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.orb[data-state="syncing"]::after { animation: pulse 1.4s ease-out infinite; }
.orb[data-state="offline"], .orb[data-state="auth"] { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }
.orb[data-state="error"] { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
@keyframes pulse { from { transform: scale(.6); opacity: .7; } to { transform: scale(2.4); opacity: 0; } }
.tabs { display: flex; gap: 6px; padding: 4px 14px; }
.tabs button { min-height: 44px; }
.tabs button[aria-pressed="true"], .chip[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--accent-text); border-color: transparent; font-weight: 650;
}
.chips { display: flex; flex-wrap: nowrap; gap: 8px; padding: 6px 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-padding-inline: 14px; }
.chips::-webkit-scrollbar { display: none; }
/* Never squeeze a chip: each keeps its own width and the row scrolls sideways (iPhone overlap bug). */
.chips > *, .range > *, .tabs > * { flex: 0 0 auto; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); white-space: nowrap; box-shadow: none; }
.banner { background: var(--glass); border: 1px solid var(--line-hi); padding: 8px 14px; margin: 8px 12px 0; border-radius: 16px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.hidden { display: none !important; }
.pre { white-space: pre-wrap; }
.msg { color: var(--danger); font-size: .9rem; min-height: 1.2em; }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }

/* page transition: every screen rises in */
main > *, .module > * { animation: rise .38s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }

/* skeleton shimmer */
.skel { position: relative; overflow: hidden; border-radius: 12px; background: var(--chip); }
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--inner), transparent); animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-list { padding: 8px 14px; display: grid; gap: 10px; }
.skel-card { height: 72px; border-radius: var(--radius); }

/* ---------- home ---------- */
.hero { padding: 26px 22px 6px; }
.greet {
  margin: 0; font: 700 clamp(2rem, 8vw, 3.4rem)/1.1 var(--font-head); letter-spacing: -.01em;
  color: var(--text);
  background: linear-gradient(100deg, var(--text) 30%, var(--heading-to)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.clock { font: 300 clamp(2.6rem, 11vw, 4.6rem)/1.05 var(--font-head); font-variant-numeric: tabular-nums; letter-spacing: .02em; margin-top: 6px; }
.date { color: var(--muted); font-size: 1.05rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 18px 18px 40px; }
.tile {
  position: relative; display: grid; align-content: center; justify-items: start; gap: 4px; min-height: 148px; padding: 18px; text-align: start;
  border-radius: 22px; background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 14px 34px -16px var(--shadow), inset 0 1px 0 var(--inner);
}
.tile::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s ease;
  box-shadow: 0 0 0 1px var(--line-hi), 0 0 34px -2px var(--glow), inset 0 0 28px -10px var(--glow);
}
.tile:hover::after, .tile:focus-visible::after { opacity: 1; }
.tile .ico { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 8px; border-radius: 16px; color: var(--accent); background: var(--chip); border: 1px solid var(--line); }
.tile .ico .icon { width: 28px; height: 28px; filter: drop-shadow(0 0 7px var(--glow)); }
.tile .name { font: 650 1.1rem/1.2 var(--font-head); }
.tile .count { color: var(--muted); font-size: .88rem; min-height: 1.3em; font-variant-numeric: tabular-nums; }
.tile .count .skel { display: inline-block; width: 4.5em; height: .9em; vertical-align: middle; }
@media (hover: hover) {
  .tile:hover, .card:hover, .fab:hover { transform: translateY(-3px); }
}
.menu {
  position: absolute; top: calc(100% + 8px); inset-inline-start: 0; min-width: 210px; display: grid; gap: 2px; padding: 8px;
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 40px -12px var(--shadow);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); animation: rise .2s ease backwards;
}
.menu button { text-align: start; border: 0; background: transparent; display: flex; align-items: center; gap: 10px; box-shadow: none; }
.menu button:hover { background: var(--chip); }
.module { flex: 1; }

/* ---------- notes: list ---------- */
.list { padding: 6px 14px 120px; display: grid; gap: 10px; }
.card {
  text-align: start; display: block; width: 100%; padding: 14px 16px; min-height: 68px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 22px -14px var(--shadow), inset 0 1px 0 var(--inner);
}
.card:hover { border-color: var(--line-hi); }
.card .t { font: 650 1.05rem/1.3 var(--font-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .s { color: var(--muted); font-size: .94rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: pre-wrap; }
.card .m { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.card .tag { background: var(--chip); border-radius: 999px; padding: 0 9px; }
.fab {
  position: fixed; inset-inline-end: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 6;
  width: 62px; height: 62px; border-radius: 50%; padding: 0; display: grid; place-items: center;
  box-shadow: 0 10px 30px -6px var(--glow), 0 0 0 1px rgba(255, 255, 255, .15) inset;
}
.fab .icon { width: 28px; height: 28px; }

/* ---------- notes: editor (calm: solid-ish surface, large type, no motion behind it) ---------- */
.editor { padding: 4px 14px 40px; display: grid; gap: 12px; }
.editor .title { font: 700 1.5rem/1.3 var(--font-head); }
.editor input, .editor textarea { background: var(--glass-strong); -webkit-backdrop-filter: none; backdrop-filter: none; }
.editor textarea { min-height: 42vh; resize: vertical; font-size: 1.08rem; line-height: 1.7; padding: 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.checks { background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; }
.checks h2 { font-size: .9rem; margin: 4px 0; color: var(--muted); }
.check { display: flex; gap: 12px; align-items: center; min-height: 44px; cursor: pointer; }
.check input { width: 24px; height: 24px; flex: none; accent-color: var(--accent); }
.check.done span { text-decoration: line-through; color: var(--muted); }

/* ---------- panels (settings) ---------- */
.panel {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; margin: 0 14px 14px;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 10px 28px -16px var(--shadow), inset 0 1px 0 var(--inner);
}
.panel h2 { margin: 0; font: 650 1.05rem/1.3 var(--font-head); }
.panel p { margin: 0; color: var(--muted); font-size: .94rem; }
.check .icon { width: 20px; height: 20px; vertical-align: middle; margin-inline-end: 6px; color: var(--accent); }

/* ---------- sign-in ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; }
.login {
  width: min(420px, 100%); display: grid; gap: 14px; padding: 30px 24px; text-align: center;
  background: var(--glass); border: 1px solid var(--line); border-radius: 28px;
  -webkit-backdrop-filter: blur(26px) saturate(160%); backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 30px 70px -24px var(--shadow), 0 0 60px -20px var(--glow), inset 0 1px 0 var(--inner);
  animation: rise .5s cubic-bezier(.2, .8, .2, 1) backwards;
}
.login h1 { margin: 0; font: 700 1.9rem/1.2 var(--font-head); }
.login p { margin: 0; color: var(--muted); }
.logo { width: 84px; height: 84px; margin: 0 auto; filter: drop-shadow(0 0 14px var(--glow)); }
.logo-ring { transform-origin: 32px 32px; animation: spin 24s linear infinite; }
.logo-core { transform-origin: 32px 32px; animation: breathe 3.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.18); } }
.loginform { display: grid; gap: 12px; }
.pwfield { position: relative; }
.pwfield input { padding-inline-end: 52px; }
.pwfield button { position: absolute; inset-block: 0; inset-inline-end: 0; border: 0; background: transparent; box-shadow: none; color: var(--muted); min-width: 48px; padding: 0; }
.pwfield button:hover { color: var(--text); }

/* ---------- reduced motion: static gradient, no animation ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- accounts, photos ---------- */
.avatar {
  --d: 40px; position: relative; flex: none; display: inline-grid; place-items: center; width: var(--d); height: var(--d); border-radius: 50%;
  background: var(--glass-strong); color: var(--text); overflow: hidden; font: 700 calc(var(--d) * .38)/1 var(--font-head);
  box-shadow: 0 0 0 2px var(--accent), 0 0 calc(var(--d) * .3) var(--glow), inset 0 0 0 2px var(--bg);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar .ini { background: linear-gradient(135deg, var(--accent), var(--violet)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.avatar.sm { --d: 34px; } .avatar.md { --d: 46px; } .avatar.lg { --d: 84px; } .avatar.xl { --d: 104px; }
.bar .avatar-btn { min-width: 44px; padding: 0; display: grid; place-items: center; border-radius: 50%; }
.hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-text { display: grid; gap: 2px; min-width: 0; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h2 { overflow-wrap: anywhere; }
.msg.ok { color: var(--ok); }
.hint { color: var(--muted); margin: 0; font-size: .92rem; }
.linklike { border: 0; background: transparent; box-shadow: none; color: var(--muted); text-decoration: underline; min-height: 36px; }
.login .avatar { margin: 0 auto; }

/* photo crop dialog */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(3, 6, 16, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sheet { width: min(360px, 100%); display: grid; gap: 12px; justify-items: center; padding: 20px; border-radius: 24px; background: var(--glass-strong); border: 1px solid var(--line); box-shadow: 0 30px 70px -20px var(--shadow); animation: rise .3s ease backwards; }
.sheet h2 { margin: 0; font: 650 1.2rem/1.3 var(--font-head); }
.sheet .row { justify-content: center; }
.crop { width: min(280px, 100%); aspect-ratio: 1; border-radius: 16px; touch-action: none; cursor: grab; background: #000; }
.sheet input[type=range] { width: min(280px, 100%); accent-color: var(--accent); min-height: 44px; }

/* admin */
.person { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.person:first-of-type { border-top: 0; }
.person .who { flex: 1; min-width: 0; }
.person .t { font: 650 1.02rem/1.3 var(--font-head); overflow-wrap: anywhere; }
.person .m { display: flex; gap: 10px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.tag.off { background: rgba(255, 120, 140, .18); color: var(--danger); margin-inline-start: 6px; border-radius: 999px; padding: 0 9px; font-size: .8rem; }
.person .tag { background: var(--chip); border-radius: 999px; padding: 0 9px; font-size: .78rem; font-weight: 500; }
.ticks { display: grid; gap: 2px; }
.audit { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.audit .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.panel .row + .msg, .panel input + .msg { margin-top: 2px; }

/* admin "view as" (notes) */
.viewas { padding: 4px 14px 0; display: grid; gap: 8px; }
.viewlabel { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.viewlabel select { flex: 1; min-height: 44px; border-radius: 14px; padding: 0 12px; border: 1px solid var(--line); background: var(--glass-strong); color: var(--text); font: inherit; }
.banner.viewing { margin: 0; border-color: var(--line-hi); background: var(--chip); font-weight: 600; }

/* ======================================================================
   Data modules: bills, lists, money, health, documents (same aurora glass)
   ====================================================================== */
:root { --amber: #ffb000; --red: #ff6b85; --s0: #22f0ff; --s1: #a370ff; --s2: #ffb000; --s3: #3dff9a; --s4: #ff3ea5; --s5: #4d8dff; --s6: #ff6a3d; --s7: #b6ff2e; --s8: #ff4d6d; --s9: #9aa3c7; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --amber: #b45309; --red: #b42318; --s0: #0369a1; --s1: #6d28d9; --s2: #b45309; --s3: #047857; --s4: #be185d; --s5: #1d4ed8; --s6: #c2410c; --s7: #4d7c0f; --s8: #b91c1c; --s9: #475569; }
}
:root[data-theme="light"] { --amber: #b45309; --red: #b42318; --s0: #0369a1; --s1: #6d28d9; --s2: #b45309; --s3: #047857; --s4: #be185d; --s5: #1d4ed8; --s6: #c2410c; --s7: #4d7c0f; --s8: #b91c1c; --s9: #475569; }

input[type=date], input[type=datetime-local], input[type=number], input[type=time], input[type=email], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); color: var(--text); font: inherit;
}
input[type=date], input[type=time], input[type=datetime-local] { min-width: 0; }
select { appearance: none; -webkit-appearance: none; padding-inline-end: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 5px var(--glow); }
input:disabled, select:disabled, textarea:disabled { opacity: .75; }
.form { padding: 4px 14px 120px; display: grid; gap: 12px; }
.fld { display: grid; gap: 4px; min-width: 0; }
.fl { font-size: .86rem; color: var(--muted); font-weight: 600; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 360px) { .two { grid-template-columns: 1fr; } }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.sub { font: 650 1rem/1.3 var(--font-head); margin: 10px 16px 0; color: var(--muted); }
.empty.small { padding: 1rem; }
.flip .icon { transform: scaleX(-1); }
.banner.bad { border-color: var(--red); }
.banner.notice { width: calc(100% - 24px); text-align: start; }
.banner .go { color: var(--accent); font-weight: 650; white-space: nowrap; }
.notices { display: grid; gap: 6px; padding: 0 6px; }
.tile .dot { position: absolute; top: 14px; inset-inline-end: 14px; width: 14px; height: 14px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); }
.pill { font-size: .78rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; background: var(--chip); }
.pill.overdue { color: var(--red); border-color: var(--red); }
.pill.soon { color: var(--amber); border-color: var(--amber); }
.pill.calm { color: var(--ok); }
.card.bill { border-inline-start: 4px solid var(--ok); }
.card.bill.soon { border-inline-start-color: var(--amber); }
.card.bill.overdue { border-inline-start-color: var(--red); }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 6px 14px; }
.cal-h { text-align: center; font-size: .75rem; color: var(--muted); }
.cal-c { min-width: 0; min-height: 44px; padding: 0; border-radius: 12px; display: grid; place-items: center; align-content: center; gap: 2px; font-size: .92rem; }
.cal-c.empty-c { border: 0; background: transparent; box-shadow: none; }
.cal-c.today { border-color: var(--accent); }
.cal-c[aria-pressed="true"] { background: var(--chip); border-color: var(--line-hi); }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: block; }
.cal-c.soon .cal-dot { background: var(--amber); }
.cal-c.overdue .cal-dot { background: var(--red); }
.cal-nav { padding: 6px 14px; }

/* lists */
.entry { display: flex; gap: 6px; align-items: center; min-height: 52px; padding: 2px 10px; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; }
.entry.done .et { text-decoration: line-through; color: var(--muted); }
.entry .et { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.entry small { color: var(--muted); display: block; }
.entry .chk { width: 26px; height: 26px; accent-color: var(--accent); flex: none; }
.entry button { min-width: 44px; min-height: 44px; border-color: transparent; background: transparent; box-shadow: none; padding: 0 8px; }
.entry.dragging { opacity: .6; border-color: var(--line-hi); }
.handle { cursor: grab; touch-action: none; color: var(--muted); }
.quick { display: flex; gap: 8px; padding: 6px 14px; }
.quick input { flex: 1; }
.progress { height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.progress.over i { background: var(--red); }

/* money */
.amt { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.amt.in { color: var(--ok); }
.amt.out { color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 6px 14px; }
.stat { background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; min-width: 0; }
.stat b { display: block; font: 700 1.05rem/1.2 var(--font-head); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat span { color: var(--muted); font-size: .78rem; }
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; padding: 6px 14px; }
@media (max-width: 380px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } }
.donut { width: 100%; max-width: 170px; }
.donut-bg { stroke: var(--chip); }
.donut-t { fill: var(--text); font: 700 4.4px var(--font-head); }
.slice.s0, .bf.s0 { stroke: var(--s0); fill: var(--s0); } .slice.s1, .bf.s1 { stroke: var(--s1); fill: var(--s1); } .slice.s2, .bf.s2 { stroke: var(--s2); fill: var(--s2); }
.slice.s3, .bf.s3 { stroke: var(--s3); fill: var(--s3); } .slice.s4, .bf.s4 { stroke: var(--s4); fill: var(--s4); } .slice.s5, .bf.s5 { stroke: var(--s5); fill: var(--s5); }
.slice.s6, .bf.s6 { stroke: var(--s6); fill: var(--s6); } .slice.s7, .bf.s7 { stroke: var(--s7); fill: var(--s7); } .slice.s8, .bf.s8 { stroke: var(--s8); fill: var(--s8); } .slice.s9, .bf.s9 { stroke: var(--s9); fill: var(--s9); }
.slice { fill: none !important; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.legend li { display: flex; gap: 8px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend .v { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.bars { width: 100%; display: block; }
.bars .bl, .linechart .bl { fill: var(--muted); font: 10px var(--font); }
.bars .bv { fill: var(--text); font: 10px var(--font); font-variant-numeric: tabular-nums; }
.bars .bt { fill: var(--chip); }
.bars .bf.over { fill: var(--red); }
.bars .bm { fill: var(--text); opacity: .6; }
.chartbox { padding: 6px 14px; }
.chartbox > .panel { margin: 0; }
.linechart { width: 100%; display: block; }
.linechart .grid { stroke: var(--line); stroke-width: 1; }
.linechart .ln { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.linechart .l0 { stroke: var(--s0); fill: none; } .linechart circle.l0 { fill: var(--s0); stroke: none; }
.linechart .l1 { stroke: var(--s1); fill: none; } .linechart circle.l1 { fill: var(--s1); stroke: none; }
.receipt-img { max-width: 100%; max-height: 60vh; border-radius: 14px; display: block; margin: 0 auto; }
.note-box { border: 1px dashed var(--line-hi); border-radius: 14px; padding: 10px 14px; color: var(--muted); font-size: .9rem; }

/* health */
.med { display: grid; gap: 6px; }
.slot { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.slot input { width: 24px; height: 24px; accent-color: var(--accent); }
.moods { display: flex; gap: 6px; }
.moods button[aria-pressed="true"] { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--accent-text); }
.range { display: flex; gap: 6px; padding: 4px 14px; }

/* ======================================================================
   BOLD NEON layer: overrides above. Keep it last.
   ====================================================================== */
/* no blur on lists and panels (performance): the panels are near-solid instead */
.bar, .panel, input[type=text], input[type=password], input[type=search], textarea, .menu, .login, .modal, .tile { -webkit-backdrop-filter: none; backdrop-filter: none; }
::selection { background: var(--accent); color: var(--accent-text); }
:focus-visible { outline-color: var(--accent); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 5px var(--glow), 0 0 20px var(--glow); }

/* header bar: a coloured neon underline in the module's colour */
.bar { border-radius: 20px; border-color: var(--line); box-shadow: 0 10px 30px -14px var(--shadow), 0 1px 0 0 var(--accent), 0 6px 18px -10px var(--glow); }
.bar h1 { text-transform: uppercase; letter-spacing: .08em; font-size: 1.05rem; color: var(--text); text-shadow: 0 0 12px var(--glow); }
.bar button:hover { background: var(--chip); color: var(--accent); }
.bar .icon, .menu .icon, .check .icon { color: var(--accent); }
.menu { border-color: var(--line-hi); }

/* buttons: glowing pills, quick press */
button:hover { border-color: var(--accent); box-shadow: 0 0 14px -4px var(--glow), inset 0 1px 0 var(--inner); }
button.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); text-transform: uppercase; letter-spacing: .06em; font-weight: 800; font-size: .92rem; }
button.primary:hover { box-shadow: 0 0 26px 0 var(--glow), inset 0 1px 0 rgba(255, 255, 255, .5); }
button.primary:active { animation: press .3s ease-out; }
button.danger { color: var(--danger); border-color: rgba(255, 141, 158, .45); }
@keyframes press { 0% { transform: scale(.92); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.bar button, .menu button, .entry button, .pwfield button, .linklike, .cal-c.empty-c { box-shadow: none; }
.bar button:hover { box-shadow: none; }
.cal-c { border-radius: 12px; }
.fab { box-shadow: 0 0 26px -2px var(--glow), 0 0 0 2px var(--accent) inset; }
.tabs button[aria-pressed="true"], .chip[aria-pressed="true"], .moods button[aria-pressed="true"] { box-shadow: 0 0 14px -2px var(--glow); }
.chip { border-color: var(--line-hi); }

/* inputs: neon focus, glowing caret */
input, textarea, select { caret-color: var(--accent); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
.login input:focus { animation: caretglow 1.1s ease-in-out infinite; }
@keyframes caretglow { 50% { box-shadow: 0 0 0 5px var(--glow), 0 0 8px var(--glow); } }

/* neon checkboxes */
input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border-radius: 7px; cursor: pointer;
  border: 2px solid var(--accent); background: transparent; display: inline-grid; place-content: center;
  box-shadow: 0 0 10px -3px var(--glow); transition: transform .15s ease;
}
input[type=checkbox]::after { content: ""; width: 12px; height: 7px; border-left: 3px solid var(--accent-text); border-bottom: 3px solid var(--accent-text); transform: rotate(-45deg) scale(0) translate(1px, -1px); transition: transform .15s ease; }
input[type=checkbox]:checked { background: var(--accent); box-shadow: 0 0 14px -1px var(--glow); }
input[type=checkbox]:checked::after { transform: rotate(-45deg) scale(1) translate(1px, -1px); }
input[type=checkbox]:active { transform: scale(.88); }
input[type=checkbox]:disabled { opacity: .5; }
.entry .chk { width: 26px; height: 26px; }
/* neon switches (Settings and Admin module lists) */
.panel .check input[type=checkbox] { width: 46px; height: 26px; border-radius: 999px; place-content: center start; padding: 0 3px; order: 2; margin-inline-start: auto; }
.panel .check input[type=checkbox]::after { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--accent); transform: none; transition: transform .18s ease; }
.panel .check input[type=checkbox]:checked { background: var(--chip); }
.panel .check input[type=checkbox]:checked::after { transform: translateX(20px); box-shadow: 0 0 12px var(--glow); }
[dir=rtl] .panel .check input[type=checkbox]:checked::after { transform: translateX(-20px); }
.panel .check { justify-content: space-between; }
.panel .check > span { order: 1; }
input[type=range] { accent-color: var(--accent); }

/* page rise + success pop */
.msg.ok { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) backwards; text-shadow: 0 0 12px var(--ok); font-weight: 650; }
.orb[data-state="saved"], .orb[data-state="synced"] { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.banner { border-color: var(--accent); box-shadow: 0 0 16px -6px var(--glow); }

/* ---------- home ---------- */
.hero { padding-top: 22px; }
.greet {
  text-transform: none; letter-spacing: -.01em;
  background: linear-gradient(100deg, #ffffff 15%, var(--heading-to) 60%, var(--accent) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 calc(10px * var(--on-glow)) rgba(255, 43, 214, .55)); animation: flicker .9s steps(1, end) backwards;
}
:root[data-theme="light"] .greet { background: linear-gradient(100deg, #12102a 20%, var(--heading-to) 100%); -webkit-background-clip: text; background-clip: text; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .greet { background: linear-gradient(100deg, #12102a 20%, var(--heading-to) 100%); -webkit-background-clip: text; background-clip: text; }
}
@keyframes flicker { 0% { opacity: 0; } 12% { opacity: 1; } 20% { opacity: .2; } 32% { opacity: 1; } 42% { opacity: .5; } 55%, 100% { opacity: 1; } }
/* digital clock */
.clock {
  font: 800 clamp(2.4rem, 11vw, 4.4rem)/1.05 var(--font-digit); font-variant-numeric: tabular-nums; letter-spacing: .06em;
  color: var(--accent); text-shadow: 0 0 calc(14px * var(--on-glow)) var(--glow), 0 0 calc(2px * var(--on-glow)) var(--accent); margin-top: 8px;
}
.date { color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-size: .85rem; font-weight: 600; }

/* module tiles: chunky neon cards, tinted by --mt (their module colour) */
.tile {
  --tc: rgb(var(--mt)); min-height: 156px; padding: 18px; border-radius: 24px; background: var(--glass-strong); border: 2px solid rgb(var(--mt) / .75);
  box-shadow: 0 0 calc(18px * var(--on-glow)) -4px rgb(var(--mt) / .8), inset 0 0 calc(22px * var(--on-glow)) -14px rgb(var(--mt) / .9);
  animation: tilein .5s cubic-bezier(.2, 1.3, .3, 1) backwards; transition: transform .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.tile:nth-child(2) { animation-delay: .06s; } .tile:nth-child(3) { animation-delay: .12s; } .tile:nth-child(4) { animation-delay: .18s; }
.tile:nth-child(5) { animation-delay: .24s; } .tile:nth-child(6) { animation-delay: .3s; } .tile:nth-child(n+7) { animation-delay: .36s; }
@keyframes tilein { from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.92); } to { opacity: 1; transform: none; } }
/* hover/press glow: a pseudo-layer whose opacity fades in */
.tile::after { box-shadow: 0 0 0 1px var(--tc), 0 0 calc(40px * var(--on-glow)) 2px rgb(var(--mt) / .65), inset 0 0 calc(30px * var(--on-glow)) -8px rgb(var(--mt) / .7); }
.tile:hover { border-color: var(--tc); box-shadow: 0 0 calc(18px * var(--on-glow)) -4px rgb(var(--mt) / .8), inset 0 0 calc(22px * var(--on-glow)) -14px rgb(var(--mt) / .9); }
.tile:active { transform: scale(.95); }
.tile:active::after { opacity: 1; }
/* animated conic gradient border on the pressed / focused tile */
.tile::before {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; pointer-events: none; opacity: 0; transition: opacity .2s ease;
  background: conic-gradient(from var(--ang), var(--tc), #ff2bd6, #ffffff, var(--tc));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.tile:hover::before, .tile:focus-visible::before, .tile:active::before { opacity: 1; animation: spinang 2.4s linear infinite; }
@keyframes spinang { to { --ang: 360deg; } }
.tile .ico { position: relative; width: 56px; height: 56px; border-radius: 18px; color: var(--tc); background: rgb(var(--mt) / .12); border: 2px solid rgb(var(--mt) / .55); }
.tile .ico .icon { width: 30px; height: 30px; stroke-width: 2.1; filter: drop-shadow(0 0 calc(6px * var(--on-glow)) var(--tc)); animation: bob 3.6s ease-in-out infinite; }
.tile:nth-child(2n) .ico .icon { animation-delay: -1.2s; } .tile:nth-child(3n) .ico .icon { animation-delay: -2.4s; }
@keyframes bob { 50% { transform: translateY(-3px) scale(1.06); } }
.tile:hover .ico .icon, .tile:focus-visible .ico .icon { animation: wiggle .5s ease; }
@keyframes wiggle { 25% { transform: rotate(-10deg) scale(1.12); } 60% { transform: rotate(8deg) scale(1.12); } }
/* "level" ring: a slowly turning arc around the icon box */
.tile .ico::before {
  content: ""; position: absolute; inset: -7px; border-radius: 50%; pointer-events: none; opacity: calc(.9 * var(--on-glow) + .35);
  background: conic-gradient(var(--tc) 0 28%, transparent 28% 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: spin 6s linear infinite;
}
.tile .name { font: 800 1.12rem/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .06em; color: var(--text); }
/* live count: glowing badge */
.tile .count:not(:empty) {
  justify-self: start; min-height: 0; padding: 2px 11px; border-radius: 999px; font-weight: 700; font-size: .84rem; color: var(--text);
  background: rgb(var(--mt) / .16); border: 1px solid rgb(var(--mt) / .8); box-shadow: 0 0 calc(10px * var(--on-glow)) -2px rgb(var(--mt) / .9);
}
.tile .dot { background: #ff3b5c; box-shadow: 0 0 12px #ff3b5c; animation: pulsedot 1.6s ease-in-out infinite; }
@keyframes pulsedot { 50% { transform: scale(1.35); } }

/* ---------- cards, panels, lists ---------- */
.card, .entry, .stat, .checks, .panel { background: var(--glass); }
.card { border-color: var(--line); transition: transform .15s ease, border-color .2s ease; }
.card:hover, .card:focus-visible { border-color: var(--accent); }
.card:active { transform: scale(.985); }
.card:active, .card[aria-current="true"], .card.active { box-shadow: 0 0 18px -4px var(--glow); border-color: var(--accent); }
.card .t { color: var(--text); }
.panel { border-color: var(--line); }
.panel h2, .sub { text-transform: uppercase; letter-spacing: .08em; font-size: .92rem; color: var(--accent); }
.stat b { color: var(--text); text-shadow: 0 0 calc(10px * var(--on-glow)) var(--glow); }
.progress { height: 8px; border-radius: 4px; }
.progress i { background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: 0 0 calc(10px * var(--on-glow)) var(--glow); }
.tag, .pill { border-color: var(--line-hi); }
.pill.overdue { box-shadow: 0 0 10px -3px var(--red); } .pill.soon { box-shadow: 0 0 10px -3px var(--amber); }
.cal-c.today { box-shadow: 0 0 12px -3px var(--glow); }
.cal-dot { box-shadow: 0 0 6px currentColor; }
/* charts: glowing strokes */
.slice { filter: drop-shadow(0 0 calc(3px * var(--on-glow)) currentColor); }
.slice.s0 { color: var(--s0); } .slice.s1 { color: var(--s1); } .slice.s2 { color: var(--s2); } .slice.s3 { color: var(--s3); } .slice.s4 { color: var(--s4); }
.slice.s5 { color: var(--s5); } .slice.s6 { color: var(--s6); } .slice.s7 { color: var(--s7); } .slice.s8 { color: var(--s8); } .slice.s9 { color: var(--s9); }
.bars .bf { filter: drop-shadow(0 0 calc(3px * var(--on-glow)) var(--accent)); }
.linechart .ln { stroke-width: 2.6; filter: drop-shadow(0 0 calc(3px * var(--on-glow)) currentColor); }
.linechart .l0 { color: var(--s0); } .linechart .l1 { color: var(--s1); }
.legend i { box-shadow: 0 0 calc(6px * var(--on-glow)) currentColor; }
.legend .s0 { color: var(--s0); } .legend .s1 { color: var(--s1); } .legend .s2 { color: var(--s2); } .legend .s3 { color: var(--s3); } .legend .s4 { color: var(--s4); }
.legend .s5 { color: var(--s5); } .legend .s6 { color: var(--s6); } .legend .s7 { color: var(--s7); } .legend .s8 { color: var(--s8); } .legend .s9 { color: var(--s9); }

/* ---------- editors stay calm: no glow, no motion, solid surfaces behind long text ---------- */
.editor input, .editor textarea { border-color: var(--line); box-shadow: none; animation: none; }
.editor input:focus, .editor textarea:focus { box-shadow: 0 0 0 2px var(--accent); }
.editor .title { text-shadow: none; }
body:has(.editor) .bar { box-shadow: 0 10px 30px -14px var(--shadow), 0 1px 0 0 var(--accent); }
body:has(.editor) * { text-shadow: none; }

/* ---------- sign-in: arcade screen ---------- */
.login { border: 2px solid var(--line-hi); box-shadow: 0 0 calc(40px * var(--on-glow)) -8px var(--glow), 0 0 calc(60px * var(--on-glow)) -20px rgba(255, 43, 214, .7), 0 30px 70px -24px var(--shadow); }
.login h1 { text-transform: uppercase; letter-spacing: .1em; font-size: 1.5rem; animation: flicker .9s steps(1, end) backwards; text-shadow: 0 0 calc(14px * var(--on-glow)) var(--glow); }
.logo { width: 96px; height: 96px; filter: drop-shadow(0 0 calc(14px * var(--on-glow)) rgba(255, 43, 214, .75)) drop-shadow(0 0 calc(10px * var(--on-glow)) var(--glow)); animation: logopulse 2.8s ease-in-out infinite; }
@keyframes logopulse { 50% { transform: scale(1.07); } }
.logo-ring { animation-duration: 18s; }
.avatar { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--bg), 0 0 0 7px var(--accent2), 0 0 calc(var(--d) * .35) var(--glow); }
.avatar .ini { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; }

/* ---------- reduced motion: no motion, static glow ---------- */
@media (prefers-reduced-motion: reduce) {
  .tile, .greet, .login h1, .logo, .tile .ico .icon, .tile .ico::before { animation: none !important; }
  .tile:hover::before, .tile:focus-visible::before { animation: none !important; }
}


.newmenu { position: fixed; inset-inline-end: 18px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 6; display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line-hi); border-radius: 18px; background: var(--glass-strong); }
.newmenu button { justify-content: flex-start; display: flex; align-items: center; gap: 10px; border-radius: 12px; }
.nthumb { display: block; width: 75px; height: 106px; margin-top: 8px; border-radius: 6px; border: 1px solid var(--line); background: #fbfaf4; object-fit: cover; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- handwriting (Notes) ----------
   A full-bleed fixed layer: 100dvh, safe-area padding, nothing scrolls behind it. The chrome (header, toolbar, popovers) uses the
   app's neon accent; the writing surface is calm paper. No transitions, filters or animations here, so ink never waits for paint. */
html:has(.ink-screen), body:has(.ink-screen) { overflow: hidden; overscroll-behavior: none; }
body:has(.ink-screen) .aurora { display: none; }
body:has(.ink-screen) { background: var(--bg); }
.ink-screen { position: fixed; top: 0; left: 0; right: 0; height: 100dvh; z-index: 40; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overscroll-behavior: none; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.ink-screen, .ink-screen * { transition: none !important; animation: none !important; filter: none !important; text-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.ink-head { flex: none; display: flex; align-items: center; gap: 4px; padding: 2px 6px; min-height: 48px; background: var(--glass-strong); border-bottom: 1px solid var(--line); }
.ink-title { flex: 1; min-width: 0; margin: 0 4px; font: 650 .95rem/1.2 var(--font-head); letter-spacing: .08em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ink-screen[data-focus="true"] .ink-head { display: none; }
.ink-btn { min-width: 44px; min-height: 44px; padding: 0; display: inline-grid; place-items: center; flex: none; border-radius: 12px; border-color: transparent; background: transparent; box-shadow: none; font-size: 1.3rem; }
.ink-btn:hover { border-color: var(--line-hi); }
.ink-btn .icon { width: 24px; height: 24px; }
.ink-btn[aria-pressed="true"], .ink-btn.on, .ink-btn[aria-expanded="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.ink-btn:disabled { opacity: .35; }
.ink-btn.danger { color: var(--danger); }
.ink-main { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.ink-tools { flex: none; display: flex; flex-wrap: nowrap; gap: 2px; align-items: center; padding: 3px 6px; overflow-x: auto; scrollbar-width: none; background: var(--glass-strong); border-bottom: 2px solid var(--accent); }
.ink-tools::-webkit-scrollbar { display: none; }
.ink-screen[data-side="left"] .ink-main { flex-direction: row; }
.ink-screen[data-side="right"] .ink-main { flex-direction: row-reverse; }
.ink-screen[data-side="left"] .ink-tools, .ink-screen[data-side="right"] .ink-tools { flex-direction: column; overflow-x: hidden; overflow-y: auto; padding: 6px 3px; border-bottom: 0; }
.ink-screen[data-side="left"] .ink-tools { border-right: 2px solid var(--accent); }
.ink-screen[data-side="right"] .ink-tools { border-left: 2px solid var(--accent); }
.ink-screen[data-collapsed="true"] .ink-tools { display: none; }
.ink-body { flex: 1; min-width: 0; min-height: 0; display: flex; }
.ink-cw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-hi); display: grid; place-items: center; }
.ink-cw .dot { display: block; border-radius: 50%; }
.ink-pill { display: none; position: absolute; z-index: 5; top: calc(env(safe-area-inset-top) + 8px); right: calc(env(safe-area-inset-right) + 8px); gap: 2px; padding: 3px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--line-hi); box-shadow: 0 4px 14px var(--shadow); }
.ink-screen[data-collapsed="true"] .ink-pill { display: flex; }
.ink-screen[data-side="left"] .ink-pill { right: auto; left: calc(env(safe-area-inset-left) + 8px); }
.ink-pill .only-focus { display: none; }
.ink-screen[data-focus="true"] .ink-pill .only-focus { display: inline-grid; }
.ink-pop { position: absolute; z-index: 10; width: max-content; min-width: 230px; max-width: min(380px, calc(100% - 16px)); max-height: calc(100% - 16px); overflow: auto; display: grid; gap: 6px; padding: 8px; background: var(--glass-strong); border: 1px solid var(--line-hi); border-radius: 16px; box-shadow: 0 14px 36px var(--shadow); }
.ink-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ink-rl { flex: 0 0 82px; font-size: .8rem; color: var(--muted); }
.ink-rc { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.ink-seg { min-height: 40px; min-width: 40px; padding: 0 12px; border-radius: 10px; font-size: .9rem; }
.ink-item { display: flex; align-items: center; gap: 10px; justify-content: flex-start; min-height: 44px; padding: 0 12px; border-radius: 12px; text-align: start; }
.ink-seg[aria-pressed="true"], .ink-item[aria-pressed="true"], .ink-width[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.ink-item.danger { color: var(--danger); }
.ink-swatch { padding: 0; border-radius: 50%; width: 40px; height: 40px; min-width: 40px; min-height: 40px; border: 2px solid var(--line); }
.ink-swatch[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
.ink-width { padding: 0; width: 44px; border-radius: 12px; display: grid; place-items: center; }
.ink-width i { display: block; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-hi); }
.ink-pct { min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.ink-drawer { position: absolute; z-index: 9; top: 0; bottom: 0; left: 0; width: min(170px, 70%); display: flex; flex-direction: column; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 8px 8px calc(env(safe-area-inset-left) + 8px); background: var(--glass-strong); border-right: 2px solid var(--accent); box-shadow: 8px 0 24px var(--shadow); }
.ink-dhead { display: flex; align-items: center; justify-content: space-between; }
.ink-thumbs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.ink-thumb { flex: none; padding: 4px; border-radius: 10px; display: grid; gap: 2px; justify-items: center; font-size: .78rem; }
.ink-thumb canvas { width: 84px; border-radius: 4px; background: #fbfaf4; }
.ink-thumb.on { border-color: var(--accent); }
.ink-scroll { position: relative; flex: 1; min-width: 0; overflow: auto; scrollbar-width: none; background: #3a3d48; touch-action: none; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
:root[data-theme="light"] .ink-scroll { background: #cfd2dc; }
.ink-screen[data-mode="endless"] .ink-scroll { background: #fbfaf4; }
.ink-screen[data-mode="endless"][data-dark="true"] .ink-scroll { background: #1a1b21; }
.ink-pages { margin: 0 auto; padding: 12px 0; }
.ink-screen[data-mode="endless"] .ink-pages { padding: 0 0 45dvh; } /* room below the last line for the resting hand */
.ink-page { position: relative; margin: 0 auto 12px; background: #fbfaf4; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); touch-action: none; overflow: hidden; }
.ink-screen[data-dark="true"] .ink-page { background: #1a1b21; }
.ink-screen[data-mode="endless"] .ink-page { margin: 0 auto; box-shadow: none; }
.ink-page canvas { position: absolute; left: 0; width: 100%; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ink-top { cursor: crosshair; }
.ink-pages[data-tool="eraser"] .ink-top, .ink-pages[data-tool="cut"] .ink-top { cursor: cell; }
.ink-note { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: #444; font-size: .95rem; pointer-events: none; }
.ink-note[hidden] { display: none; }
.ink-page-ind, .ink-status { position: absolute; z-index: 4; bottom: calc(env(safe-area-inset-bottom) + 8px); padding: 2px 12px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--line); font-size: .85rem; color: var(--muted); pointer-events: none; }
.ink-page-ind { left: 50%; transform: translateX(-50%); }
.ink-status { left: calc(env(safe-area-inset-left) + 8px); max-width: 70%; }
.ink-page-ind:empty, .ink-status:empty { display: none; }

/* typed note editor: fills the screen; line length is kept comfortable with inner padding, not a narrow card */
body:has(.ned) .shell { max-width: none; height: 100dvh; min-height: 0; }
body:has(.ned) main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ned { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 6px 12px 12px; }
.ned > textarea { flex: 1; min-height: 160px; resize: none; font-size: 1.05rem; line-height: 1.6; padding-inline: max(14px, calc((100vw - 78ch) / 2)); }
.ned .checks { max-height: 28dvh; overflow: auto; }
.ned:fullscreen { background: var(--bg); padding: calc(env(safe-area-inset-top) + 6px) calc(env(safe-area-inset-right) + 12px) calc(env(safe-area-inset-bottom) + 12px) calc(env(safe-area-inset-left) + 12px); }
.ed-exit { display: none; }
html.hub-focus .bar, html.hub-focus .status, html.hub-focus .banner { display: none; }
html.hub-focus .ned > :not(textarea):not(.ed-exit) { display: none; }
html.hub-focus .ed-exit { display: inline-grid; place-items: center; position: fixed; top: calc(env(safe-area-inset-top) + 8px); right: calc(env(safe-area-inset-right) + 8px); z-index: 20; }

/* handwriting: one-tap tools, pen favourites, mode toggle, page chip, big Next page button, page strip (bottom sheet) */
.ink-btn, .ink-fav, .ink-nb, .ink-nl, .ink-bignext, .ink-bigprev, .ink-thumb { touch-action: manipulation; }
.ink-fav { flex: none; width: 34px; min-height: 44px; padding: 0; display: inline-grid; place-items: center; border: 2px solid transparent; border-radius: 12px; background: transparent; box-shadow: none; }
.ink-fav i { display: block; border-radius: 50%; }
.ink-fav[aria-pressed="true"] { border-color: var(--accent); background: var(--glass); }
.ink-mode { grid-auto-flow: column; gap: 5px; padding: 0 10px; }
.ink-mode-l { font-size: .82rem; font-weight: 650; }
.ink-body { position: relative; }
.ink-navbar { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.ink-chip { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--line-hi); opacity: .8; pointer-events: auto; box-shadow: 0 4px 14px var(--shadow); }
.ink-nb { width: 48px; height: 48px; min-width: 48px; min-height: 48px; padding: 0; border-radius: 50%; font-size: 1.7rem; line-height: 1; background: transparent; border-color: transparent; box-shadow: none; }
.ink-nl { min-width: 68px; height: 48px; min-height: 48px; padding: 0 10px; border-radius: 999px; font-weight: 650; font-variant-numeric: tabular-nums; background: transparent; border-color: transparent; box-shadow: none; }
.ink-nb:disabled { opacity: .3; }
.ink-bignav { position: absolute; right: 16px; bottom: 12px; display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.ink-screen[data-side="right"] .ink-bignav { right: auto; left: 16px; }
.ink-bignext { min-height: 56px; padding: 0 22px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-size: 1.05rem; font-weight: 700; background: var(--accent); color: var(--accent-text); border: 2px solid var(--accent); box-shadow: 0 6px 18px var(--shadow); }
.ink-bignext b { font-size: 1.8rem; line-height: 1; }
.ink-bignext:disabled { opacity: .35; }
.ink-bignext.hint { outline: 4px solid var(--accent); outline-offset: 3px; }
.ink-bigprev { order: -1; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%; font-size: 1.5rem; line-height: 1; opacity: .85; background: var(--glass-strong); border: 1px solid var(--line-hi); }
.ink-bigprev:disabled { opacity: .3; }
.ink-screen[data-writing="true"] .ink-chip, .ink-screen[data-writing="true"] .ink-bignav { opacity: 0; pointer-events: none; }
@media (max-width: 700px) { .ink-bignav { bottom: 76px; } }
.ink-drawer { top: auto; bottom: 0; left: 0; right: 0; width: auto; border-right: 0; border-top: 2px solid var(--accent); box-shadow: 0 -8px 24px var(--shadow); gap: 4px; padding: 6px calc(env(safe-area-inset-right) + 8px) calc(env(safe-area-inset-bottom) + 8px) calc(env(safe-area-inset-left) + 8px); }
.ink-dhint { flex: 1; min-width: 0; margin: 0 10px; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ink-thumbs { flex: none; flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 10px; padding: 8px 2px; touch-action: pan-x; }
.ink-thumb { position: relative; touch-action: pan-x; }
.ink-thumb canvas { width: 96px; }
.ink-thumb.on { border-color: var(--accent); background: var(--glass); outline: 3px solid var(--accent); outline-offset: -1px; }
.ink-thumb.drag { z-index: 3; opacity: .9; box-shadow: 0 8px 20px var(--shadow); }
.ink-thumb.swipe { z-index: 3; }
.ink-thumb-add { min-width: 72px; align-content: center; }
.ink-thumb-add b { font-size: 2rem; line-height: 1; }
.ink-toast { position: absolute; z-index: 11; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 160px); display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 16px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--line-hi); box-shadow: 0 8px 24px var(--shadow); }
.ink-toast.hidden { display: none; }

/* ---------- QA fixes (layout only) ---------- */
html { scroll-padding-top: calc(84px + env(safe-area-inset-top)); scroll-padding-bottom: 130px; } /* a focused field is never left under the sticky bar or the + button */
.greet { padding-bottom: .12em; } /* gradient text clips the descender of g, y, p without it */
.module:has(.fab) { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } /* the + button never covers the last row */
.row-between > .row { flex-wrap: nowrap; flex: none; } /* edit and delete stay side by side next to a long name */
.row-between > .t { min-width: 0; }
input[type=file] { width: 100%; min-height: 44px; padding: 6px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); color: var(--text); font: inherit; }
input[type=file]::file-selector-button { min-height: 32px; margin-inline-end: 10px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-hi); background: var(--chip); color: var(--text); font: inherit; cursor: pointer; }
.note-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bars .bl, .bars .bv { font-size: 12px; }.list { grid-template-columns: minmax(0, 1fr); } /* a long unbroken name can never widen the page */
.bars, .linechart { max-width: 480px; margin-inline: auto; } /* SVG charts scale with the box: on iPad and desktop their text grew to 2x */

/* ---------- Messages ---------- */
.pins { display: grid; gap: 10px; padding: 4px 14px 0; }
.pins:empty { display: none; }
.pin { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius); background: var(--glass-strong); border: 2px solid rgb(var(--m-messages) / .85); box-shadow: 0 0 calc(18px * var(--on-glow)) -6px rgb(var(--m-messages) / .9); }
.pin.urgent { border-color: var(--red); box-shadow: 0 0 calc(18px * var(--on-glow)) -6px var(--red); }
.pin .t { font: 700 1.05rem/1.3 var(--font-head); overflow-wrap: anywhere; }
.pin.urgent .t { color: var(--red); }
.pin-text { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card.msg.unread { border-inline-start: 4px solid rgb(var(--m-messages)); }
.card.msg.unread .t { font-weight: 800; }
.msgview .pre, .msgview h2 { overflow-wrap: anywhere; }
.msgview h2 { font-size: 1.2rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.files { display: grid; gap: 8px; }
.thread { display: grid; gap: 8px; }
.bubble { max-width: 92%; padding: 8px 12px; border-radius: 16px; background: var(--chip); border: 1px solid var(--line); overflow-wrap: anywhere; }
.bubble small { display: block; color: var(--muted); font-size: .75rem; margin-top: 2px; }
.bubble.mine { justify-self: end; border-color: var(--line-hi); }
.rcpt { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.rcpt:first-of-type { border-top: 0; }
.ticks2 { font-variant-numeric: tabular-nums; color: var(--accent); white-space: nowrap; }
.panel textarea { min-height: 72px; }

.msgview a, .files a { display: inline-block; min-height: 44px; padding: 10px 0; overflow-wrap: anywhere; color: var(--accent); }
.msgview .m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .82rem; color: var(--muted); }

/* ---- Search all ---- */
.search-in { min-height: 44px; min-width: 0; padding: 0 14px; border-radius: 999px; }
.search-status { padding: 0 16px; margin: 2px 0; min-height: 1.2em; }
.search-body { padding-bottom: 40px; }
.sres { min-height: 56px; }
.sres .t { white-space: normal; overflow-wrap: anywhere; }
.sres .s { -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.sgroup { padding-top: 6px; }
.sgroup-h { display: flex; align-items: center; gap: 8px; margin: 10px 16px 0; color: rgb(var(--mt)); text-shadow: 0 0 calc(10px * var(--on-glow, 1)) rgb(var(--mt) / .5); }
.sgroup-h .icon { width: 20px; height: 20px; color: rgb(var(--mt)); }
.sgroup-n { margin-inline-start: auto; font-variant-numeric: tabular-nums; color: var(--muted); text-shadow: none; }
.sgroup .card { border-inline-start: 3px solid rgb(var(--mt) / .8); }
.search-recent-head { align-items: center; padding: 0 14px; }
mark { background: rgb(255 214 10 / .38); color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: inset 0 -2px 0 rgb(255 176 0 / .8); }

/* ---- Prayer & Quran: emerald and gold ---- */
:root { --m-faith: 16 230 160; --gold: #ffd24a; }
:root[data-theme="light"] { --m-faith: 4 120 87; --gold: #a16207; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --m-faith: 4 120 87; --gold: #a16207; } }
[data-mod="faith"] { --mt: var(--m-faith); }
html[data-mod="faith"]:root { --accent2: var(--gold); }
.faithbody { padding-bottom: 60px; }
.faithbody > .panel, .faithbody > .banner, .faithbody > .row, .faithbody > .fdate, .faithbody > .hint, .faithbody > .msg { margin-inline: 14px; }
.fhero { margin: 10px 14px; padding: 18px 16px; text-align: center; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line-hi); box-shadow: 0 0 30px -10px var(--glow), inset 0 1px 0 var(--inner); }
.fnext-lab { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; }
.fnext-name { font: 700 1.9rem/1.2 var(--font-head); color: var(--accent); text-shadow: 0 0 14px var(--glow); }
.fnext-count { font: 700 clamp(2.6rem, 14vw, 4rem)/1.1 var(--font-head); font-variant-numeric: tabular-nums; color: var(--text); }
.fnext-at { color: var(--gold); font-weight: 650; }
.fdate { text-align: center; color: var(--muted); margin-block: 8px; }
.frows { display: grid; gap: 8px; margin: 8px 14px; }
.frow { display: grid; grid-template-columns: 1fr auto 44px; align-items: center; gap: 10px; min-height: 52px; padding: 4px 8px 4px 16px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); }
.frow.minor { min-height: 44px; opacity: .85; }
.frow.next { border-color: var(--accent); box-shadow: 0 0 18px -6px var(--glow); }
.frow.friday { border-color: var(--gold); }
.frow.friday .fn { color: var(--gold); font-weight: 700; }
.frow .fn { font-weight: 650; }
.frow .ft { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.15rem; }
.frow .chk { width: 28px; height: 28px; justify-self: center; }
.fskip { width: 28px; }
.fplace { text-align: center; }
.fweek { display: flex; gap: 6px; align-items: flex-end; }
.fwd { flex: 1; display: grid; justify-items: center; gap: 4px; }
.fwbar { width: 100%; max-width: 34px; height: 60px; display: flex; align-items: flex-end; border-radius: 8px; background: var(--chip); border: 1px solid var(--line); overflow: hidden; }
.fwbar i { display: block; width: 100%; background: linear-gradient(0deg, var(--accent), var(--gold)); }
.fwl, .fwn { font-size: .78rem; color: var(--muted); }
.progress.big { height: 14px; }
.fstats { display: flex; justify-content: space-around; text-align: center; margin: 10px 0; }
.fstats b { display: block; font: 700 1.6rem/1.2 var(--font-head); color: var(--accent); }
.fstats span { font-size: .8rem; color: var(--muted); }
.fmark { display: flex; align-items: center; gap: 10px; min-height: 48px; border-top: 1px solid var(--line); }
.fmark a { color: var(--accent); min-height: 44px; display: inline-flex; align-items: center; }
.fmark span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fmark button { margin-inline-start: auto; }
.tas-wrap { display: grid; justify-items: center; gap: 10px; padding: 14px; }
.tas-l { font-weight: 650; color: var(--gold); text-align: center; min-height: 1.4em; }
.tas-btn { width: min(72vw, 260px); height: min(72vw, 260px); border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, rgb(var(--mt) / .35), var(--glass)); border: 3px solid var(--accent); box-shadow: 0 0 36px -6px var(--glow), inset 0 0 40px -14px var(--glow); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tas-btn:active { transform: scale(.97); }
.tas-n { font: 700 clamp(3.5rem, 22vw, 5.5rem)/1 var(--font-head); font-variant-numeric: tabular-nums; color: var(--text); }
.tas-s { color: var(--muted); }
.tas-row { justify-content: center; margin: 0 14px; }
.qibla { text-align: center; }
.qbig { font: 700 2.6rem/1.2 var(--font-head); color: var(--gold); }
.qdial { width: min(78vw, 300px); height: auto; margin: 6px auto; display: block; }
.qring { fill: none; stroke: var(--line-hi); stroke-width: 2; }
.qa { fill: var(--accent); filter: drop-shadow(0 0 4px var(--glow)); }
.qn { fill: var(--muted); font: 700 12px sans-serif; }
.fadj { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.fa { display: grid; gap: 4px; font-size: .88rem; }
.fa input { min-height: 44px; }
.fnotify { display: grid; gap: 4px; }
@media (max-width: 360px) { .frow { padding-inline-start: 10px; } .fnext-name { font-size: 1.5rem; } }
