/* Vazirmatn, served from this site (SIL Open Font License 1.1, The Vazirmatn Project Authors): no request to Google, nothing blocks the first paint */
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 300; font-display: swap; src: url(/art/f-vazir-arabic-300.woff2?v=ea09976a) format('woff2'); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 300; font-display: swap; src: url(/art/f-vazir-latin-300.woff2?v=ea09976a) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 400; font-display: swap; src: url(/art/f-vazir-arabic-400.woff2?v=ea09976a) format('woff2'); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 400; font-display: swap; src: url(/art/f-vazir-latin-400.woff2?v=ea09976a) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 500; font-display: swap; src: url(/art/f-vazir-arabic-500.woff2?v=ea09976a) format('woff2'); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 500; font-display: swap; src: url(/art/f-vazir-latin-500.woff2?v=ea09976a) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
/* الكشكول — the brain page. Calm and refined (in the spirit of Apple and Notion): graphite dark, quiet type,
   hairline borders, one accent used sparingly, soft motion, nothing flashy. The brain scene is one canvas. */
:root {
  --bg: #05070b; --ink: #eceff4; --dim: #8b94a3; --faint: #5d6573;
  --accent: #6fd6ea; --accent-soft: rgba(111, 214, 234, .12); --amber: #f0b45a;
  --surface: rgba(18, 21, 28, .86); --surface-2: rgba(255, 255, 255, .05); --hover: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14);
  --font: "Vazirmatn", system-ui, sans-serif; /* one soft, plain font on every device */
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; color: var(--ink); font: 400 14px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
body { background: var(--bg) url(/art/k-bg.webp?v=ea09976a) center / cover fixed no-repeat; }
body.brain-full, body:has(.login) { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr button:focus { position: fixed; top: 64px; left: 50%; translate: -50% 0; width: auto; height: auto; clip: auto; padding: 8px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); }
#app { position: relative; min-height: 100vh; }

