:root {
  --bg: #f4f5fb;
  --card: #ffffff;
  --text: #1e1b4b;
  --muted: #6b6b8f;
  --blue: #2563eb;
  --purple: #7c3aed;
  --primary: #5b4bf0;
  --primary-dark: #4c38d9;
  --grad: linear-gradient(120deg, var(--blue), var(--purple));
  --grad-dark: linear-gradient(120deg, #1d4ed8, #6d28d9);
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --border: #e5e7eb;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 50%, #e0e7ff 100%) fixed;
  min-height: 100vh;
  color: var(--text);
}
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 24px;
  background: var(--grad);
  color: #fff;
  flex-wrap: wrap;
  box-shadow: 0 4px 20px rgba(91, 75, 240, .35);
}
h2, .tracker-summary h3 {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
[hidden] { display: none !important; }

/* Demo */
.btn.l-demo {
  margin-top: 12px; background: #fff; color: var(--purple); border: 2px dashed #a78bfa;
}
.btn.l-demo:hover { background: #f5f3ff; }
.l-demo-note { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.l-demo-row { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px; }
body.locked > .demo-banner { display: none !important; }
.demo-banner {
  position: sticky; top: 0; z-index: 35; display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: #1e1b4b; color: #fff; font-weight: 600; text-align: center;
}
.demo-actions { display: inline-flex; gap: 8px; }
.demo-banner .btn.btn-start { background: var(--grad); color: #fff; }

/* Notification messages under the header */
body.locked > .notify-hint { display: none !important; }
.notify-hint {
  max-width: 1150px; margin: 14px auto 0; padding: 12px 16px; border-radius: 12px; font-weight: 600; line-height: 1.5;
  background: #ede9fe; color: #4c1d95;
}
@media (max-width: 860px) { .notify-hint { margin: 12px 14px 0; } }
.notify-hint.ok { background: #dcfce7; color: #166534; }
.notify-hint.warn { background: #fef3c7; color: #92400e; }

/* Sync status + "changed on another device" */
.sync-pill {
  border: 0; border-radius: 10px; padding: 9px 12px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  background: rgba(255,255,255,.18); color: #fff; white-space: nowrap;
}
.sync-pill[data-state="offline"], .sync-pill[data-state="error"] { background: #fef3c7; color: #92400e; }
.remote-banner {
  position: fixed; inset-inline: 0; bottom: 16px; margin: 0 auto; width: max-content; max-width: 92vw; z-index: 60;
  border: 0; border-radius: 999px; padding: 12px 20px; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--grad); color: #fff; box-shadow: 0 10px 30px rgba(91, 75, 240, .4);
}
.acct-email { padding: 8px 12px 10px; font-size: .82rem; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; word-break: break-all; }
.link-btn.danger-text { color: var(--red); }

/* Sign in */
body.locked > header, body.locked > main { display: none; }
.auth {
  position: fixed; inset: 0; z-index: 70; overflow: auto;
  display: grid; place-items: center; padding: 20px;
  background: rgba(30, 27, 75, .55); backdrop-filter: blur(3px);
}
.auth-close {
  border: 0; background: #ede9fe; color: var(--text); width: 36px; height: 36px; border-radius: 50%;
  font-size: 1rem; cursor: pointer;
}
.auth-close:hover { background: #ddd6fe; }

/* ================= Public home page ================= */
body:not(.locked) > .landing { display: none; }
.landing { color: var(--text); }
.l-nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--grad); color: #fff; box-shadow: 0 4px 20px rgba(91, 75, 240, .35);
}
.l-brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.l-brand .logo { font-size: 2rem; }
.l-nav-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn.l-ghost { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn.l-ghost:hover { background: rgba(255,255,255,.3); }
.l-hero .btn.l-ghost { background: #fff; color: var(--primary); border: 1px solid #c7d2fe; }
.l-hero .btn.l-ghost:hover { background: #eef2ff; }

.l-hero {
  max-width: 1150px; margin: 0 auto; padding: 56px 24px 40px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center;
}
.l-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1; margin: 0 0 16px; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.l-sub { font-size: 1.15rem; line-height: 1.6; color: #3f3d6b; margin: 0 0 24px; }
.l-hero-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.l-hero .btn-start { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(91, 75, 240, .35); }
.l-badges { margin: 18px 0 0; color: var(--muted); font-weight: 600; }

/* app picture */
.l-mock { display: grid; place-items: center; }
.m-phone {
  width: min(320px, 90vw); background: #fff; border-radius: 34px; padding: 16px 14px 20px;
  box-shadow: 0 30px 60px rgba(91, 75, 240, .3), 0 0 0 10px #1e1b4b; display: grid; gap: 10px;
  transform: rotate(2deg); text-align: start;
}
.m-top { display: flex; justify-content: space-between; font-weight: 700; color: var(--primary); padding: 2px 6px 4px; }
.m-alarm {
  background: var(--grad); color: #fff; border-radius: 14px; padding: 10px 12px; font-weight: 700; font-size: .9rem;
  animation: m-pop 2.4s ease-in-out infinite;
}
.m-bell { display: inline-block; animation: ring .6s ease-in-out infinite; }
@keyframes m-pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.m-card { border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; font-size: .9rem; background: #f8faff; border-inline-start: 4px solid var(--blue); }
.m-card span { color: var(--muted); }
.m-appt.visit { border-inline-start-color: var(--purple); background: #faf7ff; }
.m-tracker { display: flex; justify-content: space-between; align-items: center; border-inline-start-color: var(--green); background: #f0fdf4; }
.m-tracker strong { font-family: inherit; font-variant-numeric: tabular-nums; font-size: 1.15rem; color: var(--green); }
.m-link { color: var(--blue) !important; font-weight: 600; }
.m-contact { display: flex; justify-content: space-between; align-items: center; border-inline-start-color: #db2777; background: #fdf2f8; }
.m-pills { display: flex; gap: 4px; }
.m-pills i { font-style: normal; background: #fff; border-radius: 8px; padding: 2px 6px; }

.l-section { max-width: 1150px; margin: 0 auto; padding: 36px 24px; }
.l-h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); text-align: center; margin: 0 0 26px; }
.l-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.l-features article {
  background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: 0 6px 24px rgba(91, 75, 240, .1);
  border-top: 4px solid transparent; background-image: linear-gradient(#fff, #fff), var(--grad);
  background-origin: border-box; background-clip: padding-box, border-box;
}
.l-features h3 { margin: 0 0 8px; font-size: 1rem; }
.l-features p { margin: 0; color: #4b4a6b; line-height: 1.55; }

.l-privacy {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center;
  background: #1e1b4b; color: #e0e7ff; border-radius: 24px; padding: 36px; margin-top: 20px; margin-bottom: 20px;
}
.l-privacy .l-h2 { text-align: start; color: #fff; background: none; -webkit-background-clip: initial; background-clip: initial; }
.l-privacy p { line-height: 1.7; margin: 0; font-size: 1rem; }
.l-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.l-points li { background: rgba(255,255,255,.08); border-radius: 12px; padding: 12px 14px; font-weight: 600; }

/* Price (home page + subscribe page) */
.price-card {
  max-width: 460px; margin: 0 auto; text-align: center; background: #fff; border-radius: 22px; padding: 28px 26px 18px;
  box-shadow: 0 16px 40px rgba(91, 75, 240, .18); border: 2px solid transparent;
  background-image: linear-gradient(#fff, #fff), var(--grad); background-origin: border-box; background-clip: padding-box, border-box;
}
.price-big { font-size: 2.6rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.price-big .pp-per { font-size: 1rem; font-weight: 600; color: var(--muted); }
.price-local { margin: 2px 0 14px; color: var(--purple); font-weight: 700; min-height: 1.2em; }
.price-equiv { margin: 4px 0 0; color: var(--green); font-weight: 700; min-height: 1.2em; }
.plan-toggle {
  display: inline-flex; gap: 4px; padding: 4px; margin: 0 auto 14px; border-radius: 999px; background: #ede9fe;
}
.paywall-card .plan-toggle { display: flex; width: max-content; }
.plan-toggle button {
  border: 0; border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 700; cursor: pointer;
  background: none; color: #4c1d95; display: inline-flex; align-items: center; gap: 6px;
}
.plan-toggle button.on { background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(91, 75, 240, .35); }
.plan-toggle .save { font-size: .72rem; background: #dcfce7; color: var(--green); border-radius: 999px; padding: 2px 7px; }
.plan-toggle button.on .save { background: rgba(255,255,255,.25); color: #fff; }
.paywall-card .price-big, .paywall-card .price-equiv, .paywall-card .price-local { text-align: center; }
.price-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; text-align: start; }
.price-list li { background: #f5f3ff; border-radius: 10px; padding: 9px 12px; font-size: .9rem; }
.price-list li::before { content: "✓ "; color: var(--green); font-weight: 700; }
.price-card .btn { width: 100%; }
.paywall-card h2 { margin: 14px 0 8px; }
.paywall-card .auth-top { gap: 10px; }
.pay-note { text-align: center; margin-top: 10px; }

.l-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.l-steps li { background: #fff; border-radius: var(--radius); padding: 20px; display: flex; gap: 14px; align-items: flex-start; box-shadow: 0 6px 24px rgba(91, 75, 240, .1); }
.l-steps p { margin: 0; line-height: 1.5; }
.l-num {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-weight: 700;
}
.l-cta {
  max-width: 1100px; margin: 20px auto 0; padding: 40px 24px; text-align: center;
  background: var(--grad); color: #fff; border-radius: 24px;
}
.l-cta h2 { margin: 0 0 18px; font-size: clamp(1.5rem, 3vw, 2rem); color: #fff; background: none; -webkit-background-clip: initial; background-clip: initial; }
.l-footer { text-align: center; color: var(--muted); padding: 30px 20px 40px; font-size: .9rem; }
.legal-links { text-align: center; color: var(--muted); margin: 8px 0 0; }
.legal-links a { color: inherit; text-decoration: underline; cursor: pointer; }
.legal-links a:hover { color: var(--accent, #5b4bf0); }
.app-footer { font-size: .9rem; padding: 6px 0 24px; }
.legal-agree a { color: inherit; text-decoration: underline; }

@media (max-width: 860px) {
  .l-hero { grid-template-columns: 1fr; padding-top: 32px; text-align: center; }
  .l-hero-btns { justify-content: center; }
  .l-features, .l-steps { grid-template-columns: 1fr; }
  .l-privacy { grid-template-columns: 1fr; margin-inline: 16px; padding: 26px; }
  .l-cta { margin-inline: 16px; }
  .m-phone { transform: none; }
}
@media (max-width: 520px) {
  .l-nav { justify-content: center; }
  .l-nav .btn { padding: 8px 12px; font-size: .9rem; }
}
.auth[hidden] { display: none; }
.auth-card {
  width: min(94vw, 420px); background: #fff; border-radius: 20px; padding: 26px 26px 18px;
  box-shadow: 0 20px 50px rgba(91, 75, 240, .25);
  border-top: 5px solid transparent;
  background-image: linear-gradient(#fff, #fff), var(--grad);
  background-origin: border-box; background-clip: padding-box, border-box;
}
.auth-card h2 { margin: 0 0 6px; font-size: 1.4rem; }
.auth-top { display: flex; justify-content: space-between; align-items: center; }
.auth-top .logo { font-size: 2rem; }
.auth-lang { background: #ede9fe; color: var(--text); font-size: 1rem; }
.auth-welcome { margin: 6px 0 2px; color: var(--muted); font-weight: 600; }
.auth-submit { width: 100%; padding: 13px; font-size: 1rem; margin-top: 4px; }
.link-btn {
  display: block; width: 100%; margin-top: 12px; background: none; border: 0; cursor: pointer;
  color: var(--primary); font: inherit; font-weight: 600;
}
.link-btn:hover { text-decoration: underline; }
[hidden].signup-only { display: none !important; }

/* Account menu */
.account { position: relative; }
.account summary {
  list-style: none; cursor: pointer; background: rgba(255,255,255,.18); color: #fff;
  border-radius: 10px; padding: 9px 14px; font-weight: 600; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account summary::-webkit-details-marker { display: none; }
.account[open] summary { background: rgba(255,255,255,.3); }
.account-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 40; min-width: 210px;
  background: #fff; border-radius: 12px; padding: 6px; box-shadow: 0 12px 30px rgba(30, 27, 75, .25);
  display: grid; gap: 2px;
}
.account-menu button {
  background: none; border: 0; text-align: start; padding: 10px 12px; border-radius: 8px;
  font: inherit; color: var(--text); cursor: pointer;
}
.account-menu button:hover { background: #ede9fe; }
.account-menu .danger-text { color: var(--red); }

.brand { display: flex; align-items: center; gap: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lang-pick {
  display: flex; align-items: center; gap: 6px; font-size: 1rem;
  background: rgba(255,255,255,.18); border-radius: 10px; padding: 4px 4px 4px 10px;
}
.lang-pick select {
  margin: 0; width: auto; padding: 7px 8px; border: 0; border-radius: 8px;
  font-size: .9rem; color: var(--text); background: #fff; cursor: pointer;
}
[dir="rtl"] .lang-pick { padding: 4px 10px 4px 4px; }
[dir="rtl"] body { font-family: system-ui, "Segoe UI", Tahoma, "Noto Naskh Arabic", sans-serif; }
.logo { font-size: 2rem; }
h1 { margin: 0; font-size: 1.4rem; }
.clock { margin: 2px 0 0; opacity: .9; font-size: .9rem; }
h2 { margin: 0 0 14px; font-size: 1.15rem; }

.layout {
  display: grid; grid-template-columns: 360px 1fr; gap: 20px;
  padding: 20px 24px; max-width: 1200px; margin: 0 auto;
}
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; padding: 14px; } }

.card {
  background: var(--card); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 6px 24px rgba(91, 75, 240, .12);
  border-top: 4px solid transparent;
  background-image: linear-gradient(#fff, #fff), var(--grad);
  background-origin: border-box; background-clip: padding-box, border-box;
}
form label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 12px; }
input, select, textarea {
  width: 100%; margin-top: 4px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font: inherit; font-weight: 400; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.muted { color: var(--muted); font-weight: 400; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; }
legend { font-size: .9rem; font-weight: 600; padding: 0 4px; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; margin-bottom: 6px !important; }
.check input { width: auto; margin: 0; }

.btn {
  border: 0; border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 600;
  cursor: pointer; transition: background .15s, transform .05s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 3px 10px rgba(91, 75, 240, .3); }
.btn-primary:hover { background: var(--grad-dark); }
.btn-ghost { background: #ede9fe; color: #4c1d95; }
.btn-ghost:hover { background: #ddd6fe; }
.btn-start { background: #fff; color: var(--primary); font-size: 1rem; padding: 12px 20px; }
.btn-start.on { background: var(--green); color: #fff; }
.btn.small { padding: 6px 10px; font-size: .82rem; }
.btn.danger { background: #fee2e2; color: var(--red); }
.btn.go { background: #dcfce7; color: var(--green); }
.btn.stop { background: var(--red); color: #fff; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.list-head { display: flex; align-items: center; gap: 8px; }
.list-head h2 { margin: 0; }
.badge { background: var(--grad); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: .82rem; }
.filters {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 14px 0;
}
.filters input[type="search"] { grid-column: span 2; }
.filters input, .filters select { margin: 0; }


.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.item {
  border: 1px solid #e0e7ff; border-inline-start: 5px solid var(--blue);
  border-radius: 10px; padding: 12px 14px; background: #f8faff;
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
}
.item.visit { border-inline-start-color: var(--purple); background: #faf7ff; }
.item.soon { border-inline-start-color: var(--amber); background: #fffbeb; }
.item.past { opacity: .6; }
.item.running { border-inline-start-color: var(--green); background: #f0fdf4; }
.item h3 { margin: 0 0 4px; font-size: 1rem; }
.meta { font-size: .9rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.meta a { color: var(--primary); }
.item.visit .tag { background: #ede9fe; color: var(--purple); }
.tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; background: #dbeafe; color: var(--blue); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.countdown { font-weight: 600; color: var(--text); }
.timer { font-family: inherit; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--green); }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* Notes */
.note-btn { background: #dbeafe; color: var(--blue); }
.note-btn:hover, .note-btn.open { background: var(--grad); color: #fff; }
.note-panel {
  grid-column: 1 / -1; margin-top: 6px; padding: 12px; border-radius: 10px;
  background: #fff; border: 1px dashed #c4b5fd;
}
.note-panel textarea { margin: 0; resize: vertical; }
.note-tools { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: .82rem; }
.note-list { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.note { background: #f5f3ff; border-inline-start: 3px solid var(--purple); border-radius: 6px; padding: 8px 10px; }
.note-head { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); }
.note-text { white-space: pre-wrap; font-size: .9rem; margin-top: 2px; }
.note-del { background: none; border: 0; color: var(--red); cursor: pointer; }
.addr-link {
  color: var(--blue); font-weight: 600; text-decoration: none;
  background: #dbeafe; border-radius: 6px; padding: 1px 6px;
}
.addr-link:hover { background: var(--grad); color: #fff; }
.nav-btn {
  display: block; text-align: start; text-decoration: none; margin-bottom: 8px;
  background: var(--grad); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-btn:hover { background: var(--grad-dark); }
.addr-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: .9rem; }
.addr-chips .addr-link { padding: 4px 10px; }
/* Contacts */
.contacts { grid-column: 1 / -1; }
.spacer { flex: 1; }
.contacts .list-head { flex-wrap: wrap; }
.filters.contact-filters, .filters.task-filters { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.item.contact { border-inline-start-color: var(--purple); background: #fbfaff; grid-template-columns: 1fr; }
.item.contact .item-actions { justify-content: flex-start; }
.tag.rel-family { background: #fce7f3; color: #be185d; }
.tag.rel-friend { background: #ede9fe; color: var(--purple); }
.tag.rel-client { background: #dbeafe; color: var(--blue); }
.tag.rel-doctor { background: #dcfce7; color: var(--green); }
.tag.rel-work { background: #fef3c7; color: #b45309; }
.tag.rel-other { background: #f1f5f9; color: #475569; }
.btn.nav-mini { background: var(--grad); color: #fff; }
.btn-ghost.open { background: var(--grad); color: #fff; }
.meta.person { margin-bottom: 4px; color: var(--text); }
.meta.person a { color: var(--green); font-weight: 600; text-decoration: none; }
.alarm-box.modal-box { max-height: 92vh; overflow: auto; }
.history-text { font-size: .9rem; margin-top: 2px; }
@media (max-width: 640px) {
  .item { grid-template-columns: 1fr; }
  .item-actions { justify-content: flex-start; }
}
.quicknotes { grid-column: 1 / -1; }
.quicknotes .list-head { justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; }
.quicknotes textarea { min-height: 140px; resize: vertical; margin: 0; line-height: 1.5; }
.quicknotes .note-tools { justify-content: space-between; margin-bottom: 0; }

/* Address / GPS */
.field { margin-bottom: 12px; position: relative; }
.field-label { display: block; font-size: .9rem; font-weight: 600; }
.addr-row { display: flex; gap: 6px; margin-top: 4px; }
.addr-row input { margin: 0; flex: 1; min-width: 0; }
.icon-btn { padding: 0 12px; background: #ede9fe; font-size: 1rem; }
.icon-btn:hover { background: #ddd6fe; }
.icon-btn.busy { opacity: .5; pointer-events: none; }
.suggest {
  list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; left: 0; right: 0; z-index: 20;
  background: #fff; border: 1px solid #c7d2fe; border-radius: 10px; box-shadow: 0 10px 30px rgba(91,75,240,.2);
  max-height: 260px; overflow: auto;
}
.suggest li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: .9rem; }
.suggest li:hover, .suggest li.active { background: #ede9fe; }
.suggest li.none { cursor: default; color: var(--muted); }
.suggest li.none:hover { background: none; }
.suggest.static { position: static; margin-top: 8px; box-shadow: none; max-height: 320px; text-align: start; }
.alarm-box.modal-box { width: min(94vw, 520px); text-align: start; }
.modal-box h3 { margin: 0 0 4px; }
.modal-box .actions { justify-content: flex-end; }
.small-text { font-size: .9rem; margin: 0 0 10px; }
.addr-msg { margin: 4px 0 0; font-size: .82rem; color: var(--muted); min-height: 0; }
.addr-msg.ok { color: var(--green); }
.addr-msg.err { color: var(--red); }
.addr-map { width: 100%; height: 170px; border: 0; border-radius: 10px; margin-top: 6px; }
.meta .dist { color: var(--purple); font-weight: 600; }

/* Time tracker */
.tracker { grid-column: 1 / -1; }
.tracker-main { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.tracker-left { flex: 1 1 260px; }
.tracker-left h2 { margin-bottom: 8px; }
.tracker-left input { margin: 0; }
.tracker-clock {
  font-family: inherit; font-variant-numeric: tabular-nums; font-size: 2.6rem; font-weight: 700;
  color: var(--muted); min-width: 210px; text-align: center;
}
.tracker.running .tracker-clock {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tracker.paused .tracker-clock { color: var(--amber); }
.tracker-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.big { padding: 14px 22px; font-size: 1rem; }
.tracker-status { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.tracker-summary { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.tracker-summary h3 { margin: 0; font-size: 1rem; }
.tracker-summary select { width: auto; margin: 0; padding: 5px 8px; }
.totals { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.totals li { display: grid; grid-template-columns: 160px 1fr auto; gap: 10px; align-items: center; font-size: .9rem; }
.totals .bar { height: 10px; background: #ede9fe; border-radius: 999px; overflow: hidden; }
.totals .bar span { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.totals .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.totals .dur, .history .dur { font-family: inherit; font-variant-numeric: tabular-nums; }
details summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .9rem; }
.history { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; max-height: 240px; overflow: auto; }
.history li { display: flex; gap: 10px; align-items: center; font-size: .9rem; padding: 6px 8px; background: #f5f3ff; border-radius: 6px; }
.history li .when { color: var(--muted); flex: 1; }
.history button { background: none; border: 0; color: var(--red); cursor: pointer; font-size: 1rem; }

.alarm {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: grid; place-items: center; z-index: 50;
}
.alarm[hidden] { display: none; }
.alarm-box {
  background: #fff; border-radius: 18px; padding: 28px; width: min(92vw, 380px); text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.alarm-box .actions { justify-content: center; margin-top: 16px; }
.alarm-icon { font-size: 3rem; animation: ring 0.6s ease-in-out infinite; }
@keyframes ring { 0%,100% { transform: rotate(0); } 25% { transform: rotate(18deg); } 75% { transform: rotate(-18deg); } }

/* Assignments */
.tasks-card { grid-column: 1 / -1; }
.tasks-card .list-head { flex-wrap: wrap; }


.late-badge { background: #fee2e2; color: var(--red); border-radius: 999px; padding: 2px 10px; font-size: .82rem; font-weight: 700; }
.item.task { border-inline-start-color: var(--blue); }
.item.task.pr-high { border-inline-start-color: var(--red); }
.item.task.pr-low { border-inline-start-color: #94a3b8; }
.item.task.soon { background: #fffbeb; }
.item.task.overdue { background: #fef2f2; }
.item.task.done { opacity: .6; background: #f8fafc; }
.item.task.done h3 { text-decoration: line-through; }
.task-row { display: flex; gap: 12px; align-items: flex-start; }
.task-check {
  flex: none; width: 30px; height: 30px; margin-top: 2px; border-radius: 50%; cursor: pointer;
  border: 2px solid #a5b4fc; background: #fff; color: #fff; font-weight: 700; font-size: 1rem; line-height: 1;
}
.task-check:hover { border-color: var(--primary); background: #eef2ff; }
.item.task.done .task-check { background: var(--green); border-color: var(--green); }
.tag.pr-tag-high { background: #fee2e2; color: var(--red); }
.tag.pr-tag-low { background: #f1f5f9; color: #475569; }
.meta .late { color: var(--red); font-weight: 700; }
.assignee-chip { background: #ede9fe; color: #5b21b6; border-radius: 999px; padding: 0 8px; font-weight: 600; }

/* Profile pictures */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; flex: none; vertical-align: middle; }
.avatar.initials {
  background: linear-gradient(135deg, hsl(var(--h) 75% 55%), hsl(calc(var(--h) + 40) 70% 45%));
  color: #fff; font-weight: 700; letter-spacing: .02em;
}
.avatar.xs { width: 22px; height: 22px; font-size: .72rem; }
.avatar.sm { width: 28px; height: 28px; font-size: .72rem; border: 2px solid rgba(255,255,255,.7); }
.avatar.md { width: 44px; height: 44px; font-size: .9rem; }
.avatar.xl { width: 140px; height: 140px; font-size: 2.6rem; box-shadow: 0 10px 30px rgba(91, 75, 240, .3); }
.account summary { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; }
[dir="rtl"] .account summary { padding: 6px 6px 6px 12px; }
.acct-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.avatar-box { text-align: center; }
.alarm-box.modal-box.avatar-box { text-align: center; width: min(94vw, 420px); }
.avatar-preview { display: grid; place-items: center; margin: 12px 0 16px; }
.avatar-actions { justify-content: center; }
.avatar-actions label.btn { cursor: pointer; }
.contact-photo-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.avatar-btn { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; position: relative; }
.avatar-btn::after {
  content: "📷"; position: absolute; inset-inline-end: -4px; bottom: -4px; font-size: .82rem;
  background: #fff; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.item.contact h3 { display: flex; align-items: center; gap: 10px; }
.meta.person .avatar { margin-inline-end: 2px; }

/* Free first week */
body.locked > .trial-banner { display: none !important; }
.trial-banner {
  display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 16px; background: #dcfce7; color: #166534; font-weight: 700; text-align: center;
}
.trial-banner.urgent { background: #fef3c7; color: #92400e; }
.trial-banner .btn.btn-start { background: var(--grad); color: #fff; }
.free-badge {
  display: inline-block; margin: 0 auto 12px; padding: 6px 14px; border-radius: 999px;
  background: #dcfce7; color: #166534; font-weight: 700; font-size: .9rem;
}
.paywall-card .free-badge { display: block; width: max-content; margin: 0 0 10px; }

/* ---------- Phones: compact header (one row of controls) ---------- */
@media (max-width: 600px) {
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar h1 { font-size: 1.15rem; }
  .topbar .logo { font-size: 1.4rem; }
  .clock { font-size: .82rem; }
  .top-actions { width: 100%; gap: 6px; flex-wrap: nowrap; }
  .top-actions .lang-pick { padding: 3px 3px 3px 7px; font-size: .9rem; flex: none; }
  .top-actions .lang-pick select { padding: 6px 2px; font-size: .82rem; max-width: 96px; }
  .top-actions .btn-start {
    flex: 1; min-width: 0; padding: 9px 10px; font-size: .9rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .sync-pill[data-state="synced"], .sync-pill[data-state="syncing"] { display: none; } /* only shown when there's a problem */
  .acct-label { display: none; }                                                        /* just the picture */
  .account summary { padding: 3px; }
  .trial-banner, .demo-banner { padding: 8px 10px; font-size: .9rem; }
}

/* ---------- Planner ---------- */
.planner { grid-column: 1 / -1; }
.pl-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pl-top h2 { margin: 0; }
.pl-views { margin: 0; }
.pl-nav { display: flex; align-items: center; gap: 6px; margin: 12px 0; flex-wrap: wrap; }
.pl-title { margin-inline-start: 8px; font-size: 1rem; text-transform: capitalize; }
.pl-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-weight: 700; color: #166534; font-size: .9rem; }
.pl-progress .bar { flex: 1; height: 10px; background: #dcfce7; border-radius: 999px; overflow: hidden; max-width: 320px; }
.pl-progress .bar span { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .3s; }
.pl-late { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fef3c7; color: #92400e; padding: 8px 12px; border-radius: 10px; margin-bottom: 10px; font-weight: 600; }
.pl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pl-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: #f8faff; border-inline-start: 4px solid var(--blue); }
.pl-item.appt { border-inline-start-color: var(--blue); }
.pl-item.task { border-inline-start-color: var(--purple); background: #faf7ff; }
.pl-item.todo { border-inline-start-color: var(--green); background: #f7fdf9; }
.pl-item.done .pl-text { text-decoration: line-through; color: var(--muted); }
.pl-time { font-family: inherit; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--primary); font-size: .9rem; white-space: nowrap; }
.pl-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pl-item.todo .pl-text { cursor: text; }
.pl-sub { color: var(--muted); font-size: .82rem; }
.pl-actions { display: flex; gap: 4px; flex: none; }
.pl-btn { border: 0; background: #ede9fe; color: #4c1d95; border-radius: 8px; padding: 4px 8px; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.pl-btn:hover { background: #ddd6fe; }
.pl-btn.del { background: none; color: var(--red); font-size: .9rem; }
.task-check.small { width: 24px; height: 24px; margin: 0; font-size: .82rem; }
.pl-item.todo.done .task-check { background: var(--green); border-color: var(--green); }
.small-empty { padding: 14px 0; }
.pl-add { display: grid; grid-template-columns: 1fr 130px auto; gap: 8px; margin-top: 12px; align-items: center; }
.pl-add input { margin: 0; }
.pl-anytime-check { grid-column: 1 / -1; margin: 0 !important; font-size: .9rem; color: var(--muted); }
.pl-anytime { margin-top: 12px; }
.pl-anytime .pl-list { margin-top: 8px; }
/* week */
.pl-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.pl-day { background: #fbfaff; border: 1px solid #e0e7ff; border-radius: 12px; padding: 6px; min-height: 140px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pl-day.today { border: 2px solid var(--primary); background: #fff; }
.pl-day.past { opacity: .7; }
.pl-day-head { display: flex; align-items: baseline; gap: 6px; border: 0; background: none; cursor: pointer; padding: 4px; border-radius: 8px; font: inherit; color: var(--text); text-align: start; }
.pl-day-head:hover { background: #ede9fe; }
.pl-dow { text-transform: capitalize; color: var(--muted); font-size: .82rem; font-weight: 700; }
.pl-dnum { font-weight: 700; font-size: 1.15rem; }
.pl-day.today .pl-dnum { color: var(--primary); }
.pl-count { margin-inline-start: auto; font-size: .72rem; font-weight: 700; color: #166534; background: #dcfce7; border-radius: 999px; padding: 1px 6px; }
.pl-day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.pl-day-list .pl-item { padding: 4px 6px; gap: 4px; font-size: .82rem; border-inline-start-width: 3px; }
.pl-day-list .pl-time { font-size: .72rem; }
.pl-day-list .task-check.small { width: 18px; height: 18px; font-size: .72rem; border-width: 2px; }
.pl-day-list .pl-kind { font-size: .82rem; }
.pl-more { border: 0; background: none; color: var(--primary); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; text-align: start; padding: 2px 4px; }
.pl-more.add { font-size: 1.15rem; color: #a5b4fc; text-align: center; flex: 1; }
@media (max-width: 860px) {
  .pl-week { grid-template-columns: 1fr; }          /* phones: days stacked */
  .pl-day { min-height: 0; }
  .pl-day-head { gap: 8px; }
}
@media (max-width: 600px) {
  .pl-add { grid-template-columns: 1fr 104px; }
  .pl-add button[type="submit"] { grid-column: 1 / -1; }
  .pl-item { flex-wrap: wrap; }
  .pl-actions { margin-inline-start: auto; }
}
/* week cells: time on its own small line above the title */
.pl-day-list .pl-item { display: grid; grid-template-columns: auto 1fr; column-gap: 5px; row-gap: 0; align-items: start; }
.pl-day-list .pl-item > :first-child { grid-row: 1 / span 2; margin-top: 1px; }
.pl-day-list .pl-time { grid-column: 2; line-height: 1.2; }
.pl-day-list .pl-text { grid-column: 2; line-height: 1.25; overflow-wrap: break-word; word-break: normal; }
@media (max-width: 860px) {
  .pl-day-list .pl-item { display: flex; }   /* stacked days have room for one line */
  .pl-day-list .pl-item > :first-child { margin-top: 0; }
}
/* to-do text never gets squeezed into a sliver: it keeps room, the buttons move below if needed */
.pl-text { overflow-wrap: break-word; }
.pl-list .pl-text { flex: 1 1 150px; }
@media (max-width: 600px) {
  .pl-list .pl-item { flex-wrap: wrap; row-gap: 6px; }
  .pl-list .pl-actions { flex: 0 0 auto; }
}

/* Time Tracker → Planner */
.stop-box { width: min(92vw, 400px); }
.alarm-icon.still { animation: none; }
.stop-actions { justify-content: center; }
.stop-actions .btn { min-width: 130px; }
.pl-item.time { border-inline-start-color: #f59e0b; background: #fffbeb; }
.pl-item.time .pl-sub { color: #b45309; font-weight: 700; }
.pl-item.flash { animation: pl-flash 1.2s ease-in-out 3; box-shadow: 0 0 0 3px #fcd34d; }
@keyframes pl-flash { 50% { background: #fde68a; } }
.pl-saved { margin: 0 0 10px; padding: 10px 14px; border-radius: 10px; background: #dcfce7; color: #166534; font-weight: 700; }

/* ---------- Time Tracker: purpose + note ---------- */
.trk-label { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.trk-label input { margin-top: 3px; }
.stop-note { display: block; text-align: start; font-size: .9rem; font-weight: 600; margin: 4px 0 12px; }
.stop-note textarea { margin-top: 4px; resize: vertical; }

/* ---------- Time calendar ---------- */
.tcal { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.tcal h3 { margin: 0; font-size: 1rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tcal-total { font-weight: 700; color: var(--primary) !important; }
.tcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.tcal-head { text-align: center; font-size: .82rem; font-weight: 700; color: var(--muted); padding: 2px 0; }
.tcal-cell {
  position: relative; border: 1px solid #e0e7ff; border-radius: 10px; background: #fff; cursor: pointer; font: inherit;
  min-height: 58px; padding: 4px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; color: var(--text);
}
.tcal-cell:hover { border-color: #a5b4fc; }
.tcal-cell.other { opacity: .45; }
.tcal-cell.today { border: 2px solid var(--primary); }
.tcal-cell.selected { box-shadow: 0 0 0 3px #c4b5fd; }
.tcal-cell.lvl1 { background: #ede9fe; }
.tcal-cell.lvl2 { background: #ddd6fe; }
.tcal-cell.lvl3 { background: #c4b5fd; }
.tcal-cell.lvl4 { background: #a78bfa; color: #fff; }
.tcal-num { font-weight: 700; font-size: .9rem; }
.tcal-time { font-size: .72rem; font-weight: 700; font-family: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tcal-note { position: absolute; inset-inline-end: 3px; top: 2px; font-size: .72rem; }
.tcal-day { margin-top: 12px; background: #fbfaff; border: 1px solid #e0e7ff; border-radius: 12px; padding: 12px; }
.tcal-day-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; text-transform: capitalize; }
.tcal-day-total { font-weight: 700; color: var(--primary); text-transform: none; }
.tcal-sessions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tcal-session { background: #fffbeb; border-inline-start: 4px solid #f59e0b; border-radius: 10px; padding: 8px 10px; }
.tcal-session.running { background: #f0fdf4; border-inline-start-color: var(--green); }
.tcal-s-top { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.tcal-s-time { font-family: inherit; font-variant-numeric: tabular-nums; font-size: .82rem; font-weight: 700; color: var(--primary); }
.tcal-s-dur { color: #b45309; font-weight: 700; font-size: .9rem; }
.tcal-s-actions { margin-inline-start: auto; display: flex; gap: 4px; }
.tcal-s-note { margin-top: 4px; font-size: .9rem; color: #4b4a6b; overflow-wrap: break-word; }
@media (max-width: 600px) {
  .tcal-cell { min-height: 46px; padding: 3px; border-radius: 8px; }
  .tcal-time { font-size: .72rem; }
  .tcal-num { font-size: .82rem; }
}
.tcal-session.flash { animation: pl-flash 1.2s ease-in-out 3; box-shadow: 0 0 0 3px #fcd34d; }

/* ---------- Events ---------- */
.events-card { grid-column: 1 / -1; }
.events-card .list-head { flex-wrap: wrap; }
.ev-show { width: auto; margin: 0; padding: 6px 8px; }
.ev-list { margin-top: 12px; }
.item.event { border-inline-start-color: #0ea5e9; background: #f0f9ff; }
.item.event.ev-memorial { border-inline-start-color: #b45309; background: #fffbeb; }
.item.event.ev-assembly { border-inline-start-color: var(--blue); background: #eff6ff; }
.item.event.ev-convention { border-inline-start-color: var(--purple); background: #faf5ff; }
.item.event.ev-co_visit { border-inline-start-color: var(--green); background: #f0fdf4; }
.item.event.running { box-shadow: 0 0 0 2px #86efac; }
.ev-icon { font-size: 1.15rem; }
.ev-repeat { color: #0369a1; font-weight: 700; }
.ev-picks { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.ev-pick { border: 1px solid #c7d2fe; background: #fff; border-radius: 999px; padding: 5px 11px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--text); }
.ev-pick:hover { background: #eef2ff; }
.ev-pick.on { background: var(--grad); color: #fff; border-color: transparent; }
.pl-item.event { border-inline-start-color: #0ea5e9; background: #f0f9ff; }

/* ================= Menu and pages (Dashboard, Activity, Profile, Settings) ================= */
body.locked > .app-nav, body.locked > .page, body.locked > .app-footer { display: none !important; }
.account-btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  background: rgba(255,255,255,.18); color: #fff; border-radius: 10px; padding: 6px 12px 6px 6px; max-width: 220px;
}
.account-btn:hover { background: rgba(255,255,255,.3); }
[dir="rtl"] .account-btn { padding: 6px 6px 6px 12px; }

.app-nav {
  position: sticky; top: 0; z-index: 30; display: flex; gap: 6px; justify-content: center;
  padding: 8px 16px; background: rgba(255,255,255,.88); backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(91, 75, 240, .12); overflow-x: auto; scrollbar-width: none;
}
.app-nav::-webkit-scrollbar { display: none; }
.app-nav button {
  display: inline-flex; align-items: center; gap: 6px; flex: none; border: 0; cursor: pointer;
  background: none; color: var(--text); font: inherit; font-weight: 600; font-size: .9rem;
  padding: 9px 14px; border-radius: 999px; white-space: nowrap;
}
.app-nav button:hover { background: #ede9fe; }
.app-nav button.on { background: var(--grad); color: #fff; box-shadow: 0 3px 10px rgba(91, 75, 240, .3); }
.app-nav .nav-out { color: var(--red); margin-inline-start: 8px; }
.app-nav .nav-out:hover { background: #fee2e2; }
.nav-ic { font-size: 1rem; }
@media (max-width: 860px) {
  .app-nav { justify-content: flex-start; padding: 8px 10px; }
  .app-nav button { padding: 8px 11px; font-size: .9rem; }
}
@media (max-width: 480px) {
  .app-nav { gap: 2px; padding: 6px; }
  .app-nav button { flex-direction: column; gap: 1px; font-size: .72rem; padding: 6px 6px; border-radius: 12px; }
  .app-nav .nav-out { margin-inline-start: 0; }
  .nav-ic { font-size: 1.15rem; }
}

.page:not(.layout) { max-width: 1200px; margin: 0 auto; padding: 20px 24px; display: grid; gap: 20px; align-content: start; }
.page.narrow { max-width: 760px; }
@media (max-width: 860px) { .page:not(.layout) { padding: 14px; gap: 14px; } }
.page .card { scroll-margin-top: 70px; min-width: 0; }
.layout .card { scroll-margin-top: 70px; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.15rem; box-shadow: 0 6px 18px rgba(91, 75, 240, .25); }

/* Dashboard */
.dash-hello { display: flex; align-items: center; gap: 14px; }
.dash-hello h2 { margin: 0; font-size: 1.4rem; }
.dash-hello p { margin: 2px 0 0; }
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 860px) { .dash-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.stat {
  display: flex; gap: 12px; align-items: flex-start; text-align: start; border: 0; font: inherit; color: var(--text);
  background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: 0 6px 24px rgba(91, 75, 240, .12); cursor: pointer;
  transition: transform .1s, box-shadow .15s; min-width: 0;
}
.stat:not([disabled]):hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(91, 75, 240, .2); }
.stat[disabled] { cursor: default; }
.stat-ic { font-size: 1.4rem; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: #ede9fe; }
.stat-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.stat-num { font-size: 1.4rem; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.2; }
.stat-label { font-size: .9rem; color: var(--muted); font-weight: 600; }
.stat-sub { font-size: .82rem; font-weight: 600; color: var(--muted); }
.stat-sub.up { color: var(--green); }
.stat-sub.down { color: var(--red); }
.stat-bar { height: 6px; background: #ede9fe; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.stat-bar span { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
@media (max-width: 420px) { .stat { padding: 12px; gap: 8px; } .stat-ic { width: 36px; height: 36px; font-size: 1.15rem; } .stat-num { font-size: 1.15rem; } }

.dash-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; gap: 14px; } }
.dash-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dash-item {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: start; border: 0; cursor: pointer;
  font: inherit; color: var(--text); background: #f8f7ff; border-radius: 12px; padding: 10px 12px;
}
.dash-item:hover { background: #ede9fe; }
.dash-ic { font-size: 1.15rem; flex: none; }
.dash-main { display: grid; min-width: 0; flex: 1; }
.dash-main strong, .dash-main .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-main .muted { font-size: .82rem; }
.dash-when { flex: none; font-size: .82rem; font-weight: 700; color: var(--primary); background: #fff; border-radius: 999px; padding: 4px 10px; }
.dash-empty { padding: 20px 0; text-align: center; }
@media (max-width: 480px) {
  .dash-item { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 4px; }
  .dash-when { grid-column: 2; justify-self: start; padding: 2px 8px; }
}
.dash-tracker { text-align: center; }
.dash-trk-state { margin: 0 0 6px; font-weight: 600; color: var(--muted); }
.dash-trk-state.running { color: var(--green); }
.dash-trk-state.paused { color: var(--amber); }
.dash-trk-clock { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; margin: 4px 0; }
.dash-tracker .actions { justify-content: center; }
.dash-quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.dash-quick .btn { text-align: start; }
.dash-week-total { margin-inline-start: auto; font-weight: 700; }
.dash-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 170px; margin-top: 10px; }
.dash-bar { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; gap: 4px; min-width: 0; }
.dash-bar-val { font-size: .72rem; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; min-height: 1em; }
.dash-bar-col { display: flex; align-items: flex-end; background: #f3f1ff; border-radius: 8px; overflow: hidden; }
.dash-bar-col span { display: block; width: 100%; background: linear-gradient(0deg, var(--blue), var(--purple)); border-radius: 8px 8px 0 0; }
.dash-bar-day { font-size: .82rem; font-weight: 600; color: var(--muted); }
.dash-bar.today .dash-bar-day { color: var(--primary); font-weight: 700; }
.dash-bar.today .dash-bar-col { outline: 2px solid #c4b5fd; }

/* Activity */
.act-stats { margin-bottom: 14px; }
.act-stats .stat { box-shadow: none; background: #f8f7ff; }
.act-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { border: 1px solid #c7d2fe; background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--text); }
.chip:hover { background: #eef2ff; }
.chip.on { background: var(--grad); color: #fff; border-color: transparent; }
.act-day { margin: 18px 0 6px; font-size: .9rem; color: var(--primary); }
.act-list { list-style: none; margin: 0 0 0 14px; padding: 0; border-inline-start: 2px solid #ddd6fe; }
[dir="rtl"] .act-list { margin: 0 14px 0 0; }
.act-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.act-ic {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 8px rgba(91, 75, 240, .18); margin-inline-start: -16px; font-size: .9rem;
}
.act-main { display: grid; flex: 1; min-width: 0; gap: 1px; }
.act-main .muted { font-size: .82rem; overflow-wrap: anywhere; }
.act-time { font-size: .82rem; flex: none; padding-top: 4px; }
.act-more { display: block; margin: 14px auto 0; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.profile-head .avatar.xl { width: 110px; height: 110px; font-size: 2rem; }
.profile-who { min-width: 0; }
.profile-who h2 { margin: 0 0 2px; font-size: 1.4rem; overflow-wrap: anywhere; }
.profile-who p { margin: 2px 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .profile-head { flex-direction: column; text-align: center; } .profile-card > .actions { justify-content: center; } }
.name-form { margin-top: 14px; }
.sub-state { font-weight: 600; border-radius: 10px; padding: 10px 12px; background: #f8f7ff; }
.sub-state.ok { background: #dcfce7; color: #166534; }
.sub-state.warn { background: #fef3c7; color: #92400e; }
.sub-state.err { background: #fee2e2; color: #991b1b; }
.danger-card h2 { background: none; color: var(--red); }

/* Settings */
.set-group { margin: 22px 0 4px; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.set-row-top { align-items: flex-start; }
.set-row > div:first-child { min-width: 0; }
.set-row p { margin: 2px 0 0; }
.set-row select { width: auto; max-width: 220px; margin: 0; }
.set-row .btn { flex: none; }
.set-checks { display: grid; gap: 2px; flex: none; }
@media (max-width: 560px) {
  .set-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .set-row select { max-width: none; width: 100%; }
}
.set-saved { min-height: 1.2em; margin: 10px 0 0; }
.set-version { text-align: center; margin-top: 4px; }

/* =====================================================================================
   Professional look — one calm, consistent design for every card and tool
   (placed last so it refines the styles above)
   ===================================================================================== */
:root {
  --line: #e9e7f6;
  --soft: #f7f6fd;
  --ink: #1e1b4b;
  --ink-2: #4b4870;
  --shadow-sm: 0 1px 2px rgba(30, 27, 75, .05);
  --shadow: 0 1px 2px rgba(30, 27, 75, .04), 0 10px 30px rgba(30, 27, 75, .07);
}
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* cards */
.card {
  background: #fff; background-image: none; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 22px 24px;
}
@media (max-width: 600px) { .card { padding: 18px 16px; border-radius: 16px; } }
.layout { gap: 22px; }
@media (max-width: 860px) { .layout { gap: 14px; } }

/* section titles: dark text, the icon in a soft tile */
.card h2, .tracker-summary h3, .tcal h3 {
  background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--ink);
  font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px;
}
.card h2 { font-size: 1rem; margin: 0 0 16px; }
.card .list-head h2, .pl-top h2 { margin: 0; }
.tracker-summary h3, .tcal h3 { font-size: 1rem; }
[data-icon]::before {
  content: attr(data-icon); flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 11px; font-size: 1rem;
  background: linear-gradient(135deg, #eef2ff, #f3e8ff); box-shadow: inset 0 0 0 1px #e4e0fb;
}
.tracker-summary h3[data-icon]::before, .tcal h3[data-icon]::before { width: 30px; height: 30px; border-radius: 9px; font-size: .9rem; }
.list-head { gap: 10px; flex-wrap: wrap; }
.badge { background: #eef2ff; color: var(--primary); font-weight: 700; font-size: .82rem; padding: 3px 10px; box-shadow: inset 0 0 0 1px #dfe3ff; }
.late-badge { box-shadow: inset 0 0 0 1px #fecaca; }

/* shortcut bar at the top of My tools */
.tools-bar {
  grid-column: 1 / -1; position: sticky; top: var(--nav-h, 56px); z-index: 25;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 6px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.tools-bar::-webkit-scrollbar { display: none; }
.tools-bar button {
  flex: none; border: 0; background: none; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 600;
  color: var(--ink-2); padding: 8px 12px; border-radius: 10px; white-space: nowrap;
}
.tools-bar button:hover { background: var(--soft); color: var(--ink); }
.tools-bar button.on { background: #eef2ff; color: var(--primary); box-shadow: inset 0 0 0 1px #dcdffe; }
@media (max-width: 860px) { .tools-bar { border-radius: 12px; margin: 0 -2px; } .tools-bar button { padding: 7px 10px; font-size: .82rem; } }

/* form fields */
form label, .field-label { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea {
  border: 1px solid #e2e0f2; border-radius: 10px; padding: 10px 12px; background: #fcfcff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:not([type="checkbox"]):not([type="radio"]):hover, select:hover, textarea:hover { border-color: #cfccef; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 75, 240, .14); background: #fff; }
input::placeholder, textarea::placeholder { color: #a3a1bf; }
input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; background: var(--soft); padding: 10px 14px 6px; }
legend { color: var(--ink-2); background: #fff; border-radius: 6px; padding: 0 6px; }
.lang-pick select, .top-actions select { border: 0; box-shadow: none; }

/* buttons */
.btn { border-radius: 10px; transition: background .15s, box-shadow .15s, transform .05s, color .15s; }
.btn-primary { box-shadow: 0 4px 14px rgba(91, 75, 240, .28); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(91, 75, 240, .36); }
.btn-ghost { background: #f1efff; color: #4c1d95; }
.btn-ghost:hover { background: #e6e2ff; }
.btn.small { border-radius: 8px; padding: 6px 11px; font-size: .82rem; font-weight: 600; }
/* actions on a list item: quiet outlined buttons, coloured only on hover */
.item-actions .btn.small.btn-ghost, .item-actions .btn.small.note-btn, .item-actions .btn.small.go,
.item-actions .btn.small.danger, .item-actions a.btn.small:not(.nav-mini):not(.btn-primary) {
  background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1px #e4e2f3;
}
.item-actions .btn.small:hover { background: var(--soft); color: var(--ink); }
.item-actions .btn.small.danger { color: #b91c1c; }
.item-actions .btn.small.danger:hover { background: #fef2f2; box-shadow: inset 0 0 0 1px #fecaca; }
.item-actions .btn.small.go { color: #15803d; }
.item-actions .btn.small.go:hover { background: #f0fdf4; box-shadow: inset 0 0 0 1px #bbf7d0; }
.item-actions .btn-ghost.open, .item-actions .note-btn.open { background: var(--grad); color: #fff; box-shadow: none; }
.btn.nav-mini, .nav-btn { box-shadow: 0 3px 10px rgba(91, 75, 240, .22); }
.icon-btn { background: #f1efff; border-radius: 10px; }

/* list items: white, a thin coloured edge shows the kind, a soft tint shows urgency */
.list { gap: 10px; }
.item {
  background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--blue); border-radius: 14px;
  padding: 14px 16px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s;
}
.item:hover { box-shadow: 0 6px 20px rgba(30, 27, 75, .08); }
.item h3 { font-size: 1rem; font-weight: 700; color: var(--ink); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.item.visit, .item.contact { background: #fff; }
.item.soon, .item.task.soon { background: linear-gradient(90deg, #fffbeb, #fff 45%); }
.item.running { background: linear-gradient(90deg, #f0fdf4, #fff 45%); }
.item.task.overdue { background: linear-gradient(90deg, #fef2f2, #fff 45%); }
.item.task.done { background: #fafafd; }
.item.event, .item.event.ev-memorial, .item.event.ev-assembly, .item.event.ev-convention, .item.event.ev-co_visit { background: #fff; }
.meta { color: #6b6890; gap: 4px 14px; }
.tag {
  margin: 0; margin-inline-start: 4px; border-radius: 999px; padding: 2px 8px; font-size: .72rem; font-weight: 700;
  letter-spacing: .05em; vertical-align: middle;
}
.empty { padding: 28px 0; font-size: .9rem; }
.assignee-chip { padding: 1px 9px; }
.addr-link { border-radius: 999px; padding: 2px 9px; background: #eef2ff; }
.ev-icon { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--soft); font-size: 1rem; }

/* filters row */
.filters { gap: 8px; margin: 14px 0 16px; }
.filters input, .filters select { padding: 9px 11px; }

/* numbers and times: the app's own font with even-width digits (no typewriter font) */
.tracker-clock, .timer, .totals .dur, .history .dur, .pl-time, .tcal-time, .tcal-s-time, .m-tracker strong {
  font-family: inherit; font-variant-numeric: tabular-nums; letter-spacing: .01em;
}

/* time tracker */
.tracker-main { gap: 22px; }
.tracker-clock {
  font-size: 2.9rem; font-weight: 700; color: #b9b6d6; background: var(--soft); border: 1px solid var(--line);
  border-radius: 16px; padding: 10px 22px; min-width: 230px;
}
.tracker.running .tracker-clock { background: linear-gradient(135deg, #eef2ff, #f5f3ff); -webkit-background-clip: border-box; background-clip: border-box; color: var(--primary); border-color: #dcdffe; }
.tracker.paused .tracker-clock { color: var(--amber); background: #fffbeb; border-color: #fde68a; }
.tracker-status { font-size: .9rem; }
.tracker-summary { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.tracker-summary .list-head { gap: 12px; }
.totals li { font-size: .9rem; }
.totals .bar { height: 8px; background: #efedfb; }
.history li { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
@media (max-width: 600px) { .tracker-clock { font-size: 2rem; min-width: 0; width: 100%; } .tracker-btns { width: 100%; } .tracker-btns .btn { flex: 1; } }

/* time calendar */
.tcal { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.tcal-cell { border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.tcal-cell:hover { border-color: #c7c3f3; box-shadow: var(--shadow-sm); }
.tcal-cell.today { border: 2px solid var(--primary); }
.tcal-cell.lvl1 { background: #f1efff; }
.tcal-cell.lvl2 { background: #e4e0ff; }
.tcal-cell.lvl3 { background: #cfc8ff; }
.tcal-cell.lvl4 { background: linear-gradient(135deg, #7c6cf7, #8b5cf6); color: #fff; border-color: transparent; }
.tcal-day { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.tcal-session { background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid #f59e0b; box-shadow: var(--shadow-sm); }
.tcal-session.running { background: #fff; border-inline-start-color: var(--green); }
.tcal-head { font-size: .72rem; letter-spacing: .06em; }

/* planner */
.pl-item { background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--blue); border-radius: 12px; padding: 10px 12px; }
.pl-item.task { background: #fff; }
.pl-item.todo { background: #fff; border-inline-start-color: var(--green); }
.pl-item.time { background: #fff; border-inline-start-color: #f59e0b; }
.pl-item.event { background: #fff; border-inline-start-color: #0ea5e9; }
.pl-btn { background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1px #e4e2f3; }
.pl-btn:hover { background: var(--soft); }
.pl-btn.del { box-shadow: none; }
.pl-progress .bar { height: 8px; }
.pl-day { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.pl-day.today { border: 2px solid var(--primary); box-shadow: 0 6px 18px rgba(91, 75, 240, .12); }
.pl-day-list .pl-item { border-radius: 8px; }
.pl-views { background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }

/* quick notes */
.quicknotes textarea { background: #fffef7; border-color: #f1ead0; line-height: 1.6; padding: 14px 16px; }
.quicknotes textarea:focus { background: #fff; }

/* contacts */
.item.contact { padding: 16px; }
.item.contact h3 { gap: 12px; }
.item.contact .item-actions { margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* pop-up windows */
.alarm { background: rgba(30, 27, 75, .45); backdrop-filter: blur(3px); }
.alarm-box { border-radius: 20px; border: 1px solid var(--line); box-shadow: 0 30px 70px rgba(30, 27, 75, .3); }
.modal-box h3 { color: var(--ink); font-size: 1.15rem; }

/* appointments: the list uses the full width; new / edit opens in a pop-up window */
#listCard { grid-column: 1 / -1; }
.alarm-box.modal-box.appt-box { width: min(94vw, 560px); padding: 22px 24px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h2 {
  margin: 0; background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--ink);
  font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 10px;
}
.appt-box .actions { justify-content: flex-end; margin-top: 4px; }
@media (max-width: 600px) {
  .alarm-box.modal-box.appt-box { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; padding: 18px 16px; }
  .appt-box .actions .btn { flex: 1; }
}

/* time entry window (add time by hand / edit / finish the timer with a note) */
.alarm-box.modal-box.time-box { width: min(94vw, 480px); padding: 22px 24px; }
.time-box .actions { justify-content: flex-end; margin-top: 4px; }
.discard-btn { font-weight: 700; }
.stop-box .discard-btn { margin-top: 14px; }
.te-discard { width: auto; margin: 0 auto 0 0; }
[dir="rtl"] .te-discard { margin: 0 0 0 auto; }
@media (max-width: 600px) { .te-discard { flex-basis: 100%; order: 3; margin: 6px 0 0; } }
.te-summary { margin: -4px 0 14px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(135deg, #eef2ff, #f5f3ff); color: var(--primary); font-weight: 700; }
.te-dur { margin: -4px 0 12px; font-weight: 700; }
.time-box textarea { resize: vertical; line-height: 1.5; }
@media (max-width: 600px) {
  .alarm-box.modal-box.time-box { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; padding: 18px 16px; }
  .time-box .actions .btn { flex: 1; }
}
/* ---------- ☰ side menu ---------- */
.menu-btn {
  flex: none; width: 42px; height: 42px; border-radius: 12px; border: 0; cursor: pointer; font-size: 1.4rem; line-height: 1;
  background: rgba(255, 255, 255, .18); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .4);
}
.menu-btn:hover { background: rgba(255, 255, 255, .3); }
.drawer { position: fixed; inset: 0; z-index: 85; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(30, 27, 75, .45); opacity: 0; transition: opacity .2s ease; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(320px, 86vw); overflow-y: auto; outline: none;
  background: #fff; box-shadow: 12px 0 40px rgba(30, 27, 75, .25); padding: 14px 12px 18px;
  display: flex; flex-direction: column; transform: translateX(-102%); transition: transform .22s ease;
}
[dir="rtl"] .drawer-panel { transform: translateX(102%); box-shadow: -12px 0 40px rgba(30, 27, 75, .25); }
.drawer.open .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 12px; }
.drawer-head img.logo { width: 34px; height: 34px; border-radius: 9px; box-shadow: none; }
.drawer-head strong { flex: 1; font-size: 1.15rem; color: var(--ink); }
.drawer-user {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; cursor: pointer; font: inherit; color: var(--ink);
  background: linear-gradient(135deg, #eef2ff, #f5f3ff); border: 1px solid #e4e0fb; border-radius: 14px; padding: 10px 12px; margin-bottom: 10px;
}
.drawer-user:hover { border-color: #cfccef; }
.drawer-who { display: grid; min-width: 0; }
.drawer-who strong, .drawer-who .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-who .muted { font-size: .82rem; }
.drawer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.drawer-list button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: start; cursor: pointer; font: inherit; font-weight: 600;
  color: var(--ink); background: none; border: 0; border-radius: 10px; padding: 10px 12px;
}
.drawer-list button:hover { background: var(--soft); }
.drawer-list button.on { background: #eef2ff; color: var(--primary); }
.d-ic { width: 24px; text-align: center; font-size: 1rem; flex: none; }
.drawer-sub { display: grid; gap: 1px; margin: 0 0 4px; padding-inline-start: 22px; border-inline-start: 2px solid #ece9fb; margin-inline-start: 22px; }
.drawer-sub button { font-weight: 500; font-size: .9rem; padding: 7px 10px; color: var(--ink-2); }
.drawer-sub .d-ic { font-size: .9rem; width: 20px; }
.drawer-sep { height: 1px; background: var(--line); margin: 8px 6px; }
.drawer-list .drawer-out { color: var(--red); }
.drawer-list .drawer-out:hover { background: #fef2f2; }
.drawer-legal { margin-top: auto; padding-top: 16px; }
/* simple groups: Pages · Tools · More, then Log out apart at the bottom */
.drawer-h { margin: 14px 12px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9a97b8; }
.drawer-user { margin-bottom: 0; }
.drawer-chev { margin-inline-start: auto; font-size: 1.4rem; color: var(--primary); line-height: 1; }
[dir="rtl"] .drawer-chev { transform: scaleX(-1); }
.drawer-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.drawer-bottom .drawer-legal { margin-top: 6px; padding-top: 0; }
.drawer-out {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: start; cursor: pointer; font: inherit; font-weight: 600;
  color: var(--red); background: none; border: 0; border-radius: 10px; padding: 10px 12px;
}
.drawer-out:hover { background: #fef2f2; }
.drawer-list button { padding: 9px 12px; }
/* the top bar now holds only the 3 main pages: spread them evenly on small screens */
@media (max-width: 860px) {
  .app-nav { justify-content: center; }
  .app-nav button { flex: 1 1 0; justify-content: center; max-width: 170px; }
}
@media (max-width: 600px) { .menu-btn { width: 36px; height: 36px; font-size: 1.15rem; border-radius: 10px; } }

/* drawn event icons (the Memorial's bread and wine) sit like an emoji */
.ev-svg { width: 1.25em; height: 1.25em; display: inline-block; vertical-align: -0.25em; flex: none; }
.ev-icon .ev-svg { width: 22px; height: 22px; vertical-align: middle; }

/* ---------- Map ---------- */
.map-card { grid-column: 1 / -1; }
.map-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.map-tools input { flex: 1 1 220px; margin: 0; }
.map-tools .act-filters { margin: 0; }
.map-box {
  position: relative; z-index: 0; isolation: isolate; height: min(60vh, 460px); min-height: 280px;
  border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #e8eef5;
}
.map-pin { background: none; border: 0; }
/* a round pin (picture, initials or 📅) with a small point at the bottom */
.map-pin { position: relative; }
.map-pin::after {
  content: ""; position: absolute; left: 50%; bottom: -2px; width: 10px; height: 10px; transform: translateX(-50%) rotate(45deg);
  background: #fff; box-shadow: 2px 2px 4px rgba(30, 27, 75, .25); z-index: -1;
}
.map-pin .map-pin-txt, .map-pin .map-pin-img {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; line-height: 1;
  border: 3px solid #fff; box-shadow: 0 4px 12px rgba(30, 27, 75, .35); object-fit: cover; overflow: hidden;
}
.map-pin .map-pin-txt { font-weight: 700; font-size: .82rem; color: #fff; background: linear-gradient(135deg, hsl(var(--h, 260) 75% 55%), hsl(calc(var(--h, 260) + 40) 70% 45%)); }
.map-pin .map-pin-txt.appt { background: #fff7ed; font-size: 1rem; box-shadow: 0 0 0 2px #f59e0b, 0 4px 12px rgba(30, 27, 75, .35); }
.map-pop { display: grid; gap: 3px; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); }
.map-pop .muted { font-size: .82rem; }
.map-pop-addr { font-size: .82rem; color: var(--ink-2); }
.map-pop-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.map-pop-btns .btn { text-decoration: none; }
.map-pop-btns .btn-primary { color: #fff; }
.map-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.map-row {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: start; cursor: pointer; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; transition: border-color .15s, box-shadow .15s;
}
.map-row:hover { border-color: #cfccef; box-shadow: var(--shadow-sm); }
.map-row.nospot { cursor: default; opacity: .75; }
.map-row-pin { flex: none; width: 36px; height: 36px; }
.map-row-pin .map-pin-txt, .map-row-pin .map-pin-img {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .82rem; color: #fff; object-fit: cover;
  background: linear-gradient(135deg, hsl(var(--h, 260) 75% 55%), hsl(calc(var(--h, 260) + 40) 70% 45%));
}
.map-row-pin .map-pin-txt.appt { background: #fff7ed; box-shadow: inset 0 0 0 2px #f59e0b; font-size: 1rem; }
.map-row-main { display: grid; flex: 1; min-width: 0; }
.map-row-main .muted { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-row-warn { font-size: .82rem; font-weight: 600; color: #b45309; }
.map-row-dist { flex: none; font-size: .82rem; font-weight: 700; color: var(--primary); }
.map-empty { padding: 8px 2px; }
#mapNearMe.busy { opacity: .5; pointer-events: none; }
@media (max-width: 600px) { .map-box { height: 55vh; border-radius: 12px; } }

/* ---------- Progress page ---------- */
.pr-toggle { margin: 0; }
.pr-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 4px; }
.pr-hero > div { display: grid; gap: 2px; }
.pr-hero-label { font-size: .9rem; font-weight: 700; color: var(--ink-2); }
.pr-hero-num { font-size: 2rem; font-weight: 700; line-height: 1.1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pr-change { font-size: .9rem; font-weight: 700; color: var(--muted); }
.pr-change.up, .pr-stat .stat-sub.up { color: var(--green); }
.pr-change.down, .pr-stat .stat-sub.down { color: var(--red); }
.pr-chart { display: flex; gap: 6px; align-items: stretch; height: 210px; margin-top: 14px; }
.pr-bar { flex: 1; min-width: 0; display: grid; grid-template-rows: auto 1fr auto; gap: 4px; text-align: center; }
.pr-bar-val { font-size: .72rem; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; min-height: 1em; }
.pr-bar-col { display: flex; align-items: flex-end; background: #f3f1ff; border-radius: 8px; overflow: hidden; }
.pr-bar-col span { display: block; width: 100%; background: linear-gradient(0deg, #a5b4fc, #c4b5fd); border-radius: 8px 8px 0 0; }
.pr-bar.now .pr-bar-col span { background: linear-gradient(0deg, var(--blue), var(--purple)); }
.pr-bar.now .pr-bar-col { outline: 2px solid #c4b5fd; }
.pr-bar-label { font-size: .72rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-transform: capitalize; }
.pr-bar.now .pr-bar-label { color: var(--primary); font-weight: 700; }
.pr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 860px) { .pr-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.pr-stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 16px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.pr-stat-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.pr-stat-num { font-size: 1.4rem; font-weight: 700; color: var(--ink); }
.pr-spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 8px; }
.pr-spark span { flex: 1; background: #ddd8fb; border-radius: 3px 3px 0 0; }
.pr-spark span.now { background: var(--grad); }
.pr-streak .pr-stat-num { color: #ea580c; }
@media (max-width: 600px) {
  .pr-chart { height: 170px; gap: 4px; }
  .pr-bar-val { font-size: .72rem; }
  .pr-bar-label { font-size: .72rem; }
  .pr-hero-num { font-size: 2rem; }
}

/* ---------- Reminders window (Start Reminders) ---------- */
.alarm-box.modal-box.rem-box { width: min(94vw, 520px); padding: 22px 24px; }
.rem-status {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: -4px 0 16px; padding: 10px 12px; border-radius: 12px; background: #fef3c7; color: #92400e; font-weight: 600; font-size: .9rem;
}
.rem-status.on { background: #dcfce7; color: #166534; }
.rem-form { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 12px; }
.rem-form .rem-add { width: 100%; }
.rem-form .addr-msg { margin: -4px 0 10px; font-weight: 600; }
.rem-list-title { margin: 18px 0 8px; font-size: .9rem; color: var(--ink); }
.rem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rem-item { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid #f59e0b; border-radius: 12px; padding: 9px 10px; }
.rem-item.past { opacity: .55; }
.rem-ic { font-size: 1rem; flex: none; }
.rem-main { display: grid; flex: 1; min-width: 0; }
.rem-main strong { overflow-wrap: anywhere; }
.rem-main .muted { font-size: .82rem; }
.rem-when { font-size: .82rem; font-weight: 700; color: var(--primary); }
.rem-empty { padding: 6px 2px; }
.btn-start.on { white-space: nowrap; }
@media (max-width: 600px) {
  .alarm-box.modal-box.rem-box { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; padding: 18px 16px; }
}

/* ---------- Help button, Help window and the guided tour ---------- */
.help-btn {
  flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 1rem;
  background: rgba(255, 255, 255, .18); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45);
}
.help-btn:hover { background: rgba(255, 255, 255, .3); }
.alarm-box.modal-box.help-box { width: min(94vw, 520px); padding: 22px 24px; }
.help-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.help-item {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: start; cursor: pointer; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s;
}
.help-item:hover { border-color: #cfccef; box-shadow: var(--shadow-sm); }
.help-ic { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(135deg, #eef2ff, #f3e8ff); font-size: 1rem; }
.help-text { display: grid; flex: 1; min-width: 0; }
.help-text .muted { font-size: .82rem; }
.help-go { color: var(--primary); font-size: .9rem; }

.tour { position: fixed; inset: 0; z-index: 90; }
.tour-spot {
  position: fixed; border-radius: 14px; pointer-events: none; transition: all .25s ease;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .95), 0 0 0 9999px rgba(30, 27, 75, .62);
}
.tour.centered .tour-spot { box-shadow: 0 0 0 9999px rgba(30, 27, 75, .62); }
.tour-card {
  position: fixed; width: min(360px, calc(100vw - 24px)); background: #fff; border-radius: 18px; padding: 18px 18px 14px;
  box-shadow: 0 24px 60px rgba(30, 27, 75, .35); border: 1px solid var(--line); transition: top .25s ease, left .25s ease;
}
.tour.centered .tour-card { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 24px)); }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tour-step { font-size: .82rem; font-weight: 700; color: var(--primary); }
.tour-dots { display: flex; gap: 4px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: #e0ddf7; }
.tour-dots span.on { background: var(--primary); width: 18px; border-radius: 99px; }
.tour-card h3 { margin: 4px 0 6px; font-size: 1rem; color: var(--ink); }
.tour-card p { margin: 0 0 14px; color: var(--ink-2); line-height: 1.55; }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-skip { width: auto; margin: 0; color: var(--muted); font-weight: 600; }
@media (max-width: 600px) {
  /* phones: the card sits at the bottom of the screen */
  .tour-card { left: 8px !important; right: 8px; bottom: 8px; top: auto !important; width: auto; }
  .tour.centered .tour-card { bottom: auto; top: 50% !important; left: 50% !important; right: auto; width: calc(100vw - 24px); }
  .help-btn { width: 34px; height: 34px; font-size: 1rem; }
}

/* Time calendar: the 📆 icon and the month name open a month / year picker */
.tcal { position: relative; }
.tcal-pick-btn {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; cursor: pointer; font-size: 1rem;
  border: 0; background: linear-gradient(135deg, #eef2ff, #f3e8ff); box-shadow: inset 0 0 0 1px #e4e0fb; transition: box-shadow .15s, transform .05s;
}
.tcal-pick-btn:hover, .tcal-pick-btn.on { box-shadow: inset 0 0 0 2px var(--primary); }
.tcal-pick-btn:active { transform: scale(.95); }
.tcal-title-btn { border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.tcal-title-btn::after { content: " ▾"; color: var(--primary); font-size: .9em; }
.tcal-title-btn:hover { background: var(--soft); }
.tcal-picker {
  position: absolute; z-index: 20; top: 58px; inset-inline-start: 0; width: min(320px, 100%);
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: 0 18px 40px rgba(30, 27, 75, .18);
}
.tcal-picker-year { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tcal-picker-year strong { font-size: 1.15rem; color: var(--ink); }
.tcal-picker-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tp-month {
  position: relative; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 4px; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--ink); text-transform: capitalize;
}
.tp-month:hover { background: var(--soft); border-color: #cfccef; }
.tp-month.now { border-color: var(--primary); }
.tp-month.on { background: var(--grad); color: #fff; border-color: transparent; }
.tp-dot { position: absolute; top: 5px; inset-inline-end: 6px; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; }

.tcal-day-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tcal-day-top .tcal-day-head { margin-bottom: 0; }
.tcal-s-manual { font-size: .9rem; }

/* Activity: the week */
.wk-nav { display: flex; gap: 6px; }
.wk-nav .btn.on { background: var(--grad); color: #fff; }
.wk-nav .btn:disabled { opacity: .4; cursor: default; }
.wk-range { margin: 4px 0 14px; color: var(--ink-2); font-weight: 600; text-transform: capitalize; }
.wk-days { display: grid; gap: 6px; margin-top: 16px; }
.wk-day {
  display: grid; grid-template-columns: 90px 1fr 70px minmax(0, 1.2fr); gap: 12px; align-items: center;
  width: 100%; text-align: start; font: inherit; color: var(--ink); cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; transition: box-shadow .15s, border-color .15s;
}
.wk-day:hover { border-color: #cfccef; box-shadow: var(--shadow-sm); }
.wk-day.today { border: 2px solid var(--primary); }
.wk-day.future { opacity: .6; }
.wk-name { font-size: .9rem; color: var(--ink-2); text-transform: capitalize; }
.wk-name b { color: var(--ink); font-size: 1rem; }
.wk-bar { height: 10px; background: #efedfb; border-radius: 99px; overflow: hidden; }
.wk-bar span { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.wk-time { font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }
.wk-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.wk-chips span { font-size: .82rem; font-weight: 700; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.wk-sub { margin: 20px 0 6px; font-size: .9rem; color: var(--ink); }
/* each day: the summary row, then everything written in the Time calendar that day */
.wk-day-block { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.wk-day-block:hover { border-color: #cfccef; box-shadow: var(--shadow-sm); }
.wk-day-block.today { border: 2px solid var(--primary); }
.wk-day-block.future { opacity: .6; }
.wk-day-block .wk-day { border: 0; border-radius: 0; background: none; box-shadow: none; }
.wk-day-block.today .wk-day, .wk-day-block.future .wk-day { border: 0; opacity: 1; }
.wk-entries { list-style: none; margin: 0; padding: 4px 14px 12px; display: grid; gap: 6px; border-top: 1px dashed var(--line); background: var(--soft); }
.wk-entry { background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid #f59e0b; border-radius: 10px; padding: 8px 10px; margin-top: 6px; }
.wk-entry.running { border-inline-start-color: var(--green); }
.wk-entry-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .9rem; }
.wk-entry-time { font-size: .82rem; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.wk-entry-dur { color: #b45309; font-weight: 700; font-size: .9rem; }
.wk-entry-note { margin-top: 4px; font-size: .9rem; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.act-note { margin-top: 2px; font-size: .9rem; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) { .wk-entries { padding: 2px 10px 10px; } }
@media (max-width: 600px) {
  .wk-day { grid-template-columns: 74px 1fr 64px; row-gap: 6px; padding: 10px 12px; }
  .wk-chips { grid-column: 1 / -1; }
  .wk-chips:empty { display: none; }
  .wk-purposes li { grid-template-columns: 110px 1fr auto; }
}

/* the logo (icons/logo.svg) */
img.logo { display: block; width: 42px; height: 42px; border-radius: 11px; flex: none; box-shadow: 0 4px 14px rgba(30, 27, 75, .25); }
.topbar img.logo { box-shadow: 0 0 0 2px rgba(255, 255, 255, .6), 0 4px 14px rgba(30, 27, 75, .25); }
.l-brand img.logo { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }
.auth-top img.logo { width: 48px; height: 48px; border-radius: 13px; }
.m-brand { display: inline-flex; align-items: center; gap: 6px; }
.m-logo { width: 20px; height: 20px; border-radius: 5px; }
@media (max-width: 600px) { .topbar img.logo { width: 36px; height: 36px; border-radius: 10px; } }

/* RTL: the soft tints read from the right */
[dir="rtl"] .item.soon, [dir="rtl"] .item.task.soon { background: linear-gradient(270deg, #fffbeb, #fff 45%); }
[dir="rtl"] .item.running { background: linear-gradient(270deg, #f0fdf4, #fff 45%); }
[dir="rtl"] .item.task.overdue { background: linear-gradient(270deg, #fef2f2, #fff 45%); }

/* small 🌙 / ☀️ switch (home page bar) and the switch row in the ☰ menu */
.theme-btn {
  flex: none; width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer; font-size: 1rem;
  background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .4);
}
.theme-btn:hover { background: rgba(255, 255, 255, .3); }
.drawer-list .theme-row { justify-content: flex-start; }
.switch { margin-inline-start: auto; width: 42px; height: 24px; border-radius: 99px; background: #d4d1ea; position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
[dir="rtl"] .switch.on::after { transform: translateX(-18px); }

/* =====================================================================================
   🌙 Dark mode — same layout, darker colors (turned on with <html data-theme="dark">)
   ===================================================================================== */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121124; --card: #1c1b30; --text: #ecebff; --muted: #9b98bf; --border: #33304f;
  --line: #33304f; --soft: #24223d; --ink: #ecebff; --ink-2: #c3c0e3;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .35);
  --tint: #2b2750; --tint-text: #c4b5fd;
}
[data-theme="dark"] body { background: linear-gradient(135deg, #12112a 0%, #181633 50%, #121a30 100%) fixed; color: var(--text); }
[data-theme="dark"] .topbar { background: linear-gradient(120deg, #1e3a8a, #4c1d95); box-shadow: 0 4px 20px rgba(0, 0, 0, .45); }
[data-theme="dark"] .l-nav { background: linear-gradient(120deg, #1e3a8a, #4c1d95); }

/* surfaces */
[data-theme="dark"] :is(.card, .item, .pl-item, .pl-day, .tcal-cell, .tcal-session, .wk-day-block, .wk-entry, .stat, .pr-stat, .alarm-box,
  .auth-card, .drawer-panel, .help-item, .rem-item, .map-row, .chip, .ev-pick, legend, .tp-month, .tcal-picker, .tour-card, .account-menu,
  .suggest, .note-panel, .price-card, .l-steps li, .l-features article, .dash-when, .wk-chips span, .history li, .item.visit, .item.contact,
  .item.event, .item.task.done, .pl-day.today, .pl-btn, .m-pills i) {
  background: var(--card); background-image: none; color: var(--text);
}
[data-theme="dark"] .item-actions .btn.small.btn-ghost, [data-theme="dark"] .item-actions .btn.small.note-btn, [data-theme="dark"] .item-actions .btn.small.go,
[data-theme="dark"] .item-actions .btn.small.danger, [data-theme="dark"] .item-actions a.btn.small:not(.nav-mini):not(.btn-primary) {
  background: var(--card); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
}
[data-theme="dark"] .item-actions .btn.small.danger { color: #fca5a5; }
[data-theme="dark"] .item-actions .btn.small.go { color: #86efac; }
[data-theme="dark"] .item-actions .btn.small:hover { background: var(--soft); color: var(--ink); }
[data-theme="dark"] :is(.app-nav, .tools-bar) { background: rgba(28, 27, 48, .92); border-color: var(--line); }
[data-theme="dark"] :is(.dash-item, .act-stats .stat, .sub-state, .tcal-day, .wk-entries, .rem-form, fieldset, .tracker-clock, .price-list li, .drawer-user) {
  background: var(--soft); color: var(--text);
}
[data-theme="dark"] :is(.app-nav button:hover, .tools-bar button:hover, .drawer-list button:hover, .dash-item:hover, .chip:hover, .ev-pick:hover,
  .tp-month:hover, .help-item:hover, .map-row:hover, .pl-day-head:hover, .suggest li:hover, .suggest li.active, .account-menu button:hover) { background: #2a2846; }

/* soft purple chips and buttons */
[data-theme="dark"] :is(.badge, .stat-ic, .tools-bar button.on, .drawer-list button.on, .btn-ghost, .icon-btn, .addr-link, .assignee-chip, .tag,
  .note-btn, .auth-close, .help-ic, [data-icon]::before, .tcal-pick-btn, .plan-toggle, .pl-views, .auth-lang, .m-card) {
  background: var(--tint); color: var(--tint-text); box-shadow: none;
}
[data-theme="dark"] .btn-ghost:hover, [data-theme="dark"] .icon-btn:hover { background: #38336a; }
[data-theme="dark"] .plan-toggle button { color: var(--tint-text); }
[data-theme="dark"] .plan-toggle button.on { color: #fff; }
:root[data-theme="dark"] :is(.chip.on, .tp-month.on, .ev-pick.on) { background: var(--grad); color: #fff; }
[data-theme="dark"] .top-actions .btn-start:not(.on) { background: #f4f3ff; color: var(--primary); }
[data-theme="dark"] a.btn-ghost { color: var(--tint-text); }
[data-theme="dark"] .m-phone { background: #1c1b30; }

/* text that was dark on light */
[data-theme="dark"] :is(h1, h3, .item h3, .pl-title, .tcal-num, .pl-dnum, .profile-who h2, .tour-card h3, .modal-head h2, .card h2, .tracker-summary h3, .tcal h3,
  .drawer-head strong, .pr-stat-num, .wk-name b, .tcal-picker-year strong, .rem-list-title, .wk-sub, .act-main span, .price-big) { color: var(--ink); }
[data-theme="dark"] :is(.meta, .muted, .stat-label, .l-features p, .l-sub, .wk-name, .wk-entry-note, .act-note, .tcal-s-note, .map-pop-addr, .tour-card p, .l-badges) { color: var(--muted); }
[data-theme="dark"] :is(h2, .stat-num, .pr-hero-num, .l-hero h1, .l-h2) { background: linear-gradient(120deg, #93c5fd, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="dark"] :is(.card h2, .modal-head h2, .tracker-summary h3, .tcal h3, .l-privacy .l-h2, .l-cta h2) { background: none; color: var(--ink); -webkit-background-clip: border-box; background-clip: border-box; }
[data-theme="dark"] :is(.l-privacy .l-h2, .l-cta h2) { color: #fff; }
[data-theme="dark"] .ev-repeat { color: #7dd3fc; }
[data-theme="dark"] :is(.tcal-s-dur, .wk-entry-dur, .pl-item.time .pl-sub, .map-row-warn) { color: #fbbf24; }
[data-theme="dark"] :is(.pl-progress, .price-equiv) { color: #86efac; }
[data-theme="dark"] :is(.tcal-s-time, .wk-entry-time, .pl-time, .rem-when, .map-row-dist, .dash-when, .tcal-day-total, .tcal-total, .act-day, .tour-step) { color: #a5b4fc; }
[data-theme="dark"] .meta.person { color: var(--text); }
[data-theme="dark"] .meta.person a { color: #86efac; }
[data-theme="dark"] a { color: #a5b4fc; }
[data-theme="dark"] .btn-primary { color: #fff; }

/* form fields */
[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) { background: #16152a; border-color: #3a3758; color: var(--ink); }
[data-theme="dark"] :is(input, textarea)::placeholder { color: #6f6c93; }
[data-theme="dark"] :is(input, select, textarea):focus { background: #191830; }
[data-theme="dark"] .quicknotes textarea { background: #1f1d33; border-color: #3a3758; }
[data-theme="dark"] .lang-pick select { background: #f4f3ff; color: #1e1b4b; }

/* status colors */
[data-theme="dark"] :is(.notify-hint.ok, .pl-saved, .sub-state.ok, .rem-status.on, .trial-banner, .free-badge, .pl-count, .plan-toggle .save) { background: #173326; color: #86efac; }
[data-theme="dark"] :is(.notify-hint.warn, .trial-banner.urgent, .pl-late, .sub-state.warn, .rem-status, .sync-pill[data-state="offline"], .sync-pill[data-state="error"]) { background: #3a2e12; color: #fcd34d; }
[data-theme="dark"] .rem-status.on { background: #173326; color: #86efac; }
[data-theme="dark"] :is(.sub-state.err, .late-badge, .btn.danger, .tag.pr-tag-high) { background: #3b1a1f; color: #fca5a5; }
[data-theme="dark"] .notify-hint { background: var(--tint); color: var(--tint-text); }
[data-theme="dark"] .te-summary { background: var(--tint); color: var(--tint-text); }
[data-theme="dark"] .tag.rel-family { background: #3b1830; color: #f9a8d4; }
[data-theme="dark"] .tag.rel-doctor { background: #173326; color: #86efac; }
[data-theme="dark"] .tag.rel-work { background: #3a2e12; color: #fcd34d; }
[data-theme="dark"] .tag.rel-client { background: #1e2a4a; color: #93c5fd; }
[data-theme="dark"] :is(.tag.rel-other, .tag.pr-tag-low) { background: #2a2c3a; color: #cbd5e1; }

/* list items: the urgency tint, darker */
:root[data-theme="dark"] :is(.item.soon, .item.task.soon) { background: linear-gradient(90deg, #3a2e12, var(--card) 45%); }
:root[data-theme="dark"] .item.running { background: linear-gradient(90deg, #173326, var(--card) 45%); }
:root[data-theme="dark"] .item.task.overdue { background: linear-gradient(90deg, #3b1a1f, var(--card) 45%); }
:root[data-theme="dark"][dir="rtl"] :is(.item.soon, .item.task.soon) { background: linear-gradient(270deg, #3a2e12, var(--card) 45%); }
:root[data-theme="dark"][dir="rtl"] .item.running { background: linear-gradient(270deg, #173326, var(--card) 45%); }
:root[data-theme="dark"][dir="rtl"] .item.task.overdue { background: linear-gradient(270deg, #3b1a1f, var(--card) 45%); }

/* bars and charts */
[data-theme="dark"] :is(.totals .bar, .stat-bar, .dash-bar-col, .pr-bar-col, .wk-bar, .pl-progress .bar) { background: #2b2750; }
[data-theme="dark"] .pr-spark span { background: #3b3570; }
[data-theme="dark"] .pr-bar-col span { background: linear-gradient(0deg, #4c4a9e, #6b5fc9); }
[data-theme="dark"] .pr-bar.now .pr-bar-col span, [data-theme="dark"] .pr-spark span.now { background: var(--grad); }
:root[data-theme="dark"] .tcal-cell.lvl1 { background: #2b2750; }
:root[data-theme="dark"] .tcal-cell.lvl2 { background: #3b3570; }
:root[data-theme="dark"] .tcal-cell.lvl3 { background: #5046a3; color: #fff; }
:root[data-theme="dark"] .tcal-cell.lvl4 { background: linear-gradient(135deg, #7c6cf7, #8b5cf6); color: #fff; }
[data-theme="dark"] .tracker.running .tracker-clock { background: var(--tint); color: #c4b5fd; }
[data-theme="dark"] .tracker.paused .tracker-clock { background: #3a2e12; color: #fcd34d; }
[data-theme="dark"] .tracker-clock { color: #6f6c93; }

/* home page */
[data-theme="dark"] .l-hero .btn.l-ghost { background: var(--card); color: #c4b5fd; border-color: var(--line); }
[data-theme="dark"] .btn.l-demo { background: var(--card); color: #c4b5fd; border-color: #6d5bd0; }
[data-theme="dark"] .l-privacy { background: #0f0e22; }

/* pop-ups, menu, tour */
[data-theme="dark"] .alarm { background: rgba(5, 4, 15, .65); }
[data-theme="dark"] .drawer-backdrop { background: rgba(5, 4, 15, .6); }
[data-theme="dark"] .drawer-out:hover { background: #3b1a1f; }
[data-theme="dark"] .drawer-h { color: #7d7aa3; }
[data-theme="dark"] .switch { background: #3a3758; }
[data-theme="dark"] .switch.on { background: var(--primary); }

/* map: soften the bright map pictures a little, and dark pop-ups */
[data-theme="dark"] .map-box .leaflet-tile-pane { filter: brightness(.78) contrast(1.08) saturate(.9); }
[data-theme="dark"] :is(.leaflet-popup-content-wrapper, .leaflet-popup-tip) { background: var(--card); color: var(--text); }
[data-theme="dark"] .leaflet-bar a { background: var(--card); color: var(--text); border-color: var(--line); }
[data-theme="dark"] .map-box { background: #1a2333; border-color: var(--line); }

/* the icon tiles next to titles (a ::before can't be styled inside :is()) */
[data-theme="dark"] [data-icon]::before { background: var(--tint); box-shadow: inset 0 0 0 1px #3b3570; }

/* =====================================================================================
   Home page — professional look (hero, trust strip, features, who it is for, questions)
   ===================================================================================== */
.l-nav { padding: 12px max(24px, calc((100vw - 1150px) / 2)); }
.l-nav-links { display: flex; gap: 22px; margin-inline: auto 12px; }
.l-nav-links a { color: rgba(255, 255, 255, .85); text-decoration: none; font-weight: 600; font-size: .9rem; }
.l-nav-links a:hover { color: #fff; }
@media (max-width: 900px) { .l-nav-links { display: none; } }

.l-hero { position: relative; padding: 64px 24px 56px; gap: 48px; }
.l-kicker {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; padding: 6px 14px; border-radius: 999px;
  font-size: .9rem; font-weight: 700; color: var(--primary); background: #eef2ff; box-shadow: inset 0 0 0 1px #dcdffe;
}
.l-hero h1 { letter-spacing: -.025em; margin-bottom: 18px; }
.l-sub { max-width: 560px; }
.l-hero-btns .btn.big { padding: 15px 24px; border-radius: 12px; }
.l-mock { position: relative; }
.l-glow {
  position: absolute; width: 420px; height: 420px; border-radius: 50%; z-index: 0; filter: blur(60px); opacity: .55;
  background: radial-gradient(circle at 30% 30%, #60a5fa, transparent 60%), radial-gradient(circle at 70% 70%, #a78bfa, transparent 60%);
}
.m-phone { position: relative; z-index: 1; }
.l-float {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px;
  background: #fff; color: var(--ink); font-size: .9rem; box-shadow: 0 14px 34px rgba(30, 27, 75, .2); border: 1px solid var(--line);
  animation: l-float 5s ease-in-out infinite;
}
.l-float span { font-size: 1.15rem; }
.l-float-a { top: 12%; inset-inline-start: -4%; }
.l-float-b { bottom: 22%; inset-inline-end: -6%; animation-delay: -1.6s; }
.l-float-c { bottom: 4%; inset-inline-start: 4%; animation-delay: -3.2s; }
@keyframes l-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .l-float, .m-alarm, .m-bell { animation: none; } }

.l-trust { max-width: 1100px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); }
.l-trust > div {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 12px; text-align: center;
  background: #fff; border: 1px solid var(--line); font-size: .9rem; color: var(--ink);
}
.l-trust > div:first-child { border-radius: 16px 0 0 16px; }
.l-trust > div:last-child { border-radius: 0 16px 16px 0; }
.l-trust > div + div { border-inline-start: 0; }
[dir="rtl"] .l-trust > div:first-child { border-radius: 0 16px 16px 0; }
[dir="rtl"] .l-trust > div:last-child { border-radius: 16px 0 0 16px; }
.l-trust-ic { font-size: 1.15rem; }

.l-section { padding: 64px 24px; }
.l-eyebrow { text-align: center; margin: 0 0 8px; font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }
.l-h2 { letter-spacing: -.02em; margin-bottom: 34px; }
.l-features { grid-template-columns: repeat(3, 1fr); gap: 18px; }
.l-features article, .l-who article {
  background: #fff; background-image: none; border: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 18px;
  padding: 22px; box-shadow: 0 1px 2px rgba(30, 27, 75, .04), 0 10px 30px rgba(30, 27, 75, .06); transition: transform .15s, box-shadow .15s;
}
.l-features article:hover, .l-who article:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(30, 27, 75, .12); }
.l-features h3, .l-who h3 { display: flex; align-items: center; gap: 12px; font-size: 1rem; color: var(--ink); margin: 0 0 10px; }
.l-features h3[data-icon]::before, .l-who h3[data-icon]::before { width: 42px; height: 42px; border-radius: 12px; font-size: 1.15rem; }
.l-features p, .l-who p { color: var(--ink-2); line-height: 1.6; margin: 0; }
.l-who { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.l-who article { background: linear-gradient(160deg, #f5f3ff, #fff 60%); }

.l-privacy { border-radius: 28px; padding: 44px; }
.l-steps li { border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(30, 27, 75, .06); }
.price-card { border-radius: 24px; }

.l-faq { max-width: 780px; margin: 0 auto; display: grid; gap: 10px; }
.l-faq details { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 4px 20px; transition: box-shadow .15s; }
.l-faq details[open] { box-shadow: 0 10px 30px rgba(30, 27, 75, .08); }
.l-faq summary {
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0;
  font-size: 1rem; font-weight: 700; color: var(--ink);
}
.l-faq summary::-webkit-details-marker { display: none; }
.l-faq summary::after { content: "+"; font-size: 1.4rem; font-weight: 500; color: var(--primary); transition: transform .2s; }
.l-faq details[open] summary::after { transform: rotate(45deg); }
.l-faq p { margin: 0 0 18px; color: var(--ink-2); line-height: 1.65; }

.l-cta { padding: 56px 24px; border-radius: 28px; box-shadow: 0 20px 50px rgba(91, 75, 240, .3); }
.l-cta-sub { margin: -8px 0 22px; opacity: .9; font-size: 1rem; }
.l-footer { display: grid; gap: 8px; justify-items: center; padding: 40px 20px 48px; }
.l-footer-brand { display: flex; align-items: center; gap: 8px; font-size: 1rem; color: var(--ink); }
.l-footer-brand img.logo { width: 30px; height: 30px; border-radius: 8px; box-shadow: none; }
.l-footer-links { margin: 0; }
.l-footer-links a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.l-footer-links a:hover { color: var(--primary); }
html { scroll-behavior: smooth; }
#features, #pricing, #faq, #who { scroll-margin-top: 70px; }

@media (max-width: 1000px) { .l-who { grid-template-columns: repeat(2, 1fr); } .l-features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .l-hero { padding: 36px 18px 40px; }
  .l-trust { grid-template-columns: repeat(2, 1fr); padding: 0 16px; }
  .l-trust > div:nth-child(1) { border-radius: 16px 0 0 0; }
  .l-trust > div:nth-child(2) { border-radius: 0 16px 0 0; }
  .l-trust > div:nth-child(3) { border-radius: 0 0 0 16px; border-inline-start: 1px solid var(--line); border-top: 0; }
  .l-trust > div:nth-child(4) { border-radius: 0 0 16px 0; border-top: 0; }
  .l-section { padding: 44px 16px; }
  .l-float-a { inset-inline-start: 0; }
  .l-float-b { inset-inline-end: 0; }
  .l-privacy { padding: 28px; }
}
@media (max-width: 600px) {
  .l-features, .l-who { grid-template-columns: 1fr; }
  .l-float { font-size: .82rem; padding: 7px 10px; }
  .l-glow { width: 300px; height: 300px; }
  .l-cta { margin-inline: 16px; padding: 40px 18px; }
}

/* dark look */
[data-theme="dark"] .l-kicker { background: var(--tint); color: var(--tint-text); box-shadow: inset 0 0 0 1px #3b3570; }
[data-theme="dark"] :is(.l-trust > div, .l-faq details, .l-float) { background: var(--card); border-color: var(--line); color: var(--text); }
:root[data-theme="dark"] .l-who article { background: linear-gradient(160deg, #26234a, var(--card) 60%); }
[data-theme="dark"] :is(.l-features article, .l-who article) { border-color: var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
[data-theme="dark"] :is(.l-features h3, .l-who h3, .l-faq summary, .l-footer-brand) { color: var(--ink); }
[data-theme="dark"] :is(.l-features p, .l-who p, .l-faq p) { color: var(--muted); }
[data-theme="dark"] .l-glow { opacity: .35; }
[data-theme="dark"] .l-eyebrow { color: #a5b4fc; }
[data-theme="dark"] .l-footer-links a { color: var(--muted); }

/* phones: the hero already has the big "start" button, so the top bar keeps just the essentials */
@media (max-width: 520px) { .l-nav .btn-start { display: none; } .l-nav { gap: 8px; } }
@media (max-width: 860px) { .l-sub { margin-inline: auto; } .l-mock { width: fit-content; margin-inline: auto; } }
@media (max-width: 860px) { .l-float-a { inset-inline-start: -30%; } .l-float-b { inset-inline-end: -28%; } .l-float-c { inset-inline-start: -24%; } }
@media (max-width: 600px) { .l-float { display: none; } }

/* ---------- computers and tablets: the ☰ menu stays open as a list on the left (☰ hides / shows it) ---------- */
@media (min-width: 700px) {
  body { --side: 260px; }
  body:not(.locked):not(.side-off) { padding-inline-start: var(--side); }
  body:not(.locked):not(.side-off) #drawer { display: block !important; inset: 0 auto 0 0; width: var(--side); z-index: 40; }
  [dir="rtl"] body:not(.locked):not(.side-off) #drawer { inset: 0 0 0 auto; }
  body:not(.locked):not(.side-off) #drawer .drawer-backdrop,
  body:not(.locked):not(.side-off) #drawer [data-close-drawer] { display: none; }
  body:not(.locked):not(.side-off) .drawer-panel,
  [dir="rtl"] body:not(.locked):not(.side-off) .drawer-panel {
    width: var(--side); transform: none; transition: none; box-shadow: none;
    border-inline-end: 1px solid var(--line);
  }
  /* the normal menu button at the top left of the list, then the logo and "DT" */
  body:not(.locked):not(.side-off) #menuBtn {
    position: fixed; top: 14px; inset-inline-start: 12px; z-index: 41; width: 36px; height: 36px; border-radius: 10px;
    background: var(--soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line);
  }
  body:not(.locked):not(.side-off) #menuBtn:hover { background: #eef2ff; color: var(--primary); }
  body:not(.locked):not(.side-off) .drawer-panel { padding-top: 14px; }
  body:not(.locked):not(.side-off) .drawer-head { padding: 0 4px 12px 46px; min-height: 48px; gap: 8px; }
  [dir="rtl"] body:not(.locked):not(.side-off) .drawer-head { padding: 0 46px 12px 4px; }
  body:not(.locked):not(.side-off) .drawer-head img.logo { width: 36px; height: 36px; border-radius: 10px; }
  body:not(.locked):not(.side-off) #menuBtn svg { width: 20px; height: 20px; }
  body:not(.locked):not(.side-off) .drawer-head .dh-full { display: none; }
  body:not(.locked):not(.side-off) .drawer-head .dh-short { display: inline; letter-spacing: .04em; }
}
@media (min-width: 700px) and (max-width: 1000px) {
  body { --side: 232px; }
  body:not(.locked):not(.side-off) .drawer-list button { padding: 8px 8px; gap: 8px; }
}
@media (min-width: 700px) {
  :root[data-theme="dark"] body:not(.locked):not(.side-off) #menuBtn { background: var(--tint); color: var(--tint-text); box-shadow: inset 0 0 0 1px #3b3570; }
  :root[data-theme="dark"] body:not(.locked):not(.side-off) #menuBtn:hover { background: var(--tint); color: var(--tint-text); }
}
/* menu button icons (drawn, so they look the same on every device) */
.menu-btn { display: inline-grid; place-items: center; padding: 0; }
.menu-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.menu-btn .ic-panel { display: none; stroke-width: 1.9; }
.drawer-head .dh-short { display: none; }

/* ---------- country: sign-up, Profile, and the one-time question ---------- */
#aCountry, #profCountry, #cmSelect { width: 100%; }
#authForm label .small-text { display: block; margin-top: 4px; font-weight: 500; }
.country-box { max-width: 440px; }
.country-box form { display: grid; gap: 10px; }
#profCountryCard select { margin-top: 6px; }
.drawer-head strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- publisher status: the question, the goal box, Profile ---------- */
.alarm-box.modal-box.status-box { width: min(94vw, 500px); padding: 22px 24px; }
.status-box form { display: grid; gap: 10px; }
.pub-opts { display: grid; gap: 8px; }
.pub-opt {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--card, #fff); transition: border-color .15s, background .15s;
}
.pub-opt:hover { border-color: #c7c2f5; }
.pub-opt:has(input:checked) { border-color: var(--primary); background: #f5f3ff; }
.pub-opt input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); flex: none; }
.pub-opt-body { display: grid; gap: 1px; text-align: start; }
.pub-opt-body strong { color: var(--ink); font-size: 1rem; }
.pub-custom { display: grid; gap: 4px; padding: 4px 2px 0; }
.pub-custom input, .pub-goal-row input { max-width: 160px; }
.pub-goal-row { display: grid; gap: 4px; margin-top: 10px; }
#profPub { width: 100%; margin-top: 6px; }

.goal-card { margin-bottom: 16px; }
.goal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 0 6px; }
.goal-status { font-weight: 700; color: var(--primary); font-size: .9rem; }
.goal-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.goal-line strong { font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.goal-bar { height: 10px; border-radius: 99px; background: #ede9fe; overflow: hidden; margin: 10px 0 6px; }
.goal-bar span { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .3s; }
.goal-foot { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.goal-done { color: #059669; }

:root[data-theme="dark"] .pub-opt { background: var(--card); border-color: var(--line); }
:root[data-theme="dark"] .pub-opt:hover { border-color: #4b4590; }
:root[data-theme="dark"] .pub-opt:has(input:checked) { border-color: #8b7cf6; background: var(--tint); }
:root[data-theme="dark"] .goal-bar { background: #2b2750; }
:root[data-theme="dark"] .goal-status { color: #c4b5fd; }
:root[data-theme="dark"] .goal-done { color: #34d399; }
.goal-head .goal-status { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-card .link-btn { width: auto; flex: none; margin: 0; padding: 2px 4px; display: inline; text-align: end; }
.goal-card p .link-btn { padding: 0 2px; }
/* status question: compact choices, and Save always in view */
.status-box .pub-opts { gap: 6px; }
.status-box .pub-opt { padding: 9px 12px; }
.status-box .actions { position: sticky; bottom: -22px; margin: 0 -24px -22px; padding: 12px 24px 18px; background: var(--card, #fff); border-top: 1px solid var(--line); }
:root[data-theme="dark"] .status-box .actions { background: var(--card); }
@media (max-width: 600px) { .status-box .pub-opt-body strong { font-size: .9rem; } .status-box .actions .btn { width: 100%; } }
/* publisher status: start date, Profile summary, goal inside the Time Tracker */
.pub-since { display: grid; gap: 4px; margin-top: 2px; font-weight: 600; }
.pub-since input { max-width: 220px; }
.goal-since { font-weight: 500; color: var(--ink-2); }
.pub-info { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 6px; }
.pub-info li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--soft); }
.trk-goal { margin: 4px 0 16px; padding: 14px 16px; border-radius: 16px; background: var(--soft); border: 1px solid var(--line); }
.trk-goal .link-btn { width: auto; flex: none; margin: 0; padding: 2px 4px; display: inline; }
.trk-goal .goal-line strong { font-size: 1.4rem; }
:root[data-theme="dark"] .goal-since { color: #a9a5d6; }
:root[data-theme="dark"] .pub-info li, :root[data-theme="dark"] .trk-goal { background: #24223d; border-color: var(--line); }
.goal-head .goal-status { white-space: normal; }
.goal-since { display: block; font-size: .82rem; margin-top: 1px; }
.goal-head { align-items: flex-start; }

/* ---------- goal reached: celebration over the whole screen ---------- */
.celebrate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle at 50% 45%, rgba(109, 93, 246, .28), rgba(15, 12, 40, .55) 70%); animation: cel-in .35s ease-out both; }
.celebrate.out { animation: cel-out .45s ease-in both; }
.celebrate-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.celebrate-card { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; padding: 26px 34px; max-width: min(88vw, 420px);
  border-radius: 24px; background: var(--card, #fff); color: var(--ink); box-shadow: 0 30px 80px rgba(20, 16, 60, .45); animation: cel-pop .55s cubic-bezier(.2, 1.4, .4, 1) both; }
.celebrate-ic { font-size: 3.4rem; line-height: 1; animation: cel-bounce 1s ease-in-out .4s 2; }
.celebrate-card strong { font-size: 1.4rem; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.celebrate-card span { color: var(--ink-2); font-weight: 600; }
@keyframes cel-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cel-out { to { opacity: 0; } }
@keyframes cel-pop { from { opacity: 0; transform: scale(.6) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes cel-bounce { 0%, 100% { transform: none; } 30% { transform: translateY(-10px) rotate(-8deg); } 60% { transform: translateY(0) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .celebrate, .celebrate-card, .celebrate-ic { animation: none; } }
:root[data-theme="dark"] .celebrate-card { background: #1f1d38; border: 1px solid var(--line); }
:root[data-theme="dark"] .celebrate-card strong { background: linear-gradient(120deg, #93c5fd, #c4b5fd); -webkit-background-clip: text; background-clip: text; }

/* ---------- share my goal ---------- */
.goal-actions { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.goal-share { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 700;
  color: var(--primary); background: #eef2ff; border: 1px solid #dcdffe; }
.goal-share:hover { background: #e0e7ff; }
.share-ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.celebrate-share { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; }
.celebrate-share .share-ic { width: 18px; height: 18px; }
.goal-box, .celebrate-card { position: relative; }
.share-note { position: absolute; inset-inline-end: 0; top: -34px; padding: 6px 12px; border-radius: 10px; font-size: .82rem; font-weight: 700;
  background: #111827; color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.25); animation: cel-in .2s ease-out both; white-space: nowrap; }
.celebrate-card .share-note { inset-inline-end: 50%; transform: translateX(50%); top: auto; bottom: -44px; }
:root[data-theme="dark"] .goal-share { color: #c4b5fd; background: var(--tint); border-color: #3b3570; }
:root[data-theme="dark"] .goal-share:hover { background: #352f63; }
@media (max-width: 420px) { .goal-share span { display: none; } .goal-share { padding: 7px 9px; } }
.goal-card, .trk-goal { position: relative; }
.goal-card .share-note, .trk-goal .share-note { top: 12px; inset-inline-end: 16px; }

/* ---------- share later: goal history (Progress) and "Later" on the Goal reached card ---------- */
.gh-card { position: relative; margin-bottom: 16px; }
.gh-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.gh-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); }
.gh-main { display: grid; gap: 2px; min-width: 0; }
.gh-main strong { text-transform: capitalize; color: var(--ink); }
.gh-hours { display: grid; justify-items: end; gap: 1px; font-size: .9rem; }
.gh-hours strong { font-size: 1rem; color: var(--ink); }
.gh-ok { color: #059669; font-weight: 700; font-size: .82rem; }
.gh-card .share-note { top: 12px; inset-inline-end: 16px; }
.celebrate-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.celebrate-btns .celebrate-share { margin-top: 0; }
.celebrate-hint { margin-top: 4px; font-size: .82rem !important; }
:root[data-theme="dark"] .gh-list li { background: #24223d; }
:root[data-theme="dark"] .gh-ok { color: #34d399; }
@media (max-width: 420px) { .gh-list li { gap: 10px; padding: 10px 12px; } }

/* ---------- profile setup when the app opens: the questions cover the whole page ---------- */
.setup-top { display: none; }
.alarm.setup {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; overflow-y: auto; padding: 0 16px 32px;
  background: linear-gradient(160deg, #eef2ff 0%, #f5f3ff 45%, #fdf4ff 100%); backdrop-filter: none;
}
.alarm.setup[hidden] { display: none; }
.alarm.setup .setup-top { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; width: min(100%, 600px); padding: 22px 4px 10px; }
.setup-brand { display: flex; align-items: center; gap: 10px; }
.setup-brand img.logo { width: 38px; height: 38px; border-radius: 11px; box-shadow: none; }
.setup-brand strong { font-size: 1.15rem; color: var(--ink); }
.setup-step { font-size: .9rem; font-weight: 700; color: var(--ink-2); }
.setup-bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: rgba(109, 93, 246, .15); overflow: hidden; }
.setup-bar span { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .3s; }
.alarm.setup .alarm-box.modal-box {
  width: min(100%, 600px); max-height: none; overflow: visible; margin: 8px 0 0; padding: 26px 26px 0;
  border-radius: 24px; box-shadow: 0 20px 60px rgba(30, 27, 75, .12); animation: none;
}
.alarm.setup .modal-head h2 { font-size: 1.4rem; }
.alarm.setup .status-box .actions { position: sticky; bottom: 0; margin: 8px -26px 0; padding: 14px 26px 20px; border-radius: 0 0 24px 24px; }
.alarm.setup .country-box form .actions { padding-bottom: 24px; }
.alarm.setup .actions .btn { min-width: 160px; }
.setup-intro { margin: 0; font-weight: 600; color: var(--ink); }
.setup-intro:empty { display: none; }
.alarm:not(.setup) .setup-intro { display: none; }
body.in-setup { overflow: hidden; }
:root[data-theme="dark"] .alarm.setup { background: linear-gradient(160deg, #12112a 0%, #191637 50%, #1f1440 100%); }
:root[data-theme="dark"] .alarm.setup .alarm-box.modal-box { box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
:root[data-theme="dark"] .setup-brand strong { color: var(--ink); }
:root[data-theme="dark"] .setup-bar { background: #2b2750; }
@media (max-width: 600px) {
  .alarm.setup { padding: 0 0 0; }
  .alarm.setup .setup-top { padding: 16px 16px 8px; }
  .alarm.setup .alarm-box.modal-box { margin: 6px 0 0; border-radius: 22px 22px 0 0; padding: 22px 18px 0; min-height: calc(100vh - 92px); min-height: calc(100dvh - 92px); display: flex; flex-direction: column; }
  .alarm.setup .alarm-box.modal-box form { flex: 1; display: flex; flex-direction: column; gap: 10px; }
  .alarm.setup .status-box .actions, .alarm.setup .country-box .actions { margin: auto -18px 0; padding: 14px 18px 22px; border-radius: 0; }
  .alarm.setup .actions .btn { width: 100%; }
  .alarm.setup .modal-head h2 { font-size: 1.15rem; }
}

.alarm.setup .alarm-box.modal-box.country-box { max-width: none; width: min(100%, 600px); }

/* ---------- About you (setup step 1 and Profile → Edit profile) ---------- */
#avatarModal { z-index: 70; } /* the picture window opens above the setup page */
.alarm-box.modal-box.about-box { width: min(94vw, 520px); padding: 22px 24px; }
.about-box form { display: grid; gap: 12px; }
.about-box label { display: grid; gap: 4px; font-weight: 600; }
.ab-photo { display: flex; align-items: center; gap: 16px; }
.ab-photo .avatar-btn { flex: none; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.ab-photo p { margin: 4px 0 0; }
.ab-pw { display: grid; gap: 12px; padding: 14px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); }
.ab-pw p { margin: 0; }
.alarm.setup #abClose { display: none; }
.alarm.setup .about-box { padding-bottom: 0; }
.alarm.setup .about-box .actions { position: sticky; bottom: 0; margin: 4px -26px 0; padding: 14px 26px 20px; background: var(--card, #fff); border-top: 1px solid var(--line); border-radius: 0 0 24px 24px; }
.alarm:not(.setup) .about-box .actions { justify-content: flex-end; }
.prof-contact { margin: 2px 0; }
.drawer-list .drawer-out { width: 100%; margin-top: 4px; }
:root[data-theme="dark"] .ab-pw { background: #24223d; }
:root[data-theme="dark"] .alarm.setup .about-box .actions { background: var(--card); }
@media (max-width: 600px) {
  .alarm.setup .about-box .actions { margin: auto -18px 0; padding: 14px 18px 22px; border-radius: 0; }
}
.about-box label { display: block; }
.about-box label input { display: block; width: 100%; margin-top: 5px; }
.ab-photo .avatar.xl { width: 84px; height: 84px; font-size: 2rem; }
/* the side list's top row (menu button, logo, DT) stays put while the list scrolls */
@media (min-width: 700px) {
  body:not(.locked):not(.side-off) .drawer-head {
    position: sticky; top: -14px; z-index: 2; background: inherit;
    margin: -14px -12px 0; padding: 14px 16px 12px 58px; min-height: 62px;
  }
  [dir="rtl"] body:not(.locked):not(.side-off) .drawer-head { padding: 14px 58px 12px 16px; }
}

/* ---------- menu list: smaller letters ---------- */
.drawer-list button, .drawer-list .drawer-out { font-size: .9rem; font-weight: 600; padding: 7px 10px; gap: 10px; }
.drawer-list .d-ic { font-size: .9rem; width: 20px; }
.drawer-h { font-size: .72rem; margin: 12px 10px 3px; }
.drawer-user { padding: 8px 10px; gap: 10px; }
.drawer-who strong { font-size: .9rem; }
.drawer-who .muted { font-size: .72rem; }
.drawer-legal { font-size: .72rem; }
@media (min-width: 700px) and (max-width: 1000px) {
  body:not(.locked):not(.side-off) .drawer-list button { padding: 6px 8px; gap: 8px; }
}

.ab-why { margin: -2px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); }
:root[data-theme="dark"] .ab-why { background: #24223d; }

.pw-match { margin: -6px 0 0; font-size: .82rem; font-weight: 600; min-height: 1em; }
.pw-match.ok { color: #059669; }
.pw-match.bad { color: var(--red); }
input.bad { border-color: var(--red) !important; }
:root[data-theme="dark"] .pw-match.ok { color: #34d399; }

.ab-forgot { display: grid; justify-items: start; gap: 2px; padding-top: 4px; border-top: 1px dashed var(--line); }
.ab-forgot .link-btn { padding: 4px 0; font-weight: 600; }
.ab-forgot .addr-msg { margin: 0; }

/* ---------- © copyright line ---------- */
.copyright { margin: 0; font-size: .72rem; color: var(--muted, #8a87a8); }
.app-footer .copyright { display: block; margin-top: 6px; }
.l-footer .copyright { margin-top: 6px; }
.drawer-copy { margin-top: 4px; }

/* ---------- "Do you have an account?" ---------- */
.auth-choose { display: grid; gap: 10px; margin: 6px 0 4px; }
.choose-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: start; cursor: pointer; font: inherit;
  border-radius: 16px; border: 1.5px solid var(--line); background: var(--card, #fff); color: var(--ink); transition: border-color .15s, transform .15s;
}
.choose-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.choose-btn.primary { border-color: transparent; background: var(--grad); color: #fff; box-shadow: 0 10px 26px rgba(91, 75, 240, .3); }
.choose-ic { font-size: 1.4rem; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--soft); flex: none; }
.choose-btn.primary .choose-ic { background: rgba(255, 255, 255, .2); }
.choose-txt { display: grid; gap: 2px; flex: 1; }
.choose-txt strong { font-size: 1rem; }
.choose-txt span { font-size: .82rem; opacity: .8; }
.choose-chev { font-size: 1.4rem; opacity: .7; }
.auth-back { margin-top: 2px; }
:root[data-theme="dark"] .choose-btn:not(.primary) { background: #24223d; border-color: var(--line); color: var(--ink); }
#authForm [data-modes][hidden] { display: none !important; }

/* ---------- sign in / "Do you have an account?" / create account: the whole screen ---------- */
#authScreen.auth {
  backdrop-filter: none; padding: 32px 16px;
  background: radial-gradient(circle at 15% 10%, rgba(96, 165, 250, .25), transparent 45%),
              radial-gradient(circle at 85% 90%, rgba(167, 139, 250, .28), transparent 50%),
              linear-gradient(160deg, #eef2ff 0%, #f5f3ff 50%, #fdf4ff 100%);
}
#authScreen .auth-card { width: min(100%, 460px); padding: 30px 30px 22px; }
:root[data-theme="dark"] #authScreen.auth {
  background: radial-gradient(circle at 15% 10%, rgba(59, 130, 246, .22), transparent 45%),
              radial-gradient(circle at 85% 90%, rgba(139, 92, 246, .25), transparent 50%),
              linear-gradient(160deg, #12112a 0%, #191637 50%, #1f1440 100%);
}
@media (max-width: 600px) {
  #authScreen.auth { padding: 0; place-items: stretch; }
  #authScreen .auth-card {
    width: 100%; min-height: 100vh; min-height: 100dvh; border-radius: 0; box-shadow: none;
    padding: 22px 20px 28px; display: flex; flex-direction: column;
  }
  #authScreen .auth-choose { margin-top: 14px; gap: 12px; }
  #authScreen .choose-btn { padding: 18px 16px; }
}
@media (max-width: 600px) { #authScreen .auth-card { justify-content: flex-start; padding-top: max(40px, 9vh); } }

/* "← Back" next to Next / Finish in the setup */
.alarm.setup .actions { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.alarm.setup .actions .setup-back { min-width: 0; flex: none; }
.alarm.setup .actions button[type="submit"] { flex: 1; max-width: 260px; margin-inline-start: auto; }
@media (max-width: 600px) { .alarm.setup .actions .btn.setup-back { width: auto; } .alarm.setup .actions button[type="submit"] { max-width: none; } }

.choose-demo { justify-self: center; margin-top: 4px; font-weight: 600; }

/* ---------- password boxes: show / hide ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-inline-end: 46px !important; }
.pw-eye {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted, #8a87a8); cursor: pointer; display: grid; place-items: center; padding: 0;
}
.pw-eye:hover { background: var(--soft); color: var(--primary); }
.pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
label .pw-wrap { margin-top: 5px; }
.about-box label .pw-wrap input { margin-top: 0; }
input[type="date"], input[type="month"], input[type="time"] { cursor: pointer; }
:root[data-theme="dark"] .pw-eye:hover { background: var(--tint); color: var(--tint-text); }

/* ---------- short messages at the bottom ("You'll be reminded…") ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 120; max-width: min(92vw, 460px);
  padding: 12px 18px; border-radius: 14px; background: #111827; color: #fff; font-weight: 600; font-size: .9rem; line-height: 1.4;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .3); animation: toast-in .25s ease-out both; cursor: pointer;
}
.toast.out { animation: toast-out .35s ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 12px); } }
:root[data-theme="dark"] .toast { background: #ecebff; color: #1e1b4b; }
.toast { width: max-content; text-align: center; }

/* ---------- the pointing hand 👆 on everything you can click or tap ---------- */
button, [role="button"], select, summary, a[href], label.check, .pub-opt, .choose-btn, .chip, .ev-pick,
input[type="checkbox"], input[type="radio"], input[type="file"],
input[type="date"], input[type="month"], input[type="time"],
input::-webkit-calendar-picker-indicator { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; }

/* ---------- map: a color per kind of pin, the legend, several countries ---------- */
.map-pin.k-contact { --pin: #2563eb; } .map-pin.k-visit { --pin: #16a34a; } .map-pin.k-appt { --pin: #f59e0b; } .map-pin.k-event { --pin: #7c3aed; }
.map-row-pin.k-contact { --pin: #2563eb; } .map-row-pin.k-visit { --pin: #16a34a; } .map-row-pin.k-appt { --pin: #f59e0b; } .map-row-pin.k-event { --pin: #7c3aed; }
.map-pin .map-pin-txt, .map-pin .map-pin-img { box-shadow: 0 0 0 3px var(--pin, #fff), 0 4px 12px rgba(30, 27, 75, .35) !important; }
.map-pin::after { border-top-color: var(--pin, #fff) !important; }
.map-row-pin .map-pin-txt, .map-row-pin .map-pin-img { box-shadow: inset 0 0 0 2px var(--pin, transparent), 0 0 0 2px var(--pin, transparent) !important; }
.map-pin .map-pin-txt.appt { background: #fff; }
.map-pin-txt .ev-svg { width: 22px; height: 22px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 2px 2px; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.countries-h { margin: 16px 0 2px; font-size: 1rem; color: var(--ink); }
.country-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.country-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--ink); }
.country-chip button { border: 0; background: transparent; color: var(--muted, #8a87a8); cursor: pointer; width: 22px; height: 22px; border-radius: 50%; font-size: .8rem; }
.country-chip button:hover { background: rgba(220, 38, 38, .12); color: var(--red); }
#profCountryAdd { width: 100%; margin-top: 4px; }
:root[data-theme="dark"] .country-chip { background: #24223d; }

/* ---------- map: search box with its button ---------- */
.map-search { display: flex; gap: 8px; flex: 1 1 260px; min-width: 0; margin: 0; }
.map-search input { flex: 1; min-width: 0; }
.map-search-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border-radius: 12px; white-space: nowrap; }
.map-pin.k-found { --pin: #dc2626; }
@media (max-width: 420px) { .map-search-btn span[data-i18n] { display: none; } .map-search-btn { padding: 0 14px; } }

/* ---------- suggestions while typing ---------- */
.live-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 600; margin: 0; padding: 4px; list-style: none;
  max-height: 300px; overflow-y: auto; border-radius: 14px; background: var(--card, #fff); border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(30, 27, 75, .22); }
.live-suggest li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.live-suggest li:hover, .live-suggest li.active { background: var(--soft); }
.live-suggest .sg-ic { flex: none; width: 22px; text-align: center; }
.live-suggest .sg-txt { display: grid; min-width: 0; }
.live-suggest .sg-txt strong { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-suggest .sg-txt .muted { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root[data-theme="dark"] .live-suggest { background: #1f1d38; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .live-suggest li:hover, :root[data-theme="dark"] .live-suggest li.active { background: var(--tint); }

/* ---------- Send feedback ---------- */
.alarm-box.modal-box.fb-box { width: min(94vw, 520px); padding: 22px 24px; }
.fb-box form { display: grid; gap: 12px; }
.fb-box label { display: grid; gap: 5px; font-weight: 600; }
.fb-box textarea { width: 100%; resize: vertical; min-height: 110px; font: inherit; }
.fb-rate { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 600; }
.fb-stars { display: flex; gap: 2px; }
.fb-stars button { border: 0; background: none; font-size: 1.9rem; line-height: 1; padding: 2px 3px; color: #cbd5e1; transition: transform .1s, color .1s; }
.fb-stars button:hover { transform: scale(1.15); }
.fb-stars button.on { color: #f59e0b; }
:root[data-theme="dark"] .fb-stars button { color: #3b3866; }
:root[data-theme="dark"] .fb-stars button.on { color: #fbbf24; }

/* ---------- Tools page: every tool + search ---------- */
.hub-card { display: grid; gap: 12px; }
.hub-search { flex: none; }
.hub-search input { height: 46px; }
.hub-h { margin: 6px 0 -4px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hub-tool, .hub-hit { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card, #fff); color: var(--ink); font: inherit; text-align: start; transition: background .12s, transform .12s; }
.hub-tool:hover, .hub-hit:hover { background: var(--soft); }
.hub-tool:active, .hub-hit:active { transform: scale(.99); }
.hub-ic { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--soft); font-size: 1.2rem; }
.hub-name { flex: 1; font-weight: 600; }
.hub-txt { flex: 1; display: grid; min-width: 0; }
.hub-txt strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-txt .muted { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-count { flex: none; min-width: 26px; padding: 2px 8px; border-radius: 999px; background: var(--grad); color: #fff; font-size: .8rem; font-weight: 700; text-align: center; }
.hub-chev { flex: none; color: var(--muted); font-size: 1.3rem; }
.hub-none { margin: 0; }
:root[data-theme="dark"] .hub-tool, :root[data-theme="dark"] .hub-hit { background: #1f1d38; }
:root[data-theme="dark"] .hub-tool:hover, :root[data-theme="dark"] .hub-hit:hover, :root[data-theme="dark"] .hub-ic { background: var(--tint); }

/* ---------- More (⚙️ in the top bar) ---------- */
#moreList .switch { margin-inline-start: auto; }
#moreList .more-out { color: var(--red); }

/* ---------- this device only (no account) ---------- */
.local-only { display: none !important; }
body.local-mode .local-only { display: revert !important; }
body.local-mode .cloud-only { display: none !important; }

/* ---------- App Store / Google Play version: nothing priced or sold ---------- */
.store-only { display: none !important; }
html.store-app .store-only { display: revert !important; }
html.store-app:not(.store-pay) .paid-only, html.store-app #trialBanner, html.store-app #landing { display: none !important; }
html.store-app body.locked { background: var(--bg, #0f0d24); }

/* ---------- home page: Free and Cloud prices side by side ---------- */
.price-cards { display: grid; gap: 18px; max-width: 900px; margin: 0 auto; align-items: stretch; }
@media (min-width: 760px) { .price-cards { grid-template-columns: 1fr 1fr; } }
.price-cards .price-card { max-width: none; margin: 0; width: 100%; display: flex; flex-direction: column; }
.price-cards .price-card .price-list { flex: 1; align-content: start; }
.price-name { margin: 0 0 10px; font-size: 1.15rem; }
.free-card { background-image: linear-gradient(#fff, #fff), linear-gradient(135deg, #cbd5e1, #e2e8f0); box-shadow: 0 10px 28px rgba(15, 23, 42, .08); }
.price-note-all { text-align: center; max-width: 640px; margin: 16px auto 0; }
:root[data-theme="dark"] .free-card { background-image: linear-gradient(#1f1d38, #1f1d38), linear-gradient(135deg, #3b3866, #2a2750); }
#pwLocal { margin-top: 8px; }

/* ---------- inside a tool: the tool tabs, with the one you're in clearly marked ---------- */
.tools-bar button.on, [data-theme="dark"] .tools-bar button.on { background: var(--grad); color: #fff; box-shadow: 0 3px 10px rgba(91, 75, 240, .3); }

/* ---------- the page / tool you're on stays highlighted (phones keep "hover" on the last button tapped) ---------- */
.app-nav button.on, .app-nav button.on:hover, [data-theme="dark"] .app-nav button.on, [data-theme="dark"] .app-nav button.on:hover,
.tools-bar button.on, .tools-bar button.on:hover, [data-theme="dark"] .tools-bar button.on, [data-theme="dark"] .tools-bar button.on:hover {
  background: var(--grad); color: #fff; box-shadow: 0 3px 10px rgba(91, 75, 240, .3);
}
@media (hover: none) {
  /* touch screens: no hover color at all on the menus, so nothing looks selected by mistake */
  .app-nav button:not(.on):hover, [data-theme="dark"] .app-nav button:not(.on):hover,
  .tools-bar button:not(.on):hover, [data-theme="dark"] .tools-bar button:not(.on):hover { background: none; }
  .drawer-list button:not(.on):hover, [data-theme="dark"] .drawer-list button:not(.on):hover { background: none; }
}
.drawer-list button.on:hover { background: #eef2ff; color: var(--primary); }
[data-theme="dark"] .drawer-list button.on, [data-theme="dark"] .drawer-list button.on:hover { background: var(--tint); color: var(--tint-text); }

/* ---------- Add a to-do: day (calendar) + time as hour : minute + AM/PM ---------- */
.pl-add { grid-template-columns: 1fr; }
.pl-add #plText { grid-column: 1 / -1; }
.pl-when { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.pl-field { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); margin: 0; }
.pl-field input[type="date"] { min-width: 150px; margin: 0; }
.pl-time { display: inline-flex; align-items: center; gap: 4px; }
.pl-time select { margin: 0; width: auto; min-width: 64px; padding-inline: 10px 26px; }
.pl-time b { color: var(--muted); }
.pl-add.no-when .pl-when { opacity: .45; }
.pl-add button[type="submit"] { justify-self: start; min-width: 140px; }
@media (max-width: 600px) { .pl-add button[type="submit"] { justify-self: stretch; } .pl-field input[type="date"] { min-width: 0; width: 100%; } .pl-when > label { flex: 1 1 100%; } }

/* ---------- 📸 Moments ---------- */
.mom-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.mom-btn { cursor: pointer; }
.mom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mom-item { position: relative; padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--soft); aspect-ratio: 1; }
.mom-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mom-cap { position: absolute; inset: auto 0 0 0; padding: 18px 8px 6px; color: #fff; font-size: .78rem; font-weight: 600; text-align: start;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7)); display: grid; overflow: hidden; }
.mom-cap small { font-weight: 500; opacity: .85; }
@media (max-width: 480px) { .mom-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.alarm-box.modal-box.mom-box { width: min(94vw, 560px); }
.mom-box form { display: grid; gap: 10px; }
.mom-box label { display: grid; gap: 4px; font-weight: 600; }
.mom-photo { width: 100%; max-height: 52vh; object-fit: contain; border-radius: 14px; background: #000; }
.mom-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.danger-text { color: var(--red); }

/* ---------- Schedule: the month calendar ---------- */
.pl-mdow, .pl-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pl-mdow { margin: 6px 0 4px; }
.pl-mdow span { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.pl-mday { position: relative; aspect-ratio: 1 / 1; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--card, #fff);
  color: var(--ink); font: inherit; cursor: pointer; display: grid; grid-template-rows: 1fr auto; align-items: start; justify-items: center; padding: 6px 2px 5px; }
.pl-mday:hover { border-color: var(--primary); }
.pl-mnum { font-weight: 700; font-size: .95rem; }
.pl-mday.other { opacity: .38; }
.pl-mday.past:not(.today) .pl-mnum { color: var(--muted); }
.pl-mday.today { border: 2px solid var(--primary); }
.pl-mday.sel { background: var(--grad); color: #fff; border-color: transparent; }
.pl-mday.sel .pl-mnum { color: #fff; }
.pl-dots { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; min-height: 6px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.dot.appt { background: #3b82f6; } .dot.event { background: #f59e0b; } .dot.task { background: #22c55e; }
.dot.todo { background: #a855f7; } .dot.time { background: #14b8a6; }
.pl-mday.sel .dot { box-shadow: 0 0 0 1.5px #fff; }
.pl-mcount { position: absolute; top: 3px; inset-inline-end: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: .62rem; font-weight: 700; line-height: 16px; }
.pl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 4px; font-size: .78rem; color: var(--muted); }
.pl-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.pl-legend .dot { width: 8px; height: 8px; }
:root[data-theme="dark"] .pl-mday { background: #1f1d38; }
@media (max-width: 420px) { .pl-mday { border-radius: 10px; min-height: 40px; padding-top: 4px; } .pl-mnum { font-size: .85rem; } .pl-month { gap: 3px; } }
/* month calendar: the count sits on the corner (not over the number); the chosen day stays purple in dark mode */
.pl-mcount { top: -6px; inset-inline-end: -5px; min-width: 15px; height: 15px; line-height: 15px; font-size: .58rem; padding: 0 3px; box-shadow: 0 0 0 2px var(--bg, #12112a); }
:root[data-theme="dark"] .pl-mday.sel, .pl-mday.sel { background: var(--grad); color: #fff; border-color: transparent; }
:root[data-theme="dark"] .pl-mday.today:not(.sel) { border: 2px solid #8b7cf6; }
.pl-month { padding-top: 6px; }

/* month calendar: month + year boxes */
.pl-pick { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pl-pick select { margin: 0; width: auto; padding-inline: 10px 28px; font-weight: 700; }
#plPickMonth { min-width: 120px; }

/* ---------- accent colors (Settings → Accent color; purple is the default) ---------- */
html[data-accent="blue"] { --blue: #0ea5e9; --purple: #2563eb; --primary: #2563eb; --primary-dark: #1d4ed8; --grad-dark: linear-gradient(120deg, #0c4a6e, #1e3a8a); }
html[data-accent="blue"][data-theme="dark"] { --tint: #1d2b4d; --tint-text: #93c5fd; }
html[data-accent="blue"][data-theme="dark"] :is(.topbar, .l-nav) { background: linear-gradient(120deg, #0c4a6e, #1e3a8a); }
html[data-accent="teal"] { --blue: #14b8a6; --purple: #0891b2; --primary: #0d9488; --primary-dark: #0f766e; --grad-dark: linear-gradient(120deg, #134e4a, #164e63); }
html[data-accent="teal"][data-theme="dark"] { --tint: #17363d; --tint-text: #5eead4; }
html[data-accent="teal"][data-theme="dark"] :is(.topbar, .l-nav) { background: linear-gradient(120deg, #134e4a, #164e63); }
html[data-accent="green"] { --blue: #22c55e; --purple: #15803d; --primary: #16a34a; --primary-dark: #15803d; --grad-dark: linear-gradient(120deg, #14532d, #166534); }
html[data-accent="green"][data-theme="dark"] { --tint: #183826; --tint-text: #86efac; }
html[data-accent="green"][data-theme="dark"] :is(.topbar, .l-nav) { background: linear-gradient(120deg, #14532d, #166534); }
html[data-accent="orange"] { --blue: #f59e0b; --purple: #ea580c; --primary: #ea580c; --primary-dark: #c2410c; --grad-dark: linear-gradient(120deg, #7c2d12, #9a3412); }
html[data-accent="orange"][data-theme="dark"] { --tint: #3a2818; --tint-text: #fdba74; }
html[data-accent="orange"][data-theme="dark"] :is(.topbar, .l-nav) { background: linear-gradient(120deg, #7c2d12, #9a3412); }
html[data-accent="pink"] { --blue: #ec4899; --purple: #a855f7; --primary: #db2777; --primary-dark: #be185d; --grad-dark: linear-gradient(120deg, #831843, #6b21a8); }
html[data-accent="pink"][data-theme="dark"] { --tint: #3a1d36; --tint-text: #f9a8d4; }
html[data-accent="pink"][data-theme="dark"] :is(.topbar, .l-nav) { background: linear-gradient(120deg, #831843, #6b21a8); }
html[data-accent="red"] { --blue: #f43f5e; --purple: #b91c1c; --primary: #dc2626; --primary-dark: #b91c1c; --grad-dark: linear-gradient(120deg, #7f1d1d, #881337); }
html[data-accent="red"][data-theme="dark"] { --tint: #3a1b20; --tint-text: #fca5a5; }
html[data-accent="red"][data-theme="dark"] :is(.topbar, .l-nav) { background: linear-gradient(120deg, #7f1d1d, #881337); }
.accent-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.accent-pick button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; padding: 0;
  box-shadow: 0 0 0 1px var(--line, #e5e7eb); transition: transform .12s; }
.accent-pick button:hover { transform: scale(1.08); }
.accent-pick button.on { border-color: var(--card, #fff); box-shadow: 0 0 0 3px var(--text); }
.accent-pick [data-accent-pick="purple"] { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.accent-pick [data-accent-pick="blue"] { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.accent-pick [data-accent-pick="teal"] { background: linear-gradient(135deg, #14b8a6, #0891b2); }
.accent-pick [data-accent-pick="green"] { background: linear-gradient(135deg, #22c55e, #15803d); }
.accent-pick [data-accent-pick="orange"] { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.accent-pick [data-accent-pick="pink"] { background: linear-gradient(135deg, #ec4899, #a855f7); }
.accent-pick [data-accent-pick="red"] { background: linear-gradient(135deg, #f43f5e, #b91c1c); }

/* ---------- more accent colors ---------- */
html[data-accent="indigo"] { --blue: #6366f1; --purple: #4338ca; --primary: #4f46e5; --primary-dark: #4338ca; --grad-dark: linear-gradient(120deg, #312e81, #3730a3); }
html[data-accent="indigo"][data-theme="dark"] { --tint: #25264f; --tint-text: #a5b4fc; }
html[data-accent="indigo"][data-theme="dark"] :is(.topbar, .l-nav) { background: linear-gradient(120deg, #312e81, #3730a3); }
.accent-pick [data-accent-pick="indigo"] { background: linear-gradient(135deg, #6366f1, #4338ca); }
html[data-accent="cyan"] { --blue: #22d3ee; --purple: #0284c7; --primary: #0891b2; --primary-dark: #0e7490; --grad-dark: linear-gradient(120deg, #164e63, #075985); }
html[data-accent="cyan"][data-theme="dark"] { --tint: #15343f; --tint-text: #67e8f9; }
html[data-accent="cyan"][data-theme="dark"] :is(.topbar, .l-nav) { background: linear-gradient(120deg, #164e63, #075985); }
.accent-pick [data-accent-pick="cyan"] { background: linear-gradient(135deg, #22d3ee, #0284c7); }
html[data-accent="gold"] { --blue: #facc15; --purple: #d97706; --primary: #ca8a04; --primary-dark: #a16207; --grad-dark: linear-gradient(120deg, #713f12, #854d0e); }
html[data-accent="gold"][data-theme="dark"] { --tint: #3a3018; --tint-text: #fde047; }
html[data-accent="gold"][data-theme="dark"] :is(.topbar, .l-nav) { background: linear-gradient(120deg, #713f12, #854d0e); }
.accent-pick [data-accent-pick="gold"] { background: linear-gradient(135deg, #facc15, #d97706); }
html[data-accent="brown"] { --blue: #c08457; --purple: #7c4a2d; --primary: #9a5b34; --primary-dark: #7c4a2d; --grad-dark: linear-gradient(120deg, #451a03, #5b3416); }
html[data-accent="brown"][data-theme="dark"] { --tint: #33261d; --tint-text: #e7b99a; }
html[data-accent="brown"][data-theme="dark"] :is(.topbar, .l-nav) { background: linear-gradient(120deg, #451a03, #5b3416); }
.accent-pick [data-accent-pick="brown"] { background: linear-gradient(135deg, #c08457, #7c4a2d); }
html[data-accent="slate"] { --blue: #64748b; --purple: #334155; --primary: #475569; --primary-dark: #334155; --grad-dark: linear-gradient(120deg, #1e293b, #334155); }
html[data-accent="slate"][data-theme="dark"] { --tint: #26303f; --tint-text: #cbd5e1; }
html[data-accent="slate"][data-theme="dark"] :is(.topbar, .l-nav) { background: linear-gradient(120deg, #1e293b, #334155); }
.accent-pick [data-accent-pick="slate"] { background: linear-gradient(135deg, #64748b, #334155); }
html[data-accent="maroon"] { --blue: #be123c; --purple: #7f1d1d; --primary: #9f1239; --primary-dark: #881337; --grad-dark: linear-gradient(120deg, #4c0519, #7f1d1d); }
html[data-accent="maroon"][data-theme="dark"] { --tint: #381820; --tint-text: #fda4af; }
html[data-accent="maroon"][data-theme="dark"] :is(.topbar, .l-nav) { background: linear-gradient(120deg, #4c0519, #7f1d1d); }
.accent-pick [data-accent-pick="maroon"] { background: linear-gradient(135deg, #be123c, #7f1d1d); }
.set-quick { margin: 6px 0 14px; }
.set-quick .hub-tool { padding: 10px 12px; }
#setMoreList .more-out { color: var(--red); }

/* ---------- Settings → Appearance: pictures of the light and the dark look ---------- */
.set-row:has(#setThemePick) { flex-direction: column; align-items: stretch; gap: 10px; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-pick button { display: grid; gap: 6px; padding: 8px; border-radius: 16px; border: 2px solid var(--line, #e5e7eb); background: none;
  cursor: pointer; font: inherit; color: var(--text); text-align: center; }
.theme-pick button.on { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.tp-name { font-size: .82rem; font-weight: 600; line-height: 1.25; }
.tp-mock { display: grid; grid-template-rows: 14px 1fr; gap: 5px; height: 92px; padding: 6px; border-radius: 11px; overflow: hidden; }
.tp-mock i { display: block; font-style: normal; }
.tp-bar { border-radius: 5px; background: var(--grad); }
.tp-card { border-radius: 7px; padding: 6px; display: grid; gap: 5px; align-content: start; }
.tp-line { height: 6px; border-radius: 3px; }
.tp-line.short { width: 60%; }
.tp-btn { height: 12px; width: 55%; border-radius: 6px; background: var(--grad); margin-top: 2px; }
.tp-light { background: #eef0fa; } .tp-light .tp-card { background: #fff; } .tp-light .tp-line { background: #d9dcef; }
.tp-dark { background: #121124; } .tp-dark .tp-card { background: #1f1d38; } .tp-dark .tp-line { background: #3b3866; }
.tp-auto { background: linear-gradient(90deg, #eef0fa 50%, #121124 50%); }
.tp-auto .tp-card { background: linear-gradient(90deg, #fff 50%, #1f1d38 50%); }
.tp-auto .tp-line { background: linear-gradient(90deg, #d9dcef 50%, #3b3866 50%); }

/* ---------- goal reached: the happy kid with a cup of coffee + "Yeah!" ---------- */
.celebrate-art { position: relative; width: min(260px, 70vw); margin: -8px auto 4px; }
.celebrate-art img { width: 100%; height: auto; display: block; }
.celebrate-yeah { position: absolute; top: 2%; inset-inline-end: 0; padding: 6px 12px; border-radius: 16px 16px 16px 4px;
  background: #fde047; color: #713f12; font-weight: 800; font-size: 1.15rem; box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  animation: yeahPop .5s cubic-bezier(.2, 1.6, .4, 1) .7s both; }
@keyframes yeahPop { from { transform: scale(0) rotate(-12deg); opacity: 0; } to { transform: scale(1) rotate(-6deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .celebrate-yeah { animation: none; } }

/* two kids: two "Yeah!" bubbles, one for each */
.celebrate-art { width: min(300px, 78vw); }
.celebrate-yeah { inset-inline-end: 12%; top: -4%; }
.celebrate-yeah.two { inset-inline-end: auto; inset-inline-start: 2%; top: 4%; background: #a7f3d0; color: #065f46; border-radius: 16px 16px 4px 16px;
  animation-delay: 1.1s; }
.celebrate-yeah { font-size: 1.05rem; white-space: nowrap; }
/* "beta" language note (e.g. Twi): two lines, a little longer than a normal message */
.toast.beta-note { max-width: min(92vw, 460px); white-space: normal; line-height: 1.4; text-align: start; cursor: pointer; }
.toast.beta-note span { opacity: .8; font-size: .9em; }

/* ---------- Settings: the ☁️ Cloud card ---------- */
.set-cloud { display: flex; align-items: center; gap: 12px; padding: 14px; margin: 6px 0 12px; border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 14%, transparent), color-mix(in srgb, var(--purple) 14%, transparent));
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); }
.set-cloud-ic { font-size: 1.8rem; flex: none; }
.set-cloud-txt { flex: 1; min-width: 0; }
.set-cloud-txt p { margin: 2px 0 0; }
.set-cloud .btn { flex: none; white-space: nowrap; }
@media (max-width: 520px) { .set-cloud { flex-wrap: wrap; } .set-cloud .btn { width: 100%; } }

/* ---------- accent colors come with the Cloud ---------- */
.accent-pick button.lock { position: relative; filter: saturate(.55) brightness(.85); }
.accent-pick button.lock::after { content: "🔒"; position: absolute; inset: auto -4px -4px auto; font-size: .7rem; line-height: 1;
  background: var(--card, #fff); border-radius: 50%; padding: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.accent-lock { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
.accent-lock.flash { animation: lockFlash .6s ease; }
@keyframes lockFlash { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- Settings → Icon style ---------- */
.icon-style-row { flex-direction: column; align-items: stretch; gap: 10px; }
.icon-pick { grid-template-columns: repeat(2, 1fr); }
.ip-sample { display: flex; justify-content: center; align-items: center; gap: 10px; height: 52px; border-radius: 11px; background: var(--soft, #f4f5fb); font-size: 1.35rem; }
.ip-sample.line [data-ic] { --ic-size: 24px; }
.icon-pick button.lock { position: relative; }
.icon-pick button.lock::after { content: "🔒"; position: absolute; top: 6px; inset-inline-end: 8px; font-size: .8rem; }
/* the "Outline" sample always shows outlines, even while the colorful style is on */
.ip-sample.line [data-ic] { font-size: 0 !important; }
.ip-sample.line [data-ic]::before { content: ""; display: inline-block; width: 24px; height: 24px; background-color: var(--primary);
  -webkit-mask: var(--ln) center / contain no-repeat; mask: var(--ln) center / contain no-repeat; }
[data-theme="dark"] .ip-sample.line [data-ic]::before { background-color: var(--tint-text); }
.ip-sample.line [data-ic="📅"] { --ln: var(--ic-calendar); } .ip-sample.line [data-ic="👥"] { --ln: var(--ic-people); } .ip-sample.line [data-ic="📸"] { --ln: var(--ic-camera); }
html[data-icons="line"] body:not(.locked) :is(.dash-ic, .act-ic) { --ic-size: 20px; }

/* Schedule month calendar on wider screens: shorter, tidy day boxes (phones keep square ones) */
@media (min-width: 640px) {
  .pl-mday { aspect-ratio: auto; height: 66px; min-height: 0; padding: 7px 4px 6px; border-radius: 12px; }
  .pl-mnum { font-size: .95rem; }
  .pl-month { gap: 6px; }
}
@media (min-width: 1100px) { .pl-mday { height: 74px; } }

/* ---------- Schedule → Month: the calendar stays open with the chosen day ---------- */
.pl-dayhead { margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--line, #e5e7eb); font-size: 1.05rem;
  scroll-margin-top: calc(var(--nav-h, 56px) + 60px); }
@media (min-width: 1024px) {
  .pl-split.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .pl-split.split .pl-dayhead { margin-top: 0; padding-top: 0; border-top: 0; }
  .pl-split.split #plDayView { border-inline-start: 1px solid var(--line, #e5e7eb); padding-inline-start: 20px; }
  .pl-split.split .pl-mday { height: 58px; }
}

/* ---------- Settings → "With the Cloud": everything supporters get, in one place ---------- */
.set-support { border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); border-radius: 18px; padding: 4px 14px 12px; margin-bottom: 8px;
  background: color-mix(in srgb, var(--primary) 5%, transparent); }
.set-support .set-cloud { margin: 10px -4px 8px; }
.set-support .set-row:last-of-type { border-bottom: 0; }
.sup-perks { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 6px; }
.sup-perks li { display: flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 600; }
.sup-mark::before { content: "🔒"; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: .72rem;
  background: var(--soft, #f4f5fb); }
.set-support.unlocked .sup-mark::before { content: "✓"; background: var(--grad); color: #fff; font-weight: 800; font-size: .8rem; }

/* ---------- Dashboard → Quick add: outline icons + "Device Sync" ---------- */
.dash-quick .btn { display: flex; align-items: center; gap: 8px; }
.dash-quick .qa-ic { --ic-size: 18px; flex: none; }
.dash-quick .qa-sync { grid-column: 1 / -1; border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  background: color-mix(in srgb, var(--primary) 7%, transparent); }
.qa-sync-tag { margin-inline-start: auto; font-size: .75rem; font-weight: 700; color: var(--primary); }
[data-theme="dark"] .qa-sync-tag { color: var(--tint-text); }
.set-support.flash { animation: supFlash 1.6s ease; }
@keyframes supFlash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 45%, transparent); } }

/* ---------- Settings → Device Sync (opens the Cloud part under it) ---------- */
.sync-row .sync-tag { margin-inline-start: auto; font-size: .75rem; font-weight: 700; color: var(--primary); padding-inline-end: 6px; }
[data-theme="dark"] .sync-row .sync-tag { color: var(--tint-text); }
.sync-row .hub-chev { transition: transform .2s ease; }
.sync-row.open .hub-chev { transform: rotate(90deg); }
.sync-wrap > .set-group:first-child { margin-top: 6px; }
#setSyncList { margin-bottom: 8px; }
.sync-wrap { margin-bottom: 14px; }
.qa-sync-tag, .sync-row .sync-tag { display: inline-flex; align-items: center; gap: 4px; }
.qa-sync-tag .tag-ic, .sync-tag .tag-ic { --ic-size: 15px; font-size: .8rem; }
.set-cloud-ic[data-ic] { --ic-size: 34px; }

/* ---------- Supporter: gold ---------- */
:root { --gold: #b7791f; --gold-soft: #f6c453; }
#setSupportHead { color: var(--gold); letter-spacing: .08em; }
[data-theme="dark"] #setSupportHead { color: var(--gold-soft); }
#setSupportHead::before { content: "★"; margin-inline-end: 6px; }
.set-support { border-color: color-mix(in srgb, var(--gold-soft) 70%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--gold-soft) 16%, transparent), color-mix(in srgb, var(--gold-soft) 4%, transparent)); }
[data-theme="dark"] .set-support { border-color: color-mix(in srgb, var(--gold-soft) 45%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--gold-soft) 10%, transparent), color-mix(in srgb, var(--gold-soft) 3%, transparent)); }
.set-support.flash { animation-name: supFlashGold; }
@keyframes supFlashGold { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold-soft) 60%, transparent); } }
.set-support { border: 1.5px solid #f0bf55; }
[data-theme="dark"] .set-support { border-color: color-mix(in srgb, var(--gold-soft) 60%, transparent); }

/* ---------- Weather: Dashboard card + Schedule day ---------- */
.wx-card h2 { margin-bottom: 6px; }
.wx-ic { display: inline-grid; place-items: center; font-size: 1.15rem; line-height: 1; --ic-size: 22px; }
.wx-big { font-size: 2.4rem; --ic-size: 46px; }
.wx-intro { display: flex; align-items: center; gap: 14px; }
.wx-intro h2 { margin: 0 0 2px; }
.wx-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.wx-refresh { font-size: 1.1rem; width: 34px; height: 34px; border-radius: 50%; }
.wx-now { display: flex; align-items: center; gap: 14px; margin: 2px 0 12px; }
.wx-temp { font-size: 2.2rem; font-weight: 800; line-height: 1.05; }
.wx-temp small { font-size: .95rem; font-weight: 700; margin-inline-start: 2px; opacity: .7; }
.wx-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wx-part { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; text-align: center;
  background: color-mix(in srgb, var(--primary) 7%, transparent); }
.wx-pname { font-size: .78rem; font-weight: 700; color: var(--muted, #6b7280); display: grid; }
.wx-pname small { font-weight: 600; font-size: .7rem; opacity: .85; }
.wx-part strong { font-size: 1.1rem; }
.wx-rain { font-size: .74rem; font-weight: 700; color: #2563eb; }
[data-theme="dark"] .wx-rain { color: #7cb4ff; }
.wx-tip { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; padding: 10px 12px; border-radius: 12px; font-weight: 600; font-size: .92rem;
  background: color-mix(in srgb, var(--primary) 9%, transparent); }
.wx-tip .wx-ic { --ic-size: 20px; }
.wx-src { margin: 6px 0 0; }
.wx-chip { display: inline-flex; align-items: center; gap: 5px; margin-inline-start: 10px; padding: 3px 10px; border-radius: 999px; vertical-align: middle;
  font-size: .8rem; font-weight: 700; background: color-mix(in srgb, var(--primary) 10%, transparent); white-space: nowrap; }
.wx-chip .wx-ic { --ic-size: 16px; font-size: .95rem; }
.wx-card .list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wx-card .list-head h2 { margin: 0; }
.wx-refresh { border: 0; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); cursor: pointer; font-weight: 800; }
[data-theme="dark"] .wx-refresh { color: var(--tint-text); }
.trk-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 0; }
.trk-head h2 { margin: 0; }
.trk-head .wx-chip { margin-inline-start: 10px; }
.item .meta .wx-chip { margin-inline-start: 0; }
.trk-head { margin-bottom: 10px; }

/* ---------- Welcome + Supporter popups (supporter.js) ---------- */
.sp-overlay { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 18, 40, .5); }
.sp-sheet { position: relative; width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card, #fff); color: var(--ink, #1f1b3a); border-radius: 24px 24px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.25);
  animation: spUp .28s ease; }
@keyframes spUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) {
  .sp-overlay { align-items: center; }
  .sp-sheet { border-radius: 24px; max-height: 88vh; padding-bottom: 20px; }
}
body.sp-open { overflow: hidden; }
.sp-handle { display: block; width: 40px; height: 4px; border-radius: 3px; background: color-mix(in srgb, var(--ink, #222) 18%, transparent); margin: 2px auto 12px; }
.sp-close { position: absolute; top: 10px; inset-inline-end: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: color-mix(in srgb, var(--ink, #222) 8%, transparent); color: inherit; cursor: pointer; font-size: .9rem; z-index: 1; }
.sp-box { border: 1.5px solid; border-radius: 16px; padding: 12px; margin-top: 12px; }
#spBody > .sp-box:first-child, .pw-support > .sp-box:first-child { margin-top: 0; }
.sp-label { margin: 0 0 8px; font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.sp-note { border-color: #afa9ec; background: #f6f5fe; }
.sp-note .sp-label { color: #534ab7; }
.sp-paper { background: #fff; border-radius: 11px; padding: 12px 13px; color: #26215c; line-height: 1.6; font-size: .95rem; }
.sp-paper p { margin: 0 0 9px; }
.sp-paper p:last-child { margin-bottom: 0; }
.sp-sign { font-family: Georgia, "Times New Roman", serif; font-style: italic; color: #534ab7; text-align: end; font-size: 1.12rem; margin-top: 10px !important; }
.sp-sign-center { text-align: center; margin: 10px 0 0; }
.sp-gold { border-color: #ef9f27; background: #fdf6e9; color: #633806; }
.sp-gold .sp-label { color: #ba7517; }
.sp-sub { margin: 0 0 7px; font-weight: 700; font-size: .85rem; }
.sp-perks { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px 8px; }
.sp-perks li { display: flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 600; }
.sp-perk-ic { width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; background: #fff;
  border: 1px solid #fac775; font-size: .9rem; --ic-size: 16px; --ic-color: #ba7517; }
.sp-choose { margin: 0 0 8px; font-size: .85rem; color: #854f0b; }
.sp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sp-opt { border: 1px solid #e3ddcf; border-radius: 12px; padding: 8px 4px; background: #fff; color: #2c2c2a; cursor: pointer; text-align: center; font: inherit; }
.sp-opt b { display: block; font-size: .95rem; }
.sp-opt span { display: block; font-size: .7rem; color: #888780; }
.sp-opt.on { border: 2px solid #ba7517; background: #faeeda; color: #633806; }
.sp-opt.on span { color: #854f0b; }
.sp-more { display: block; margin: 8px auto 0; border: 0; background: none; color: #854f0b; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; }
.sp-sum { margin-top: 12px; background: #fff; border: 1px solid #fac775; border-radius: 12px; padding: 10px; text-align: center; display: grid; gap: 2px; }
.sp-sum strong { font-size: 1.3rem; color: #633806; }
.sp-sum span { font-size: .82rem; color: #854f0b; }
.sp-cta, .sp-wide { width: 100%; margin-top: 10px; }
.sp-fine { margin: 6px 0 0; font-size: .74rem; text-align: center; color: #854f0b; }
.sp-msg { margin: 8px 0 0; text-align: center; }
.sp-coral { border-color: #f0997b; background: #fdf5f1; color: #712b13; padding: 0; overflow: hidden; }
.sp-tip-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: start; }
.sp-gift { width: 34px; height: 34px; border-radius: 10px; background: #fff; border: 1px solid #f5c4b3; display: grid; place-items: center; flex: none; }
.sp-gift svg { width: 19px; height: 19px; fill: none; stroke: #d85a30; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sp-tip-words { flex: 1; display: grid; }
.sp-tip-words strong { font-size: .92rem; }
.sp-tip-words small { font-size: .76rem; color: #993c1d; }
.sp-chev { color: #993c1d; font-size: 1.1rem; }
.sp-tip-body { padding: 0 12px 12px; }
.sp-tip-text { margin: 0 0 10px; font-size: .86rem; line-height: 1.5; }
.sp-tips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.sp-tip { border: 1px solid #f5c4b3; border-radius: 12px; padding: 10px 2px; background: #fff; color: #712b13; font: inherit; font-weight: 700; font-size: .8rem; cursor: pointer; }
.sp-tip.on { border: 2px solid #d85a30; background: #faece7; }
.sp-tip-cta { width: 100%; margin-top: 10px; background: #d85a30; color: #fff; border: 0; }
.sp-tip-cta:hover { background: #c24e27; }
.sp-thanks { text-align: center; padding: 4px 2px; }
.sp-thanks p { margin: 0 0 8px; line-height: 1.55; font-size: .9rem; }
.sp-thanks-title { font-size: 1.1rem !important; font-weight: 800; }
.sp-thanks .sp-sign { text-align: center; color: #993c1d; }
.sp-gray { border-color: #d3d1c7; background: #f8f7f4; color: #444441; }
.sp-gray .sp-label { color: #5f5e5a; }
.sp-fb { display: flex; align-items: center; gap: 10px; }
.sp-fb p { margin: 0; flex: 1; font-size: .86rem; line-height: 1.4; }
.sp-later { display: block; margin: 14px auto 0; }
.wl-top { text-align: center; margin-bottom: 14px; }
.wl-done { display: inline-flex; gap: 6px; align-items: center; background: #eaf3de; color: #27500a; border-radius: 999px; padding: 5px 12px; font-size: .8rem; font-weight: 700; }
.wl-avatar { display: grid; place-items: center; width: 62px; height: 62px; margin: 14px auto 8px; border-radius: 50%; background: #eeedfe; color: #3c3489; border: 2px solid #afa9ec; font-weight: 800; font-size: 1.25rem; }
.wl-top h2 { margin: 0; font-size: 1.2rem; }
.wl-hi { font-size: 1.05rem; font-weight: 800; color: #3c3489; }
[data-theme="dark"] .sp-note { border-color: #3c3489; background: #1e1b33; }
[data-theme="dark"] .sp-note .sp-label { color: #afa9ec; }
[data-theme="dark"] .sp-paper { background: #26233a; color: #e8e6f5; }
[data-theme="dark"] .sp-sign { color: #cecbf6; }
[data-theme="dark"] .wl-hi { color: #cecbf6; }
[data-theme="dark"] .sp-gold { border-color: #854f0b; background: #231a0c; color: #fac775; }
[data-theme="dark"] .sp-gold .sp-label, [data-theme="dark"] .sp-choose, [data-theme="dark"] .sp-more { color: #fac775; }
[data-theme="dark"] .sp-perk-ic { background: #412402; border-color: #854f0b; --ic-color: #fac775; }
[data-theme="dark"] .sp-opt { background: #2a2838; border-color: #444441; color: #e8e6f5; }
[data-theme="dark"] .sp-opt span { color: #b4b2a9; }
[data-theme="dark"] .sp-opt.on { background: #412402; border-color: #ef9f27; color: #fac775; }
[data-theme="dark"] .sp-opt.on span { color: #fac775; }
[data-theme="dark"] .sp-sum { background: #2a1e0c; border-color: #854f0b; }
[data-theme="dark"] .sp-sum strong { color: #fac775; }
[data-theme="dark"] .sp-sum span, [data-theme="dark"] .sp-gold .sp-fine { color: #ef9f27; }
[data-theme="dark"] .sp-coral { border-color: #993c1d; background: #24140f; color: #f5c4b3; }
[data-theme="dark"] .sp-gift { background: #4a1b0c; border-color: #993c1d; }
[data-theme="dark"] .sp-gift svg { stroke: #f0997b; }
[data-theme="dark"] .sp-tip-words small, [data-theme="dark"] .sp-chev, [data-theme="dark"] .sp-coral .sp-fine, [data-theme="dark"] .sp-thanks .sp-sign { color: #f0997b; }
[data-theme="dark"] .sp-tip { background: #2a1a14; border-color: #993c1d; color: #f5c4b3; }
[data-theme="dark"] .sp-tip.on { background: #4a1b0c; border-color: #f0997b; }
[data-theme="dark"] .sp-gray { border-color: #444441; background: #1f1e24; color: #d3d1c7; }
[data-theme="dark"] .sp-gray .sp-label { color: #b4b2a9; }
[data-theme="dark"] .wl-done { background: #173404; color: #c0dd97; }
[data-theme="dark"] .wl-avatar { background: #26215c; color: #cecbf6; border-color: #534ab7; }
/* the Cloud payment page uses the Supporter part instead of the old monthly/yearly card */
#paywall.sp-pay .price-block, #paywall.sp-pay .price-list, #paywall.sp-pay #pwSubscribe, #paywall.sp-pay .pay-note { display: none; }
.pw-support { text-align: start; margin: 10px 0 6px; }
#paywall:not(.sp-pay) .pw-support { display: none; }
/* home page price card: yearly only now */
.price-block .plan-toggle { display: none; }
.sp-close { top: 4px; width: 30px; height: 30px; }
#supportModal .sp-handle { margin-bottom: 16px; }
#spBody { margin-top: 18px; }
.sp-opt span { white-space: nowrap; }
.sp-lbl-ic { --ic-size: 14px; --ic-color: currentColor; font-size: .8rem; }
.sp-perk-ic svg { width: 16px; height: 16px; fill: none; stroke: #ba7517; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .sp-perk-ic svg { stroke: #fac775; }
.sp-opt span { white-space: normal; line-height: 1.25; }
.pw-support .sp-opt b { font-size: .88rem; }
.sp-overlay { z-index: 9000; }
/* price chips: "US$9.98 a year" (the year is always said) */
.sp-opt b { font-size: .86rem; line-height: 1.25; }
.sp-opt { padding: 8px 3px; }
.pw-support .sp-opt b { font-size: .8rem; }
.sp-opt b { font-size: .95rem; }
.pw-support .sp-opt b { font-size: .88rem; }
.sp-opt i { display: block; font-style: normal; font-weight: 700; font-size: .74rem; color: #854f0b; margin: 1px 0 2px; }
.sp-opt.on i { color: #633806; }
[data-theme="dark"] .sp-opt i { color: #ef9f27; }
[data-theme="dark"] .sp-opt.on i { color: #fac775; }
.sp-opt b { white-space: nowrap; font-size: .9rem; }
.sp-opt b small { font-size: .72rem; font-weight: 700; margin-inline-start: 1px; }
.pw-support .sp-opt b { font-size: .82rem; }
/* Settings: the Import button (a label for the file picker) centered like the others */
.set-row label.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; }
@media (max-width: 640px) { .set-row label.btn { width: 100%; } }

/* ---------- Share MyServiceTime (QR code) ---------- */
.share-sheet { text-align: center; max-width: 400px; }
.sh-title { margin: 6px 40px 4px; font-size: 1.2rem; }
.sh-sub { margin: 0 8px 14px; font-size: .9rem; }
.sh-qr { width: min(260px, 72vw); aspect-ratio: 1; margin: 0 auto; padding: 10px; border-radius: 18px; background: #fff;
  border: 1.5px solid #afa9ec; display: grid; place-items: center; color: #444; font-size: .85rem; }
.sh-qr svg { width: 100%; height: 100%; display: block; }
.sh-link { margin: 12px 0 14px; font-weight: 700; color: var(--primary); word-break: break-all; }
[data-theme="dark"] .sh-link { color: var(--tint-text); }
.sh-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sh-msg { margin: 10px 0 0; min-height: 1.2em; }

/* ---------- Settings → Appearance: more choices (theme.js sets data-* on <html>) ---------- */
.seg-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: min(100%, 260px); }
.seg-pick.seg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.seg-pick button { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 46px; padding: 8px 6px; border-radius: 14px;
  border: 2px solid var(--line, #e5e7eb); background: none; color: inherit; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.seg-pick button.on { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); color: var(--primary); }
[data-theme="dark"] .seg-pick button.on { color: var(--tint-text, #c4b5fd); }
.ts-a { line-height: 1; font-weight: 800; }
.ts-s { font-size: 13px; } .ts-m { font-size: 16px; } .ts-l { font-size: 20px; } .ts-xl { font-size: 24px; }
.fn-a { font-size: 18px; line-height: 1; }
.fn-std { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.fn-classic { font-family: Georgia, "Noto Serif", "Times New Roman", serif; }
.cn-box { width: 26px; height: 18px; border: 2.5px solid currentColor; display: block; }
.cn-round { border-radius: 8px; } .cn-square { border-radius: 2px; }
@media (min-width: 700px) { .look-row { align-items: center; } }

/* text size: everything is sized in rem, so the root size scales the whole app */
html[data-textsize="s"] { font-size: 14.5px; }
html[data-textsize="l"] { font-size: 18px; }
html[data-textsize="xl"] { font-size: 20px; }
/* spacing */
html[data-density="compact"] .card { padding: 14px 16px; }
html[data-density="compact"] .card + .card, html[data-density="compact"] .page > * + * { margin-top: 10px; }
html[data-density="compact"] .set-row { padding-block: 8px; }
html[data-density="compact"] .hub-tool { padding-block: 8px; }
html[data-density="compact"] .item, html[data-density="compact"] .dash-item { padding-block: 8px; }
html[data-density="compact"] .btn { padding-block: 8px; }
html[data-density="compact"] .dash-stats, html[data-density="compact"] .dash-grid { gap: 10px; }
/* corners */
html[data-corners="square"] { --radius: 6px; }
html[data-corners="square"] :is(.card, .btn, input, select, textarea, .hub-tool, .stat, .stat-card, .dash-item, .item, .sp-box, .sp-sheet,
  .sp-opt, .sp-tip, .sp-paper, .seg-pick button, .theme-pick button, .wx-part, .wx-tip, .wx-chip, .tools-bar, .tools-bar button, .app-nav button,
  .modal-box, .alarm-box, .tag, .sh-qr) { border-radius: 6px !important; }
/* font */
html[data-font="classic"] body, html[data-font="classic"] :is(button, input, select, textarea) { font-family: Georgia, "Noto Serif", "Times New Roman", serif; }
/* bold text */
html[data-bold="on"] body { font-weight: 600; }
html[data-bold="on"] :is(p, li, span, label, input, select, textarea, .muted, .small-text) { font-weight: 600; }
/* animations off */
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important; }
/* Text size: a Supporter extra */
.seg-pick button.lock { position: relative; opacity: .6; }
.seg-pick button.lock::after { content: "🔒"; position: absolute; top: 3px; inset-inline-end: 5px; font-size: .62rem; line-height: 1; }
.lk-lock { margin-top: 4px; }
.sp-perks li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.lk-lock-all { margin: 14px 0 2px; padding: 9px 12px; border-radius: 12px; font-size: .86rem; font-weight: 600;
  background: #fdf6e9; border: 1px solid #fac775; color: #854f0b; }
[data-theme="dark"] .lk-lock-all { background: #231a0c; border-color: #854f0b; color: #fac775; }

/* Event icons: outline drawings with the outline icon style, the colorful ones with "Colorful icons" */
.ev-svg .ev-line { display: none; }
.ev-svg .ev-line { fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .ev-svg .ev-line { stroke: var(--tint-text, #c4b5fd); }
html[data-icons="line"] .ev-svg .ev-col { display: none; }
html[data-icons="line"] .ev-svg .ev-line { display: inline; }
/* small outline icons inside list rows (date, place) */
.mi { --ic-size: 15px; --ic-color: currentColor; display: inline-grid; place-items: center; vertical-align: -2px; }

/* "Are you sure?" box */
.sure-overlay { z-index: 9500; align-items: center; padding: 16px; }
.sure-sheet { max-width: 360px; border-radius: 22px; text-align: center; padding: 22px 20px 18px; }
.sure-ic { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: #fee2e2; }
.sure-ic svg { width: 26px; height: 26px; fill: none; stroke: #dc2626; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .sure-ic { background: #3b1219; }
[data-theme="dark"] .sure-ic svg { stroke: #f87171; }
.sure-sheet h2 { margin: 0 0 6px; font-size: 1.2rem; }
.sure-sheet p { margin: 0 0 6px; word-break: break-word; }
.sure-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.sure-yes { background: #dc2626; color: #fff; border: 0; }
.sure-yes:hover { background: #b91c1c; }
.sure-actions .btn.sure-yes, [data-theme="dark"] .sure-actions .btn.sure-yes { background: #dc2626 !important; color: #fff !important; border: 0 !important; }
.sure-actions .btn.sure-yes:hover { background: #b91c1c !important; }

/* Phones and tablets: typing boxes are at least 16px. Smaller than that and the phone (every iPhone) zooms the
   whole screen in when a box is tapped, and the page stays cut off on the side. The rest of the text keeps its size. */
@media (hover: none) and (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea { font-size: max(16px, 1em) !important; }
}

/* Phones: the language picker in the top bar is just the 🌐 button (tapping it opens the same list of languages),
   so "Start Reminders" has room for its whole name in every language. Settings still shows the language by name. */
@media (max-width: 600px) {
  .top-actions .lang-pick {
    position: relative; flex: none; width: 40px; height: 40px; padding: 0; gap: 0;
    justify-content: center; font-size: 1.2rem; line-height: 1;
  }
  [dir="rtl"] .top-actions .lang-pick { padding: 0; }
  .top-actions .lang-pick select {
    position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; padding: 0;
    opacity: 0; cursor: pointer;
  }
  .top-actions .lang-pick:focus-within { outline: 2px solid #fff; outline-offset: 2px; }
  .top-actions .btn-start { padding: 9px 12px; }
}
@media (max-width: 370px) { /* the narrowest phones: a little tighter, so every language still fits */
  .top-actions { gap: 4px; }
  .top-actions .btn-start { padding: 9px 8px; font-size: .85rem; }
}

/* Paying inside the phone apps: store prices (other countries), "Restore purchases" */
.sp-iap-wait { margin: 10px 0; color: var(--muted); text-align: center; }
.sp-restore { display: block; margin: 8px auto 0; font-size: .9rem; }

/* ---------- App lock (lock.js) ---------- */
html.app-locked body > *:not(#lockScreen):not(#sureModal) { visibility: hidden !important; }
html.app-locked body { overflow: hidden; }
.lk-screen { position: fixed; inset: 0; z-index: 9400; display: grid; place-items: center; overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(120% 80% at 50% 0%, rgba(124, 58, 237, .28), transparent 60%), var(--bg, #12112a); color: var(--text); }
.lk-screen[hidden] { display: none; }
.lk-card { width: 100%; max-width: 340px; text-align: center; }
.lk-logo { width: 64px; height: 64px; border-radius: 18px; box-shadow: 0 10px 30px rgba(124, 58, 237, .35); }
.lk-title { margin: 16px 0 4px; font-size: 1.3rem; }
.lk-text { margin: 0 0 4px; color: var(--muted); line-height: 1.45; }
.lk-hint { margin: 0; font-size: .85rem; color: var(--muted); }
.lk-dots { display: flex; justify-content: center; gap: 14px; margin: 22px 0 8px; }
.lk-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--primary, #7c3aed); transition: background .12s; }
.lk-dots i.on { background: var(--primary, #7c3aed); }
.lk-dots.shake { animation: lk-shake .35s; }
@keyframes lk-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.lk-msg { min-height: 1.4em; margin: 0 0 10px; font-size: .9rem; color: var(--muted); }
.lk-msg.bad { color: #ef4444; }
.lk-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 22px; justify-content: center; margin: 4px 0 14px; }
.lk-pad.off { opacity: .4; pointer-events: none; }
.lk-key { width: 76px; height: 76px; border-radius: 50%; border: 0; font: inherit; font-size: 1.7rem; font-weight: 600; cursor: pointer;
  color: var(--text); background: rgba(124, 58, 237, .12); display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.lk-key:active { background: rgba(124, 58, 237, .32); transform: scale(.96); }
.lk-key-ic { background: transparent; }
.lk-key-ic svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lk-key-none { background: none; cursor: default; }
.lk-link { display: block; margin: 6px auto 0; font-size: .95rem; }
.lk-wide { width: 100%; margin-top: 18px; }
.lk-erase { background: #dc2626 !important; color: #fff !important; border: 0; }
[data-theme="light"] .lk-screen { background: radial-gradient(120% 80% at 50% 0%, rgba(124, 58, 237, .14), transparent 60%), var(--bg, #f6f5ff); }
@media (max-height: 640px) { .lk-key { width: 64px; height: 64px; font-size: 1.45rem; } .lk-pad { grid-template-columns: repeat(3, 64px); gap: 10px 20px; } .lk-logo { width: 52px; height: 52px; } }
/* Settings → "Security" row: On / Off, and the highlight when it opens */
.hub-tool .hub-state { margin-inline-start: auto; font-size: .78rem; font-weight: 700; color: var(--primary); padding-inline-end: 6px; }
[data-theme="dark"] .hub-tool .hub-state { color: var(--tint-text); }
#setSecurity.flash { animation: supFlash 1.6s ease; border-radius: 14px; }

/* ---------- What's new + Rate (whatsnew.js) ---------- */
.wn-overlay { z-index: 9100; }
.wn-sheet { max-width: 460px; }
.wn-head { display: flex; align-items: center; gap: 12px; margin: 4px 36px 14px 0; }
.wn-head h2 { margin: 0; font-size: 1.3rem; }
.wn-head p { margin: 2px 0 0; }
.wn-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: rgba(124, 58, 237, .14); --ic-size: 26px; }
.wn-latest { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; font-weight: 600; color: #15803d; background: rgba(34, 197, 94, .12); }
[data-theme="dark"] .wn-latest { color: #86efac; }
.wn-update { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding: 12px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .14), rgba(124, 58, 237, .18)); }
.wn-update p { margin: 0; font-weight: 600; }
.wn-rel { padding: 12px 0; border-top: 1px solid var(--border, rgba(127, 127, 127, .2)); }
.wn-rel h3 { margin: 0 0 6px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.wn-rel ul { margin: 0; padding-inline-start: 20px; }
.wn-rel li { margin: 6px 0; line-height: 1.45; }
.wn-badge { font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; padding: 2px 8px; border-radius: 999px; background: var(--grad, #7c3aed); }
.wn-done { width: 100%; margin-top: 8px; }
.hub-tool .hub-state.wn-dot { color: #fff; background: var(--grad, #7c3aed); border-radius: 999px; padding: 2px 9px; margin-inline-end: 6px; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.toast.toast-link { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rate-sheet { max-width: 360px; text-align: center; }
.rate-stars { font-size: 2rem; letter-spacing: 4px; color: #f59e0b; }
.rate-sheet h2 { margin: 6px 0; }
.rate-btn { display: block; width: 100%; margin: 10px 0 0; text-decoration: none; }
.rate-soon { margin: 12px 0 4px; padding: 12px; border-radius: 12px; background: rgba(124, 58, 237, .12); line-height: 1.45; }

/* ---------- 🔔 Notifications (notices.js) ---------- */
.brand { min-width: 0; }
.bell-btn { position: relative; margin-inline-start: auto; flex: none; width: 42px; height: 42px; border-radius: 12px; border: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 1.25rem; color: #fff; background: rgba(255, 255, 255, .16); --ic-size: 22px; --ic-color: #fff; }
.bell-btn:hover { background: rgba(255, 255, 255, .26); }
.bell-btn .bell-ic { display: grid; place-items: center; }
html[data-icons="line"] body:not(.locked) .bell-btn .bell-ic { --ic-color: #fff; }
.bell-count { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; box-sizing: border-box;
  font-size: .72rem; font-weight: 800; line-height: 20px; text-align: center; color: #fff; background: #ef4444; box-shadow: 0 0 0 2px #4c1d95; }
.bell-count[hidden] { display: none; }
.nt-wrap { position: fixed; inset: 0; z-index: 8800; background: rgba(10, 8, 30, .35); }
.nt-wrap[hidden] { display: none; }
.nt-panel { position: absolute; top: max(64px, calc(env(safe-area-inset-top) + 56px)); inset-inline-end: 12px; width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 560px); overflow-y: auto; border-radius: 20px; background: var(--card, #1c1b30); color: var(--text);
  box-shadow: 0 24px 60px rgba(10, 8, 30, .45); outline: none; animation: nt-in .18s ease-out; }
@keyframes nt-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.nt-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 18px; background: inherit;
  border-bottom: 1px solid var(--border, rgba(127, 127, 127, .2)); }
.nt-head h2 { margin: 0; font-size: 1.1rem; margin-inline-end: auto; }
.nt-head .link-btn { font-size: .85rem; }
.nt-x { width: 32px; height: 32px; border-radius: 50%; }
.nt-list { list-style: none; margin: 0; padding: 6px; }
.nt-item { width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 0; border-radius: 14px; background: none; color: inherit;
  font: inherit; text-align: start; cursor: pointer; }
.nt-item:hover { background: rgba(124, 58, 237, .08); }
.nt-item.unread { background: rgba(124, 58, 237, .1); }
.nt-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem; background: rgba(124, 58, 237, .14); --ic-size: 20px; }
.nt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nt-body strong { font-size: .95rem; }
.nt-item:not(.unread) .nt-body strong { font-weight: 600; }
.nt-body span { font-size: .88rem; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
.nt-body small { font-size: .78rem; color: var(--muted); }
.nt-dot { flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--primary, #7c3aed); }
.nt-empty { margin: 0; padding: 30px 20px; text-align: center; color: var(--muted); line-height: 1.5; }
.nt-empty span { display: block; margin: 0 auto 8px; font-size: 1.6rem; --ic-size: 30px; }
@media (max-width: 600px) { .bell-btn { width: 40px; height: 40px; } .nt-panel { inset-inline: 10px; width: auto; } }
/* The notifications button: a ✨ in a soft tile, like the icons in the Settings list (and the accent color) */
.bell-btn { width: 44px; height: 44px; border-radius: 12px; background: var(--tint, #2b2750); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset; }
.bell-btn:hover { background: var(--tint, #2b2750); filter: brightness(1.12); }
html[data-icons="line"] body:not(.locked) .bell-btn .bell-ic { --ic-color: var(--tint-text, #c4b5fd); --ic-size: 24px; }
@media (max-width: 600px) { .bell-btn { width: 42px; height: 42px; } }

/* ---------- App info, and the Privacy Policy / Terms inside the app (appinfo.js) ---------- */
.ai-sheet { max-width: 420px; text-align: center; }
.ai-top img { width: 76px; height: 76px; border-radius: 20px; margin-top: 6px; box-shadow: 0 10px 26px rgba(76, 29, 149, .35); }
.ai-top h2 { margin: 12px 0 2px; font-size: 1.35rem; }
.ai-top p { margin: 0; }
.ai-box { margin: 16px 0 12px; border-radius: 16px; background: var(--soft, rgba(124, 58, 237, .08)); text-align: start; }
.ai-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border, rgba(127, 127, 127, .18)); }
.ai-row:last-child { border-bottom: 0; }
.ai-row span { color: var(--muted); }
.ai-from { margin: 0 6px 14px; line-height: 1.5; font-style: italic; color: var(--muted); }
.ai-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ai-btns .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; --ic-size: 18px; }
.ai-legal { margin: 14px 0 6px; }
.ai-credits { margin: 8px 0 0; text-align: start; border-radius: 14px; padding: 10px 14px; background: var(--soft, rgba(124, 58, 237, .08)); }
.ai-credits summary { cursor: pointer; font-weight: 600; }
.ai-credits ul { margin: 8px 0 2px; padding-inline-start: 18px; }
.ai-credits li { margin: 5px 0; } .ai-credits small { color: var(--muted); }
.ai-copy { margin: 14px 0 0; font-size: .85rem; color: var(--muted); }
.legal-overlay { position: fixed; inset: 0; z-index: 9200; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom)); background: rgba(10, 8, 30, .55); }
.legal-frame { width: 100%; max-width: 760px; height: 100%; max-height: 900px; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: var(--card, #1c1b30); box-shadow: 0 24px 60px rgba(10, 8, 30, .5); }
.legal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--border, rgba(127, 127, 127, .2)); }
.legal-head .icon-btn { width: 34px; height: 34px; border-radius: 50%; }
.legal-frame iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.ai-legal { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 10px; } .ai-legal .link-btn { white-space: nowrap; } .ai-legal span { color: var(--muted); }
#aiModal .ai-legal .link-btn { display: inline-block; width: auto; margin: 0; padding: 4px 2px; }
.ai-h { margin: 6px 4px 6px; text-align: start; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ai-total strong { font-size: 1.05rem; } .ai-total span { color: var(--text) !important; font-weight: 700; }
.ai-note { margin: -4px 6px 12px; font-size: .85rem; line-height: 1.45; color: var(--muted); text-align: start; }
/* Settings → Security, in its own window */
.sec-sheet { max-width: 460px; }
.sec-head { display: flex; align-items: center; gap: 12px; margin: 2px 40px 8px 0; }
.sec-head h2 { margin: 0; font-size: 1.25rem; }
.sec-sheet .set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border, rgba(127, 127, 127, .18)); }
.sec-sheet .set-row:last-child { border-bottom: 0; }
.sec-sheet .set-row p { margin: 4px 0 0; }
.sec-sheet .set-row select { max-width: 48%; }
/* the Security window: text on the left, its switch / choice on the right (also on phones) */
.sec-sheet .set-row { flex-direction: row !important; align-items: center !important; text-align: start; }
.sec-sheet .set-row > div:first-child { flex: 1; }
.sec-sheet .set-row .check { flex: none; margin: 0; white-space: nowrap; }
.sec-sheet .set-row select { flex: none; width: auto; max-width: 46%; }
.sec-sheet .set-row .btn { flex: none; width: auto; }
#alBioRow.off strong, #alBioRow.off .check { opacity: .55; } #alBioRow.off .check input { cursor: not-allowed; }
/* Home: "Become a Supporter" (pages.js → renderDashboard) */
.home-sup { width: 100%; display: flex; align-items: center; gap: 14px; margin: 14px 0; padding: 14px 16px; border-radius: 18px; cursor: pointer; text-align: start;
  font: inherit; border: 1px solid #ef9f27; background: linear-gradient(135deg, #fdf6e9, #fbe8c6); color: #633806; box-shadow: 0 6px 18px rgba(239, 159, 39, .18); }
.home-sup[hidden] { display: none; }
.home-sup:hover { filter: brightness(1.03); }
.home-sup-ic { flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: #ef9f27; }
.home-sup-ic svg { width: 24px; height: 24px; fill: #fff; }
.home-sup-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-sup-txt strong { font-size: 1.02rem; }
.home-sup-txt span { font-size: .88rem; opacity: .85; line-height: 1.4; }
.home-sup-go { flex: none; font-size: 1.6rem; line-height: 1; opacity: .7; }
[data-theme="dark"] .home-sup { border-color: #854f0b; background: linear-gradient(135deg, #231a0c, #33240d); color: #fac775; box-shadow: none; }
[data-theme="dark"] .home-sup-ic { background: #ba7517; }
/* Settings → "Become a Supporter" row (gold, like the Home card) */
.hub-tool.sup-row { border: 1px solid #ef9f27; background: linear-gradient(135deg, #fdf6e9, #fbe8c6); color: #633806; }
.hub-tool.sup-row .hub-name { font-weight: 700; }
.hub-tool.sup-row .sup-ic { background: #ef9f27; }
.hub-tool.sup-row .sup-ic svg { width: 20px; height: 20px; fill: #fff; }
[data-theme="dark"] .hub-tool.sup-row { border-color: #854f0b; background: linear-gradient(135deg, #231a0c, #33240d); color: #fac775; }
[data-theme="dark"] .hub-tool.sup-row .sup-ic { background: #ba7517; }

/* ---------- Territories (territories.js) ---------- */
.tr-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.tr-item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; cursor: pointer; text-align: start; font: inherit; color: inherit;
  border: 1px solid var(--border, rgba(127, 127, 127, .2)); background: var(--soft, rgba(124, 58, 237, .06)); }
.tr-item:hover { border-color: var(--primary); }
.tr-item.done { opacity: .72; }
.tr-num { flex: none; min-width: 48px; height: 48px; padding: 0 8px; box-sizing: border-box; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.15rem; font-weight: 800; color: #fff; background: var(--grad, #7c3aed); }
.tr-item.done .tr-num { background: #64748b; }
.tr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tr-body strong { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-body small { color: var(--muted); font-size: .84rem; }
.tr-chips { display: flex; gap: 6px; margin-top: 2px; --ic-size: 16px; }
.tr-chip { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: .85rem; background: var(--tint, rgba(124, 58, 237, .14)); }
.tr-thumb { flex: none; width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.tr-box { max-width: 560px; }
.tr-fields { display: grid; grid-template-columns: 1fr 2fr; gap: 10px 12px; }
.tr-fields label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 600; }
.tr-fields label em { font-style: normal; font-weight: 400; }
.tr-fields .tr-f-notes { grid-column: 1 / -1; }
.tr-fields input, .tr-fields textarea { width: 100%; box-sizing: border-box; }
@media (max-width: 480px) { .tr-fields { grid-template-columns: 1fr 1fr; } .tr-fields .tr-f-name { grid-column: 1 / -1; order: -1; } .tr-fields .tr-f-num { order: -2; grid-column: 1 / -1; } }
.tr-map-h { margin: 16px 0 8px; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tr-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tr-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; cursor: pointer; font: inherit; font-size: .92rem; font-weight: 600; text-align: start;
  color: inherit; border: 1px solid var(--border, rgba(127, 127, 127, .25)); background: var(--card, transparent); }
.tr-opt:hover { border-color: var(--primary); }
.tr-opt:first-child { grid-column: 1 / -1; }
.tr-opt-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1rem; background: var(--tint, rgba(124, 58, 237, .14)); --ic-size: 19px; }
.tr-linkbox { display: flex; gap: 8px; margin-top: 10px; }
.tr-linkbox input { flex: 1; min-width: 0; }
.tr-have { display: grid; gap: 8px; margin-top: 6px; }
.tr-have:empty { display: none; }
.tr-have-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--soft, rgba(124, 58, 237, .07)); }
.tr-have-txt { flex: 1; min-width: 0; font-weight: 600; font-size: .92rem; }
.tr-have-btns { display: flex; flex-wrap: wrap; gap: 2px 10px; justify-content: flex-end; }
.tr-have-btns .link-btn { display: inline; width: auto; margin: 0; font-size: .88rem; }
.tr-have-img { flex: none; width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.tr-mini { height: 170px; margin-top: 10px; border-radius: 14px; overflow: hidden; }
.tr-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.tr-map-wrap { position: fixed; inset: 0; z-index: 9300; display: grid; place-items: center; padding: max(10px, env(safe-area-inset-top)) 8px max(10px, env(safe-area-inset-bottom)); background: rgba(10, 8, 30, .6); }
.tr-map-box { width: 100%; max-width: 820px; height: 100%; max-height: 880px; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: var(--card, #1c1b30); color: var(--text); }
.tr-map-head { padding: 12px 16px 8px; } .tr-map-head p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.tr-map-el { flex: 1; min-height: 240px; }
.tr-map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border, rgba(127, 127, 127, .2)); --ic-size: 16px; }
.tr-map-tools .btn { display: inline-flex; align-items: center; gap: 6px; }
.tr-map-box .addr-msg { margin: 0 14px 8px; }
.tr-map-box .addr-msg:empty { display: none; }
.tr-photo-view { position: fixed; inset: 0; z-index: 9600; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .88); }
.tr-photo-view img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.tr-photo-view .icon-btn { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 40px; height: 40px; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .18); }
/* Territories: nothing wider than the phone (date boxes have a wide built-in size), and the map's buttons on one line */
.tr-box { box-sizing: border-box; width: 100%; overflow-x: hidden; }
.tr-fields > label { min-width: 0; }
.tr-fields input, .tr-fields textarea, .tr-fields input[type=date] { min-width: 0; max-width: 100%; }
.tr-opt { min-width: 0; } .tr-opt span:last-child { min-width: 0; }
.tr-map-head { display: flex; align-items: flex-start; gap: 10px; } .tr-map-head > div { flex: 1; min-width: 0; }
.tr-map-x { flex: none; width: 36px; height: 36px; border-radius: 50%; }
.tr-map-tools { flex-wrap: nowrap; }
.tr-map-tools .btn.small { padding-inline: 10px; }
@media (max-width: 400px) { .tr-map-tools { gap: 6px; padding-inline: 10px; } .tr-map-tools .btn.small { padding-inline: 8px; font-size: .82rem; } }
/* App lock: choose how it unlocks — Face ID / fingerprint or a passcode (Settings → Security and the lock screen) */
.sec-block { padding: 14px 0; border-bottom: 1px solid var(--border, rgba(127, 127, 127, .18)); }
.sec-block > strong { display: block; margin-bottom: 10px; }
.sec-block p { margin: 10px 0 0; }
.al-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.al-opt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px 14px; border-radius: 16px; cursor: pointer;
  border: 2px solid var(--border, rgba(127, 127, 127, .25)); background: var(--card, rgba(127, 127, 127, .06)); color: inherit; font: inherit; font-weight: 600; text-align: center; }
.al-opt:disabled { opacity: .45; cursor: not-allowed; }
.al-opt.on { border-color: var(--primary, #7c3aed); background: rgba(124, 58, 237, .14); }
.al-opt.on::after { content: "\2713"; position: absolute; top: 8px; inset-inline-end: 10px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary, #7c3aed); color: #fff; font-size: .75rem; }
.al-opt-ic svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.al-opt-ic svg circle { fill: currentColor; stroke: none; }
.al-opt.on .al-opt-ic { color: var(--primary, #7c3aed); }
[data-theme="dark"] .al-opt.on .al-opt-ic { color: #c4b5fd; }
.al-opt-label { font-size: .92rem; line-height: 1.25; }
.lk-choose { margin: 22px 0 6px; } .lk-choose.off { opacity: .5; pointer-events: none; }
.lk-choose .al-opt { padding: 22px 10px 18px; }
.lk-bio-hint { margin: 8px 0 0; line-height: 1.4; }
.lk-bio-big { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 30px auto 10px; padding: 22px 26px; border-radius: 22px; border: 0; cursor: pointer;
  background: rgba(124, 58, 237, .16); color: inherit; font: inherit; font-weight: 600; }
.lk-bio-big svg { width: 64px; height: 64px; fill: none; stroke: var(--primary, #7c3aed); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .lk-bio-big svg { stroke: #c4b5fd; }
.lk-bio-big:active { transform: scale(.97); }
/* App lock: "Set up fingerprint" (opens the phone's settings) */
.al-setup { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; }
.al-setup svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lk-card .al-setup { margin-top: 16px; }
/* Assignments: title picks always in outline (like New event's), "type a name" boxes under the menus */
.ev-svg .tk-line { display: inline !important; }
#taskModal label > input[type=text][id$=Other] { margin-top: 0; }
#taskPicks { margin-top: 6px; }
.ev-pick.on .ev-svg .ev-line { stroke: #fff; } /* a picked choice: white icon on the purple */
/* Front page: "Get the app" under the top picture */
.l-art { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.l-getapp { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 1.02rem;
  color: #fff; background: var(--grad); box-shadow: 0 10px 26px rgba(91, 75, 240, .35); position: relative; z-index: 2; }
.l-getapp svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.l-getapp-go { font-size: 1.3rem; line-height: 1; opacity: .85; }
.l-getapp:hover { filter: brightness(1.08); }
/* Cloud page right after creating the account from "Become a Supporter": only the last step */
.sp-last-text { margin: 4px 0 12px; line-height: 1.5; }
.sp-last .sp-other { display: block; margin: 12px auto 0; }
#paywall.sp-last-step .price-block, #paywall.sp-last-step .price-list, #paywall.sp-last-step #pwSubscribe, #paywall.sp-last-step .pay-note { display: none !important; }
/* Moments: a Supporter extra */
.mom-lock { text-align: center; padding: 22px 16px 18px; margin: 12px 0 4px; border-radius: 18px; border: 1px solid #ef9f27;
  background: linear-gradient(135deg, #fdf6e9, #fbe8c6); color: #633806; }
[data-theme="dark"] .mom-lock { border-color: #854f0b; background: linear-gradient(135deg, #231a0c, #33240d); color: #fac775; }
.mom-lock-ic { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: #ef9f27; margin-bottom: 10px; }
[data-theme="dark"] .mom-lock-ic { background: #ba7517; }
.mom-lock-ic svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mom-lock strong { display: block; font-size: 1.08rem; margin-bottom: 6px; }
.mom-lock p { margin: 0 0 14px; line-height: 1.5; opacity: .9; }
/* ☰ menu: the gold Supporter group (Moments) */
.drawer-h-sup { color: #b7791f; }
[data-theme="dark"] .drawer-h-sup { color: #fac775; }
.drawer-sup button { background: linear-gradient(135deg, #fdf6e9, #fbe8c6); border: 1px solid #f3d29b; color: #633806; }
.drawer-sup button:hover { background: linear-gradient(135deg, #fbefd9, #f8ddb0); }
[data-theme="dark"] .drawer-sup button { background: linear-gradient(135deg, #231a0c, #33240d); border-color: #5c3d0a; color: #fac775; }
.drawer-sup button.on { box-shadow: inset 0 0 0 2px #ef9f27; }
.d-lock { margin-inline-start: auto; display: inline-flex; }
.d-lock svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.d-lock[hidden] { display: none; }
/* Settings → Supporter list: Moments as one simple line (lock until Supporter, then › to open) */
.mom-set-link { display: flex; align-items: center; gap: 10px; width: 100%; margin: 10px 0 4px; padding: 11px 12px; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--ink); text-align: start; background: var(--soft, rgba(127, 127, 127, .08)); border: 1px solid var(--line, rgba(127, 127, 127, .18)); }
.mom-set-link:hover { border-color: #ef9f27; }
.mom-set-go { margin-inline-start: auto; display: inline-flex; font-size: 1.3rem; line-height: 1; opacity: .7; }
.mom-set-go svg { width: 16px; height: 16px; fill: none; stroke: #ef9f27; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sup-perk-ic { display: inline-flex; vertical-align: -3px; --ic-size: 18px; }
/* Help window: "Need more help? Email us" */
.help-mail { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 14px; border-radius: 14px; background: var(--soft, rgba(127,127,127,.08)); border: 1px solid var(--line, rgba(127,127,127,.18)); }
.help-mail[hidden] { display: none; }
.help-mail > div { flex: 1; min-width: 0; } .help-mail p { margin: 2px 0 0; } .help-mail p a { word-break: break-all; }
.help-mail-ic { flex: none; font-size: 1.4rem; --ic-size: 24px; }
.help-mail .btn { flex: none; text-decoration: none; }
#setMoreList a.hub-tool { text-decoration: none; color: inherit; }
#setMoreList .hub-state[data-support-addr] { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The top bar: one solid dark navy (default color, light and dark), instead of the blue-to-purple blend */
html[data-accent="purple"] :is(.topbar, .l-nav), html:not([data-accent]) :is(.topbar, .l-nav) { background: #101b3f; box-shadow: 0 4px 18px rgba(8, 14, 40, .35); }
/* Notifications: the list shows a short preview; tapping one opens it to read */
.nt-body span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nt-back { font-size: 1.6rem; line-height: 1; margin-inline-end: 2px; }
.nt-read { padding: 8px 6px 6px; text-align: center; }
.nt-read-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: rgba(124, 58, 237, .12); font-size: 1.6rem; --ic-size: 28px; }
.nt-read h3 { margin: 12px 0 2px; font-size: 1.15rem; line-height: 1.3; }
.nt-read-when { margin: 0 0 12px; font-size: .82rem; color: var(--muted); }
.nt-read-text { margin: 0 0 16px; text-align: start; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.nt-read-btn { width: 100%; }
/* Tips: 5 amounts + "Other amount" (any amount the person types) */
.sp-tips { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sp-tip-other { font-weight: 700; }
.sp-tip-custom { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 4px 12px; border: 2px solid #d85a30; border-radius: 12px; background: #fff; }
.sp-tip-custom span { font-weight: 700; color: #712b13; }
.sp-tip-custom input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 1.1rem; font-weight: 700; color: #712b13; padding: 8px 0; }
[data-theme="dark"] .sp-tip-custom { background: #2a1610; }
[data-theme="dark"] .sp-tip-custom span, [data-theme="dark"] .sp-tip-custom input { color: #f5c4b3; }
.sp-tip-hint { margin: 6px 2px 0; font-size: .78rem; opacity: .8; }
.sp-tip-hint.bad { color: #ef4444; opacity: 1; font-weight: 600; }
.sp-tip-cta:disabled { opacity: .55; cursor: not-allowed; }
