/* Tend · platform styles: tasks, garden, journal, progress, palette, notifications, dashboard widgets. */

/* ---------- tasks workspace ---------- */
.ws { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.ws-nav { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 2px; }
.ws-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.ws-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.ws-nav a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.ws-nav a .cnt { margin-inline-start: auto; font-size: 12px; color: var(--ink-3); font-weight: 700; }
.ws-nav .ws-h { padding: 14px 12px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
html[lang="ar"] .ws-nav .ws-h { letter-spacing: 0; }
@media (max-width: 900px) { .ws { grid-template-columns: 1fr; } .ws-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 6px; gap: 4px; } .ws-nav a { white-space: nowrap; } .ws-nav .ws-h { display: none; } }
.quick-add { display: flex; gap: 8px; align-items: center; padding: 8px 10px 8px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); margin-bottom: 14px; }
.quick-add input { flex: 1; border: 0; background: none; font-size: 15px; padding: 6px 0; min-width: 0; }
.quick-add input:focus { outline: none; }
.quick-add .qh { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
@media (max-width: 640px) { .quick-add .qh { display: none; } }
.trow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 12px; transition: background var(--t); position: relative; }
.trow:hover { background: var(--surface-2); }
.trow.done .tt { text-decoration: line-through; color: var(--ink-3); }
.trow.selected { background: var(--accent-soft); }
.trow .tt { font-weight: 600; font-size: 15px; cursor: pointer; }
.trow .tt:hover { color: var(--accent); }
.trow .tm { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; align-items: center; }
.trow .tm .due.over { color: var(--bad); font-weight: 700; } .trow .tm .due.today { color: var(--accent); font-weight: 700; }
.trow .ta { display: flex; gap: 2px; opacity: 0; transition: opacity var(--t); }
.trow:hover .ta, .trow:focus-within .ta { opacity: 1; }
@media (hover: none) { .trow .ta { opacity: 1; } }
.trow.sub { padding-inline-start: 44px; }
.cb { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line-2); display: inline-grid; place-items: center; background: var(--surface); cursor: pointer; transition: all 120ms; flex: none; color: transparent; }
.cb:hover { border-color: var(--accent); }
.cb.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cb.p4 { border-color: var(--bad); } .cb.p3 { border-color: var(--warn); } .cb.p2 { border-color: var(--c-sky); }
.cb.round { border-radius: 50%; }
.pflag { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.pflag.p4 { color: var(--bad); } .pflag.p3 { color: var(--warn); } .pflag.p2 { color: var(--c-sky); } .pflag.p1 { color: var(--ink-3); }
.tgroup { margin-top: 18px; }
.tgroup-h { display: flex; align-items: center; gap: 8px; margin: 0 12px 4px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
html[lang="ar"] .tgroup-h { letter-spacing: 0; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.bulkbar { position: sticky; bottom: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); z-index: 30; margin-top: 14px; }
.bulkbar .btn { background: color-mix(in srgb, var(--bg) 16%, transparent); color: var(--bg); }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.bcol { background: var(--surface-2); border-radius: var(--r-lg); padding: 10px; min-height: 220px; transition: outline-color var(--t); outline: 2px dashed transparent; }
.bcol.over { outline-color: var(--accent); }
.bcol-h { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; font-weight: 800; font-size: 13px; }
.bcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.bcard:active { cursor: grabbing; } .bcard.dragging { opacity: .4; }
.bcard .tt { font-weight: 600; font-size: 14px; cursor: pointer; }
.bcard .tm { font-size: 12px; color: var(--ink-3); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .ch { font-size: 11px; color: var(--ink-3); font-weight: 700; text-align: center; padding: 4px; }
.cal .cd { min-height: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px; font-size: 12px; cursor: pointer; transition: border-color var(--t); }
.cal .cd:hover { border-color: var(--ink-3); } .cal .cd.other { opacity: .45; } .cal .cd.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); } .cal .cd.sel { background: var(--accent-soft); }
.cal .cd .dn { font-weight: 800; color: var(--ink-2); margin-bottom: 4px; display: flex; justify-content: space-between; }
.cal .cd .ci { display: block; padding: 2px 5px; border-radius: 6px; background: var(--accent-soft); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .cd .ci.done { opacity: .5; text-decoration: line-through; } .cal .cd .ci.over { background: var(--bad-soft); }
.cal .cd .more { color: var(--ink-3); font-size: 11px; }
.cal .cd .dots { display: none; gap: 2px; flex-wrap: wrap; } .cal .cd .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
@media (max-width: 640px) { .cal .cd { min-height: 56px; padding: 4px; } .cal .cd .ci, .cal .cd .more { display: none; } .cal .cd .dots { display: flex; } }
.drawer-back { position: fixed; inset: 0; background: rgba(20, 16, 10, .35); z-index: 101; animation: fade 160ms both; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(540px, 100%); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 102; overflow: auto; padding: 22px 24px 40px; animation: slidein 220ms var(--ease) both; border-inline-start: 1px solid var(--line); }
@keyframes slidein { from { transform: translateX(var(--slide, 30px)); opacity: 0 } to { transform: none; opacity: 1 } }
html[dir="rtl"] .drawer { --slide: -30px; }
.drawer .title-input { font-family: var(--serif); font-size: 24px; font-weight: 500; border: 0; background: none; width: 100%; padding: 4px 0; border-bottom: 1px solid transparent; }
.drawer .title-input:focus { outline: none; border-bottom-color: var(--accent); }
.drawer .dsec { padding: 14px 0; border-top: 1px solid var(--line); }
.drawer .dsec h4 { margin-bottom: 8px; font-family: var(--sans); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
html[lang="ar"] .drawer .dsec h4 { letter-spacing: 0; }
.workload { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; display: flex; }
.workload i { display: block; height: 100%; } .workload i.ok { background: var(--good); } .workload i.warn { background: var(--warn); } .workload i.over { background: var(--bad); }
.focus-ring { position: relative; width: 230px; height: 230px; margin: 6px auto; display: grid; place-items: center; }
.focus-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.focus-ring .ft { font-family: var(--serif); font-size: 54px; font-variant-numeric: tabular-nums; line-height: 1; }
.focus-ring .fs { font-size: 12px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-top: 6px; text-align: center; }
.pick-list { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.pick-list label { display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer; }
.pick-list label + label { border-top: 1px solid var(--line); }
.pick-list label:hover { background: var(--surface-2); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.stepper button { width: 36px; height: 36px; font-size: 18px; color: var(--ink-2); } .stepper button:hover { background: var(--surface-2); }
.stepper input { width: 64px; text-align: center; border: 0; background: none; font-weight: 700; font-size: 15px; }

/* ---------- garden ---------- */
.garden-scene { position: relative; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.garden-scene svg { display: block; width: 100%; height: auto; }
.garden-mini svg { display: block; width: 100%; height: auto; border-radius: var(--r); }
.sway { transform-origin: var(--ox, 50%) var(--oy, 100%); transform-box: fill-box; animation: sway 6s ease-in-out infinite; }
.sway.s2 { animation-duration: 7.5s; animation-delay: -2s; } .sway.s3 { animation-duration: 9s; animation-delay: -4s; }
@keyframes sway { 0%, 100% { transform: rotate(-1.4deg) } 50% { transform: rotate(1.4deg) } }
.leaf-fall { animation: leaffall var(--dur, 9s) linear infinite; animation-delay: var(--delay, 0s); }
@keyframes leaffall { 0% { transform: translate(0, 0) rotate(0); opacity: 0 } 8% { opacity: .95 } 100% { transform: translate(var(--dx, 30px), 300px) rotate(320deg); opacity: 0 } }
.firefly { animation: firefly 4.5s ease-in-out infinite; animation-delay: var(--delay, 0s); }
@keyframes firefly { 0%, 100% { opacity: 0; transform: translateY(0) } 50% { opacity: 1; transform: translateY(-10px) } }
.snowf { animation: snow var(--dur, 11s) linear infinite; animation-delay: var(--delay, 0s); }
@keyframes snow { 0% { transform: translateY(-10px); opacity: 0 } 12% { opacity: .9 } 100% { transform: translateY(330px); opacity: 0 } }
.bird { animation: bird 14s linear infinite; animation-delay: var(--delay, 0s); }
@keyframes bird { 0% { transform: translateX(-80px) } 100% { transform: translateX(700px) } }
.branch-hit { cursor: pointer; }
.branch-hit:hover .leafgrp { filter: brightness(1.12) saturate(1.1); }
.branch-hit.lit .leafgrp { filter: drop-shadow(0 0 6px rgba(255, 220, 120, .8)); }
.garden-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink-2); }
.garden-legend b { color: var(--ink); }
.unlock { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: start; width: 100%; transition: border-color var(--t); }
.unlock.locked { opacity: .55; } .unlock .ui { font-size: 24px; width: 32px; text-align: center; }
.unlock.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.unlock b { display: block; font-size: 14px; } .unlock span { font-size: 12px; color: var(--ink-2); }
.inspect { min-height: 120px; }

/* ---------- journal ---------- */
/* mood / energy / rating pickers: see layout.css (.mood-pick) */
.jstrip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; }
.jstrip button { flex: none; width: 50px; padding: 8px 0; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--ink-2); text-align: center; }
.jstrip button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); } .jstrip button .m { display: block; font-size: 20px; line-height: 1.2; }
.jstrip button.has { border-color: var(--line-2); }
.review-step { padding: 18px 0; border-top: 1px solid var(--line); }
.fact { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 14px; }
.fact .fk { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; padding: 3px 7px; border-radius: 6px; flex: none; margin-top: 2px; }
.fact .fk.fact { background: var(--good-soft); color: var(--good); } .fact .fk.interp { background: var(--warn-soft); color: var(--warn); }
html[lang="ar"] .fact .fk { letter-spacing: 0; }