/* ---------- boot / sign-in ---------- */
.boot, .login { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 42%, #0b1420 0%, var(--bg) 70%); }
.login-orb { width: 56px; height: 56px; border-radius: 50%; margin-bottom: 14px;
  background: radial-gradient(circle, #fff 0 8%, rgba(111, 214, 234, .75) 22%, rgba(111, 214, 234, .12) 55%, transparent 72%); animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .6; } }
.login h1 { margin: 0; font-weight: 500; font-size: 28px; letter-spacing: -.01em; }
.login p { margin: 0; color: var(--dim); max-width: 34ch; }
.login code { color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 8px; border-radius: 6px; direction: ltr; display: inline-block; }
.pill { margin-top: 14px; font-size: 12px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--dim); }

/* ---------- the page: a bar on top, then the board of glass cards with the brain in the middle ---------- */
/* the page follows the screen it is opened on: full width (with margins that grow with the screen), card heights that follow its height */
.page { margin: 0; padding: max(clamp(12px, 2vh, 22px), env(safe-area-inset-top)) clamp(14px, 3vw, 56px) 45vh; transition: margin .3s var(--ease); }
@media (min-width: 2400px) { .page { max-width: 2400px; margin-inline: auto; } }
.pagebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 2px 18px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .9; }
.bar-btns { display: flex; gap: 8px; }
.bar-btn { border: 1px solid var(--line); background: rgba(18, 22, 30, .55); border-radius: 7px; padding: 4px 10px; font-size: 13px; color: var(--dim); transition: color .25s, border-color .25s, background .25s; }
.bar-btn:hover, .bar-btn[aria-pressed="true"] { color: var(--ink); border-color: var(--line-2); }
.bar-btn.ghost { background: transparent; }
.board { --row: clamp(78px, calc((100vh - 170px) / 5), 150px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: var(--row); grid-auto-flow: dense; gap: clamp(10px, 1vw, 16px); }

/* the glass: a soft frosted card over the still background (the moving brain is never behind glass, so it stays light) */
.card { position: relative; grid-column: span 3; grid-row: span 2; display: flex; flex-direction: column; min-width: 0; border-radius: 12px; overflow: hidden; }
.glass { background: rgba(16, 20, 28, .46); border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px) saturate(1.15); -webkit-backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 18px 40px -18px rgba(0, 0, 0, .55); }
.card.size-s { grid-row: span 1; }
.card.size-w { grid-column: span 6; }
.card.size-t { grid-row: span 4; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px 2px; min-height: 34px; }
.card-t { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: rgba(236, 239, 244, .82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-ic { font-size: 14px; }
.card-b { flex: 1; min-height: 0; overflow: auto; padding: 2px 12px 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .12) transparent; }
.card-tools { display: none; gap: 2px; }
body.editing .card-tools { display: flex; }
.tool { border: 0; background: transparent; color: var(--dim); width: 24px; height: 24px; border-radius: 6px; font-size: 13px; line-height: 1; }
.tool:hover { background: var(--hover); color: var(--ink); }
.tool.del:hover { color: #ff8d8d; }
body.editing .card.glass { outline: 1px dashed rgba(255, 255, 255, .16); outline-offset: -1px; cursor: grab; }
.dragging-card { opacity: .45; }
.drop-here { outline: 1px solid var(--accent) !important; }
.add-card { grid-column: 1 / -1; grid-row: span 1; border: 1px dashed rgba(255, 255, 255, .1); background: transparent; color: var(--faint); align-items: center; justify-content: center; flex-direction: row; gap: 8px; font-size: 13px; transition: color .25s, border-color .25s, background .25s; }
.add-card:hover { background: rgba(255, 255, 255, .025); }
.add-card.slot { grid-column: span 3; }
.add-card:hover { color: var(--ink); border-color: var(--accent); }
.add-plus { font-size: 20px; color: var(--accent); }

/* the brain's card: wide in the middle, a full-screen button in its corner */
.brain-card { grid-column: 4 / span 6; grid-row: 1 / span 5; background: rgba(6, 9, 15, .42); border: 1px solid rgba(255, 255, 255, .07); }
.brain-card .card-h { position: absolute; top: 0; inset-inline: 0; z-index: 2; padding: 10px 12px; pointer-events: none; }
.brain-card .card-h > * { pointer-events: auto; }
.card-tools-b { display: flex; gap: 6px; }
.icon-btn { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: rgba(10, 14, 20, .6); color: var(--dim); font-size: 15px; line-height: 1; transition: color .25s, border-color .25s; }
.icon-btn:hover, .icon-btn[aria-pressed="true"] { color: var(--ink); border-color: var(--line-2); }
.brain-host { position: absolute; inset: 0; }
.brain-card.full { position: fixed; inset: 0; z-index: 40; border-radius: 0; border: 0; background: var(--bg) url(/art/k-bg.webp?v=ea09976a) center / cover no-repeat; animation: fullIn .45s var(--ease); }
@keyframes fullIn { from { opacity: .4; transform: scale(.97); } }
.stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.stage.dragging { cursor: grabbing; }
.cv { position: absolute; inset: 0; display: block; }
.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-width: 0; background: rgba(10, 14, 20, .5); border-radius: 10px; padding: 2px; }
.crumb { border: 0; background: transparent; padding: 4px 9px; border-radius: 8px; color: var(--dim); font-size: 13px; transition: color .25s, background .25s; }
.crumb:hover { color: var(--ink); background: var(--hover); }
.crumb.here { color: var(--ink); }
.sep { color: var(--faint); }

/* the branch card (what used to float over the brain) */
.panel { animation: panelIn .45s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(4px); } }

/* the cards' contents */
.photo-btn, .photo-empty { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; border-radius: 12px; overflow: hidden; }
.photo { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 12px; }
.t-photo .card-b { padding: 0 10px 10px; }
.photo-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1px dashed var(--line-2); color: var(--dim); font-size: 13px; }
.photo-empty:hover { color: var(--ink); border-color: var(--accent); }
.meter-top { display: flex; align-items: center; gap: 10px; }
.meter { flex: 1; display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; direction: rtl; }
.seg { height: 9px; padding: 0; border: 0; border-radius: 3px; background: rgba(255, 255, 255, .09); transition: background .2s; }
.seg.on { background: var(--mc, var(--accent)); }
.seg:hover { background: var(--mc, var(--accent)); opacity: .7; }
.meter-v { font-size: 13px; color: var(--ink); min-width: 38px; text-align: end; }
.meter-note { margin-top: 8px; font-size: 13px; color: var(--mc, var(--dim)); cursor: text; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter-note[data-empty], .note-t[data-empty] { color: var(--faint); }
.note-t { font-size: 14px; line-height: 1.8; white-space: pre-wrap; cursor: text; min-height: 100%; }
.inline-in { width: 100%; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); border-radius: 8px; padding: 6px 9px; outline: none; resize: none; }
textarea.inline-in { min-height: 120px; line-height: 1.8; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; height: 100%; align-content: center; }
.metric { text-align: center; padding: 10px 4px; border-radius: 12px; background: rgba(255, 255, 255, .035); }
.metric b { display: block; font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
.metric span { font-size: 12px; color: var(--dim); }
.times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.time { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 10px; background: rgba(255, 255, 255, .035); font-size: 12px; color: var(--dim); }
.time b { font-size: 13px; font-weight: 500; color: var(--ink); }
.time.now { outline: 1px solid rgba(111, 214, 234, .45); }
.khatma { margin-top: 10px; display: grid; gap: 5px; font-size: 12px; color: var(--dim); }
.kbar { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.kbar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.card-form { display: grid; gap: 10px; }
.f-row { display: grid; gap: 4px; font-size: 12px; color: var(--dim); }
.f-row input { border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); border-radius: 8px; padding: 6px 9px; outline: none; }
.f-ic { width: 70px; text-align: center; }
.f-btns { display: flex; gap: 8px; }
.swatches { display: flex; gap: 8px; }
.sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.sw.on { border-color: #fff; }

/* the library of cards */
.picker-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0, 0, 0, .45); padding: 20px; }
.picker { width: min(640px, 100%); max-height: 86vh; overflow: auto; border-radius: 20px; padding: 18px; display: grid; gap: 12px; background: rgba(18, 22, 30, .82); }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.pick { display: grid; gap: 4px; justify-items: start; text-align: start; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.pick:hover { border-color: var(--accent); background: rgba(111, 214, 234, .06); }
.pick-ic { font-size: 20px; }
.pick b { font-weight: 500; font-size: 14px; }
.pick-d { font-size: 12px; color: var(--dim); line-height: 1.6; }

/* smaller screens: fewer columns, the brain first and full width */
@media (max-width: 1100px) {
  .board { --row: clamp(80px, 11vh, 130px); grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .brain-card { grid-column: 1 / -1; grid-row: 1 / span 5; }
  .card.size-w { grid-column: 1 / -1; }
  .page { padding-inline: 22px; }
}
@media (max-width: 640px) {
  .page { padding: 10px 10px 40vh; }
  .board { --row: clamp(84px, 13vh, 120px); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card, .card.size-w { grid-column: 1 / -1; }
  .card.size-s { grid-column: span 1; }
  .brain-card { grid-row: 1 / span 4; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .bar-btn { padding: 5px 10px; }
}
.p-eyebrow { font-size: 12px; color: var(--dim); }
.p-title { margin: 2px 0 12px; font-size: 18px; font-weight: 500; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.p-h { margin: 16px 0 6px; font-size: 12px; font-weight: 500; color: var(--faint); }
.p-note { margin: 6px 0; color: var(--dim); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 2px 0 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stat { text-align: center; padding: 9px 2px 8px; }
.stat + .stat { border-inline-start: 1px solid var(--line); }
.stat b { display: block; font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.stat span { font-size: 11px; color: var(--dim); }
.stat.warn b { color: var(--amber); }

.kids { display: flex; flex-wrap: wrap; gap: 6px; }
.kid { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 4px 10px; font-size: 13px; transition: background .25s, border-color .25s; }
.kid:hover { background: var(--hover); border-color: var(--line-2); }
.kid.add { color: var(--dim); background: transparent; border-style: dashed; }
.kid.add:hover { color: var(--ink); }
.kid-n { font-size: 11px; color: var(--faint); }
.kid-n:empty { display: none; }
.kid-in, .add-in, .hb-add-name, .hb-add-time { border: 1px solid var(--line); background: rgba(0, 0, 0, .25); border-radius: 10px; padding: 8px 11px; outline: none; transition: border-color .25s, box-shadow .25s; }
.kid-in { border-radius: 8px; padding: 4px 10px; font-size: 13px; width: 150px; }
.kid-in:focus, .add-in:focus { border-color: rgba(111, 214, 234, .5); box-shadow: 0 0 0 3px var(--accent-soft); }
.add-in { width: 100%; margin-top: 12px; }
.add-in::placeholder, .kid-in::placeholder { color: var(--faint); }

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.it { display: flex; align-items: flex-start; gap: 10px; padding: 7px 6px; border-radius: 8px; transition: background .2s, opacity .35s, transform .35s var(--ease); }
.it:hover { background: var(--hover); }
.it.going { opacity: 0; transform: translateX(-16px); }
.chk { flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .28); background: transparent; position: relative; transition: border-color .2s, background .2s; }
.chk:hover { border-color: var(--accent); background: var(--accent-soft); }
.it.p1 .chk { border-color: rgba(255, 255, 255, .6); }
.it-b { display: grid; min-width: 0; }
.it-t { overflow-wrap: anywhere; font-size: 13.5px; }
.it-w { font-size: 12px; color: var(--dim); }
.it.late .it-w { color: var(--amber); }
.it.late .chk { border-color: rgba(240, 180, 90, .7); }

/* ---------- the list view ---------- */
.listview { max-width: 760px; margin: 0 auto; padding: 6px 4px 60px; }
.listview .tree { list-style: none; margin: 0; padding: 0; }
.listview .tree .tree { padding-inline-start: 16px; border-inline-start: 1px solid var(--line); margin-inline-start: 8px; }
.listview summary { cursor: pointer; padding: 8px 4px; font-size: 14px; display: flex; gap: 8px; align-items: center; border-radius: 8px; }
.listview summary:hover { background: var(--hover); }
.listview summary .kid-n { margin-inline-start: auto; }


/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 20; pointer-events: none; }
.toast { padding: 8px 16px; border-radius: 10px; background: rgba(30, 33, 41, .96); border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  font-size: 14px; animation: toastIn .35s var(--ease); transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.noscript { position: fixed; inset: 0; display: grid; place-content: center; margin: 0; }


@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.pray { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.pray-t { color: var(--dim); font-size: 13px; }
.top-btns { display: flex; gap: 6px; }

/* a section heading: splits the page into named parts, like a heading in Notion */
.t-heading { grid-column: 1 / -1 !important; grid-row: span 1 !important; background: none !important; border: 0 !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; box-shadow: none !important; justify-content: flex-end; }
.t-heading .card-h { padding: 0 2px 4px; min-height: 0; }
.t-heading .card-t { display: none; }
.t-heading .card-b { flex: 0; padding: 0 2px 6px; overflow: visible; border-bottom: 1px solid var(--line); }
.sec-title { font-size: 18px; font-weight: 500; letter-spacing: -.01em; cursor: text; }
.sec-title[data-empty] { color: var(--faint); }

/* the branches sidebar, like Notion's: slides in on the start side (right in Arabic), the page makes room for it */
.sidebar { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 30; width: 270px; padding: 12px 8px 24px; overflow: auto; border-radius: 0; border-block: 0; border-inline-end: 0;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .12) transparent; animation: sideIn .3s var(--ease); }
.sidebar[hidden] { display: none; }
@keyframes sideIn { from { transform: translateX(-16px); opacity: 0; } }
body.list-on .page { margin-inline-end: 270px; } /* the branches on the left, the cards on the right */
.side-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 10px; }
.side-t { font-size: 14px; font-weight: 500; }
.side-sec { padding: 6px 10px 4px; font-size: 12px; color: var(--faint); }
.tree { display: grid; gap: 1px; }
.trow { display: flex; align-items: center; gap: 2px; border-radius: 6px; }
.trow:hover { background: var(--hover); }
.tw { flex: none; width: 20px; height: 22px; padding: 0; border: 0; background: none; color: var(--faint); font-size: 13px; line-height: 1; border-radius: 4px; transition: transform .2s; transform: rotate(180deg); }
.tw.open { transform: rotate(90deg); }
.tw.none { visibility: hidden; }
.tw:hover { color: var(--ink); background: var(--hover); }
.tn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 4px 6px; border: 0; background: none; text-align: start; font-size: 13.5px; color: rgba(236, 239, 244, .86); border-radius: 6px; }
.tn.here { color: var(--ink); background: rgba(111, 214, 234, .09); }
.tn-ic { flex: none; font-size: 13px; width: 18px; text-align: center; }
.tn-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-n { flex: none; font-size: 11px; color: var(--faint); margin-inline-start: 2px; }
@media (max-width: 900px) { body.list-on .page { margin-inline-end: 0; } .sidebar { width: min(290px, 86vw); box-shadow: 20px 0 50px rgba(0, 0, 0, .5); } }
/* ---------- the task board (like Trello) ---------- */
.card.size-f { grid-column: 1 / -1; grid-row: span 4; }
.kb { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-bottom: 12px; overflow: hidden; }
.kcol { display: flex; flex-direction: column; min-height: 0; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .05); }
.kcol-h { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px 6px; font-size: 13px; font-weight: 500; color: rgba(236, 239, 244, .86); }
.kcol-n { font-size: 11px; color: var(--faint); font-weight: 400; }
.klist { flex: 1; min-height: 40px; overflow: auto; padding: 2px 8px 8px; display: grid; gap: 7px; align-content: start; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .12) transparent; border-radius: 10px; transition: background .2s; }
.klist.kover { background: rgba(111, 214, 234, .06); }
.kc { padding: 8px 10px 9px; border-radius: 9px; cursor: pointer; background: rgba(34, 40, 54, .62); border: 1px solid rgba(255, 255, 255, .07);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 14px -10px rgba(0, 0, 0, .6); transition: border-color .2s, transform .2s, background .2s; }
.kc:hover { border-color: rgba(255, 255, 255, .16); background: rgba(40, 47, 63, .7); }
.kc:focus-visible { outline: 2px solid var(--accent); }
.kc.kdrag { opacity: .4; }
.kc.kp1 { border-inline-start: 2px solid rgba(242, 112, 107, .8); }
.kc-t { font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.kdone .kc-t { color: var(--dim); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .25); }
.klabels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.klabel { width: 30px; height: 6px; border-radius: 3px; display: block; }
.kbadges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--dim); }
.kbadge { padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, .05); }
.kbadge.late { background: rgba(240, 180, 90, .18); color: var(--amber); }
.kbadge.today { background: rgba(111, 214, 234, .14); color: #a9eaf5; }
.kbadge.full { background: rgba(95, 211, 141, .16); color: #8fe2b0; }
.kbadge.ksec { color: var(--faint); }
.kadd { margin: 0 8px 8px; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); font-size: 13px; text-align: start; }
.kadd:hover { background: var(--hover); color: var(--ink); }
.kadd-in { margin: 0 8px 8px; width: calc(100% - 16px); }
/* the back of a card */
.cardback { width: min(620px, 100%); max-height: 90vh; overflow: auto; border-radius: 16px; padding: 16px 18px 18px; background: rgba(20, 24, 33, .9); display: grid; gap: 10px; }
.cb-head { display: flex; gap: 8px; align-items: flex-start; }
.cb-title { flex: 1; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 4px 6px; font-size: 18px; font-weight: 500; resize: none; outline: none; line-height: 1.5; }
.cb-title:focus { border-color: var(--line-2); background: rgba(0, 0, 0, .2); }
.cb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.cb-wide { grid-column: 1 / -1; }
.cb-lab { font-size: 12px; color: var(--faint); margin-bottom: 4px; }
.cb-sel, .cb-in { width: 100%; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); border-radius: 8px; padding: 6px 9px; outline: none; color-scheme: dark; }
.cb-sel option { background: #161a22; }
.cb-pair { display: grid; grid-template-columns: 1fr 110px; gap: 6px; }
.cb-labels { display: flex; gap: 8px; }
.cb-label { width: 40px; height: 22px; border-radius: 6px; border: 2px solid transparent; padding: 0; opacity: .55; }
.cb-label.on { opacity: 1; border-color: #fff; }
.cb-note { font-size: 13px; color: var(--dim); padding: 6px 2px; }
.cb-desc { width: 100%; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); border-radius: 10px; padding: 8px 10px; outline: none; resize: vertical; line-height: 1.7; }
.cb-desc:focus { border-color: var(--line-2); }
.cb-checks { display: grid; gap: 2px; }
.cb-check { display: flex; align-items: center; gap: 8px; padding: 4px 4px; border-radius: 6px; }
.cb-check:hover { background: var(--hover); }
.cb-check .chk { margin-top: 0; }
.chk.on { background: var(--accent); border-color: var(--accent); }
.cb-check.d .cb-ct { color: var(--dim); text-decoration: line-through; }
.cb-ct { flex: 1; font-size: 13.5px; }
.cb-foot { display: flex; justify-content: space-between; margin-top: 6px; }
.cb-done { color: var(--ink); border-color: rgba(111, 214, 234, .45); }
.cb-del:hover { color: #ff8d8d; }
@media (max-width: 900px) { .kb { grid-template-columns: repeat(3, minmax(220px, 1fr)); overflow-x: auto; } .card.size-f { grid-row: span 5; } }
@media (max-width: 640px) { .cb-grid { grid-template-columns: 1fr; } }
/* ---------- task pictures ---------- */
.kc-cover { display: block; width: calc(100% + 20px); margin: -8px -10px 8px; height: 110px; object-fit: cover; border-radius: 9px 9px 0 0; }
.cb-cover { display: grid; gap: 8px; margin: -16px -18px 4px; }
.cb-cover-img { width: 100%; max-height: 240px; object-fit: cover; display: block; border-radius: 16px 16px 0 0; }
.cb-cover-btns { display: flex; gap: 8px; padding: 0 18px; }
.cb-addimg { justify-self: start; border: 1px dashed var(--line-2); background: transparent; color: var(--dim); border-radius: 8px; padding: 6px 12px; font-size: 13px; }
.cb-addimg:hover { color: var(--ink); border-color: var(--accent); }

/* ---------- the glass preview on hover ---------- */
.preview { position: fixed; z-index: 70; width: 280px; padding: 12px 14px; border-radius: 14px; pointer-events: none; opacity: 0; transform: translateY(4px) scale(.98);
  transition: opacity .18s var(--ease), transform .18s var(--ease); background: rgba(22, 27, 37, .72); border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(18px) saturate(1.25); -webkit-backdrop-filter: blur(18px) saturate(1.25); box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .06) inset; }
.preview.on { opacity: 1; transform: none; }
.pv-cover { display: block; width: calc(100% + 28px); margin: -12px -14px 10px; height: 130px; object-fit: cover; border-radius: 14px 14px 0 0; }
.pv-t { font-size: 14.5px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.pv-sec { font-size: 12px; color: var(--dim); margin-top: 2px; }
.pv-note { font-size: 12.5px; color: rgba(236, 239, 244, .75); margin-top: 8px; line-height: 1.7; white-space: pre-wrap; }
.pv-ck { display: grid; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--dim); }
.pv-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.pv-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.pv-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-list em { font-style: normal; font-size: 11px; color: var(--faint); flex: none; }
.pv-list li.late em { color: var(--amber); }
.pv-hint { margin-top: 8px; font-size: 11px; color: var(--faint); }
/* ================= the light theme =================
   Soft daylight glass for the page and the cards. The brain's card stays a dark window onto space
   (its light and its nerves need the dark to glow), framed like a screen in the light page. */
:root[data-theme="light"] {
  --bg: #f3f5f8; --ink: #1d222b; --dim: #5d6673; --faint: #8c95a2;
  --accent: #1a8fb0; --accent-soft: rgba(26, 143, 176, .12); --amber: #b97412;
  --surface: rgba(255, 255, 255, .86); --surface-2: rgba(0, 0, 0, .035); --hover: rgba(0, 0, 0, .05);
  --line: rgba(20, 30, 45, .09); --line-2: rgba(20, 30, 45, .16);
  color-scheme: light;
}
[data-theme="light"] body { background: #f3f5f8; background-image: radial-gradient(1100px 700px at 85% -10%, rgba(120, 200, 230, .28), transparent 60%), radial-gradient(900px 600px at 0% 30%, rgba(180, 160, 255, .2), transparent 60%), radial-gradient(800px 600px at 60% 110%, rgba(255, 200, 150, .16), transparent 60%); background-attachment: fixed; }
[data-theme="light"] .glass { background: rgba(255, 255, 255, .62); border-color: rgba(255, 255, 255, .75); box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 12px 32px -16px rgba(20, 40, 70, .22); }
[data-theme="light"] .card-t, [data-theme="light"] .kcol-h, [data-theme="light"] .tn, [data-theme="light"] .pv-note { color: var(--ink); }
[data-theme="light"] .bar-btn { background: rgba(255, 255, 255, .7); }
[data-theme="light"] .brain-card { background: #070b12; border-color: rgba(10, 20, 35, .25); box-shadow: 0 20px 44px -18px rgba(10, 25, 50, .45); }
[data-theme="light"] .brain-card .crumb.here, [data-theme="light"] .brain-card .crumb:hover { color: #eceff4; }
[data-theme="light"] .brain-card .crumb { color: #8b94a3; }
[data-theme="light"] .brain-card .icon-btn { color: #8b94a3; border-color: rgba(255, 255, 255, .1); }
[data-theme="light"] .brain-card .icon-btn:hover { color: #eceff4; }
[data-theme="light"] .add-card { border-color: rgba(20, 30, 45, .14); }
[data-theme="light"] .add-card:hover { background: rgba(255, 255, 255, .5); }
[data-theme="light"] .metric, [data-theme="light"] .time { background: rgba(255, 255, 255, .55); }
[data-theme="light"] .seg { background: rgba(20, 30, 45, .1); }
[data-theme="light"] .kcol { background: rgba(255, 255, 255, .35); border-color: rgba(255, 255, 255, .6); }
[data-theme="light"] .kc { background: rgba(255, 255, 255, .82); border-color: rgba(20, 30, 45, .08); box-shadow: 0 4px 12px -8px rgba(20, 40, 70, .3); }
[data-theme="light"] .kc:hover { background: #fff; border-color: rgba(20, 30, 45, .16); }
[data-theme="light"] .kbadge { background: rgba(20, 30, 45, .06); }
[data-theme="light"] .kbadge.late { background: rgba(240, 160, 50, .16); color: #a3620a; }
[data-theme="light"] .kbadge.today { background: rgba(26, 143, 176, .12); color: #146f88; }
[data-theme="light"] .kbadge.full { background: rgba(40, 170, 100, .14); color: #1d7a4a; }
[data-theme="light"] .kdone .kc-t { text-decoration-color: rgba(0, 0, 0, .25); }
[data-theme="light"] .inline-in, [data-theme="light"] .add-in, [data-theme="light"] .kid-in, [data-theme="light"] .hb-add-name, [data-theme="light"] .hb-add-time, [data-theme="light"] .cb-sel, [data-theme="light"] .cb-in, [data-theme="light"] .cb-desc, [data-theme="light"] .f-row input { background: rgba(255, 255, 255, .8); color-scheme: light; }
[data-theme="light"] .cb-sel option { background: #fff; }
[data-theme="light"] .cb-title:focus { background: rgba(255, 255, 255, .8); }
[data-theme="light"] .picker, [data-theme="light"] .cardback { background: rgba(250, 251, 253, .94); }
[data-theme="light"] .picker-back { background: rgba(30, 40, 55, .25); }
[data-theme="light"] .pick { background: rgba(255, 255, 255, .7); }
[data-theme="light"] .preview { background: rgba(255, 255, 255, .78); border-color: rgba(255, 255, 255, .9); box-shadow: 0 20px 44px -16px rgba(20, 40, 70, .3); }
[data-theme="light"] .toast { background: rgba(255, 255, 255, .96); box-shadow: 0 10px 26px rgba(20, 40, 70, .18); }
[data-theme="light"] .sidebar { background: rgba(250, 251, 253, .86); }
[data-theme="light"] .tn.here { background: rgba(26, 143, 176, .1); }
[data-theme="light"] .chk { border-color: rgba(20, 30, 45, .3); }
[data-theme="light"] .it.p1 .chk { border-color: rgba(20, 30, 45, .6); }
[data-theme="light"] .sw.on, [data-theme="light"] .cb-label.on { border-color: #1d222b; }
[data-theme="light"] .login, [data-theme="light"] .boot { background: radial-gradient(ellipse at 50% 42%, #ffffff 0%, var(--bg) 70%); }[data-theme="light"] .seg.on { background: var(--mc, var(--accent)); }

/* the brain's own light background: a soft pearl mist (it does not follow the page's theme) */
.brain-card.sky-light, [data-theme="light"] .brain-card.sky-light { background: radial-gradient(120% 90% at 50% 38%, #ffffff 0%, #f1f5f9 38%, #e2e9f1 72%, #d3dce7 100%); border-color: rgba(20, 30, 45, .12); }
.brain-card.sky-light.full { background: radial-gradient(120% 90% at 50% 38%, #ffffff 0%, #eef3f8 45%, #d9e2ec 100%); }
.brain-card.sky-light .crumbs { background: rgba(255, 255, 255, .7); }
.brain-card.sky-light .crumb { color: #5d6673; }
.brain-card.sky-light .crumb.here, .brain-card.sky-light .crumb:hover { color: #1d222b; }
.brain-card.sky-light .icon-btn { background: rgba(255, 255, 255, .7); border-color: rgba(20, 30, 45, .12); color: #5d6673; }
.brain-card.sky-light .icon-btn:hover { color: #1d222b; }
/* ================= the cards, in the style of a smoky glass panel =================
   deep and softly lit from above, generous rounded corners; type: small spaced labels, light large figures.
   A card may carry a picture that fades down into the glass. */
.card { border-radius: 22px; }
.glass { background: linear-gradient(180deg, rgba(60, 64, 72, .34) 0%, rgba(26, 28, 33, .6) 50%, rgba(14, 15, 19, .76) 100%);
  border: 1px solid rgba(255, 255, 255, .085);
  backdrop-filter: blur(24px) saturate(1.1); -webkit-backdrop-filter: blur(24px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 -50px 70px -50px rgba(0, 0, 0, .4), 0 34px 60px -30px rgba(0, 0, 0, .85); }
.glass::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(90% 55% at 70% 0%, rgba(255, 255, 255, .07), transparent 62%); }
.card > .card-h, .card > .card-b { position: relative; z-index: 1; }
.card-bgimg { position: absolute; top: 0; inset-inline: 0; width: 100%; height: 82%; object-fit: cover; z-index: 0; pointer-events: none; opacity: .9;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .7) 35%, rgba(0, 0, 0, .15) 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .7) 35%, rgba(0, 0, 0, .15) 75%, transparent 100%); }
.has-bg .card-t { color: rgba(255, 255, 255, .86); text-shadow: 0 1px 10px rgba(0, 0, 0, .55); }
.has-bg .card-b { text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.card-h { padding: 14px 16px 2px; }
.card-b { padding: 4px 16px 16px; }
.card-t { font-size: 11.5px; font-weight: 400; letter-spacing: .05em; color: rgba(236, 239, 244, .55); }
.card-ic { font-size: 12px; opacity: .9; }
.p-eyebrow { font-size: 11px; letter-spacing: .05em; color: rgba(236, 239, 244, .45); }
.p-title { font-weight: 300; font-size: 24px; letter-spacing: 0; }
.metric { background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .05); border-radius: 16px; }
.metric b, .stat b { font-weight: 300; font-size: 28px; letter-spacing: -.01em; }
.metric span, .stat span { font-size: 11px; letter-spacing: .04em; color: rgba(236, 239, 244, .5); }
.time { border-radius: 12px; }
.time b { font-weight: 300; font-size: 15px; }
.sec-title { font-weight: 300; font-size: 22px; }
.note-t { font-weight: 300; font-size: 15px; }
.meter-v { font-weight: 300; font-size: 18px; }
.pray { border-radius: 14px; }
.pray-n { font-weight: 300; font-size: 15px; }
.kcol { border-radius: 16px; }
.kc { border-radius: 12px; }
.kc-cover { border-radius: 12px 12px 0 0; }
[data-theme="light"] .card-t, [data-theme="light"] .p-eyebrow, [data-theme="light"] .metric span { color: var(--dim); }
[data-theme="light"] .glass::before { background: radial-gradient(90% 55% at 70% 0%, rgba(255, 255, 255, .55), transparent 62%); }
[data-theme="light"] .has-bg .card-t { color: #fff; }
[data-theme="light"] .metric { background: rgba(255, 255, 255, .5); border-color: rgba(255, 255, 255, .7); }
/* the picture button on every card: shown when the mouse rests on the card (always faintly on touch screens) */
.card-acts { display: flex; align-items: center; gap: 2px; }
.bg-tool { opacity: .5; transition: opacity .2s; font-size: 12px; } /* always there, a little faint; brighter when the mouse is on the card */
.card:hover .bg-tool, .bg-tool:focus-visible, body.editing .bg-tool { opacity: .85; }
@media (hover: none) { .bg-tool { opacity: .6; } }
.mini-menu { position: fixed; z-index: 75; display: grid; min-width: 180px; padding: 6px; border-radius: 12px; background: rgba(24, 28, 36, .9); }
.mini-menu button { border: 0; background: none; text-align: start; padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.mini-menu button:hover { background: var(--hover); }
.mini-menu .danger { color: #ff9a9a; }
[data-theme="light"] .mini-menu { background: rgba(255, 255, 255, .95); }
[data-theme="light"] .mini-menu .danger { color: #c0392b; }
/* the photo card: press to see it whole, a small button to change it */
.t-photo .card-b { position: relative; }
.photo-change { position: absolute; bottom: 18px; inset-inline-end: 18px; z-index: 2; border: 1px solid rgba(255, 255, 255, .25); background: rgba(10, 14, 20, .55); color: #fff; border-radius: 9px; padding: 3px 10px; font-size: 12px; opacity: 0; transition: opacity .2s;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.t-photo:hover .photo-change, .photo-change:focus-visible { opacity: 1; }
@media (hover: none) { .photo-change { opacity: .85; } }
.photo-btn { cursor: zoom-in; }
.cb-cover-img { cursor: zoom-in; }
/* the picture viewer */
.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; align-content: center; gap: 12px; padding: 24px; cursor: zoom-out;
  background: rgba(4, 6, 10, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: lbIn .25s var(--ease); }
@keyframes lbIn { from { opacity: 0; } }
.lb-img { max-width: min(92vw, 1400px); max-height: 82vh; object-fit: contain; border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: lbZoom .3s var(--ease); }
@keyframes lbZoom { from { transform: scale(.96); opacity: .6; } }
.lb-cap { color: rgba(255, 255, 255, .8); font-size: 14px; }
.lb-x { position: fixed; top: 18px; inset-inline-end: 18px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(20, 24, 32, .7); color: #fff; font-size: 15px; }
/* a task card with its picture behind the whole card, under smoky glass */
.kc.kc-full { position: relative; overflow: hidden; min-height: 92px; border-color: rgba(255, 255, 255, .14); background: rgba(12, 14, 18, .35); }
.kc-full .kc-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.kc-full::after { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(20, 22, 28, .1) 0%, rgba(14, 16, 20, .55) 55%, rgba(10, 12, 16, .82) 100%); }
.kc-full > :not(.kc-bg) { position: relative; z-index: 1; }
.kc-full .kc-t { color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, .6); padding-top: 26px; font-weight: 500; }
.kc-full .kbadge { background: rgba(10, 12, 16, .45); color: rgba(255, 255, 255, .86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
[data-theme="light"] .kc.kc-full { background: rgba(12, 14, 18, .35); }
/* the two ways to show the picture */
.seg-group { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.seg-btn { border: 0 !important; border-radius: 0 !important; background: transparent !important; }
.seg-btn.on { background: rgba(111, 214, 234, .16) !important; color: var(--ink) !important; }
.cb-cover-btns { flex-wrap: wrap; }
/* ================= a card dressed with a picture: smoky frosted glass over it (in both themes) =================
   the picture is clear at the top, then slowly frosted and darkened under the glass; light, thin text; a warm glow below */
.card.has-bg { --ink: #f3efe8; --dim: rgba(243, 239, 232, .62); --faint: rgba(243, 239, 232, .42); --line: rgba(255, 255, 255, .1); --line-2: rgba(255, 255, 255, .18); --hover: rgba(255, 255, 255, .07);
  color: var(--ink); background: #0d0f13 !important; border: 1px solid rgba(255, 255, 255, .12) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 40px 70px -34px rgba(0, 0, 0, .9) !important; }
.card.has-bg .card-bgimg { top: 0; inset-inline: 0; height: 100%; opacity: 1; filter: saturate(1.05) brightness(.92); -webkit-mask-image: none; mask-image: none; }
.card.has-bg::before { z-index: 0; background: radial-gradient(70% 45% at 50% 108%, rgba(255, 150, 70, .16), transparent 70%), radial-gradient(90% 40% at 70% 0%, rgba(255, 255, 255, .08), transparent 60%); }
.card.has-bg::after { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(180deg, rgba(12, 14, 18, 0) 0%, rgba(12, 14, 18, .25) 22%, rgba(14, 16, 20, .62) 48%, rgba(13, 14, 18, .84) 72%, rgba(11, 12, 15, .93) 100%);
  backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .35) 20%, #000 52%); mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .35) 20%, #000 52%); }
.card.has-bg > .card-h, .card.has-bg > .card-b { position: relative; z-index: 1; }
.card.has-bg .card-t { color: rgba(255, 255, 255, .92) !important; text-shadow: 0 1px 12px rgba(0, 0, 0, .6); letter-spacing: .06em; }
.card.has-bg .card-b { text-shadow: 0 1px 10px rgba(0, 0, 0, .45); }
.card.has-bg .it-t, .card.has-bg .note-t, .card.has-bg .p-title, .card.has-bg .metric b, .card.has-bg .meter-v, .card.has-bg .time b, .card.has-bg .sec-title { color: #f3efe8; font-weight: 300; }
.card.has-bg .it-w, .card.has-bg .metric span, .card.has-bg .time { color: rgba(243, 239, 232, .6); }
.card.has-bg .it.late .it-w { color: #f2c27a; }
.card.has-bg .chk { border-color: rgba(255, 255, 255, .45); }
.card.has-bg .metric, .card.has-bg .time, .card.has-bg .pray { background: rgba(255, 255, 255, .05) !important; border-color: rgba(255, 255, 255, .08) !important; }
.card.has-bg .seg { background: rgba(255, 255, 255, .14); }
.card.has-bg .seg.on { background: var(--mc, var(--accent)); }
.card.has-bg .it:hover { background: rgba(255, 255, 255, .06); }
.card.has-bg .tool { color: rgba(255, 255, 255, .75); }
.card.has-bg .bg-tool { opacity: .8; }
/* the card background library: a small grid of thumbnails, in the card's 🖼 menu and in its settings */
.bg-menu { min-width: 0; width: 292px; padding: 10px; gap: 8px; }
.bg-menu-t { font-size: 12px; font-weight: 400; color: var(--dim); padding: 0 2px; }
.bg-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.mini-menu .bg-th, .bg-th { padding: 0; aspect-ratio: 4 / 5; border-radius: 9px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); cursor: pointer; display: grid; place-items: center; transition: transform .18s ease, border-color .18s ease; }
.bg-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-th:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .3); }
.bg-th.on { border-color: #e9d9b8; box-shadow: 0 0 0 2px rgba(233, 217, 184, .35); }
.bg-th.none { font-size: 18px; color: var(--dim); }
.card-form .bg-grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); flex: 1; }
[data-theme="light"] .bg-th { border-color: rgba(0, 0, 0, .1); background: rgba(0, 0, 0, .03); }
[data-theme="light"] .bg-th.on { border-color: #a8885a; box-shadow: 0 0 0 2px rgba(168, 136, 90, .3); }

/* Notion scale: compact rows, small calm numbers, tighter padding. The brain and the task board keep their room by spanning more rows. */
.board { --row: 68px; gap: 12px; }
.card { border-radius: 14px; }
.card-h { padding: 10px 14px 0; min-height: 32px; }
.card-t { font-size: 12.5px; }
.card-b { padding: 4px 14px 12px; }
.brain-card { grid-row: 1 / span 9; }
.card.size-f { grid-row: span 7; }
.metrics { gap: 8px; }
.metric { padding: 8px 4px 7px; border-radius: 10px; }
.metric b, .stat b { font-size: 18px; font-weight: 400; line-height: 1.3; }
.metric span, .stat span { font-size: 10.5px; letter-spacing: .02em; }
.p-title { font-size: 17px; margin: 0 0 8px; }
.sec-title { font-size: 17px; }
.meter-v { font-size: 14px; }
.note-t { font-size: 13.5px; line-height: 1.7; }
@media (max-width: 1100px) { .board { --row: 64px; } .brain-card { grid-row: 1 / span 8; } }
@media (max-width: 640px) { .board { --row: 60px; gap: 10px; } .brain-card { grid-row: 1 / span 6; } .card.size-f { grid-row: span 8; } }

/* a card's own settings: a ⚙ beside 🖼 on every card (faint until hover), opening a glass window */
.set-tool { font-size: 13px; }
.card-set { width: min(440px, 100%); gap: 14px; }
.set-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.set-h b { font-weight: 400; font-size: 15px; }
.card-set .card-form { gap: 12px; }
.card-set .f-row input, .card-set .cb-sel { width: 100%; box-sizing: border-box; }
.card-set .f-ic { width: 64px; text-align: center; }
.card-set .bg-grid { grid-template-columns: repeat(5, 64px); }
.size-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 11px; font-size: 12px; color: var(--dim); }
.chip:hover { color: var(--ink); }
.chip.on { color: var(--ink); border-color: rgba(233, 217, 184, .55); background: rgba(233, 217, 184, .08); }
.set-btns { flex-wrap: wrap; }
.set-btns .danger { margin-inline-start: auto; }
.bar-btn.primary { color: var(--ink); border-color: rgba(233, 217, 184, .45); background: rgba(233, 217, 184, .1); }
.bar-btn.primary:hover { background: rgba(233, 217, 184, .18); }
.bar-btn.danger { color: #ff9a9a; border-color: rgba(255, 140, 140, .3); }
.bar-btn.danger:hover { background: rgba(255, 140, 140, .1); }
[data-theme="light"] .bar-btn.primary { color: #5b4526; border-color: rgba(168, 136, 90, .5); background: rgba(168, 136, 90, .1); }
[data-theme="light"] .bar-btn.danger { color: #c0392b; }
[data-theme="light"] .chip.on { border-color: rgba(168, 136, 90, .6); background: rgba(168, 136, 90, .1); }

/* "are you sure?" */
.sure-back { z-index: 90; }
.sure { width: min(360px, 100%); gap: 10px; text-align: start; }
.sure-t { font-weight: 400; font-size: 15px; }
.sure-p { margin: 0; font-size: 13px; color: var(--dim); overflow-wrap: anywhere; }

/* finishing a task: a clear small button instead of a bare circle */
.it { align-items: center; }
.done-btn { flex: none; margin-inline-start: auto; border: 1px solid rgba(120, 220, 170, .28); background: rgba(120, 220, 170, .06); color: #9fe3c2; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; line-height: 1.6; white-space: nowrap; opacity: .75; transition: opacity .2s, background .2s; }
.it:hover .done-btn, .done-btn:focus-visible { opacity: 1; }
.done-btn:hover { background: rgba(120, 220, 170, .14); }
.it-b { flex: 1; min-width: 0; }
[data-theme="light"] .done-btn { color: #1f7a52; border-color: rgba(31, 122, 82, .3); background: rgba(31, 122, 82, .06); }
.card.has-bg .done-btn { color: #c9f0dc; border-color: rgba(200, 240, 220, .35); }
.card-set .f-row input.f-ic { width: 64px; justify-self: start; }

/* ================= scrolling performance =================
   1) the page background sits on its own fixed layer instead of background-attachment: fixed (which repaints the whole page on every scroll step)
   2) cards no longer blur what is behind them live (backdrop-filter on every card re-blurs on every scroll step); their glass is a slightly
      deeper tint instead, and a picture card's frost is a pre-blurred copy of its picture (cb-*.webp)
   3) smaller shadows, and cards far off screen skip rendering until they come near */
body { background: var(--bg); }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--bg) url(/art/k-bg.webp?v=ea09976a) center / cover no-repeat; transform: translateZ(0); }
[data-theme="light"] body { background: #f3f5f8; background-attachment: scroll; background-image: none; }
[data-theme="light"] body::before { background: #f3f5f8; background-image: radial-gradient(1100px 700px at 85% -10%, rgba(120, 200, 230, .28), transparent 60%), radial-gradient(900px 600px at 0% 30%, rgba(180, 160, 255, .2), transparent 60%), radial-gradient(800px 600px at 60% 110%, rgba(255, 200, 150, .16), transparent 60%); }
.card.glass, .kc, .kc-full .kbadge, .card.has-bg::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.card.glass { background: linear-gradient(180deg, rgba(44, 47, 54, .78) 0%, rgba(24, 26, 31, .86) 50%, rgba(15, 16, 20, .9) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 30px -18px rgba(0, 0, 0, .8); }
[data-theme="light"] .card.glass { background: rgba(255, 255, 255, .84); box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 8px 22px -14px rgba(20, 40, 70, .22); }
.card.has-bg { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 16px 34px -20px rgba(0, 0, 0, .9) !important; }
.card-bgblur { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; pointer-events: none; filter: brightness(.8) saturate(1.1);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .4) 22%, #000 55%); mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .4) 22%, #000 55%); }
.card.has-bg::after { z-index: 0; }
.board > .card:not(.brain-card):not(.add-card) { content-visibility: auto; contain-intrinsic-size: auto 150px; }
.kc { box-shadow: 0 4px 10px -8px rgba(0, 0, 0, .6); }

/* every card moves and resizes on its own, any time (no arrange mode): the ⠿ grip drags it, the corner handle sizes it */
.grip { cursor: grab; font-size: 14px; letter-spacing: -1px; }
.grip:active { cursor: grabbing; }
.card.custom { grid-column: span var(--cw, 3); grid-row: span var(--rh, 2); }
.rsz { position: absolute; bottom: 0; inset-inline-end: 0; width: 18px; height: 18px; z-index: 3; cursor: nesw-resize; opacity: 0; transition: opacity .2s;
  background: linear-gradient(225deg, transparent 45%, rgba(255, 255, 255, .35) 46%, rgba(255, 255, 255, .35) 54%, transparent 55%, transparent 65%, rgba(255, 255, 255, .35) 66%, rgba(255, 255, 255, .35) 74%, transparent 75%); border-end-start-radius: 0; }
.card:hover .rsz, .card.resizing .rsz { opacity: .8; }
[dir="ltr"] .rsz { cursor: nwse-resize; }
.card.resizing { outline: 1px dashed rgba(233, 217, 184, .5); outline-offset: -1px; z-index: 5; }
body.resizing-card { cursor: nesw-resize; user-select: none; }
.card.dragging-card { opacity: .45; }
.card.drop-here { outline: 1.5px dashed rgba(233, 217, 184, .7); outline-offset: -2px; }
[data-theme="light"] .rsz { background: linear-gradient(225deg, transparent 45%, rgba(20, 30, 45, .3) 46%, rgba(20, 30, 45, .3) 54%, transparent 55%, transparent 65%, rgba(20, 30, 45, .3) 66%, rgba(20, 30, 45, .3) 74%, transparent 75%); }
@media (max-width: 1100px) { .card.custom { grid-column: span var(--cw6, 3); } }
@media (max-width: 640px) { .card.custom { grid-column: 1 / -1; } .rsz { display: none; } }

/* the card controls: thin line icons (Apple-like), quiet until the card is hovered */
.card-acts .tool { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--dim); }
.card-acts .tool .ic { width: 16px; height: 16px; display: block; }
.card-acts .tool:hover { color: var(--ink); background: var(--hover, rgba(255, 255, 255, .07)); }
.card-acts .grip .ic { width: 15px; height: 15px; }
.card.has-bg .card-acts .tool { color: rgba(255, 255, 255, .78); }
.card.has-bg .card-acts .tool:hover { color: #fff; background: rgba(255, 255, 255, .12); }

/* a section heading: its title keeps its own height (it used to collapse to nothing and slip below the card's edge) */
.t-heading { overflow: visible; content-visibility: visible !important; justify-content: flex-end; }
.t-heading .card-b { flex: none; overflow: visible; }
.t-heading .card-h { position: absolute; top: 4px; inset-inline-end: 0; padding: 0; z-index: 2; }
.t-heading .sec-title { padding-inline-end: 70px; line-height: 1.5; }
[data-theme="light"] .sec-title { color: #1d222b; }
[data-theme="light"] .sec-title[data-empty] { color: rgba(29, 34, 43, .38); }

/* frosted matte glass: the whole card shows the picture blurred (shapes and light only), a soft satin sheen on top, deeper below for the text */
.card.has-bg .card-bgblur.frost { inset: 0; width: 100%; height: 100%; filter: none; -webkit-mask-image: none; mask-image: none; transform: scale(1.06); }
.card.has-bg::after { background: linear-gradient(180deg, rgba(255, 255, 255, .05) 0%, rgba(14, 16, 20, .14) 30%, rgba(14, 16, 20, .4) 70%, rgba(12, 13, 16, .58) 100%) !important;
  -webkit-mask-image: none !important; mask-image: none !important; }
.card.has-bg::before { z-index: 1; background: radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, .1), transparent 60%), radial-gradient(70% 45% at 50% 110%, rgba(255, 160, 90, .1), transparent 70%); }
.card.has-bg > .card-h, .card.has-bg > .card-b, .card.has-bg > .rsz { z-index: 2; }
.card.has-bg { border-color: rgba(255, 255, 255, .14) !important; }

/* the glass slider: clear → soft frost → rough frost. Layers: the clear picture, the blurred matte copy (opacity = frost), grain at the rough end */
.card.has-bg .card-bgimg.clear { inset: 0; height: 100%; opacity: 1; filter: brightness(.92); -webkit-mask-image: none; mask-image: none; }
.card.has-bg .card-bgblur.frost { opacity: var(--fr, .8); }
.card.has-bg .grain { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: url(/art/k-grain.webp?v=ea09976a) repeat; background-size: 96px 96px; opacity: var(--gr, 0); }
.card.has-bg::after { background: linear-gradient(180deg, rgba(255, 255, 255, .04) 0%, rgba(14, 16, 20, calc(var(--sh, .3) * .6)) 30%, rgba(14, 16, 20, var(--sh, .3)) 65%, rgba(12, 13, 16, calc(var(--sh, .3) + .2)) 100%) !important; }
.fr { display: grid; gap: 6px; }
.fr-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--dim); }
.fr-word { color: var(--ink); font-size: 12.5px; }
.fr-ends { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint, rgba(236, 239, 244, .4)); }
.fr-range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; cursor: pointer; }
.fr-range::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .32)); }
.fr-range::-moz-range-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .32)); }
.fr-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #f5f3ef; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .35), 0 0 0 .5px rgba(0, 0, 0, .1); }
.fr-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #f5f3ef; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.fr-range:focus-visible { outline: none; } .fr-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(233, 217, 184, .35); }
[data-theme="light"] .fr-range::-webkit-slider-runnable-track { background: linear-gradient(90deg, rgba(20, 30, 45, .08), rgba(20, 30, 45, .28)); }
[data-theme="light"] .fr-range::-moz-range-track { background: linear-gradient(90deg, rgba(20, 30, 45, .08), rgba(20, 30, 45, .28)); }
.bg-menu .fr { padding: 6px 2px 2px; border-top: 1px solid var(--line); margin-top: 2px; }

/* ================= «اسأل عقلك»: the assistant, in a quiet Apple-like glass window =================
   a small pill in the top bar opens it; a soft spectrum line breathes along its edge while it thinks */
.ask-btn { display: inline-flex; align-items: center; gap: 6px; }
.ask-btn .ic { width: 15px; height: 15px; color: #e9d9b8; }
.ask { position: fixed; z-index: 80; bottom: 22px; inset-inline-start: 22px; width: min(400px, calc(100vw - 28px)); height: min(600px, calc(100vh - 44px));
  display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; isolation: isolate;
  background: rgba(22, 24, 29, .86); border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(24px) saturate(1.2); -webkit-backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .08);
  opacity: 0; transform: translateY(14px) scale(.98); transform-origin: bottom right; transition: opacity .24s ease, transform .3s cubic-bezier(.2, .8, .2, 1); }
.ask.on { opacity: 1; transform: none; }
.ask-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .4s;
  background: radial-gradient(60% 40% at 15% 0%, rgba(120, 200, 255, .16), transparent 70%), radial-gradient(60% 40% at 85% 0%, rgba(200, 140, 255, .14), transparent 70%), radial-gradient(70% 40% at 50% 100%, rgba(255, 170, 110, .1), transparent 70%); }
.ask.thinking .ask-glow { opacity: 1; animation: askBreath 2.4s ease-in-out infinite; }
@keyframes askBreath { 50% { opacity: .45; } }
.ask-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
.ask-t { display: inline-flex; align-items: center; gap: 8px; }
.ask-t .ic { width: 17px; height: 17px; color: #e9d9b8; }
.ask-t b { font-weight: 500; font-size: 14.5px; letter-spacing: .01em; }
.ask-x .ic { width: 15px; height: 15px; }
.ask-x { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.ask-log { flex: 1; min-height: 0; overflow: auto; padding: 6px 14px 10px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .12) transparent; }
.ask-hello { margin: auto 0; padding: 8px 4px; display: grid; gap: 6px; }
.ask-hello-t { font-size: 16px; font-weight: 400; }
.ask-hello-p { font-size: 13px; color: var(--dim); }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ask-chips .chip { padding: 6px 12px; font-size: 12.5px; background: rgba(255, 255, 255, .04); }
.ask-msg { display: flex; }
.ask-msg.me { justify-content: flex-start; }
.ask-msg.ai { justify-content: flex-end; }
.ask-b { max-width: 86%; padding: 9px 13px; border-radius: 18px; font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-msg.me .ask-b { background: linear-gradient(180deg, #3a7bd5, #2f6bc4); color: #fff; border-end-start-radius: 6px; }
.ask-msg.ai .ask-b { background: rgba(255, 255, 255, .07); color: var(--ink); border-end-end-radius: 6px; }
.ask-msg.err .ask-b { color: #ffb4a8; }
.ask-msg.ai { flex-direction: column; align-items: flex-end; gap: 8px; }
.typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; animation: askDot 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes askDot { 40% { opacity: .9; transform: translateY(-2px); } }
.ask-draft { width: 86%; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(233, 217, 184, .22); background: rgba(233, 217, 184, .05); display: grid; gap: 10px; }
.ask-draft ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.ask-draft li { display: grid; gap: 1px; }
.ask-draft li b { font-weight: 500; font-size: 13px; }
.ask-draft li span { font-size: 11.5px; color: var(--dim); }
.ask-ok { font-size: 12.5px; color: #9fe3c2; } .ask-ok.dim { color: var(--dim); }
.ask-bar { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 6px; border-radius: 20px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); }
.ask-bar:focus-within { border-color: rgba(233, 217, 184, .35); }
.ask-in { flex: 1; resize: none; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; line-height: 1.6; padding: 5px 8px; max-height: 120px; }
.ask-in::placeholder { color: var(--faint, rgba(236, 239, 244, .4)); }
.ask-send { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #3a7bd5; color: #fff; transition: opacity .2s, transform .15s; }
.ask-send .ic { width: 16px; height: 16px; stroke-width: 2.1; }
.ask-send:disabled { opacity: .3; }
.ask-send:not(:disabled):active { transform: scale(.92); }
.ask-foot { margin: 8px 16px 12px; font-size: 10.5px; color: var(--faint, rgba(236, 239, 244, .4)); text-align: center; }
[data-theme="light"] .ask { background: rgba(250, 251, 253, .9); border-color: rgba(255, 255, 255, .9); box-shadow: 0 30px 70px -24px rgba(20, 40, 70, .35); }
[data-theme="light"] .ask-msg.ai .ask-b { background: rgba(20, 30, 45, .06); }
[data-theme="light"] .ask-bar { background: rgba(20, 30, 45, .04); border-color: rgba(20, 30, 45, .08); }
[data-theme="light"] .ask-x { background: rgba(20, 30, 45, .06); }
[data-theme="light"] .ask-ok { color: #1f7a52; }
[data-theme="light"] .ask-t .ic, [data-theme="light"] .ask-btn .ic { color: #a8885a; }
@media (max-width: 640px) { .ask { inset: auto 0 0 0; width: 100%; height: 82vh; border-radius: 22px 22px 0 0; } .ask-btn span { display: none; } }
@media (prefers-reduced-motion: reduce) { .ask, .ask.thinking .ask-glow, .typing i { transition: none; animation: none; } }

/* «مظهر البطاقات»: one place for the whole board's look; it sits at the side with no dark veil, so the cards change live behind it */
.style-back { background: transparent !important; place-items: start end; padding: 70px 22px 22px; pointer-events: none; }
.style-back > * { pointer-events: auto; }
.style-set { width: min(380px, 100%); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .75); }
.set-ic { display: inline-flex; align-items: center; gap: 8px; }
.set-ic .ic, .style-btn .ic, .menu-row .ic { width: 16px; height: 16px; }
.seg-ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; border-radius: 10px; background: rgba(255, 255, 255, .07); }
.seg-o { border: 0; background: transparent; color: var(--dim); border-radius: 8px; padding: 6px 8px; font-size: 12.5px; transition: background .2s, color .2s; }
.seg-o.on { background: rgba(255, 255, 255, .16); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
[data-theme="light"] .seg-ctl { background: rgba(20, 30, 45, .07); }
[data-theme="light"] .seg-o.on { background: #fff; box-shadow: 0 1px 3px rgba(20, 30, 45, .18); }
.look-note { margin: 0; font-size: 12.5px; color: var(--dim); line-height: 1.7; }
.look-box { display: grid; gap: 10px; }
.look-own { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--dim); padding-top: 8px; border-top: 1px solid var(--line); }
.mini-menu .menu-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.style-set .bg-grid { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 640px) { .style-back { place-items: end center; padding: 10px; } }

/* finer, softer grain at the rough end: drawn at half its size (true-pixel specks), never stronger than a satin finish;
   the rough end also turns the glass a little milky, like real frosted glass, instead of only adding noise */
.card.has-bg .grain { background-size: 64px 64px; opacity: calc(var(--gr, 0) * .75); image-rendering: auto; }
.card.has-bg .grain::after { content: ''; position: absolute; inset: 0; background: rgba(220, 225, 232, .06); opacity: var(--gr, 0); }

/* buttons with a line icon (no emoji): «غيّرها» on the photo card, the task cover buttons */
.photo-change, .ic-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.photo-change .ic, .ic-btn .ic { width: 15px; height: 15px; flex: none; }
.photo-change { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(18, 20, 25, .62) !important; border: 1px solid rgba(255, 255, 255, .14) !important; color: #f3efe8 !important; border-radius: 999px !important; padding: 4px 11px !important; font-size: 12px !important; }

/* «حالة العقل»: the small window under the brain's ∿ button */
.mind-btn { display: inline-grid; place-items: center; }
.mind-btn .ic { width: 16px; height: 16px; }
.mind-menu { width: 290px; min-width: 0; padding: 12px; gap: 10px; }
.mind-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mind-h .set-ic { font-size: 13.5px; } .mind-h .ic { width: 16px; height: 16px; color: #e9d9b8; }
.mind-now { font-weight: 400; font-size: 12.5px; color: var(--ink); padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, .07); }
.seg3 { grid-template-columns: repeat(3, 1fr); }
.mind-mood { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.mind-mood:empty { display: none; }
.mind-mood .cb-sel { flex: 1; }
.mind-why { margin: 0; font-size: 11.5px; line-height: 1.7; color: var(--dim); }
.mind-menu .fr-range:disabled { opacity: .45; cursor: default; }
[data-theme="light"] .mind-now { background: rgba(20, 30, 45, .07); }

/* the brain's sky: deep space (dark mode) or a pearl sky (light mode, the ◐ button). Sharp 16:9 pictures, centred, cropped to the card */
.brain-card, [data-theme="light"] .brain-card { background: #03050a url(/art/k-sky-d.webp?v=ea09976a) center / cover no-repeat; }
.brain-card.full { background: #03050a url(/art/k-sky-d.webp?v=ea09976a) center / cover no-repeat; }
.brain-card.sky-light, [data-theme="light"] .brain-card.sky-light, .brain-card.sky-light.full { background: #eef1f6 url(/art/k-sky-l.webp?v=ea09976a) center / cover no-repeat; }

/* the skies in AVIF first (a third to a half lighter), WebP for older browsers: the line above each image-set is the fallback */
.brain-card, [data-theme="light"] .brain-card, .brain-card.full { background-image: image-set(url(/art/k-sky-d.avif?v=ea09976a) type("image/avif"), url(/art/k-sky-d.webp?v=ea09976a) type("image/webp")); }
.brain-card.sky-light, [data-theme="light"] .brain-card.sky-light, .brain-card.sky-light.full { background-image: image-set(url(/art/k-sky-l.avif?v=ea09976a) type("image/avif"), url(/art/k-sky-l.webp?v=ea09976a) type("image/webp")); }

/* a habit's streak on its card: a warm, quiet badge */
.kbadge.streak { color: #f4c27a; border-color: rgba(244, 194, 122, .35); background: rgba(244, 194, 122, .08); }
[data-theme="light"] .kbadge.streak { color: #a5631a; border-color: rgba(165, 99, 26, .3); background: rgba(165, 99, 26, .07); }

/* ===== the features panel: iOS-like switches ===== */
.feat-menu { width: 320px; min-width: 0; padding: 12px; gap: 4px; max-height: min(78vh, 640px); overflow: auto; }
.feat-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.feat-t { display: grid; gap: 1px; } .feat-t b { font-weight: 400; font-size: 13px; } .feat-t i { font-style: normal; font-size: 11px; color: var(--dim); }
.switch { -webkit-appearance: none; appearance: none; flex: none; width: 38px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, .16); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .2s cubic-bezier(.3, .7, .3, 1); }
.switch:checked { background: #34c759; }
.switch:checked::after { transform: translateX(-16px); }
[dir="ltr"] .switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { outline: 2px solid rgba(233, 217, 184, .6); outline-offset: 2px; }
[data-theme="light"] .switch { background: rgba(20, 30, 45, .16); } [data-theme="light"] .switch:checked { background: #34c759; }
.bar-btn[hidden] { display: none !important; }

/* ===== «◎ الآن» ===== */
.now-menu { width: 330px; min-width: 0; padding: 14px; gap: 8px; }
.now-t { font-size: 16px; font-weight: 400; line-height: 1.6; }
.now-sub { font-size: 12px; color: var(--dim); }
.now-empty { margin: 4px 0; font-size: 13px; color: var(--dim); }
.now-btns { flex-wrap: wrap; margin-top: 4px; }

/* ===== «⏱ التركيز»: a calm ring ===== */
.focus-win { position: fixed; z-index: 85; bottom: 22px; inset-inline-end: 22px; width: 290px; padding: 14px 16px 16px; border-radius: 22px; display: grid; gap: 10px;
  background: rgba(22, 24, 29, .9) !important; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .75); }
.fbody { display: grid; gap: 10px; justify-items: center; text-align: center; }
.fwrap { position: relative; width: 150px; height: 150px; }
.fsvg { width: 100%; height: 100%; }
.ftrack { stroke: rgba(255, 255, 255, .08); }
.fring { stroke: #e9d9b8; transition: stroke-dashoffset .5s linear; }
.fclock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 300; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.ftitle { font-size: 14px; max-width: 250px; }
.f-end { font-size: 15px; }
[data-theme="light"] .focus-win { background: rgba(250, 251, 253, .95) !important; } [data-theme="light"] .ftrack { stroke: rgba(20, 30, 45, .08); } [data-theme="light"] .fring { stroke: #a8885a; }

/* ===== «🔎 البحث»: a Spotlight-like window ===== */
.search-back { place-items: start center; padding-top: 12vh; }
.search-box { width: min(560px, 100%); padding: 0; gap: 0; overflow: hidden; }
.search-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.search-bar .ic { width: 18px; height: 18px; color: var(--dim); flex: none; }
.search-in { flex: 1; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 16px; }
.search-in::-webkit-search-cancel-button { display: none; }
.search-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.search-hit { width: 100%; text-align: start; border: 0; background: transparent; border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; cursor: pointer; }
.search-hit:hover, .search-hit:focus-visible { background: var(--hover, rgba(255, 255, 255, .07)); outline: none; }
.search-hit b { font-weight: 400; font-size: 14px; } .search-hit span { font-size: 11.5px; color: var(--dim); }
.search-hint { padding: 12px 10px; font-size: 12.5px; color: var(--dim); }

/* ===== the mood history: 14 quiet little bars under a meter ===== */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 22px; margin: 6px 0 2px; }
.spark i { flex: 1; min-width: 3px; border-radius: 2px; background: var(--mc, #b48cff); opacity: .55; }
.spark i:last-child { opacity: .95; }
.spark i.none { height: 3px; opacity: .15; background: currentColor; }

/* ---------- carrying a card anywhere ---------- */
.card-acts .grip { touch-action: none; }
body.carrying, body.carrying * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.drag-ghost { position: fixed; top: 0; left: 0; margin: 0; z-index: 60; pointer-events: none; transform-origin: 0 0; opacity: .92;
  border-radius: 18px; box-shadow: 0 26px 60px rgba(0, 0, 0, .45), 0 0 0 1px rgba(233, 217, 184, .35); will-change: transform; overflow: hidden; }
.card.drag-hole { background: transparent !important; box-shadow: none !important; outline: 1.5px dashed rgba(233, 217, 184, .55); outline-offset: -3px; }
.card.drag-hole > * { visibility: hidden; }
[data-theme="light"] .card.drag-hole { outline-color: rgba(60, 80, 110, .4); }
[data-theme="light"] .drag-ghost { box-shadow: 0 22px 50px rgba(20, 40, 70, .25), 0 0 0 1px rgba(60, 80, 110, .2); }
.undo-pill { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 6px 8px 6px 16px; border-radius: 999px; font-size: 14px; animation: toastIn .3s var(--ease); }
/* a task's text opens its card to edit it */
.it-open { all: unset; display: grid; flex: 1; min-width: 0; cursor: pointer; border-radius: 6px; }
.it-open:hover .it-t { text-decoration: underline; text-decoration-color: rgba(233, 217, 184, .35); text-underline-offset: 3px; }
.it-open:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; }
/* the wide page: each card in its own place (column, row) */
@media (min-width: 1101px) {
  .board > .card.pinned { grid-column: var(--gx) / span var(--gw); grid-row: var(--gy) / span var(--gh); }
  .board > .t-heading.pinned { grid-column: 1 / -1 !important; grid-row: var(--gy) / span 1 !important; }
}
/* ---------- «🎧 مكتبتي» ---------- */
.card-b.lib { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.lib-top { display: flex; align-items: center; gap: 8px; }
.lib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-chip { border: 1px solid var(--line-2); background: transparent; color: var(--dim); border-radius: 999px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.lib-chip.on, .lib-chip:hover { color: var(--ink); border-color: var(--accent); }
.lib-add { width: 100%; text-align: start; }
.lib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; overflow-y: auto; min-height: 0; flex: 1; }
.lib-it { border-radius: 10px; padding: 5px 6px; transition: background .2s; }
.lib-it:hover { background: var(--hover); }
.lib-row { display: flex; align-items: center; gap: 10px; }
.lib-open { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.lib-th { width: 72px; height: 40px; flex: none; border-radius: 7px; object-fit: cover; background: rgba(255, 255, 255, .05); }
.lib-th-ic { display: grid; place-items: center; font-size: 18px; }
.lib-b { display: grid; min-width: 0; }
.lib-t { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-s { font-size: 11.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-open:hover .lib-t { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(233, 217, 184, .35); }
.lib-it.w .lib-th { opacity: .75; }
.lib-note { all: unset; display: block; margin: 4px 0 2px; margin-inline-start: 82px; font-size: 12.5px; line-height: 1.6; color: var(--dim); cursor: pointer; border-inline-start: 2px solid rgba(233, 217, 184, .3); padding-inline-start: 8px; }
.lib-note:hover { color: var(--ink); }
.lib-edit { flex: none; }
.lib-ask { max-width: 460px; }
.cb-link { display: inline-flex; align-self: flex-start; margin: 4px 0 8px; text-decoration: none; }
/* ---------- «📅 التقويم» ---------- */
.card-b.cal { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; }
.cal-head { display: flex; align-items: center; gap: 6px; }
.cal-title { font-size: 14.5px; font-weight: 500; min-width: 7.5em; text-align: center; }
.cal-today { margin-inline-start: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { font-size: 11px; color: var(--dim); text-align: center; padding-bottom: 2px; }
.cal-d { min-height: 64px; border-radius: 9px; padding: 4px 5px; background: rgba(255, 255, 255, .025); border: 1px solid transparent; display: flex; flex-direction: column; gap: 2px; min-width: 0; cursor: pointer; transition: background .2s, border-color .2s; }
.cal-grid.w .cal-d { min-height: 180px; }
.cal-d:hover { background: rgba(255, 255, 255, .05); }
.cal-d.out { opacity: .4; }
.cal-d.past .cal-n { color: var(--faint); }
.cal-d.today { border-color: rgba(233, 217, 184, .45); }
.cal-d.today .cal-n { color: var(--accent); font-weight: 600; }
.cal-d.sel { background: rgba(233, 217, 184, .08); border-color: rgba(233, 217, 184, .6); }
.cal-d.cal-over { background: rgba(111, 214, 234, .12); border-color: rgba(111, 214, 234, .6); }
.cal-n { font-size: 12px; line-height: 1.2; }
.cal-c { font-size: 11px; line-height: 1.45; padding: 1px 5px; border-radius: 5px; background: rgba(111, 214, 234, .13); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; border-inline-start: 2px solid rgba(111, 214, 234, .7); }
.cal-c:hover { background: rgba(111, 214, 234, .22); }
.cal-c.p1 { border-inline-start-color: #f2706b; }
.cal-c.late { background: rgba(245, 163, 91, .16); border-inline-start-color: #f5a35b; }
.cal-c.rep { background: rgba(169, 139, 255, .13); border-inline-start-color: rgba(169, 139, 255, .7); }
.cal-c.done { opacity: .45; text-decoration: line-through; }
.cal-c.drag { opacity: .4; }
.cal-c[draggable="true"] { cursor: grab; }
.cal-more { font-size: 10.5px; color: var(--dim); }
.cal-grid.w .cal-c { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cal-day { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 6px; }
.cal-day-h { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.cal-it { padding: 2px 0; }
.cal-it .cal-c { white-space: normal; font-size: 12.5px; }
[data-theme="light"] .cal-d { background: rgba(10, 30, 60, .03); }
@media (max-width: 640px) { .cal-d { min-height: 48px; } .cal-grid.m .cal-c { font-size: 0; height: 5px; padding: 0; border: 0; } .cal-grid.w { grid-template-columns: 1fr; } .cal-grid.w .cal-wd { display: none; } .cal-grid.w .cal-d { min-height: 0; } }
/* ---------- «🗑 المحذوفات» ---------- */
.trash-box { max-width: 560px; width: min(560px, 94vw); max-height: 82vh; display: flex; flex-direction: column; }
.trash-h { display: flex; align-items: center; justify-content: space-between; }
.trash-list { overflow-y: auto; min-height: 60px; }
.trash-ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.trash-it { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; transition: background .2s; }
.trash-it:hover { background: var(--hover); }
.trash-ic { width: 26px; text-align: center; flex: none; }
.trash-b { display: grid; flex: 1; min-width: 0; }
.trash-b b { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-b span { font-size: 11.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ---------- «📄 صفحة الكتابة» ---------- */
.pg { position: relative; display: grid; align-content: start; gap: 2px; padding: 4px 0 18px; min-height: 90px; cursor: text; font-size: 14.5px; line-height: 1.75; }
.pg-b { position: relative; display: flex; align-items: flex-start; gap: 8px; border-radius: 6px; padding: 1px 4px; }
.pg-b:focus-within { background: rgba(255, 255, 255, .025); }
.pg-tx { flex: 1; min-width: 0; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.pg-tx:empty::before { content: attr(data-ph); color: var(--faint); pointer-events: none; }
.pg-b:focus-within .pg-tx:empty::before { content: attr(data-ph); }
.pg-p .pg-tx:empty:not(:focus)::before { content: ''; }
.pg-h1 .pg-tx { font-size: 22px; font-weight: 600; line-height: 1.45; margin-top: 10px; }
.pg-h2 .pg-tx { font-size: 18px; font-weight: 600; line-height: 1.5; margin-top: 8px; }
.pg-h3 .pg-tx { font-size: 15.5px; font-weight: 600; margin-top: 4px; }
.pg-ul::before { content: '•'; color: var(--accent); width: 14px; text-align: center; flex: none; }
.pg-num { color: var(--dim); min-width: 18px; text-align: center; flex: none; font-variant-numeric: tabular-nums; }
.pg-chk { flex: none; width: 17px; height: 17px; margin-top: 5px; border-radius: 5px; border: 1.5px solid var(--line-2); background: transparent; cursor: pointer; padding: 0; position: relative; }
.pg-chk.on { background: var(--accent); border-color: var(--accent); }
.pg-chk.on::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: #12141a; }
.pg-todo.done .pg-tx { color: var(--dim); text-decoration: line-through; }
.pg-quote { border-inline-start: 3px solid rgba(233, 217, 184, .45); padding-inline-start: 12px; color: var(--dim); }
.pg-callout { background: rgba(233, 217, 184, .07); border: 1px solid rgba(233, 217, 184, .16); border-radius: 10px; padding: 8px 10px; margin: 4px 0; }
.pg-ic { flex: none; }
.pg-hr { padding: 6px 4px; outline: none; }
.pg-hr hr { width: 100%; border: 0; border-top: 1px solid var(--line-2); margin: 6px 0; }
.pg-hr:focus hr, .pg-img:focus-within { border-color: var(--accent); }
.pg-b.pg-img { display: block; padding: 4px; outline: none; }
.pg-b.pg-img:focus { background: rgba(233, 217, 184, .08); }
img.pg-img { display: block; max-width: 100%; max-height: 420px; border-radius: 10px; cursor: zoom-in; }
.pg-x { position: absolute; top: 10px; inset-inline-end: 10px; opacity: 0; transition: opacity .2s; background: rgba(12, 14, 20, .7) !important; }
.pg-b:hover .pg-x, .pg-b:focus .pg-x { opacity: 1; }
.pg-menu { position: absolute; inset-inline-start: 0; z-index: 40; width: 250px; max-height: 300px; overflow-y: auto; padding: 6px; border-radius: 12px; display: grid; gap: 2px; box-shadow: 0 18px 44px rgba(0, 0, 0, .45); }
.pg-mi { all: unset; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.pg-mi.on, .pg-mi:hover { background: var(--hover); }
.pg-mi-ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--line-2); font-size: 13px; }
.pg-mi-b { display: grid; }
.pg-mi-b b { font-weight: 500; font-size: 13.5px; }
.pg-mi-b span { font-size: 11.5px; color: var(--dim); }
.cb-desc-h { display: flex; align-items: center; justify-content: space-between; }
.cb-full { font-size: 12px; padding: 3px 10px; }
.cb-page { border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; max-height: 320px; overflow-y: auto; }
/* the full page */
.pg-back { position: fixed; inset: 0; z-index: 85; background: rgba(4, 6, 10, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow-y: auto; animation: lbIn .25s var(--ease); }
.pg-sheet { max-width: 760px; margin: 5vh auto 10vh; padding: 22px 34px 40px; border-radius: 18px; background: var(--bg-2, #12151c); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.pg-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pg-state { font-size: 12px; color: var(--dim); }
.pg-title { width: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 28px; font-weight: 600; line-height: 1.35; resize: none; outline: none; padding: 0; margin-bottom: 6px; field-sizing: content; overflow: hidden; }
.pg-sheet .pg { font-size: 15.5px; min-height: 40vh; }
[data-theme="light"] .pg-sheet { background: #fbfaf7; }
[data-theme="light"] .pg-chk.on::after { color: #fff; }
@media (max-width: 640px) { .pg-sheet { margin: 0; min-height: 100%; border-radius: 0; padding: 14px 16px 30px; } .pg-title { font-size: 22px; } }
/* the «add a card» line under the lowest card on the wide page */
@media (min-width: 1101px) { .board > .add-card.at-end { grid-row: var(--gy) / span 1; grid-column: 1 / -1; } }

/* ---------- quiet tiles: the emoji grey in a small square (or in full colour, from «مظهر البطاقات» ← الرموز) ---------- */
[data-icons="tile"] .emo { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 6px; background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09); font-size: 12px; line-height: 1; filter: grayscale(1) brightness(1.12); opacity: .85; vertical-align: middle; }
[data-theme="light"][data-icons="tile"] .emo { background: rgba(10, 30, 60, .04); border-color: rgba(10, 30, 60, .1); filter: grayscale(1) brightness(.9); }
[data-icons="tile"] .card-ic.emo { width: 20px; height: 20px; font-size: 11px; border-radius: 5px; }
[data-icons="tile"] .crumb .emo { width: 18px; height: 18px; font-size: 10.5px; border-radius: 5px; margin-inline-end: 6px; }
[data-icons="color"] .crumb .emo { margin-inline-end: 5px; }
.crumb { display: inline-flex; align-items: center; }
[data-icons="tile"] .tn-ic.emo { width: 22px; }
/* the tools at the top of the side list */
.side-tools { display: grid; gap: 1px; padding: 0 2px 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.side-tool { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border: 0; background: none; border-radius: 7px; color: var(--dim); font: inherit; font-size: 13.5px; text-align: start; cursor: pointer; transition: background .2s, color .2s; }
.side-tool:hover { background: var(--hover); color: var(--ink); }
.side-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 6px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .09); filter: none !important; opacity: 1 !important; }
.side-ic .ic { width: 14px; height: 14px; }
[data-theme="light"] .side-ic { background: rgba(10, 30, 60, .04); border-color: rgba(10, 30, 60, .1); }
/* while the side list is open its tools stand in for the top-bar buttons (the list button stays, to close it) */
@media (min-width: 901px) { body.list-on .bar-btns > :not(.list-btn) { display: none; } }
/* the top-bar buttons on the right, the brain's name on the left (the user's choice) */
.pagebar { flex-direction: row-reverse; }

/* the side list on the right (the start side in Arabic); the page makes room on the right */
.sidebar { inset-inline-end: auto; inset-inline-start: 0; border-inline-end: 1px solid var(--line); border-inline-start: 0; }
@keyframes sideInR { from { transform: translateX(16px); opacity: 0; } }
.sidebar { animation-name: sideInR; }
body.list-on .page { margin-inline-end: 0; margin-inline-start: 270px; }
@media (max-width: 900px) { body.list-on .page { margin-inline-start: 0; } .sidebar { box-shadow: -20px 0 50px rgba(0, 0, 0, .5); } }
/* the top-bar buttons in their first order from the right: «الفروع» first (beside the list), then the theme, the features … «الآن» */
.bar-btns { flex-direction: row-reverse; }
/* the meter: a tall, easy target (the thin bars stay as they look) and it can be slid */
.meter { cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.seg { position: relative; height: 26px; background: transparent !important; opacity: 1 !important; cursor: pointer; }
.seg::before { content: ''; position: absolute; inset-inline: 0; top: 50%; height: 9px; margin-top: -4.5px; border-radius: 3px; background: rgba(255, 255, 255, .09); transition: background .2s, opacity .2s; }
.seg.on::before { background: var(--mc, var(--accent)); }
.seg:hover::before { background: var(--mc, var(--accent)); opacity: .7; }
.seg.on:hover::before { opacity: 1; }
[data-theme="light"] .seg::before { background: rgba(20, 30, 45, .1); }
[data-theme="light"] .seg.on::before, .card.has-bg .seg.on::before { background: var(--mc, var(--accent)); }
.card.has-bg .seg::before { background: rgba(255, 255, 255, .14); }
.meter-top { margin-block: -6px -4px; }

/* ---------- a branch's menu (⋯) ---------- */
.tm { flex: none; width: 24px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--dim); font-size: 15px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; }
.trow:hover .tm, .tm:focus-visible, .p-title:hover .tm { opacity: 1; }
.tm:hover { background: var(--hover); color: var(--ink); }
@media (hover: none) { .tm { opacity: .7; } }
.p-tm { margin-inline-start: 6px; vertical-align: middle; }
.bm { width: 240px; padding: 6px; display: grid; gap: 1px; }
.bm-h { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px; font-size: 13.5px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.bm-i { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border: 0; background: none; border-radius: 7px; color: var(--ink); font: inherit; font-size: 13.5px; text-align: start; cursor: pointer; }
.bm-i:hover { background: var(--hover); }
.bm-i.danger { color: #f2908b; }
.bd { max-width: 440px; width: min(440px, 94vw); display: grid; gap: 10px; }
.bd-row { display: flex; gap: 8px; }
.bd-ic { width: 56px; flex: none; text-align: center; }
.bd-row .cb-in:last-child { flex: 1; }
.bd-note { margin: 0; }
.trash-sec { margin-top: 12px; }

/* ================= nothing cut off =================
   1) a card whose content goes on past its edge fades softly there (markMore in brain.js adds .more-b / .more-t), so it reads «scroll for more»
   2) «عبادتي» at its usual size takes four rows: the next prayer, the six times and the khatma all fit (TYPE_ROWS in brain.js)
   3) a one-row meter shows only its bar; its sentence and its 14 days show when the card is taller
   4) on a phone the cards follow each other in one column, so each one simply grows to fit what it holds (up to most of the screen);
      the photo keeps its own size (a tall picture would otherwise fill the screen) */
.card-b.more-b { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent); }
.card-b.more-t { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22px); mask-image: linear-gradient(to bottom, transparent, #000 22px); }
.card-b.more-t.more-b { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22px, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 22px, #000 calc(100% - 30px), transparent); }
.card.t-ibada.size-m:not(.custom) { grid-row: span 4; }
@media (min-width: 641px) { .card.t-meter.size-s:not(.custom) .meter-note, .card.t-meter.size-s:not(.custom) .spark { display: none; } }
@media (max-width: 640px) {
  .board { grid-auto-rows: minmax(var(--row), auto); }
  .board > .card:not(.brain-card):not(.size-f):not(.custom):not(.add-card):not(.t-photo) { grid-row: span 1; max-height: 72vh; }
  .board > .brain-card { height: calc(6 * var(--row) + 5 * 10px); }
  .board > .card.size-f:not(.custom) { height: calc(8 * var(--row) + 7 * 10px); }
  .board > .card.custom { height: calc(var(--rh, 2) * var(--row) + (var(--rh, 2) - 1) * 10px); }
}
/* a tall screen (a phone) gets the tall background, so the wide picture is not stretched 2.5 times (made by ui/art.mjs --bg) */
@media (max-aspect-ratio: 4/5) {
  body::before { background-image: url(/art/k-bg-m.webp?v=ea09976a); }
  [data-theme="light"] body::before { background-image: radial-gradient(1100px 700px at 85% -10%, rgba(120, 200, 230, .28), transparent 60%), radial-gradient(900px 600px at 0% 30%, rgba(180, 160, 255, .2), transparent 60%), radial-gradient(800px 600px at 60% 110%, rgba(255, 200, 150, .16), transparent 60%); }
}
/* ================= the brain does not catch the page =================
   On the page, one finger (a phone) scrolls the page even over the brain; two fingers zoom and look around (brain.js bindPointer).
   In full screen everything belongs to the brain again. The mouse wheel scrolls the page; Ctrl + wheel zooms, and a small hint says so. */
.stage { touch-action: pan-x pan-y; }
.brain-card.full .stage { touch-action: none; }
.wheel-hint { position: absolute; left: 50%; bottom: 16px; z-index: 4; transform: translate(-50%, 6px); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; white-space: nowrap; pointer-events: none;
  color: rgba(236, 239, 244, .92); background: rgba(10, 14, 20, .72); border: 1px solid rgba(255, 255, 255, .1); opacity: 0; transition: opacity .25s, transform .25s; }
.wheel-hint.on { opacity: 1; transform: translate(-50%, 0); }
.brain-card.sky-light .wheel-hint { color: #2a3140; background: rgba(255, 255, 255, .85); border-color: rgba(10, 30, 60, .12); }

/* ================= the top bar on a phone =================
   Eight buttons did not fit: the last ones went off the screen and the brain's name broke onto two lines. On a phone the side list
   (☰) already holds asking, the card look, the deleted items, the features and the theme, so the bar keeps only «الآن», search and ☰.
   The name stays on one line (shortened with … when it is long). */
@media (max-width: 640px) {
  .pagebar { gap: 8px; padding-bottom: 12px; }
  .brand { min-width: 0; flex: 1; }
  .brand-n { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bar-btns { flex: none; gap: 6px; }
  .bar-btns > :not(.list-btn):not(.feat-now):not(.feat-search) { display: none; }
}
/* ================= resizing a card by touch =================
   The corner handle claims the finger (touch-action: none), as the ⠿ grip does: before this, a touch screen took the drag as
   scrolling the page and stopped the resize at once. On a touch screen the handle is a little bigger and always faintly shown. */
.rsz { touch-action: none; }
@media (pointer: coarse) { .rsz { width: 28px; height: 28px; opacity: .55; background-size: 18px 18px; background-position: 0 100%; background-repeat: no-repeat; } [dir="ltr"] .rsz { background-position: 100% 100%; } }
/* the «/» list of a note card floats over the page (a small card would cut it off) */
.pg-menu.pg-float { position: fixed; inset-inline-start: auto; z-index: 95; }
/* the «ملاحظة» card as a small writing page: the same blocks as «صفحة الكتابة», a little smaller to suit a card */
.note-pg .pg { min-height: 100%; padding: 0 0 6px; font-size: 13.5px; line-height: 1.7; }
.note-pg .pg-h1 .pg-tx { font-size: 18px; margin-top: 4px; } .note-pg .pg-h2 .pg-tx { font-size: 16px; margin-top: 4px; } .note-pg .pg-h3 .pg-tx { font-size: 14.5px; }
.note-pg .pg-b { padding-inline: 2px; }
.card.has-bg .note-pg .pg-tx { color: #f3efe8; }
/* ================= the mood log =================
   On the card: the last 14 days as bars or a line (the card's choice), a day not touched lighter («تلقائي»), and a short line under it.
   A press opens «سجل المزاج»: the chart, the numbers with their reasons, and every day to correct. */
.mood-open { all: unset; display: block; width: 100%; cursor: pointer; border-radius: 8px; margin-top: 6px; }
.mood-open:focus-visible { outline: 1px solid var(--mc, var(--accent)); outline-offset: 3px; }
.mood-chart { position: relative; height: 26px; }
.mood-chart.bars { display: flex; align-items: flex-end; gap: 3px; }
.mood-chart.bars i { flex: 1; min-width: 3px; border-radius: 2px 2px 1px 1px; background: var(--mc, #b48cff); opacity: .9; }
.mood-chart.bars i.carry { opacity: .3; }
.mood-chart.bars i.none { height: 4px; width: 4px; flex: 0 0 4px; margin-inline: auto; border-radius: 50%; background: currentColor; opacity: .18; align-self: flex-end; }
.mood-chart.bars i.noted { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55); }
.mood-chart.line svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mood-chart.line path { fill: none; stroke: var(--mc, #b48cff); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.mood-chart.line .dot { position: absolute; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: var(--mc, #b48cff); }
.mood-chart.line .dot.carry { background: var(--bg, #0b0d12); border: 1px solid var(--mc, #b48cff); opacity: .6; }
.mood-chart.line .dot.noted { box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.mood-sum { display: block; margin-top: 4px; font-size: 11.5px; color: var(--dim); }
.mood-open:hover .mood-sum { color: var(--ink); }
@media (min-width: 641px) { .card.t-meter.size-s:not(.custom) .mood-open { display: none; } }
.mood-log { width: min(520px, 100%); max-height: min(88vh, 860px); overflow-y: auto; gap: 12px; }
.mood-chart.big { height: 90px; margin: 4px 0 0; }
.mood-chart.big.bars { gap: 4px; }
.mood-chart.big.line .dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; }
.ml-opts { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.ml-hint { margin: 0; font-size: 12px; color: var(--dim); line-height: 1.7; }
.ml-nums { grid-template-columns: repeat(3, 1fr); height: auto; }
.ml-lab { font-size: 12px; color: var(--dim); margin: 2px 0 4px; }
.ml-why { display: grid; gap: 4px; }
.ml-wr { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 5px 8px; border-radius: 8px; background: rgba(255, 255, 255, .03); }
.ml-wr b { font-weight: 500; } .ml-wr span { color: var(--dim); font-size: 12px; }
.ml-days { display: grid; gap: 2px; }
.ml-day { all: unset; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.ml-day:hover, .ml-day.open { background: var(--hover, rgba(255, 255, 255, .05)); }
.ml-day:focus-visible { outline: 1px solid var(--mc); }
.ml-d { width: 92px; flex: none; color: var(--dim); }
.ml-val { width: 26px; flex: none; text-align: center; font-weight: 600; color: var(--mc); }
.ml-val.low { color: #ff9a8a; } .ml-val.high { color: #7fdcae; } .ml-val.empty { color: var(--faint); font-weight: 400; }
.ml-info { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ml-info i { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.ml-auto { color: var(--faint); border: 1px dashed var(--line-2); }
.ml-tag { color: var(--ink); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.ml-n { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ml-edit { flex: none; color: var(--faint); font-size: 12px; }
.ml-row { border: 1px solid var(--line); border-radius: 10px; }
.ml-ed { padding: 4px 10px 10px; display: grid; gap: 4px; }
.ml-vals { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; }
.ml-v { all: unset; text-align: center; padding: 6px 0; border-radius: 7px; font-size: 13px; cursor: pointer; border: 1px solid var(--line); color: var(--dim); }
.ml-v:hover { color: var(--ink); }
.ml-v.on { color: #12141a; background: var(--mc); border-color: var(--mc); font-weight: 600; }
.ml-v.low.on { background: #ff9a8a; border-color: #ff9a8a; } .ml-v.high.on { background: #7fdcae; border-color: #7fdcae; }
.ml-rs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ml-add { width: 120px; padding: 4px 10px; font-size: 12px; border-radius: 999px; }
.ml-del { color: #ff9a9a !important; border-color: rgba(255, 140, 140, .3) !important; }
.ml-note { width: 100%; box-sizing: border-box; resize: vertical; min-height: 54px; font: inherit; font-size: 13px; }
[data-theme="light"] .ml-tag { background: rgba(10, 30, 60, .05); }
[data-theme="light"] .ml-wr { background: rgba(10, 30, 60, .035); }
[data-theme="light"] .mood-chart.line .dot.carry { background: #fff; }
@media (max-width: 640px) { .ml-d { width: 74px; } .ml-v { padding: 7px 0; font-size: 12px; } }

/* ---------- «عاداتي»: the habits branch card (a +/− week and a chain per habit) ---------- */
.hb-sum { font-size: 12px; color: var(--dim); padding: 0 0 6px; }
.hb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hb-row { padding: 7px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.hb-row:first-child { border-top: 0; }
.hb-l1 { display: grid; grid-template-columns: minmax(0, 1fr) 92px 78px; align-items: center; gap: 7px; min-width: 0; }
.hb-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 500; color: var(--ink); }
.hb-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-edit { flex: none; border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 12px; line-height: 1; padding: 3px 5px; border-radius: 6px; }
.hb-edit:hover { color: var(--accent); background: var(--hover); }
.hb-at { justify-self: center; font-size: 12px; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 1px 9px; white-space: nowrap; }
.hb-at.none { color: var(--faint); background: var(--surface-2); }
.hb-streak { justify-self: end; font-size: 12px; color: var(--amber); background: rgba(240, 180, 90, .10); border-radius: 99px; padding: 1px 9px; white-space: nowrap; }
.hb-streak.zero { color: var(--faint); background: var(--surface-2); }
.hb-l2 { display: grid; grid-template-columns: minmax(0, 1fr) 92px 78px; align-items: center; gap: 7px; }
.hb-dots { display: inline-flex; align-items: center; gap: 5px; }
.hb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); opacity: .5; }
.hb-dot.pos { background: #45d08a; opacity: 1; }
.hb-dot.neg { background: #f2726f; opacity: .9; }
.hb-dot.today { background: transparent; border: 1.5px solid var(--accent); opacity: 1; width: 8px; height: 8px; }
.hb-dot.today.pos { background: #45d08a; border-color: #45d08a; }
.hb-dot.today.neg { background: #f2726f; border-color: #f2726f; }
.hb-val { justify-self: center; font-size: 12px; min-width: 26px; text-align: center; border-radius: 6px; padding: 0 6px; }
.hb-val.pos { color: #45d08a; background: rgba(69, 208, 138, .12); }
.hb-val.neg { color: #f2726f; background: rgba(242, 114, 111, .12); }
.hb-val.none { color: var(--faint); background: var(--surface-2); }
.hb-quick { justify-self: end; display: inline-flex; gap: 4px; }
.hb-q { border: 1px solid var(--line-2); background: transparent; border-radius: 7px; width: 32px; height: 32px; font-size: 13px; line-height: 1; cursor: pointer; }
.hb-q.plus { color: #45d08a; }
.hb-q.minus { color: #f2726f; }
.hb-q:hover { background: var(--hover); }
[data-theme="light"] .hb-dot.pos, [data-theme="light"] .hb-dot.today.pos { background: #1d7a4a; border-color: #1d7a4a; }
[data-theme="light"] .hb-dot.neg, [data-theme="light"] .hb-dot.today.neg { background: #b3372c; border-color: #b3372c; }
[data-theme="light"] .hb-val.pos { color: #1d7a4a; background: rgba(29, 122, 74, .10); }
[data-theme="light"] .hb-val.neg { color: #b3372c; background: rgba(179, 55, 44, .10); }
[data-theme="light"] .hb-q.plus { color: #1d7a4a; }
[data-theme="light"] .hb-q.minus { color: #b3372c; }
[data-theme="light"] .hb-streak { background: rgba(185, 116, 18, .10); }
.hb-add { display: flex; gap: 6px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.hb-add-name { flex: 1; min-width: 0; font-size: 12.5px; padding: 6px 9px; border-radius: 8px; }
.hb-add-name::placeholder { color: var(--faint); }
.hb-add-time { width: 96px; font-size: 12.5px; padding: 6px 6px; border-radius: 8px; color-scheme: dark; }
.hb-add-btn { border: 1px solid var(--accent); color: var(--accent); background: transparent; border-radius: 8px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }
.hb-add-btn:hover { background: var(--hover); }
.hb-add-btn:disabled { opacity: .5; cursor: default; }
.hb-add-name:focus, .hb-add-time:focus { border-color: var(--accent); }
[data-theme="light"] .hb-add-btn { color: #1a8fb0; border-color: #1a8fb0; }
.hb-editing { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 2px 0; }
.hb-editing .hb-add-name { flex: 1; min-width: 120px; }
.hb-cancel { border: 1px solid var(--line-2); background: transparent; color: var(--dim); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; cursor: pointer; }
.hb-cancel:hover { background: var(--hover); color: var(--ink); }