/* ---------- progress ---------- */
.ach-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.ach-card.locked { opacity: .65; } .ach-card .ai { font-size: 28px; width: 40px; text-align: center; flex: none; }
.ach-card b { display: block; font-size: 14px; } .ach-card span.d { font-size: 12.5px; color: var(--ink-2); }
.tier { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; } .tier.bronze { color: #b8763a; } .tier.silver { color: #8a94a3; } .tier.gold { color: #c9a227; }
html[lang="ar"] .tier { letter-spacing: 0; }
.level-hero { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.level-hero .ln { width: 96px; height: 96px; border-radius: 28px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--serif); font-size: 44px; }

/* ---------- palette & notifications ---------- */
.palette-back { position: fixed; inset: 0; background: rgba(20, 16, 10, .35); z-index: 109; animation: fade 120ms both; }
.palette { position: fixed; top: 10vh; left: 50%; transform: translateX(-50%); width: min(640px, calc(100% - 32px)); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); z-index: 110; overflow: hidden; animation: pop 160ms var(--ease) both; }
.palette input { width: 100%; border: 0; padding: 16px 18px; font-size: 17px; background: none; border-bottom: 1px solid var(--line); }
.palette input:focus { outline: none; }
.palette .pl { max-height: 52vh; overflow: auto; padding: 6px; }
.palette .ph { padding: 8px 12px 2px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.palette .pi { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.palette .pi.active, .palette .pi:hover { background: var(--surface-2); }
.palette .pi .pk { font-size: 11px; color: var(--ink-3); margin-inline-start: auto; }
.bell-badge { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
.notif { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.notif:hover { background: var(--surface-2); } .notif.unread { background: var(--accent-soft); }
.notif .nt { font-weight: 700; font-size: 13.5px; } .notif .nb { font-size: 12.5px; color: var(--ink-2); white-space: pre-line; max-height: 60px; overflow: hidden; } .notif .nd { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.menu.wide { min-width: 360px; max-width: 420px; max-height: 70vh; overflow: auto; }
@media (max-width: 640px) { .menu.wide { position: fixed; inset-inline: 10px; top: 64px; min-width: 0; max-width: none; } }

/* ---------- dashboard widgets & sheet ---------- */
.widget-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.widget-head h3 { font-size: 17px; }
.sheet-back { position: fixed; inset: 0; background: rgba(20, 16, 10, .4); z-index: 101; animation: fade 160ms both; }
.sheet { position: fixed; inset-inline: 0; bottom: 0; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); z-index: 102; padding: 14px 14px calc(16px + env(safe-area-inset-bottom)); animation: sheetin 220ms var(--ease) both; }
@keyframes sheetin { from { transform: translateY(40px); opacity: 0 } to { transform: none; opacity: 1 } }
.sheet a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; color: var(--ink); font-weight: 700; }
.sheet a:hover { background: var(--surface-2); text-decoration: none; }
kbd.key { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface-2); }
.toggle-list label { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.intention { font-family: var(--serif); font-size: 22px; font-style: italic; }
.plan-task { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.plan-task + .plan-task { border-top: 1px solid var(--line); }
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 14px; background: linear-gradient(90deg, var(--accent-soft), transparent 80%); border: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.goal-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.goal-row + .goal-row { border-top: 1px solid var(--line); }
.subtle-link { color: var(--ink-2); font-size: 13px; }
.nav a { padding: 8px 10px; }

/* ---- stats additions ---- */
.lg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 4px; vertical-align: middle; }
.cmp-table td:first-child { color: var(--ink-2); }
.obs-list { display: flex; flex-direction: column; gap: 8px; }
.kbd-list { display: flex; flex-wrap: wrap; gap: 8px; }
