:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #1e2235;
    --muted: #7b8096;
    --line: #e8eaf2;
    --primary: #5b3df5;
    --primary-soft: #efecff;
    --high: #e5484d; --high-bg: #fdecec;
    --medium: #f08a24; --medium-bg: #fff2e2;
    --low: #2fa56b; --low-bg: #e6f6ee;
    --progress: #3b6cf6; --progress-bg: #e8eefe;
    --radius: 12px;
}

/* ==== THEME (generated by darkify) ==== */
:root {
    --c-a3a8bd: #a3a8bd;
    --c-b9bdd0: #b9bdd0;
    --c-c9c3ee: #c9c3ee;
    --c-cfc8f7: #cfc8f7;
    --c-cfd2e0: #cfd2e0;
    --c-d9d4f6: #d9d4f6;
    --c-dcdaf0: #dcdaf0;
    --c-ddd8f5: #ddd8f5;
    --c-e2dcff: #e2dcff;
    --c-e6e2fb: #e6e2fb;
    --c-e8f1ff: #e8f1ff;
    --c-e9e6fb: #e9e6fb;
    --c-ebe9f9: #ebe9f9;
    --c-ece8ff: #ece8ff;
    --c-eceaf8: #eceaf8;
    --c-f0edff: #f0edff;
    --c-f1f0fb: #f1f0fb;
    --c-f3f1ff: #f3f1ff;
    --c-f3f2fb: #f3f2fb;
    --c-f4f5fb: #f4f5fb;
    --c-f6c9cf: #f6c9cf;
    --c-f6dfb8: #f6dfb8;
    --c-f7f5ff: #f7f5ff;
    --c-f7f6fd: #f7f6fd;
    --c-faf9ff: #faf9ff;
    --c-fafaff: #fafaff;
    --c-fbfbfe: #fbfbfe;
    --c-fcfcff: #fcfcff;
    --c-fdecec: #fdecec;
    --c-ffe3e3: #ffe3e3;
    --c-fff0d6: #fff0d6;
    --c-fff1dd: #fff1dd;
    --c-fff3cd: #fff3cd;
    --c-fff4d6: #fff4d6;
    --c-fff4e6: #fff4e6;
    --c-fff6e0: #fff6e0;
    --c-fff6f6: #fff6f6;
    --c-fff8e1: #fff8e1;
    --c-fff8f8: #fff8f8;
    --c-fffaf3: #fffaf3;
    --c-fffdf3: #fffdf3;
    --t-1e2235: #1e2235;
    --t-4b3fb0: #4b3fb0;
    --t-6b7280: #6b7280;
    --t-7a4a05: #7a4a05;
    --t-8a4b06: #8a4b06;
    --t-8a5a06: #8a5a06;
    --t-8a6d00: #8a6d00;
    --t-a8610d: #a8610d;
    --t-b42318: #b42318;
    --t-b4293a: #b4293a;
    --t-b45309: #b45309;
    --t-b45f06: #b45f06;
    --t-b9770e: #b9770e;
    --t-c0272d: #c0272d;
    --t-c2410c: #c2410c;
    --t-e0900b: #e0900b;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #12141f; --card: #1b1e2e; --text: #e7e9f3; --muted: #9298b2; --line: #2d3148;
    --primary: #8b73ff; --primary-soft: #2b2554;
    --high: #d9797e; --high-bg: #33232b;
    --medium: #f5a05a; --medium-bg: #3b2d1b;
    --low: #6aa88e; --low-bg: #1d2b28;
    --progress: #7a9cff; --progress-bg: #1c2851;
    --shadow: 0 4px 18px rgba(0,0,0,.35); --shadow-lg: 0 8px 26px rgba(0,0,0,.5);
    --c-a3a8bd: #6a6f88;
    --c-b9bdd0: #565b74;
    --c-c9c3ee: #463a90;
    --c-cfc8f7: #3d2f8d;
    --c-cfd2e0: #4a4f66;
    --c-d9d4f6: #3a3074;
    --c-dcdaf0: #3d3965;
    --c-ddd8f5: #3b316b;
    --c-e2dcff: #31256b;
    --c-e6e2fb: #322a5c;
    --c-e8f1ff: #20324e;
    --c-e9e6fb: #312b55;
    --c-ebe9f9: #312d4d;
    --c-ece8ff: #2d2553;
    --c-eceaf8: #322e4a;
    --c-f0edff: #2b2549;
    --c-f1f0fb: #2d2b41;
    --c-f3f1ff: #2a2642;
    --c-f3f2fb: #2d2b3d;
    --c-f4f5fb: #2b2d39;
    --c-f6c9cf: #8b313d;
    --c-f6dfb8: #8c5e10;
    --c-f7f5ff: #292539;
    --c-f7f6fd: #2b2937;
    --c-faf9ff: #282632;
    --c-fafaff: #272731;
    --c-fbfbfe: #28282e;
    --c-fcfcff: #27272d;
    --c-fdecec: #4d2b2b;
    --c-ffe3e3: #622a2a;
    --c-fff0d6: #624410;
    --c-fff1dd: #593d15;
    --c-fff3cd: #685004;
    --c-fff4d6: #5e480c;
    --c-fff4e6: #4d371b;
    --c-fff6e0: #513f13;
    --c-fff6f6: #392727;
    --c-fff8e1: #4e4012;
    --c-fff8f8: #352727;
    --c-fffaf3: #382e20;
    --c-fffdf3: #35311d;
    --t-1e2235: #dbdff2;
    --t-4b3fb0: #8579ea;
    --t-6b7280: #8d94a2;
    --t-7a4a05: #ffcf8a;
    --t-8a4b06: #ffc47f;
    --t-8a5a06: #f9c975;
    --t-8a6d00: #f0d366;
    --t-a8610d: #fab35f;
    --t-b42318: #ff8f84;
    --t-b4293a: #ff7a8b;
    --t-b45309: #ffa95f;
    --t-b45f06: #ffaf56;
    --t-b9770e: #f0ae45;
    --t-c0272d: #ff7a80;
    --t-c2410c: #ff9762;
    --t-e0900b: #ee9e19;
}
/* The map keeps working in the dark: the light tiles are inverted */
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.92); }
:root[data-theme="dark"] .leaflet-container { background: #1b1e2e; }
:root[data-theme="dark"] img.avatar, :root[data-theme="dark"] .logo-mark { filter: none; }
:root[data-theme="dark"] input, :root[data-theme="dark"] textarea, :root[data-theme="dark"] select { color: var(--text); }
:root[data-theme="dark"] ::placeholder { color: #6f7590; opacity: 1; }

* { box-sizing: border-box; }
html, body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--text); background: var(--bg); font-size: 15px; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; margin: 1.5rem 0 .5rem; }
a { color: var(--primary); text-decoration: none; }
.boot, .empty { padding: 2rem; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: var(--card); border-right: 1px solid var(--line); padding: 1.25rem 1rem; flex-shrink: 0; }
.logo { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.3rem; margin-bottom: 1.5rem; }
.logo-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 1rem; }
.nav-item { display: block; padding: .65rem .85rem; border-radius: 10px; color: var(--text); margin-bottom: .35rem; }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-create { border: 1px solid var(--primary); color: var(--primary); }
.main { flex: 1; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 2rem; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 1.3rem; }
.user { display: flex; align-items: center; gap: .75rem; }
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-info small { color: var(--muted); }
.content { padding: 1.5rem 2rem; }

.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-style: normal; font-size: .85rem; }
.avatar.sm { width: 26px; height: 26px; font-size: .7rem; }
.avatar.pending { background: var(--medium-bg); color: var(--medium); }

/* Cards & stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.stat { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .1rem; text-align: left; font: inherit; color: var(--text); cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.stat:hover { box-shadow: 0 4px 14px rgba(30,34,53,.08); }
.stat.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.stat.alert { background: var(--c-fff8f8); }
.stat strong { font-size: 1.8rem; line-height: 1.1; }
.stat > span:not(.stat-icon) { color: var(--muted); font-size: .88rem; }
.stat-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; font-size: 1.05rem; margin-bottom: .45rem; }
.stat-icon.blue { background: var(--c-e8f1ff); } .stat-icon.indigo { background: var(--primary-soft); } .stat-icon.amber { background: var(--c-fff4d6); }
.stat-icon.orange { background: var(--medium-bg); } .stat-icon.red { background: var(--high-bg); } .stat-icon.green { background: var(--low-bg); }
.progress-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.2rem; margin-bottom: 1.25rem; }
.progress-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .55rem; font-size: .92rem; color: var(--muted); }
.progress-head strong { color: var(--text); }
.progress-bar { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #8b73ff); border-radius: 999px; transition: width .4s; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.card.narrow { max-width: 720px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }

/* Tabs */
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: .9rem 0; }
.tab { border: 0; background: none; padding: .4rem .8rem; border-radius: 8px; color: var(--muted); cursor: pointer; font: inherit; }
.tab.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* Table */
.table { display: flex; flex-direction: column; gap: .5rem; overflow-x: auto; }
.row { display: grid; grid-template-columns: minmax(200px, 3fr) minmax(160px, 2fr) 90px 110px 130px; gap: .75rem; align-items: center; padding: .75rem 1rem; border-radius: 10px; }
.row.head { color: var(--muted); font-size: .85rem; padding-block: .25rem; }
.row:not(.head) { border: 1px solid var(--line); border-left: 4px solid var(--line); }
.row.clickable { cursor: pointer; }
.row.clickable:hover { background: var(--c-fafaff); }
.row.prio-high { border-left-color: var(--high); }
.row.prio-medium { border-left-color: var(--medium); }
.row.prio-low { border-left-color: var(--low); }
.title { font-weight: 600; }
.person { display: flex; align-items: center; gap: .5rem; }

/* Badges */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 6px; font-size: .8rem; font-weight: 500; background: var(--bg); color: var(--muted); }
.badge.high { background: var(--high-bg); color: var(--high); }
.badge.medium { background: var(--medium-bg); color: var(--medium); }
.badge.low { background: var(--low-bg); color: var(--low); }
.badge.st-review { background: var(--medium-bg); color: var(--medium); }
.badge.st-done { background: var(--low-bg); color: var(--low); }
.badge.st-notdone { background: var(--high-bg); color: var(--high); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.form label, .field { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; font-size: .9rem; }
.label { font-weight: 500; font-size: .9rem; }
.field > .badge { align-self: flex-start; }
.input { width: 100%; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--card); color: var(--text); }
.input:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
textarea.input { resize: vertical; }
.input::placeholder { color: var(--c-a3a8bd); font-weight: 400; }
.hint { color: var(--muted); font-size: .8rem; font-weight: 400; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.actions { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.25rem; }
.alert { background: var(--high-bg); color: var(--high); padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; }

.btn { display: inline-block; border: 1px solid transparent; border-radius: 8px; padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-align: center; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #4a2fe0; }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--text); }
.btn-danger { background: var(--high-bg); color: var(--high); }

.seg { display: flex; gap: .5rem; flex-wrap: wrap; }
.seg-btn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: .45rem .9rem; cursor: pointer; font: inherit; color: var(--text); }
.seg-btn.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.seg-btn.on.high { background: var(--high-bg); border-color: var(--high); color: var(--high); }
.seg-btn.on.medium { background: var(--medium-bg); border-color: var(--medium); color: var(--medium); }
.seg-btn.on.low { background: var(--low-bg); border-color: var(--low); color: var(--low); }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.chip { background: var(--primary-soft); color: var(--primary); padding: .2rem .6rem; border-radius: 999px; font-size: .85rem; }
.names { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar.more { background: var(--bg); color: var(--muted); }
.person { min-width: 0; }
.assignees { display: flex; flex-direction: column; gap: .5rem; margin: .25rem 0 1.25rem; }
.assignee { display: flex; align-items: center; gap: .6rem; }
.assignee .grow { flex: 1; }

/* Codes, deadlines, declined */
.code { display: block; color: var(--muted); font-size: .75rem; font-family: ui-monospace, Consolas, monospace; letter-spacing: .02em; }
.due-badge { display: inline-block; margin-left: .35rem; padding: .1rem .5rem; border-radius: 6px; font-size: .75rem; font-weight: 600; }
.due-badge.soon { background: var(--medium-bg); color: var(--medium); }
.due-badge.overdue { background: var(--high-bg); color: var(--high); }
.row.due-soon { background: var(--c-fffaf3); }
.row.due-overdue { background: var(--c-fff6f6); }
.row.is-declined { opacity: .6; }
.badge.st-declined { background: var(--high-bg); color: var(--high); }
.section-gap { margin-top: 1.25rem; }
.info { background: var(--primary-soft); color: var(--primary); padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; }
.devhint { background: var(--c-fff8e1); color: var(--t-8a6d00); border: 1px dashed #e6c200; padding: .5rem .75rem; border-radius: 8px; font-size: .85rem; margin-bottom: .5rem; }
.input.code { letter-spacing: .4em; font-size: 1.2rem; text-align: center; max-width: 11rem; }
.linkbtn { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0 .25rem; }
.linkbtn.danger { color: var(--high); }
.linkbtn:disabled { opacity: .5; cursor: default; }
.search { max-width: 280px; }
.head-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: nowrap; }
.head-actions .btn { white-space: nowrap; flex-shrink: 0; }
.head-actions .search { flex: 1 1 auto; min-width: 0; }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-form .input { flex: 1; min-width: 140px; }
.duration { display: flex; gap: .5rem; max-width: 260px; }
.contact { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; background: var(--bg); border-radius: 8px; }
.contact small { color: var(--low); }
/* User menu (top right) */
.usermenu { position: relative; }
.user-btn { display: flex; align-items: center; gap: .6rem; background: none; border: 1px solid transparent; border-radius: 12px; padding: .3rem .6rem .3rem .3rem; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.user-btn:hover { background: var(--bg); border-color: var(--line); }
.chev { color: var(--muted); font-size: .8rem; }
.menu-backdrop { position: fixed; inset: 0; z-index: 40; background: transparent; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(30,34,53,.15); z-index: 50; padding: .35rem; }
.menu-head { display: flex; flex-direction: column; padding: .6rem .75rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .35rem; }
.menu-head small { color: var(--muted); }
.menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .6rem .75rem; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.menu-item:hover { background: var(--bg); }
.menu-item.danger { color: var(--high); }
.menu-sep { height: 1px; background: var(--line); margin: .35rem 0; }

/* Map & location */
.map { width: 100%; border-radius: 10px; border: 1px solid var(--line); margin: .5rem 0 1rem; z-index: 0; }
.autocomplete { position: relative; }
.suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(30,34,53,.15); z-index: 40; overflow: hidden; }
.suggest { display: flex; gap: .5rem; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: var(--card); padding: .6rem .8rem; cursor: pointer; font: inherit; font-size: .9rem; color: var(--text); }
.suggest:last-child { border-bottom: 0; }
.suggest.active { background: var(--primary-soft); }
.suggest .pin { flex-shrink: 0; }
.suggest-info { padding: .65rem .8rem; color: var(--muted); font-size: .9rem; }
.suggest-info.error { color: var(--high); }
.chosen { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; background: var(--bg); border-radius: 8px; }
.place { color: var(--muted); }

/* Groups */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; margin-top: 1rem; }
.group-card { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: 10px; padding: .75rem 1rem; }
.group-icon { font-size: 1.6rem; width: 44px; height: 44px; display: grid; place-items: center; background: var(--primary-soft); border-radius: 12px; }
.grow { flex: 1; min-width: 0; }
.editor { border: 1px solid var(--line); border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; margin: 1rem 0; background: var(--c-fcfcff); }
.icons { display: flex; flex-wrap: wrap; gap: .4rem; }
.icon-btn { font-size: 1.3rem; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
.icon-btn.on { border-color: var(--primary); background: var(--primary-soft); }
.member { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.chip.toggle { border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; font: inherit; font-size: .9rem; padding: .35rem .8rem; }
.chip.toggle.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Notifications */
.bell { position: relative; }
.bell-btn { position: relative; border: 1px solid var(--line); background: var(--card); border-radius: 10px; width: 40px; height: 40px; cursor: pointer; font-size: 1.1rem; }
.bell-badge { position: absolute; top: -6px; right: -6px; background: var(--high); color: #fff; font-size: .7rem; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.bell-menu { position: absolute; right: 0; top: 48px; width: 340px; max-height: 420px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(30,34,53,.15); z-index: 50; }
.bell-head { padding: .75rem 1rem; font-weight: 600; border-bottom: 1px solid var(--line); }
.note { padding: .7rem 1rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.note.unread { background: var(--primary-soft); }
.note.link { cursor: pointer; }
.note.link:hover { background: var(--bg); }

/* Task details */
.desc { white-space: pre-wrap; }
.meta { display: grid; grid-template-columns: 150px 1fr; gap: .4rem 1rem; margin: 1rem 0 1.25rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.field { margin-bottom: 1rem; }
.comment { display: flex; gap: .7rem; margin-bottom: .9rem; }
.comment p { margin: .15rem 0 0; }
.comment-form { display: flex; gap: .6rem; }

/* Auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 2rem; }
.auth-card .logo { margin-bottom: 1rem; }

#blazor-error-ui { color-scheme: light only; background: var(--c-fff3cd); bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); box-sizing: border-box; display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* Visual polish: soft shadows, borderless cards, pill tabs */
:root { --shadow: 0 4px 18px rgba(60,50,130,.07); --shadow-lg: 0 8px 26px rgba(60,50,130,.12); }
body { background: linear-gradient(180deg, var(--c-f7f6fd) 0%, var(--c-f4f5fb) 100%); background-attachment: fixed; }
.sidebar { position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; background: var(--card); border-right: 0; box-shadow: 2px 0 18px rgba(60,50,130,.05); padding: 1.5rem 1.1rem; }
.logo { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.logo-mark { width: 36px; height: 36px; background: linear-gradient(135deg, #6a4cff, #4b2fe0); box-shadow: 0 4px 10px rgba(91,61,245,.35); }
.nav-item { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; font-weight: 500; }
.nav-item.active { background: linear-gradient(90deg, var(--c-ece8ff), var(--c-f3f1ff)); }
.ni { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-create { justify-content: center; margin-top: 1.1rem; border: 0; color: #fff; font-weight: 600; background: linear-gradient(135deg, #6a4cff, #4b2fe0); box-shadow: 0 6px 16px rgba(91,61,245,.35); }
.nav-create:hover { background: linear-gradient(135deg, #7459ff, #5a3df0); }
.topbar { background: transparent; border-bottom: 0; padding: 1.4rem 2rem .4rem; }
.topbar h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; }
.bell-btn { border: 0; box-shadow: var(--shadow); border-radius: 12px; }
.user-btn:hover { background: var(--card); box-shadow: var(--shadow); border-color: transparent; }

.stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.stat { border: 0; box-shadow: var(--shadow); border-radius: 16px; padding: 1rem 1.1rem; gap: .65rem; }
.stat:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.stat.selected { box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.stat.alert { background: var(--c-fff8f8); }
.stat-top { display: flex; align-items: center; gap: .9rem; }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; margin: 0; font-size: 1.15rem; flex-shrink: 0; }
.stat strong { font-size: 2rem; font-weight: 800; }
.stat > span:not(.stat-icon) { font-size: .92rem; }
.progress-card { border: 0; box-shadow: var(--shadow); border-radius: 16px; padding: 1rem 1.3rem; }
.progress-head { color: var(--text); }
.progress-bar { height: 8px; background: var(--c-e9e6fb); }
.card { border: 0; box-shadow: var(--shadow); border-radius: 18px; padding: 1.4rem 1.6rem; }
.card-head h2 { font-size: 1.5rem; font-weight: 800; }

.searchbox { position: relative; width: 100%; max-width: 380px; }
.searchbox-icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); opacity: .55; pointer-events: none; font-size: .95rem; }
.searchbox .search { max-width: none; padding-left: 2.4rem; border-radius: 12px; padding-block: .7rem; }

.tabs { gap: .55rem; margin: 1rem 0 1.1rem; }
.tab { background: var(--c-f3f2fb); padding: .5rem 1.05rem; border-radius: 999px; color: var(--text); }
.tab:hover { background: var(--c-ebe9f9); }
.tab.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(91,61,245,.3); }

.row.head { background: var(--c-f1f0fb); border-radius: 10px; padding: .6rem 1rem; color: var(--text); font-weight: 500; }
.row:not(.head) { border-color: var(--c-eceaf8); box-shadow: 0 2px 8px rgba(60,50,130,.05); border-radius: 12px; background: var(--card); }
.row.due-soon { background: var(--c-fffaf3); } .row.due-overdue { background: var(--c-fff6f6); }
.badge { border-radius: 8px; }

/* Top bar: icons on the right; burger + logo only on small screens */
.topbar { justify-content: flex-end; }
.burger, .top-logo, .drawer-backdrop { display: none; }
.burger { background: var(--card); border: 0; box-shadow: var(--shadow); border-radius: 12px; width: 40px; height: 40px; cursor: pointer; color: var(--text); place-items: center; }
.top-logo { align-items: center; gap: .5rem; font-weight: 800; font-size: 1.1rem; }
.top-logo .logo-mark { width: 30px; height: 30px; font-size: .9rem; }
.dash { display: block; }

/* Mobile web */
@media (max-width: 800px) {
    .shell { display: block; }
    .topbar { position: sticky; top: 0; z-index: 30; justify-content: flex-start; gap: .7rem; padding: .6rem .75rem; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); }
    .burger { display: grid; }
    .top-logo { display: flex; }
    .user { margin-left: auto; gap: .45rem; }
    .user-info, .chev { display: none; }
    .user-btn { padding: .2rem; }
    .content { padding: .75rem; }

    /* Navigation becomes a drawer opened with the burger button */
    .sidebar { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: 260px; max-width: 80vw; padding: 1.2rem 1rem; transform: translateX(-105%); transition: transform .2s ease; overflow-y: auto; }
    .sidebar.open { transform: none; box-shadow: 6px 0 30px rgba(30,34,53,.25); }
    .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(30,34,53,.4); }
    .logo { margin-bottom: 1.2rem; }

    /* Dashboard: progress first, then small tiles (they also work as the filters) */
    .dash { display: flex; flex-direction: column; }
    .progress-card { order: -1; margin-bottom: .6rem; padding: .7rem .9rem; border-radius: 14px; }
    .progress-head { font-size: .85rem; margin-bottom: .4rem; }
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: .75rem; }
    .stat { padding: .5rem .6rem; gap: .2rem; border-radius: 12px; }
    .stat-top { gap: .4rem; }
    .stat-icon { width: 24px; height: 24px; border-radius: 8px; font-size: .75rem; }
    .stat strong { font-size: 1.15rem; }
    .stat > span:not(.stat-icon) { font-size: .68rem; }
    .tabs { display: none; }
    .card { padding: 1rem; border-radius: 16px; }
    .card-head { flex-wrap: wrap; }
    .card-head h2 { font-size: 1.25rem; }
    .searchbox, .search { max-width: none; width: 100%; }
    .searchbox { flex: 1 1 100%; }

    .row { grid-template-columns: 1fr 1fr; }
    .row.head { display: none; }
    .two { grid-template-columns: 1fr; }
    .head-actions { flex-wrap: wrap; }
    .head-actions .search { flex: 1 1 100%; }
}
.check { flex-direction: row !important; align-items: center; gap: .55rem !important; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }

/* Create-task form polish */
.card.narrow { max-width: 860px; padding: 1.8rem 2rem; }
.card.narrow > h2 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; }
.form { gap: 1.25rem; }
.form label, .field > .label { font-weight: 700; font-size: .95rem; }
.form .check { font-weight: 500; }
.req { color: var(--high); }
.input { border-radius: 10px; padding: .75rem .95rem; border-color: var(--c-dcdaf0); box-shadow: 0 1px 2px rgba(60,50,130,.04); }
.input:focus { outline: 3px solid var(--primary-soft); border-color: var(--primary); }
.seg { gap: .6rem; }
.seg-btn { padding: .6rem 1.5rem; border-radius: 10px; border-color: var(--c-dcdaf0); font-weight: 500; }
.seg-btn:hover { background: var(--c-faf9ff); }
.form-actions { margin-top: .5rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.form-actions .btn { padding: .75rem 1.6rem; border-radius: 10px; }
.form-actions .btn-primary { box-shadow: 0 6px 16px rgba(91,61,245,.3); }
.nav-item.active.nav-create { background: linear-gradient(90deg, var(--c-ece8ff), var(--c-f3f1ff)); color: var(--primary); box-shadow: none; justify-content: flex-start; }
.nav-create { justify-content: flex-start; }

/* Compact stat tiles: always one row of four on desktop widths */
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
.stat { padding: .7rem .8rem; gap: .35rem; border-radius: 14px; }
.stat-top { gap: .55rem; }
.stat-icon { width: 32px; height: 32px; border-radius: 10px; font-size: .95rem; }
.stat strong { font-size: 1.5rem; }
.stat > span:not(.stat-icon) { font-size: .8rem; line-height: 1.2; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* "Przypisz do [x] do mnie" on one row */
.label-row { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; }
.check.pill { padding: .25rem .75rem .25rem .55rem; border: 1px solid var(--c-dcdaf0); border-radius: 999px; background: var(--card); font-size: .88rem; line-height: 1.2; transition: background .15s, border-color .15s; }
.check.pill input { width: 16px; height: 16px; }
.check.pill.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }

/* Priority, due date and estimate on one row */
.three { display: grid; grid-template-columns: auto minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: end; }
.three > .field { margin-bottom: 0; }
.three .seg { flex-wrap: nowrap; }
.three .seg-btn { padding: .72rem 1.1rem; }
.three .input { height: 46px; }
.form .input { font-weight: 400; }
@media (max-width: 1000px) { .three { grid-template-columns: 1fr 1fr; } .three > .field { grid-column: 1 / -1; } }
@media (max-width: 520px) { .three { grid-template-columns: 1fr; } }

/* Star, attachments, acceptance */
.star { color: #f5a524; margin-right: .3rem; font-size: 1.05em; }
.clip { opacity: .7; font-weight: 400; }
.badge.st-pending { background: var(--primary-soft); color: var(--primary); }

/* Recurrence picker in the new-task form */
.inline-field { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; }
.input.num { width: 5rem; }

/* Confirmation of receipt: marker in lists, status line under the badge, box in the task details */
.ack-tag { font-weight: 600; color: var(--primary); }
.ack-tag.ack-ok { color: var(--low); }
.ack-tag.ack-no { color: var(--muted, var(--t-6b7280)); }
.ack-line { display: block; margin-top: .25rem; font-size: .75rem; font-weight: 600; line-height: 1.25; }
.ack-line.ack-ok, .ack.ack-ok { color: var(--low); }
.ack-line.ack-wait, .ack.ack-wait { color: var(--primary); }
.ack-line.ack-no { color: var(--high); }
.receipt-box.ok { background: var(--low-bg); color: var(--low); border-color: transparent; }
.check.opt { align-items: flex-start; font-weight: 500; }
.check.opt input { margin-top: .2rem; }
.check.opt small { display: block; font-weight: 400; }
.attachment { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; background: var(--c-f7f6fd); border-radius: 10px; font-weight: 400; }
.file-input { font: inherit; font-size: .9rem; }
.star-btn.on { background: var(--c-fff6e0); border-color: #f5a524; color: var(--t-b9770e); }
.accept-box { display: flex; flex-direction: column; gap: .6rem; padding: 1rem 1.1rem; margin-bottom: 1rem; border: 1px solid var(--primary); }

/* Important tasks waiting for a done / not done answer */
.hang-banner { display: flex; flex-direction: column; gap: .35rem; padding: .9rem 1.2rem; margin-bottom: 1rem; border-radius: 16px; background: var(--c-fff6e0); border: 1px solid #f5a524; color: var(--t-8a5a06); }
.hang-banner .chip { background: var(--card); color: var(--t-8a5a06); border: 1px solid #f5c76b; }
.hang-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.hang-box { display: flex; flex-direction: column; gap: .6rem; padding: 1rem 1.1rem; margin-bottom: 1rem; background: var(--c-fff6e0); color: var(--t-8a5a06); border: 1px solid #f5a524; }

/* Notepad on the top bar */
.user { gap: .6rem; }
.note-panel { width: 360px; max-width: calc(100vw - 2rem); }
.note-state { float: right; font-weight: 400; }
.note-area { display: block; width: 100%; border: 0; padding: .8rem 1rem; font: inherit; resize: vertical; min-height: 220px; background: var(--c-fffdf3); color: var(--text); border-radius: 0 0 12px 12px; }
.note-area:focus { outline: none; }

@media (max-width: 800px) {
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
    .stat { padding: .5rem .6rem; gap: .2rem; }
    .stat-icon { width: 24px; height: 24px; font-size: .75rem; }
    .stat strong { font-size: 1.15rem; }
    .stat > span:not(.stat-icon) { font-size: .68rem; }
}

/* Notepad as a text-field-like trigger on the left of the top bar (icon only on mobile) */
.topbar { justify-content: space-between; }
.note-trigger { width: 340px; max-width: 45vw; display: flex; align-items: center; gap: .6rem; padding: 0 .9rem; text-align: left; font: inherit; font-size: .92rem; color: var(--muted); }
.note-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.note-menu .note-panel { left: 0; right: auto; }
.user { margin-left: auto; }
.extra-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .9rem; }
.list-head { margin-bottom: .8rem; }
.list-head .searchbox { max-width: 460px; }
.dash { display: flex; flex-direction: column; }
.progress-card { margin-bottom: 1rem; }
@media (max-width: 800px) {
    .note-menu { margin-left: auto; }
    .user { margin-left: 0; }
    .note-trigger { width: 40px; padding: 0; justify-content: center; }
    .note-label { display: none; }
    .note-menu .note-panel { left: auto; right: -80px; }
    .progress-card { margin-bottom: .6rem; }
}

/* Nicer file picker */
.file-input { display: block; width: 100%; padding: .75rem .9rem; border: 1.5px dashed var(--c-c9c3ee); border-radius: 12px; background: var(--c-faf9ff); color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; transition: border-color .15s, background .15s; }
.file-input:hover { border-color: var(--primary); background: var(--primary-soft); }
.file-input::file-selector-button { margin-right: .9rem; padding: .55rem 1.1rem; border: 0; border-radius: 10px; background: linear-gradient(135deg, #6a4cff, #4b2fe0); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(91,61,245,.3); transition: filter .15s; }
.file-input::file-selector-button:hover { filter: brightness(1.08); }

/* Notepad grows with its content */
.note-area { min-height: 180px; max-height: 65vh; overflow-y: auto; resize: none; }

/* Notepad: the field itself is the editor (expands in place) */
.note-inline { position: relative; width: 340px; max-width: 45vw; height: 40px; flex-shrink: 0; }
.note-ico { position: absolute; z-index: 61; left: 0; top: 0; width: 42px; height: 40px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.note-field { position: absolute; z-index: 1; top: 0; left: 0; width: 100%; height: 40px; margin: 0; padding: 0 14px 0 42px; border: 0; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font: inherit; font-size: .92rem; line-height: 40px; color: var(--text); resize: none; overflow: hidden; cursor: text; transition: box-shadow .15s; }
.note-field::placeholder { color: var(--muted); }
.note-field:focus { outline: none; }
.note-field.expanded { z-index: 60; min-height: 200px; max-height: 65vh; overflow-y: auto; background: var(--c-fffdf3); box-shadow: var(--shadow-lg), 0 0 0 2px var(--primary-soft); padding: 10px 14px 12px 42px; line-height: 20px; }
.note-state { position: absolute; z-index: 61; right: 12px; top: 12px; font-size: .75rem; color: var(--muted); pointer-events: none; }
@media (max-width: 800px) {
    .note-inline { width: 40px; max-width: none; margin-left: auto; }
    .note-ico { width: 40px; }
    .note-field { padding: 0; color: transparent; cursor: pointer; }
    .note-field::placeholder { color: transparent; }
    .note-state { display: none; }
    .note-field.expanded { position: fixed; top: 58px; left: .75rem; right: .75rem; width: auto; padding: 14px; color: var(--text); cursor: text; }
    .note-inline.open .note-ico { display: none; }
}

/* Pinned task bar at the very top */
.pin-bar { display: flex; align-items: center; gap: .9rem; padding: .6rem 2rem; color: #fff; cursor: pointer;
    background: linear-gradient(95deg, #4b2fe0 0%, #6a4cff 55%, #8b73ff 100%); box-shadow: 0 6px 20px rgba(91,61,245,.28); }
.pin-bar:focus-visible { outline: 3px solid var(--card); outline-offset: -3px; }
.pin-ico { font-size: 1.05rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.pin-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: .6rem; white-space: nowrap; }
.pin-label { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.pin-title { overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
.pin-star { color: #ffd166; margin-right: .3rem; }
.pin-code { opacity: .7; font-family: ui-monospace, Consolas, monospace; }
.pin-meta { display: flex; gap: .45rem; flex-shrink: 0; }
.pin-chip { background: rgba(255,255,255,.2); border-radius: 999px; padding: .2rem .7rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pin-chip.soon { background: var(--c-fff0d6); color: var(--t-a8610d); }
.pin-chip.overdue { background: var(--c-ffe3e3); color: var(--t-c0272d); }
.pin-x { flex-shrink: 0; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; cursor: pointer; font-size: .8rem; line-height: 1; }
.pin-x:hover { background: rgba(255,255,255,.35); }
.pin-btn.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.top-stack { position: relative; z-index: 30; }
@media (max-width: 800px) {
    .top-stack { position: sticky; top: 0; }
    .top-stack .topbar { position: static; }
    .pin-bar { padding: .5rem .75rem; gap: .6rem; }
    .pin-label, .pin-code, .pin-meta .pin-chip:first-child:not(:last-child) { display: none; }
    .pin-title { font-size: .92rem; }
    .pin-chip { font-size: .72rem; padding: .15rem .55rem; }
}
@media (max-width: 800px) {
    /* A closed drawer must not leak its shadows into the screen edge */
    .sidebar { visibility: hidden; box-shadow: none; transition: transform .2s ease, visibility 0s linear .2s; }
    .sidebar.open { visibility: visible; transition: transform .2s ease; }
}

/* Task details: calmer layout */
.task-card { padding: 1.6rem 1.8rem; }
.td-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.td-title h2 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.td-title .code { margin-top: .25rem; }
.td-tools { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.round-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--c-f3f2fb); cursor: pointer; font-size: 1rem; line-height: 1; display: grid; place-items: center; color: var(--muted); transition: background .15s, transform .15s; }
.round-btn:hover { background: var(--c-e9e6fb); transform: translateY(-1px); }
.round-btn.on { background: var(--primary-soft); color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.round-btn.star-toggle { font-size: 1.2rem; }
.round-btn.star-toggle.on { background: var(--c-fff6e0); color: var(--t-e0900b); box-shadow: 0 0 0 2px #f5a524; }
.pin-btn:not(.on) { filter: grayscale(1); opacity: .75; }
.td-desc { white-space: pre-wrap; margin: 0 0 1.1rem; padding: .85rem 1rem; background: var(--c-faf9ff); border-radius: 12px; line-height: 1.5; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1.1rem; }
.fact { display: flex; flex-direction: column; gap: .2rem; padding: .65rem .85rem; background: var(--c-f7f6fd); border-radius: 12px; min-width: 0; }
.fact.wide { grid-column: 1 / -1; }
.fact span { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fact b { font-weight: 600; word-break: break-word; }
.fact i { font-style: normal; }
.fact .due-badge { margin-left: .35rem; }
.td-section { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: .6rem; }
.td-section-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.td-label { font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.status-seg .seg-btn { padding: .6rem 1.4rem; border-radius: 10px; }
.status-seg .seg-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(91,61,245,.3); }
.status-seg .seg-btn.st-btn-notdone.on { background: var(--high); border-color: var(--high); color: #fff; box-shadow: 0 4px 12px rgba(220,60,60,.3); }
.status-seg .seg-btn.st-btn-done.on { background: var(--low); border-color: var(--low); box-shadow: 0 4px 12px rgba(47,165,107,.3); }
.decline-line { display: flex; flex-direction: column; gap: .4rem; }
.attachment { gap: .7rem; }
.file-ico { font-size: 1rem; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-file { position: relative; overflow: hidden; padding: .45rem .95rem; font-size: .88rem; border-style: dashed; border-color: var(--c-c9c3ee); color: var(--primary); cursor: pointer; }
.add-file:hover { background: var(--primary-soft); }
.sr-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.task-card .comments { margin: 0; }
.task-card .assignees { margin: 0; }
@media (max-width: 800px) {
    .task-card { padding: 1rem; }
    .td-title h2 { font-size: 1.3rem; }
    .facts { grid-template-columns: 1fr 1fr; }
}
.decline-line { align-items: flex-start; }
.decline-line .linkbtn { padding: 0; }
.status-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.decline-btn { padding: .6rem 1.2rem; border-radius: 10px; white-space: nowrap; }

.cancel-box { display: flex; flex-direction: column; gap: .2rem; background: var(--c-fdecec); color: var(--high); }

/* Confirmation dialog */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgba(30,34,53,.5); backdrop-filter: blur(3px); animation: fade-in .15s ease; }
.modal { width: 100%; max-width: 430px; padding: 1.8rem 1.6rem 1.4rem; background: var(--card); border-radius: 20px; text-align: center; box-shadow: 0 24px 60px rgba(30,34,53,.35); animation: pop-in .18s ease; display: flex; flex-direction: column; gap: .7rem; }
.modal-icon { width: 60px; height: 60px; margin: 0 auto .2rem; display: grid; place-items: center; border-radius: 50%; background: var(--high-bg); font-size: 1.7rem; }
.modal h3 { margin: 0; font-size: 1.2rem; font-weight: 800; line-height: 1.3; }
.modal p { margin: 0; color: var(--muted); line-height: 1.5; }
.modal-actions { display: flex; gap: .7rem; justify-content: center; margin-top: .5rem; }
.modal-actions .btn { flex: 1; padding: .75rem 1rem; border-radius: 12px; }
.btn-danger.solid { background: var(--high); color: #fff; box-shadow: 0 6px 16px rgba(229,72,77,.32); }
.btn-danger.solid:hover:not(:disabled) { background: #d23a3f; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

.chip.self { background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: .8rem; padding: .15rem .65rem; }

/* "Tasks to confirm" banner: sits above everything, cannot be dismissed */
.accept-bar { display: flex; align-items: center; gap: .9rem; padding: .65rem 2rem; color: #fff;
    background: linear-gradient(95deg, #d9480f 0%, #f0701a 55%, #f59f00 100%); box-shadow: 0 6px 20px rgba(217,72,15,.3); }
.ab-ico { font-size: 1.15rem; animation: ab-ring 2.4s ease-in-out infinite; transform-origin: 50% 0; }
.ab-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.ab-label { font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; opacity: .9; }
.ab-task { display: flex; align-items: baseline; gap: .6rem; min-width: 0; white-space: nowrap; }
.ab-title { overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
.ab-star { color: #ffe08a; margin-right: .3rem; }
.ab-from { opacity: .85; }
.ab-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.ab-btn { border: 0; border-radius: 10px; padding: .5rem 1rem; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.ab-btn.ghost { background: rgba(255,255,255,.2); color: #fff; }
.ab-btn.ghost:hover { background: rgba(255,255,255,.32); }
.ab-btn.solid { background: var(--card); color: var(--t-c2410c); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.ab-btn.solid:hover:not(:disabled) { background: var(--c-fff4e6); }
.ab-btn:disabled { opacity: .6; cursor: default; }
/* "Important task needs an answer" bar: same shape as the confirmation bar, in red so it reads as more urgent */
@keyframes ab-ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-4deg); } }
@media (max-width: 800px) {
    .accept-bar { flex-wrap: wrap; padding: .55rem .75rem; gap: .5rem .6rem; }
    .ab-actions { width: 100%; }
    .ab-actions .ab-btn { flex: 1; padding: .5rem .4rem; }
    /* little room on a phone: the confirmation banner takes the pinned task's place until it is resolved */
    .top-stack:has(.accept-bar) .pin-bar { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ab-ico { animation: none; } }

/* Copy button inside the notepad field */
.note-copy { position: absolute; z-index: 61; top: 6px; right: 8px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.note-copy .ni { width: 17px; height: 17px; }
.note-copy:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary); }
.note-copy:disabled { opacity: .35; cursor: default; }
.note-copy.done { color: var(--low); background: var(--low-bg); }
.note-field { padding-right: 44px; }
.note-field.expanded { padding-right: 44px; }
.note-state { right: 44px; }
@media (max-width: 800px) {
    .note-copy { display: none; }
    .note-inline.open .note-copy { display: grid; position: fixed; top: 69px; right: 1.35rem; z-index: 101; background: rgba(255,255,255,.7); }
}

/* "New task" button: always in the top bar, left of the notepad (icon only on a phone) */
.topbar { gap: .75rem; }
.new-task-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: 40px; padding: 0 1.1rem; flex-shrink: 0; border-radius: 12px; color: #fff; font-weight: 600; font-size: .92rem; white-space: nowrap;
    background: linear-gradient(135deg, #6a4cff, #4b2fe0); box-shadow: 0 6px 16px rgba(91,61,245,.35); transition: filter .15s, transform .15s; }
.new-task-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.new-task-btn .ni { stroke-width: 2.2; }
@media (max-width: 800px) {
    .new-task-btn { width: 40px; padding: 0; gap: 0; }
    .new-task-label { display: none; }
}
/* Phone: [menu] [Smooflo] ........ [+] [notepad] [bell] [avatar] - the full app name stays visible */
@media (max-width: 800px) {
    .topbar { gap: .4rem; }
    .top-logo { white-space: nowrap; flex-shrink: 0; }
    .new-task-btn { margin-left: auto; }
    .note-inline { margin-left: 0; }
}
/* Very narrow phones: slightly smaller buttons so the name and all icons still fit in one row */
@media (max-width: 370px) {
    .burger, .new-task-btn, .note-inline, .note-field, .note-ico, .bell-btn { width: 36px; }
    .burger, .new-task-btn, .note-inline, .note-field, .note-ico, .bell-btn { height: 36px; }
    .topbar { padding-left: .5rem; padding-right: .5rem; }
    .top-logo { font-size: 1rem; gap: .35rem; }
}

/* The top bar (with the bars above it) stays visible while the page scrolls, on desktop too */
.top-stack { position: sticky; top: 0; }
@media (min-width: 801px) {
    .top-stack .topbar { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding-bottom: .7rem; }
}

/* "Na dziś" page header */
.today-head h2 { margin: 0; }
.today-count { color: var(--muted); font-size: .92rem; }
.today-count strong { color: var(--text); font-size: 1.1rem; }
.due-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.due-row .input { width: auto; min-width: 230px; height: 46px; }
.due-row .seg { flex-wrap: nowrap; }
.three.two-up { grid-template-columns: auto minmax(0, 14rem); justify-content: start; gap: 2rem; }
@media (max-width: 520px) { .three.two-up { grid-template-columns: 1fr; } .due-row .seg { width: 100%; } .due-row .seg-btn { flex: 1; } }

/* Recipient chips: a known person shows "Name (login)", an unknown contact is marked as an invitation */
.chip.person { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.chip.person small { font-weight: 400; opacity: .8; }

/* Recipient chips: a known person shows "Name (login)", an unknown contact is marked as an invitation */
.chip.person { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.chip.person small { font-weight: 400; opacity: .8; }

/* "Important" marker: a small text label instead of a star (a star usually means "favourite"). */
.imp-tag { display: inline-block; vertical-align: middle; margin-left: .55rem; padding: .12rem .55rem; border-radius: 999px; background: var(--c-fff1dd); color: var(--t-b45f06); font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.check .imp-tag { margin-left: 0; }
.imp-ico { margin-right: .3rem; font-size: .9em; }
.ab-star, .pin-star { font-size: .9em; }

/* Hover feedback for the notification bell, like the "Nowe zadanie" button. */
.bell-btn { transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.bell-btn:hover { background: var(--c-f0edff); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(91,60,246,.22); }
.bell-btn:active { transform: none; }
.bell-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Task toolbar: share / calendar dropdowns in the top right of the task card. */
.td-tools { flex-wrap: wrap; justify-content: flex-end; }
.menu-wrap { position: relative; }
.tool-btn { display: inline-flex; align-items: center; gap: .45rem; height: 40px; padding: 0 .9rem; font-size: .9rem; white-space: nowrap; }
.tool-btn.on { background: var(--c-f0edff); border-color: var(--primary); color: var(--primary); }
.menu-backdrop { position: fixed; inset: 0; z-index: 40; }
.menu-pop { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 41; min-width: 230px; max-width: 290px; padding: .35rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(40,30,110,.18); display: flex; flex-direction: column; }
.menu-item { display: block; width: 100%; text-align: left; padding: .6rem .75rem; border: 0; border-radius: 8px; background: none; color: var(--text, inherit); font: inherit; font-size: .92rem; cursor: pointer; text-decoration: none; }
.menu-item:hover { background: var(--c-f0edff); }
.menu-note { padding: .5rem .75rem .35rem; font-size: .76rem; color: #8b8fa8; border-top: 1px solid var(--line); margin-top: .25rem; }
@media (max-width: 700px) { .tool-text { display: none; } .tool-btn { width: 40px; padding: 0; justify-content: center; } }

/* Task header bar: status dropdown, separator, tool buttons; facts as compact chips. */
.td-head { align-items: center; flex-wrap: wrap; }
.td-sep { width: 1px; height: 24px; background: var(--line); }
.status-btn .st-dot { width: 14px; height: 14px; border-radius: 4px; border: 2px solid currentColor; display: inline-block; }
.status-btn .chev { font-size: .75rem; opacity: .7; }
.menu-pop.left { right: auto; left: 0; min-width: 200px; }
.menu-item.sel { color: var(--primary); font-weight: 600; }
.pin-tool.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chips-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.fact-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .85rem; background: var(--c-f7f6fd); border-radius: 12px; font-size: .9rem; min-width: 0; }
.fact-chip > span { color: var(--muted); }
.fact-chip .dot { color: var(--muted); font-style: normal; }
.fact-chip b { font-weight: 600; }
.fact-chip .ni { color: var(--muted); flex-shrink: 0; }
.fact-chip a { font-size: .85rem; }
@media (max-width: 700px) { .status-btn { width: auto; padding: 0 .8rem; justify-content: flex-start; } .menu-pop { right: 0; } .menu-pop.left { left: 0; } }

/* Start-up screen: logo with a horizontal loading bar underneath. */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4rem; padding: 2rem; }
.boot-logo { display: flex; align-items: center; gap: .7rem; font-size: 2rem; font-weight: 800; letter-spacing: -.01em; color: var(--text, var(--t-1e2235)); }
.boot-logo .logo-mark { width: 52px; height: 52px; font-size: 1.5rem; background: linear-gradient(135deg, #6a4cff, #4b2fe0); box-shadow: 0 6px 16px rgba(91,61,245,.35); animation: boot-pulse 1.6s ease-in-out infinite; }
.boot-bar { position: relative; width: 160px; height: 4px; border-radius: 999px; background: var(--c-e6e2fb); overflow: hidden; }
.boot-bar i { position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 999px; background: linear-gradient(90deg, #6a4cff, #4b2fe0); animation: boot-slide 1.1s ease-in-out infinite; }
@keyframes boot-slide { 0% { left: -40%; } 100% { left: 100%; } }
@keyframes boot-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .boot-logo .logo-mark { animation: none; } .boot-bar i { animation-duration: 2.4s; } }

/* Compact toolbar in the task header (right side, next to the title). */
.td-head { flex-wrap: nowrap; }
.td-title { min-width: 0; }
.td-tools { gap: .35rem; }
.td-tools .tool-btn { height: 32px; padding: 0 .6rem; gap: .35rem; font-size: .8rem; font-weight: 600; border-radius: 9px; }
.td-tools .tool-btn .ni { width: 14px; height: 14px; }
.td-tools .badge { font-size: .75rem; }
@media (max-width: 900px) { .td-head { flex-wrap: wrap; } .td-tools { justify-content: flex-start; } }
@media (max-width: 700px) { .td-tools .tool-btn { width: 32px; padding: 0; } }

/* Live time-left bar on the task page. */
.time-progress { margin: -.2rem 0 1.1rem; padding: .7rem .9rem; background: var(--c-f7f6fd); border-radius: 12px; }
.tp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .45rem; font-size: .85rem; }
.tp-label { color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.tp-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.tp-track { height: 8px; border-radius: 999px; background: var(--c-e6e2fb); overflow: hidden; }
.tp-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6a4cff, #4b2fe0); transition: width .6s ease; }
.time-progress.soon .tp-track i { background: linear-gradient(90deg, #f5a524, #e8890c); }
.time-progress.soon .tp-time { color: var(--t-b45f06); }
.time-progress.over .tp-track i { background: linear-gradient(90deg, #ef5b6b, #d93a4c); }
.time-progress.over .tp-time { color: #d93a4c; }
.due-badge.ok { background: var(--c-eceaf8); color: var(--muted); }
.live-left { font-variant-numeric: tabular-nums; }

/* The remaining-time badge carries a thin progress line underneath: it fills as the deadline approaches. */
.live-left { --fill: #6a4cff; --track: var(--c-d9d4f6); font-style: normal; position: relative; padding-bottom: .28rem; overflow: hidden; font-variant-numeric: tabular-nums; }
.live-left::before, .live-left::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; }
.live-left::before { right: 0; background: var(--track); }
.live-left::after { width: max(var(--p, 0%), 4px); background: var(--fill); border-radius: 0 3px 3px 0; transition: width .6s ease; }
.live-left.ok { color: var(--t-4b3fb0); }
.live-left.soon { --fill: #e8890c; --track: var(--c-f6dfb8); color: var(--t-8a4b06); }
.live-left.overdue { --fill: #d93a4c; --track: var(--c-f6c9cf); color: var(--t-b4293a); }
.fact-chip .live-left { margin-left: .2rem; }

/* Task table: smaller type, a wider date column that does not break the date apart. */
.table .row:not(.head) { font-size: .88rem; }
.table .row .title { font-size: .95rem; font-weight: 600; }
.table .row .code { font-size: .72rem; }
.table .row.head { font-size: .92rem; }
.table .badge { font-size: .76rem; }
.due-cell { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; }
.due-cell .due-date { white-space: nowrap; }
.due-cell .due-badge { margin-left: 0; font-size: .72rem; white-space: nowrap; }
@media (min-width: 801px) {
    .table .row { grid-template-columns: minmax(180px, 2.6fr) minmax(140px, 1.6fr) 150px 90px 120px; gap: .6rem; }
}

/* Comment composer with a file picker, and files shown inside a comment. */
.comment-form .add-file { white-space: nowrap; display: inline-flex; align-items: center; }
.comment-file { margin-top: .35rem; max-width: 480px; }
@media (max-width: 700px) { .comment-form { flex-wrap: wrap; } .comment-form .input { flex: 1 1 100%; } }

/* Notification list: a header with a close button, and a layout that fits a phone */
.bell-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--card); z-index: 1; }
.bell-close { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; font-size: 1rem; line-height: 1; cursor: pointer; color: var(--muted); }
.bell-close:hover { background: var(--primary-soft); color: var(--primary); }
@media (max-width: 700px) {
    .bell { position: static; }
    .bell-menu { left: .5rem; right: .5rem; top: calc(100% + 4px); width: auto; max-height: calc(100vh - 7rem); }
}

/* Tasks the user has not opened since they were sent or changed: bold, with a dot, like unread messages */
.row.unread .title { font-weight: 800; }
.unread-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); margin-right: .45rem; vertical-align: middle; }
.row.unread { background: var(--c-faf9ff); }

/* Several reminders in the settings */
.reminder-list { display: flex; flex-direction: column; gap: .5rem; }
.reminder-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.reminder-row .remove { border: 0; background: transparent; cursor: pointer; font-size: 1rem; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.reminder-row .remove:hover { background: var(--high-bg); color: var(--high); }
.quick-add { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.edited-note { color: var(--muted); font-size: .8rem; }

/* Comment form: a clear, solid attach button that never gets squeezed or clipped */
.comment-form { align-items: stretch; }
.comment-form .attach-btn { position: relative; overflow: hidden; flex: 0 0 auto; display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; padding: 0 1rem; border: 1px solid var(--c-c9c3ee); border-style: solid; background: var(--card); color: var(--primary); font-weight: 600; font-size: .92rem; cursor: pointer; }
.comment-form .attach-btn:hover { background: var(--primary-soft); }
.comment-form .attach-btn.has-files { background: var(--primary-soft); border-color: var(--primary); }
.comment-form .btn-primary { flex: 0 0 auto; }
@media (max-width: 700px) { .comment-form .attach-btn { min-height: 42px; } .attach-text { display: inline; } }

/* Repeat row in the new-task form: "co [1] dni", "do dnia [..]" sit in one tidy row (more specific than ".form label") */
.form .due-row .inline-field { display: inline-flex; flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; font-size: .92rem; color: var(--text); }
.form .due-row .input.num { width: 5rem; min-width: 0; text-align: center; }
.recur-row select.input { min-width: 190px; width: auto; }

/* The app's own calendar (DatePicker): same look everywhere, in the app's colours */
.dp { position: relative; display: inline-block; width: 240px; max-width: 100%; }
.form .dp .input, .dp .input { width: 100%; min-width: 0; height: 46px; padding-right: 44px; cursor: pointer; }
.dp-ico { position: absolute; top: 0; right: 0; width: 44px; height: 46px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 0 12px 12px 0; }
.dp-ico:hover, .dp-text:focus + .dp-ico { color: var(--primary); }
.dp-pop { position: absolute; z-index: 70; top: calc(100% + 8px); left: 0; width: 308px; max-width: calc(100vw - 2rem); padding: .85rem .9rem .8rem; background: var(--card); border-radius: 18px; box-shadow: 0 16px 44px rgba(60,40,160,.22), 0 0 0 1px rgba(91,61,245,.08); font-weight: 400; animation: dp-in .12s ease-out; overflow-y: auto; }
@keyframes dp-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dp-head { display: flex; align-items: center; gap: .15rem; margin-bottom: .55rem; }
.dp-title { flex: 1; text-align: center; font-weight: 700; font-size: .95rem; text-transform: capitalize; color: var(--text); }
.dp-nav { width: 30px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--primary); font-size: 1.15rem; line-height: 1; cursor: pointer; }
.dp-nav:hover { background: var(--primary-soft); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow span { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: .25rem 0 .35rem; }
.dp-day { aspect-ratio: 1; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: .9rem; color: var(--text); cursor: pointer; transition: background .1s, color .1s; }
.dp-day:hover { background: var(--primary-soft); color: var(--primary); }
.dp-day.out { color: var(--c-b9bdd0); }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--primary); font-weight: 700; color: var(--primary); }
.dp-day.sel, .dp-day.sel:hover { background: var(--primary); color: #fff; font-weight: 700; box-shadow: 0 4px 10px rgba(91,61,245,.35); }
.dp-time { display: flex; align-items: center; gap: .5rem; margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--line); font-size: .9rem; font-weight: 600; }
.dp-time > span { flex: 1; }
.form .dp-time .input, .dp-time .input { width: 62px; height: 38px; padding: 0 .4rem; text-align: center; cursor: text; }
.dp-foot { display: flex; align-items: center; gap: 1rem; margin-top: .7rem; }
.dp-link { border: 0; background: transparent; padding: .25rem 0; font: inherit; font-size: .88rem; font-weight: 600; color: var(--primary); cursor: pointer; }
.dp-link:hover { text-decoration: underline; }
.dp-link:first-child { color: var(--muted); }
.dp-done { margin-left: auto; padding: .45rem 1.1rem; font-size: .88rem; }

/* The logo and the app name lead to the home page */
a.logo-link { color: inherit; text-decoration: none; cursor: pointer; }
a.logo-link:hover { opacity: .85; }

/* Days that cannot be chosen (in the past) */
.dp-day:disabled { color: var(--c-cfd2e0); cursor: not-allowed; background: transparent; text-decoration: line-through; text-decoration-color: rgba(150,155,185,.45); }
.dp-day:disabled:hover { background: transparent; color: var(--c-cfd2e0); }
.dp-nav:disabled { color: var(--c-cfd2e0); cursor: not-allowed; background: transparent; }

/* An edited task is marked with the date of the change; a finished task shows its locked status */
.edited-tag { display: inline-block; margin-top: .3rem; padding: .15rem .65rem; border-radius: 999px; background: var(--c-fff4d6); color: var(--t-8a5a06); font-size: .8rem; font-weight: 600; }
.edited-tag.sm { margin: 0; padding: 0; background: transparent; font-size: inherit; }
.status-final { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }

/* Excel-like column header: sort by clicking a title, filter with the funnel */
.table.sortable { overflow: visible; }
@media (max-width: 900px) { .table.sortable { overflow-x: auto; } }
.row.head .hcell { position: relative; display: flex; align-items: center; gap: .2rem; min-width: 0; }
.hlabel { border: 0; background: transparent; font: inherit; color: inherit; font-weight: 600; cursor: pointer; padding: .2rem .3rem; margin-left: -.3rem; border-radius: 6px; white-space: nowrap; }
.hlabel:hover { background: rgba(91,61,245,.1); color: var(--primary); }
.hcell.sorted .hlabel { color: var(--primary); }
.sort-mark { font-style: normal; font-size: .65rem; margin-left: .3rem; }
.hfilter { border: 0; background: transparent; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); cursor: pointer; flex: 0 0 auto; }
.hfilter:hover { background: rgba(91,61,245,.1); color: var(--primary); }
.hfilter.on { color: #fff; background: var(--primary); }
.fp-pop { position: absolute; z-index: 75; top: calc(100% + 6px); left: 0; width: 250px; max-width: calc(100vw - 2rem); padding: .5rem; background: var(--card); border-radius: 14px; box-shadow: 0 16px 44px rgba(60,40,160,.22), 0 0 0 1px rgba(91,61,245,.08); font-weight: 400; font-size: .88rem; color: var(--text); animation: dp-in .12s ease-out; }
.fp-pop.right { left: auto; right: 0; }
.fp-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: .45rem .6rem; border-radius: 8px; font: inherit; cursor: pointer; color: var(--text); }
.fp-item:hover { background: var(--primary-soft); color: var(--primary); }
.fp-item.muted { color: var(--muted); }
.fp-sep { height: 1px; background: var(--line); margin: .4rem .2rem; }
.form .fp-search, .fp-search { width: 100%; height: 36px; margin-bottom: .35rem; font-size: .88rem; }
.fp-list { max-height: 220px; overflow-y: auto; margin: .1rem 0 .3rem; }
.fp-check { display: flex; flex-direction: row; align-items: center; gap: .5rem; padding: .3rem .4rem; border-radius: 8px; cursor: pointer; font-weight: 400; font-size: .88rem; }
.fp-check:hover { background: var(--primary-soft); }
.fp-check input { accent-color: var(--primary); width: 16px; height: 16px; flex: 0 0 auto; }
.fp-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-check small { color: var(--muted); }
.fp-all { font-weight: 600; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; margin-bottom: .2rem; }
.fp-foot { display: flex; align-items: center; justify-content: space-between; padding: .3rem .3rem .1rem; }
.fp-foot .linkbtn:disabled { opacity: .4; cursor: default; }
.fp-ok { padding: .35rem 1rem; font-size: .85rem; }
.fp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .6rem; font-size: .85rem; color: var(--muted); }
.fp-bar .chip { background: var(--primary-soft); color: var(--primary); font-size: .8rem; }

/* Task number pinned to the top-left corner of the task card */
.task-card { position: relative; padding-top: 2.9rem; }
.code-corner { position: absolute; top: 0; left: 0; padding: .3rem .85rem .3rem .9rem; background: var(--primary-soft); color: var(--primary); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; font-weight: 700; letter-spacing: .04em; border-radius: 18px 0 14px 0; }
@media (max-width: 700px) {
    .task-card { padding-top: 2.6rem; }
    /* Phone: the chips keep only their icons and values; the labels ("Priorytet", "Od"…) are left out */
    .fact-chip .fact-label, .fact-chip .dot { display: none; }
    .fact-chip { gap: .4rem; padding: .45rem .7rem; }
}

/* Clashing appointments and proposed dates */
.ack-tag.clash { color: var(--t-b45309); }
.clash-box { background: var(--c-fff4d6); color: var(--t-7a4a05); }
.clash-list { margin: .35rem 0 .1rem 1.1rem; padding: 0; }
.clash-list a { color: inherit; font-weight: 600; text-decoration: underline; }
.proposal-box { background: var(--primary-soft); color: var(--text); }
.propose-fields { display: flex; flex-direction: column; gap: .6rem; align-items: stretch; margin: .8rem 0 .2rem; text-align: left; }
.propose-fields .dp { width: 100%; }

/* Categories: coloured tags. The colour of a category is set through --c (chip, swatch, dot) */
.cat-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
    color: var(--c, var(--primary)); background: color-mix(in srgb, var(--c, var(--primary)) 13%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--primary)) 28%, var(--card)); font-style: normal; }
.cat-chip.sm { font-size: .7rem; padding: .05rem .5rem; }
.cat-chip.pick { border: 0; cursor: pointer; font-family: inherit; }
.cat-chip.pick:hover { background: color-mix(in srgb, var(--c, var(--primary)) 24%, var(--card)); }
.cat-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: .7rem; padding: 0 .1rem; line-height: 1; opacity: .7; }
.cat-x:hover { opacity: 1; }
.cat-row { display: flex; flex-wrap: wrap; gap: .3rem; margin: .25rem 0 .1rem; }
.cat-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--primary)); flex: 0 0 auto; }
.cat-picker { position: relative; }
.cat-field { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; min-height: 46px; padding: .35rem .6rem; background: var(--card); border: 1px solid var(--c-ddd8f5); border-radius: 12px; cursor: text; }
.cat-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form .cat-input, .cat-input { flex: 1 1 120px; min-width: 100px; border: 0; outline: 0; background: transparent; font: inherit; font-size: .92rem; font-weight: 400; padding: .2rem 0; }
.cat-pop { position: absolute; z-index: 70; top: calc(100% + 6px); left: 0; right: 0; max-width: 420px; padding: .7rem .8rem; background: var(--card); border-radius: 14px; box-shadow: 0 16px 44px rgba(60,40,160,.22), 0 0 0 1px rgba(91,61,245,.08); font-weight: 400; animation: dp-in .12s ease-out; }
.cat-sug-label { font-size: .78rem; color: var(--muted); margin-bottom: .4rem; }
.cat-sug { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.cat-new { border-top: 1px solid var(--line); padding-top: .6rem; }
.cat-sug + .cat-new { margin-top: .1rem; }
.cat-swatches { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .6rem; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; box-shadow: 0 0 0 2px var(--card), 0 0 0 3px transparent; transition: transform .1s; }
.swatch:hover { transform: scale(1.12); }
.swatch.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--c); }
.cat-add { padding: .4rem 1rem; font-size: .85rem; }

/* Category filter next to the title column, and the categories page */
.hfilter.cat-filter { font-size: .8rem; }
.fp-check .cat-dot { margin-left: .1rem; }
.cat-manage { display: flex; flex-direction: column; gap: .75rem; margin-top: 1rem; }
.cat-manage-row { display: grid; grid-template-columns: 140px minmax(140px, 1fr) auto auto auto; gap: .75rem; align-items: center; padding: .75rem .9rem; background: var(--c-f7f6fd); border-radius: 14px; }
.cat-manage-row .cat-swatches { margin: 0; gap: .35rem; max-width: 190px; }
.cat-manage-row .swatch { width: 22px; height: 22px; }
.cat-manage-actions { display: flex; gap: .4rem; }
@media (max-width: 900px) { .cat-manage-row { grid-template-columns: 1fr; } .cat-manage-row .cat-swatches { max-width: none; } }

/* "Moje kategorie" in the task details */
.my-cats { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin: 0 0 1rem; }
.my-cats-label { font-size: .85rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.my-cats .cat-picker { flex: 1 1 260px; max-width: 520px; }
.my-cats .cat-field { min-height: 40px; }

/* The calendar opens upwards when there is no room below the field */
.dp-pop.up { top: auto; bottom: calc(100% + 8px); }

/* Categories page: a compact row that fits the card (replaces the earlier grid) */
.cat-manage { margin-top: .75rem; }
.cat-manage-row { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .9rem; padding: .6rem .8rem; background: var(--c-f7f6fd); border-radius: 14px; }
.cat-manage-row > .cat-chip { flex: 0 0 auto; min-width: 96px; justify-content: center; font-size: .85rem; padding: .25rem .8rem; }
.form .cat-manage-row .input, .cat-manage-row .input { flex: 1 1 150px; min-width: 120px; max-width: 240px; height: 36px; padding: 0 .75rem; font-size: .9rem; border-radius: 10px; }
.cat-manage-row .cat-swatches { flex: 0 1 auto; margin: 0; gap: .3rem; max-width: none; }
.cat-manage-row .swatch { width: 20px; height: 20px; }
.cat-manage-row .cat-count { margin-left: auto; white-space: nowrap; }
.cat-manage-row .cat-manage-actions { flex: 0 0 auto; }
.cat-manage-actions .btn { padding: .4rem .95rem; font-size: .88rem; }
.cat-new-row { margin: .9rem 0 .5rem; background: var(--primary-soft); }
.cat-new-row .cat-manage-actions { margin-left: auto; }

/* Calendar icon in the top bar (next to the bell; on a phone next to the notepad) */
.cal-btn { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: var(--card); color: var(--text); box-shadow: var(--shadow); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.cal-btn:hover { background: var(--c-f0edff); color: var(--primary); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(91,60,246,.22); }
.cal-btn.active { background: var(--card); color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary), var(--shadow); }
@media (max-width: 700px) { .cal-btn { width: 36px; height: 36px; } }

/* Calendar page */
.cal-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.cal-nav { display: flex; align-items: center; gap: .5rem; }
.cal-title { min-width: 10.5rem; text-align: center; font-size: 1.1rem; text-transform: capitalize; }
.cal-nav-btn { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.cal-nav-btn:hover { background: var(--c-e2dcff); }
.cal-today { padding: .4rem .95rem; font-size: .88rem; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow span { text-align: center; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: .3rem 0 .45rem; }
.cal-day { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: .25rem; min-height: 104px; padding: .4rem .45rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font: inherit; color: var(--text); text-align: left; cursor: pointer; transition: background .12s, box-shadow .12s, border-color .12s; }
.cal-day:hover { background: var(--c-faf9ff); border-color: var(--c-cfc8f7); }
.cal-day.weekend { background: var(--c-fbfbfe); }
.cal-day.out { opacity: .5; }
.cal-day.today .cal-num { background: var(--primary); color: #fff; }
.cal-day.sel { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft), 0 6px 16px rgba(91,61,245,.15); background: var(--c-f7f5ff); }
.cal-num { align-self: flex-start; min-width: 26px; height: 26px; padding: 0 .35rem; display: grid; place-items: center; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.cal-pills { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-pill { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .1rem .4rem; border-radius: 6px; font-size: .72rem; font-weight: 600; background: var(--primary-soft); color: var(--primary); }
.cal-pill.overdue { background: var(--high-bg); color: var(--high); }
.cal-pill.done { background: var(--low-bg); color: var(--low); }
.cal-pill.notdone { background: var(--high-bg); color: var(--high); opacity: .7; }
.cal-more { font-size: .7rem; color: var(--muted); padding-left: .3rem; }
.cal-dots { display: none; align-items: center; gap: 3px; flex-wrap: wrap; }
.cal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.cal-dot.overdue, .cal-dot.notdone { background: var(--high); }
.cal-dot.done { background: var(--low); }
.cal-dots small { font-size: .65rem; color: var(--muted); }
.cal-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: .8rem; font-size: .78rem; color: var(--muted); }
.cal-legend .cal-dot { margin-right: .25rem; }
.cal-side { position: sticky; top: 1rem; background: var(--c-f7f6fd); border-radius: 16px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .7rem; }
.cal-side h3 { font-size: 1.05rem; text-transform: capitalize; }
.cal-list { display: flex; flex-direction: column; gap: .5rem; }
.cal-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .55rem .7rem; background: var(--card); border-radius: 12px; border-left: 4px solid var(--primary); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.cal-item:hover { box-shadow: var(--shadow-lg); }
.cal-item.overdue, .cal-item.notdone { border-left-color: var(--high); }
.cal-item.done { border-left-color: var(--low); opacity: .8; }
.cal-item-time { font-size: .8rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.cal-item-main { display: flex; flex-direction: column; min-width: 0; }
.cal-item-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.cal-item-main small { color: var(--muted); font-size: .75rem; }
.cal-create { text-align: center; }
@media (max-width: 1000px) { .cal-layout { grid-template-columns: 1fr; } .cal-side { position: static; } }
@media (max-width: 700px) {
    .cal-day { min-height: 52px; padding: .3rem .25rem; align-items: center; gap: .2rem; border-radius: 10px; }
    .cal-pills { display: none; }
    .cal-dots { display: flex; justify-content: center; }
    .cal-num { min-width: 24px; height: 24px; font-size: .82rem; }
    .cal-grid { gap: 3px; }
    .cal-title { min-width: 8rem; font-size: 1rem; }
}

/* Look and language switches (user menu and sign-in pages) */
.prefs { display: flex; flex-direction: column; gap: .5rem; padding: .35rem .6rem; }
.prefs-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.prefs-label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.seg.mini { display: inline-flex; gap: 2px; padding: 2px; background: var(--c-f7f6fd); border-radius: 10px; }
.seg.mini .seg-btn { min-width: 38px; padding: .25rem .55rem; font-size: .8rem; border-radius: 8px; line-height: 1.4; }
.auth-prefs { margin-top: 1.25rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.prefs.compact { flex-direction: row; flex-wrap: wrap; justify-content: space-between; padding: 0; }

/* Calendar: more compact on a laptop screen (the whole month fits in the window height), icon only on desktop */
.cal-card { padding: 1rem 1.3rem 1.1rem; }
.cal-head { margin-bottom: .6rem; }
.cal-head h2 { font-size: 1.3rem; }
.cal-nav-btn { width: 32px; height: 32px; }
.cal-title { font-size: 1rem; min-width: 9.5rem; }
.cal-dow span { padding: .1rem 0 .25rem; font-size: .7rem; }
.cal-grid { gap: 3px; }
.cal-day { min-height: 74px; padding: .28rem .4rem; gap: .15rem; border-radius: 10px; }
.cal-num { min-width: 22px; height: 22px; font-size: .78rem; }
.cal-pill { font-size: .68rem; padding: .05rem .35rem; }
.cal-legend { margin-top: .5rem; gap: .2rem 1rem; font-size: .72rem; }
.cal-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 1rem; }
.cal-side { padding: .8rem .9rem; gap: .55rem; }
@media (max-width: 1000px) { .cal-layout { grid-template-columns: 1fr; } }
@media (max-height: 800px) and (min-width: 701px) { .cal-day { min-height: 66px; } }
@media (max-width: 700px) {
    .cal-btn { display: none; }                 /* on a phone the calendar is in the menu only: the top bar is crowded enough */
    .cal-day { min-height: 50px; }
}

/* Calendar: month controls on the left above the grid (no page heading) */
.cal-head { justify-content: flex-start; margin-bottom: .7rem; }
.cal-title { min-width: 9rem; }

/* Colour swatches: enough room between them so the selection ring does not overlap the neighbours */
.cat-swatches { gap: .6rem; padding: 4px; }
.cat-manage-row .cat-swatches { gap: .6rem; padding: 4px; flex-wrap: wrap; }
.cat-manage-row .swatch { width: 20px; height: 20px; }
.swatch { box-shadow: none; }
.swatch.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--c); }

/* Search page */
.search-card { padding-bottom: 1.2rem; }
.search-box { position: relative; margin-bottom: .8rem; }
.search-ico { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; place-items: center; pointer-events: none; }
.search-box .input { height: 48px; padding-left: 2.6rem; font-size: 1rem; border-radius: 14px; }
.search-count { margin: .2rem .2rem .6rem; }
.search-list { display: flex; flex-direction: column; gap: .5rem; }
.search-item { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem .9rem; border-radius: 12px; background: var(--c-f7f6fd); color: var(--text); text-decoration: none; border-left: 4px solid var(--primary); }
.search-item:hover { background: var(--primary-soft); }
.search-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.search-title { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; }
.search-snippet { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-main small { font-size: .76rem; }
.search-item mark { background: rgba(245,165,36,.35); color: inherit; border-radius: 3px; padding: 0 .1rem; }

/* Today's date above the progress bar on "My tasks" */
.today-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: .15rem .7rem; margin: 0 0 .75rem .15rem; color: var(--text); text-decoration: none; }
.today-dow { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.today-date { font-size: 1rem; font-weight: 500; color: var(--muted); }
.today-line:hover .today-date { color: var(--primary); }
@media (max-width: 700px) { .today-dow { font-size: 1.15rem; } .today-date { font-size: .9rem; } .today-line { margin-bottom: .55rem; } }

/* Search: the magnifier button in the top bar and the window it opens */
.search-btn { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--card); color: var(--text); box-shadow: var(--shadow); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.search-btn:hover { background: var(--c-f0edff); color: var(--primary); transform: translateY(-1px); }
.sm-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(30,34,53,.45); display: flex; justify-content: center; align-items: flex-start; padding: 9vh 1rem 1rem; animation: dp-in .12s ease-out; }
.sm-card { width: 100%; max-width: 680px; max-height: 80vh; display: flex; flex-direction: column; background: var(--card); border-radius: 18px; box-shadow: 0 24px 60px rgba(30,20,100,.35); padding: 1rem 1rem .8rem; }
.sm-card .search-box { margin-bottom: .6rem; }
.sm-card .search-box .input { padding-right: 2.6rem; }
.sm-close { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .95rem; cursor: pointer; }
.sm-close:hover { background: var(--primary-soft); color: var(--primary); }
.sm-body { overflow-y: auto; min-height: 0; }
.sm-body .empty { padding: 1.2rem .5rem; }

/* Phone: smaller icons in the top bar so that the search button fits next to the notepad, bell and avatar */
@media (max-width: 700px) {
    .burger, .new-task-btn, .note-inline, .note-field, .note-ico, .bell-btn, .search-btn { width: 32px; height: 32px; }
    .burger, .new-task-btn, .note-inline, .note-field, .note-ico, .bell-btn, .search-btn { height: 32px; }
    .search-btn svg, .bell-btn svg, .burger svg { width: 17px; height: 17px; }
    .bell-btn { font-size: .95rem; }
    .topbar { gap: .3rem; }
    .user { gap: .25rem; }
    .user-btn .avatar { width: 32px; height: 32px; font-size: .75rem; }
    .top-logo { font-size: 1rem; }
    .top-logo .logo-mark { width: 28px; height: 28px; font-size: .85rem; }
    .sm-backdrop { padding-top: 4.5rem; }
}

/* Phone: the collapsed notepad is exactly as wide as the other icons (its right padding made it wider and it overlapped the search button) */
@media (max-width: 700px) {
    .note-inline:not(.open) .note-field { padding: 0; width: 100%; min-width: 0; }
    .note-inline:not(.open) { overflow: hidden; border-radius: 10px; }
    .note-inline:not(.open) .note-ico { width: 100%; }
    .topbar > * { min-width: 0; }
}

/* An important task that still waits for "Wykonane / Nie wykonane" shortly before its end: softly red in the list */
.table .row.needs-answer { background: var(--high-bg); box-shadow: inset 4px 0 0 var(--high); }
.table .row.needs-answer:hover { background: var(--high-bg); filter: brightness(.98); }
.answer-tag { display: block; margin-top: .3rem; font-size: .72rem; font-weight: 700; color: var(--high); line-height: 1.25; }

/* Phone: the time left is short ("−2 d 14 h 18 min" overdue, "3 d 2 h" left) instead of "Po terminie …" / "Zostało …" */
.ll-short { display: none; }
@media (max-width: 700px) {
    .ll-long { display: none; }
    .ll-short { display: inline; }
}

/* Phone, dark theme: the placeholder of the collapsed notepad must stay invisible (the generic dark placeholder rule was stronger) */
@media (max-width: 700px) {
    :root[data-theme="dark"] .note-inline:not(.open) .note-field::placeholder,
    .note-inline:not(.open) .note-field::placeholder { color: transparent; opacity: 0; }
}

/* ----- tasks with several dates ----- */
.date-count { display: inline-block; margin-left: .4rem; padding: 0 .4rem; border-radius: 999px; font-size: .72rem; background: var(--c-eef0ff, #eef0ff); color: var(--c-5b3df5, #5b3df5); white-space: nowrap; }
:root[data-theme="dark"] .date-count { background: #2a2750; color: #b9b0ff; }
.extra-date { margin-top: .4rem; }
.add-date { margin-top: .4rem; align-self: flex-start; }
.date-list { list-style: none; margin: .3rem 0 .5rem; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.date-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.date-row.done .date-text { color: var(--low); }
.date-row input[type=checkbox] { width: 1.1rem; height: 1.1rem; }

/* extra dates: two columns under the kind buttons */
.extra-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; max-width: 34rem; margin-top: .5rem; }
.extra-grid:empty { display: none; }
.extra-item { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.extra-item .dp { flex: 1; min-width: 0; }
.dp-multi { display: flex; align-items: center; gap: .4rem; font-size: .85rem; padding: .3rem .2rem; cursor: pointer; }

/* calendar: which tasks to show */
.cal-filter { display: flex; gap: .5rem; flex-wrap: wrap; }
.cal-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border: 1px solid var(--line, #e3e0f5); border-radius: 999px; font-size: .85rem; cursor: pointer; user-select: none; background: var(--card, #fff); }
.cal-chip.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); font-weight: 600; }
.cal-chip input { accent-color: var(--primary); margin: 0; }

.date-list.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem 1.5rem; max-width: 36rem; }
.date-row.current .date-text { font-weight: 700; color: var(--primary); }
@media (max-width: 480px) { .date-list.two-col { grid-template-columns: 1fr; } }

/* dates: one next to the kind buttons, several in two columns underneath */
.due-dates { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; min-width: 0; }
.due-dates.multi { flex: 0 0 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 34rem; }
.due-dates:not(.multi) .dp { width: auto; }
@media (max-width: 520px) { .due-dates.multi { grid-template-columns: 1fr; } }

/* calendar popup: month on the left, time and options on the right */
.dp-pop { width: auto; }
.dp-cols { display: flex; gap: 1rem; align-items: flex-start; }
.dp-cal { width: 280px; flex: none; }
.dp-side { width: 150px; display: flex; flex-direction: column; gap: .8rem; padding-top: 2.6rem; }
.dp-side .dp-time { margin: 0; padding: 0; border: 0; flex-wrap: wrap; }
.dp-side .dp-time > span { flex: 1 0 100%; }
.dp-side .dp-multi { align-items: flex-start; font-size: .85rem; font-weight: 600; padding: 0; }
.dp-side .dp-multi input { margin-top: .15rem; }
@media (max-width: 520px) { .dp-cols { flex-direction: column; gap: .5rem; } .dp-cal { width: 100%; } .dp-side { width: 100%; padding-top: 0; flex-direction: row; flex-wrap: wrap; } }
.dp-side .side-foot { flex-direction: column-reverse; align-items: stretch; gap: .4rem; margin-top: 0; }
.dp-side .side-foot .dp-done { width: 100%; }
.dp-side .side-foot .dp-link { text-align: left; }
@media (max-width: 520px) { .dp-side .side-foot { flex-direction: row; align-items: center; } .dp-side .side-foot .dp-done { width: auto; } }
.form .dp-multi, .dp-multi { display: flex; flex-direction: row; align-items: flex-start; gap: .5rem; }
.dp-multi input[type=checkbox] { flex: none; width: 1.1rem; height: 1.1rem; margin: .1rem 0 0; }
.dp-multi span { flex: 1; min-width: 0; line-height: 1.3; }
.list-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.list-head .searchbox { flex: 1 1 260px; }

/* calendar: own tasks are filled, sent ones are outlined (white with a thin border) */
.cal-pill.sent { background: var(--card); box-shadow: inset 0 0 0 1px currentColor; }
.cal-dot.sent { background: var(--card); box-shadow: inset 0 0 0 2px var(--primary); }
.cal-dot.sent.overdue, .cal-dot.sent.notdone { box-shadow: inset 0 0 0 2px var(--high); }
.cal-dot.sent.done { box-shadow: inset 0 0 0 2px var(--low); }
.cal-item.sent { border: 1px solid var(--line, #e3e0f5); border-left-width: 4px; }
.cal-chip { opacity: .6; }
.cal-chip.on { opacity: 1; }
.cal-chip.mine.on { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.cal-chip.sent.on { background: var(--card); border: 1px solid var(--primary); color: var(--primary); }

/* important tasks: the whole side bar is red (instead of an icon in the title) */
.row.important:not(.head) { border-left-color: var(--high); }

/* "Dzisiaj" in the calendar: reads as a button, like the arrows next to it */
.cal-today { background: var(--primary-soft); color: var(--primary); border: 1px solid transparent; font-weight: 600; box-shadow: none; }
.cal-today:hover { background: var(--primary); color: #fff; }

/* profile button: the same white look and hover as the search, calendar and bell buttons */
.user-btn { background: var(--card); border-color: transparent; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.user-btn:hover { background: var(--c-f0edff); border-color: transparent; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(91,60,246,.22); }
.user-btn:hover .user-info strong { color: var(--primary); }

/* "Kolejne zadanie dla …": small buttons; the one for everybody in a soft accent colour */
.next-task { min-height: 0; height: auto; padding: .3rem .7rem; font-size: .82rem; font-weight: 600; border-radius: 10px; }
.next-task.all { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.next-task.all:hover { background: var(--primary); color: #fff; }

/* dark mode: the "new task" button is calmer (no glow, a deeper purple) */
:root[data-theme="dark"] .new-task-btn { background: linear-gradient(135deg, #5a42d6, #4630b8); box-shadow: 0 2px 6px rgba(0,0,0,.35); color: #ece9ff; }
:root[data-theme="dark"] .new-task-btn:hover { filter: brightness(1.1); box-shadow: 0 3px 10px rgba(0,0,0,.4); }

/* the category filter in the table header: the same kind of icon button as the funnel next to it, with a clear tag icon */
.hfilter.cat-filter { width: 26px; height: 26px; padding: 0; border: 0; background: transparent; color: var(--text); opacity: .75; }
.hfilter.cat-filter:hover { background: rgba(91,61,245,.1); color: var(--primary); opacity: 1; }
.hfilter.cat-filter.on { background: var(--primary); color: #fff; opacity: 1; }

/* the "do kiedy" row: the buttons, the date and the repeat dropdown are all 46 px tall; the dropdown is narrow so it sits beside the date */
.due-row .seg-btn { height: 46px; padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; }
.due-row select.input { min-width: 0; width: 165px; padding-right: 2rem; }
.due-row .dp { display: block; }

/* a calendar that stays where it opened, even when the date fields move (several dates) */
.due-field { position: relative; }
.dp.anchored { position: static; }
.dp-field { position: relative; }
.hfilter.cat-filter { width: 24px; height: 24px; }
.hfilter.cat-filter .ni { width: 14px; height: 14px; }
.row.head .hlabel { font-size: .92rem; }

/* calendar on a phone: a button switches the dots to the names of the tasks inside the days */
.cal-expand { display: none; place-items: center; width: 36px; height: 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); cursor: pointer; }
.cal-expand.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
@media (max-width: 700px) {
    .cal-expand { display: inline-grid; }
    .cal-main.expanded .cal-pills { display: flex; width: 100%; }
    .cal-main.expanded .cal-dots { display: none; }
    .cal-main.expanded .cal-day { min-height: 84px; align-items: stretch; padding: .25rem .15rem; }
    .cal-main.expanded .cal-num { align-self: center; }
    .cal-main.expanded .cal-pill { font-size: .6rem; padding: .08rem .2rem; border-radius: 4px; }
    .cal-main.expanded .pill-meta { display: none; }
    .cal-main.expanded .cal-more { font-size: .58rem; text-align: center; }
}

/* "Nowe zadanie": the same look as the other top-bar buttons (card background, accent icon/text), in both themes */
.new-task-btn, :root[data-theme="dark"] .new-task-btn { background: var(--card); color: var(--primary); box-shadow: var(--shadow); border: 0; }
.new-task-btn:hover, :root[data-theme="dark"] .new-task-btn:hover { background: var(--c-f0edff); color: var(--primary); filter: none; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(91,60,246,.22); }

/* phone: the four counters (do zrobienia, termin się zbliża, po terminie, wykonane) fit in one compact row */
@media (max-width: 700px) {
    .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; margin-bottom: .6rem; }
    .stat { padding: .4rem .25rem; gap: .15rem; border-radius: 12px; align-items: center; text-align: center; }
    .stat-top { gap: .25rem; justify-content: center; }
    .stat-icon { width: 20px; height: 20px; border-radius: 6px; font-size: .62rem; }
    .stat strong { font-size: 1.05rem; }
    .stat > span:not(.stat-icon) { font-size: .6rem; line-height: 1.15; }
}

/* ===== Phone: the home page as cards (heading, progress, scrolling counters, search + filters, task cards) ===== */
.pg-short, .filter-toggle { display: none; }
.searchbox-icon { color: var(--muted); }
@media (max-width: 700px) {
    /* heading */
    .today-line { flex-direction: column; align-items: flex-start; gap: 0; margin: .2rem 0 .8rem .1rem; }
    .today-dow { font-size: 1.9rem; line-height: 1.15; }
    .today-date { font-size: 1.1rem; }

    /* progress */
    .pg-long { display: none; }
    .pg-short { display: inline; }
    .progress-card { padding: .8rem 1rem; border-radius: 18px; }
    .progress-head { font-size: 1rem; }
    .progress-head strong { font-weight: 800; }

    /* counters: one scrolling row; icon on top, "label  number" below */
    .stats { display: flex; gap: .55rem; overflow-x: auto; scroll-snap-type: x proximity; padding: .15rem .1rem .5rem; margin: 0 -.1rem .35rem; scrollbar-width: none; }
    .stats::-webkit-scrollbar { display: none; }
    .stat { flex: 0 0 auto; display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: .45rem; row-gap: .25rem; padding: .55rem .8rem; border-radius: 16px; scroll-snap-align: start; }
    .stat-top { display: contents; }
    .stat-icon { grid-column: 1 / -1; justify-self: center; width: auto; height: auto; background: transparent !important; margin: 0; font-size: 0; }
    .stat-icon .ni { width: 22px; height: 22px; }
    .stat-icon.blue { color: #7d6f98; } .stat-icon.orange { color: #e0679a; } .stat-icon.red { color: #e03e3e; } .stat-icon.green { color: #2fa56b; }
    .stat > span:not(.stat-icon) { grid-row: 2; grid-column: 1; font-size: .85rem; color: var(--text); white-space: nowrap; }
    .stat strong { grid-row: 2; grid-column: 2; font-size: 1rem; font-weight: 800; }

    /* search + filters + declined */
    .card.filters-open, .card { overflow: visible; }
    .list-head { flex-wrap: wrap; gap: .5rem; }
    .list-head .searchbox { flex: 1 1 0; min-width: 0; }
    .filter-toggle { display: inline-grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--c-ddd8f5); background: var(--card); color: var(--primary); cursor: pointer; }
    .filter-toggle.on { background: var(--primary-soft); border-color: var(--primary); }
    .list-head .cal-chip { flex: 0 0 auto; height: 46px; border-radius: 14px; padding: 0 .8rem; font-size: .95rem; }

    /* the table header (sort + filters) is shown only after the filters button is pressed */
    .card.filters-open .table .row.head { display: flex; flex-wrap: wrap; gap: .3rem .9rem; padding: .6rem .8rem; margin-bottom: .6rem; }
    .card.filters-open .row.head .hcell { flex: 0 0 auto; }

    /* the cards */
    .table { gap: .8rem; }
    .table .row.clickable:not(.head) { display: grid; grid-template-columns: auto auto 1fr; grid-template-areas: "title title title" "person person person" "due due due" "prio stat ."; gap: 0; padding: 1rem 1.1rem; border-radius: 18px; align-items: center; box-shadow: var(--shadow); }
    .table .row.clickable:not(.head) > :nth-child(1) { grid-area: title; padding-bottom: .55rem; }
    .table .row.clickable:not(.head) > :nth-child(2) { grid-area: person; display: flex; align-items: center; gap: .6rem; font-size: 1rem; padding-bottom: .75rem; }
    .table .row.clickable:not(.head) > :nth-child(3) { grid-area: due; display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: .5rem .6rem; padding: .7rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 1rem; }
    .table .row.clickable:not(.head) > :nth-child(4) { grid-area: prio; padding-top: .8rem; }
    .table .row.clickable:not(.head) > :nth-child(5) { grid-area: stat; padding-top: .8rem; margin-left: .6rem; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }
    .table .row .title { font-size: 1.2rem; font-weight: 800; }
    .table .row .person { gap: .6rem; }

    /* date with a calendar icon; the countdown and counter are pills beside it */
    .due-cell .due-ico { display: none; }
    .due-cell .due-date::before { content: ""; display: inline-block; width: 20px; height: 20px; margin-right: .55rem; vertical-align: -4px; background: var(--primary); -webkit-mask: var(--ic-cal) center / contain no-repeat; mask: var(--ic-cal) center / contain no-repeat; }
    .due-cell .due-date.deadline::before { -webkit-mask-image: var(--ic-hourglass); mask-image: var(--ic-hourglass); }
    .due-cell .due-badge { font-size: .85rem; padding: .25rem .7rem; border-radius: 999px; }
    .due-cell .date-count { font-size: .85rem; padding: .25rem .7rem; }

    /* priority and status chips with icons */
    .table .row .badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; font-weight: 700; padding: .45rem .85rem; border-radius: 12px; }
    .table .row .badge::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--ic-flag) center / contain no-repeat; mask: var(--ic-flag) center / contain no-repeat; }
    .table .row .badge[class*="st-"]::before { -webkit-mask-image: var(--ic-dashed); mask-image: var(--ic-dashed); }
    .table .row .badge.st-done::before { -webkit-mask-image: var(--ic-check); mask-image: var(--ic-check); }
    .table .row .badge.st-declined::before, .table .row .badge.st-notdone::before { -webkit-mask-image: var(--ic-x); mask-image: var(--ic-x); }
}
:root {
    --ic-hourglass: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 2h12M6 22h12M7 2v4l5 6-5 6v4M17 2v4l-5 6 5 6v4'/></svg>");
    --ic-cal: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><path d='M16 2v4M8 2v4M3 10h18'/></svg>");
    --ic-flag: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 21V4M5 4h11l-2 4 2 4H5'/></svg>");
    --ic-dashed: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><circle cx='12' cy='12' r='9' stroke-dasharray='3.5 3.5'/></svg>");
    --ic-check: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='m8 12 3 3 5-6'/></svg>");
    --ic-x: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='m9 9 6 6M15 9l-6 6'/></svg>");
}

/* ===== Phone, round 2: one-line heading, icon-only counters, compact search row, filter sheet, profile button ===== */
.sheet-bar, .sheet-foot, .sheet-backdrop { display: none; }
@media (max-width: 700px) {
    /* heading: weekday and date on one line */
    .today-line { flex-direction: row; align-items: baseline; flex-wrap: nowrap; gap: .5rem; margin: .1rem 0 .55rem .1rem; }
    .today-dow { font-size: 1.05rem; line-height: 1.2; }
    .today-date { font-size: .95rem; }

    /* counters: just the icon and the number (the name is in the tooltip) */
    .stat > span:not(.stat-icon) { display: none; }
    .stat { grid-template-columns: auto auto; column-gap: .5rem; row-gap: 0; padding: .5rem .9rem; }
    .stat-icon { grid-column: 1; grid-row: 1; }
    /* the row of counters is centred (and still scrolls when it does not fit) */
    .stats > .stat:first-child { margin-left: auto; }
    .stats > .stat:last-child { margin-right: auto; }
    .stat { justify-content: center; }
    .stat strong { grid-row: 1; grid-column: 2; font-size: 1.1rem; }

    /* search, filter button and "Odrzucone": the same height, smaller */
    .list-head { gap: .4rem; flex-wrap: nowrap; margin-bottom: .6rem; }
    .list-head .searchbox .search { height: 38px; padding-block: 0; font-size: .88rem; border-radius: 12px; padding-left: 2.1rem; }
    .list-head .searchbox-icon { left: .7rem; width: 16px; height: 16px; }
    .filter-toggle { width: 38px; height: 38px; border-radius: 12px; }
    .filter-toggle .ni { width: 18px; height: 18px; }
    .list-head .cal-chip { height: 38px; padding: 0 .6rem; font-size: .8rem; border-radius: 12px; white-space: nowrap; }

    /* the table header turns into a bottom sheet (opened with the filter button) */
    .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 85; background: rgba(20,18,40,.5); }
    .card.filters-open .table .row.head { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0; max-height: 82vh; overflow-y: auto; margin: 0; padding: .9rem 1rem 1rem;
        background: var(--card); border-radius: 22px 22px 0 0; box-shadow: 0 -12px 40px rgba(20,18,60,.35); font-size: 1rem; }
    .card.filters-open .row.head .sheet-bar { width: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; padding-bottom: .6rem; margin-bottom: .2rem; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
    .sheet-x { border: 0; background: var(--primary-soft); color: var(--primary); width: 32px; height: 32px; border-radius: 10px; font-size: 1rem; cursor: pointer; }
    .card.filters-open .row.head .hcell { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; padding: .6rem 0; border-bottom: 1px solid var(--line); width: 100%; }
    .card.filters-open .row.head .hlabel { font-size: 1rem; flex: 1 1 auto; text-align: left; }
    .card.filters-open .row.head .hfilter { width: 36px; height: 36px; }
    .card.filters-open .row.head .fp-pop, .card.filters-open .row.head .fp-pop.right { position: static; flex: 1 0 100%; width: 100%; max-width: none; margin-top: .4rem; box-shadow: none; border: 1px solid var(--line); }
    .card.filters-open .row.head .sheet-foot { width: 100%; box-sizing: border-box; display: flex; gap: .6rem; padding-top: .8rem; }
    .card.filters-open .row.head .sheet-foot .btn { flex: 1; }

    /* profile button: the same size as the other top-bar buttons */
    .user-btn { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 12px; }
    .user-btn .avatar { width: 24px; height: 24px; font-size: .62rem; }
}
@media (max-width: 370px) { .user-btn { width: 36px; height: 36px; } .user-btn .avatar { width: 28px; height: 28px; } }

/* Phone: forms and settings pages (notification settings, profile, new task…) are more compact */
@media (max-width: 700px) {
    .card.narrow:not(.task-card) { padding: 1.1rem 1rem 1.2rem; }
    .card.narrow:not(.task-card) > h2 { font-size: 1.35rem; margin-bottom: .6rem; }
    .card.narrow:not(.task-card) .form { gap: .9rem; }
    .card.narrow:not(.task-card) .form label, .card.narrow:not(.task-card) .field > .label { font-size: .85rem; }
    .card.narrow:not(.task-card) .input { padding: .5rem .7rem; font-size: .88rem; min-height: 40px; border-radius: 10px; }
    .card.narrow:not(.task-card) .hint, .card.narrow:not(.task-card) .muted { font-size: .76rem; }
    .card.narrow:not(.task-card) .btn { padding: .5rem .9rem; font-size: .85rem; border-radius: 10px; }
    .card.narrow:not(.task-card) .reminder-row { gap: .5rem; }
    .card.narrow:not(.task-card) .seg-btn { padding: .45rem .8rem; font-size: .85rem; }
    .card.narrow:not(.task-card) .form-actions { padding-top: .9rem; }
}
@media (max-width: 700px) {
    .card.narrow:not(.task-card) .contact { font-size: .88rem; padding: .45rem .7rem; }
    .card.narrow:not(.task-card) .contact small { font-size: .72rem; }
    .card.narrow:not(.task-card) .actions .btn { width: auto; }
}

/* Priority and estimated time share one line on a phone (short label, narrow field) */
.lbl-short { display: none; }
@media (max-width: 520px) {
    .three.two-up { grid-template-columns: auto minmax(0, 1fr); gap: .7rem; align-items: end; }
    .three.two-up .seg { gap: .35rem; }
    .three.two-up .seg-btn { padding: .5rem .65rem; font-size: .85rem; }
    .three.two-up .lbl-long { display: none; }
    .three.two-up .lbl-short { display: inline; }
    .three.two-up .input { height: 40px; min-height: 40px; width: 100%; max-width: 6.5rem; }
}

/* Phone: the description starts as one line (grows while typing, see interop.js) */
textarea.autogrow { resize: none; overflow-y: auto; }
@media (max-width: 700px) { textarea.autogrow { min-height: 40px; } }

/* "Odebrane" label among the facts of a task */
.fact-chip.receipt-chip { background: var(--low-bg); color: var(--low); }
.fact-chip.receipt-chip b { color: inherit; }

/* Category chip among the facts of a task, with a drop-down list of the user's categories */
.cat-picker.compact { position: relative; display: inline-block; }
.fact-chip.cat-trigger { border: 0; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.fact-chip.cat-trigger:hover, .fact-chip.cat-trigger.on { background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.fact-chip.cat-trigger.on { color: var(--primary); }
.cat-trigger .cat-names { display: inline-flex; flex-wrap: wrap; gap: .15rem .7rem; font-weight: 700; }
.cat-trigger .cat-name { display: inline-flex; align-items: center; gap: .35rem; }
.cat-trigger .chev { margin-left: .2rem; font-size: .8rem; opacity: .7; }
.cat-menu { position: absolute; z-index: 70; top: calc(100% + 8px); right: 0; min-width: 250px; max-width: min(320px, calc(100vw - 2rem)); max-height: 60vh; overflow-y: auto; padding: .4rem; background: var(--card); border-radius: 16px; box-shadow: 0 16px 44px rgba(60,40,160,.22), 0 0 0 1px rgba(91,61,245,.08); }
.cat-opt { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .6rem .7rem; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: .95rem; cursor: pointer; text-align: left; }
.cat-opt:hover { background: var(--c-f0edff, var(--primary-soft)); }
.cat-opt.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.cat-opt .cat-opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-opt .cat-dot { width: 12px; height: 12px; }
.cat-opt.create { color: var(--primary); font-weight: 600; }
.cat-sep { height: 1px; background: var(--line); margin: .35rem .3rem; }
.cat-empty { padding: .5rem .7rem; }
.cat-create { display: flex; flex-direction: column; gap: .5rem; padding: .3rem .4rem .4rem; }
.cat-create .cat-input { border: 1px solid var(--c-ddd8f5); border-radius: 10px; padding: .5rem .7rem; background: var(--card); color: var(--text); font: inherit; width: 100%; }
@media (max-width: 700px) { .cat-menu { right: auto; left: 0; } .fact-chip.cat-trigger .fact-label, .fact-chip.cat-trigger .dot { display: none; } }
.cat-create .cat-input { flex: 0 0 auto; height: 40px; min-height: 0; width: 100%; box-sizing: border-box; }

/* "i" button that reveals an explanation (phones only) */
.info-toggle { display: none; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--c-ddd8f5); background: var(--card); color: var(--primary); font: italic 700 .95rem Georgia, serif; cursor: pointer; }
.info-toggle.on { background: var(--primary-soft); border-color: var(--primary); }
@media (max-width: 700px) {
    .info-toggle { display: inline-grid; }
    .cat-info { display: none; }
    .cat-info.open { display: block; font-size: .8rem; margin: .2rem 0 .6rem; }
    /* the categories page, more compact */
    .card:has(.cat-manage-row) .card-head { margin-bottom: .4rem; justify-content: flex-start; gap: .6rem; align-items: center; }
    .cat-manage-row { padding: .55rem .65rem; gap: .45rem .6rem; border-radius: 12px; }
    .cat-manage-row > .cat-chip { min-width: 0; font-size: .78rem; padding: .15rem .6rem; }
    .form .cat-manage-row .input, .cat-manage-row .input { height: 34px; font-size: .85rem; flex: 1 1 120px; }
    .cat-manage-row .cat-swatches { gap: .35rem; padding: 2px; flex: 1 1 100%; }
    .cat-manage-row .swatch { width: 18px; height: 18px; }
    .cat-manage-actions .btn { padding: .3rem .8rem; font-size: .8rem; }
    .cat-manage { gap: .5rem; margin-top: .5rem; }
}

/* ===== Categories page ===== */
.card.cat-page { max-width: 980px; padding: 1.8rem 2rem 2rem; }
.cat-hero { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; }
.cat-hero-ico { display: grid; place-items: center; flex: 0 0 auto; width: 56px; height: 56px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); }
.cat-hero-title { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; }
.cat-hero-title h2 { margin: 0; font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; }
.count-pill { padding: .2rem .7rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .85rem; font-weight: 600; }
.cat-hero-text p { margin: .3rem 0 0; }
.cat-add { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 1rem; padding: .9rem 1.1rem; margin-bottom: 1.2rem; background: var(--primary-soft); border-radius: 18px; }
.cat-add-label { display: inline-flex; align-items: center; gap: .8rem; margin-right: .6rem; }
.plus-tile { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--card); color: var(--primary); font-style: normal; font-size: 1.4rem; line-height: 1; }
.cat-add .input { flex: 1 1 200px; min-width: 0; height: 46px; background: var(--card); }
.cat-add-btn { height: 46px; padding: 0 1.3rem; border-radius: 12px; white-space: nowrap; }
.color-select { position: relative; flex: 0 0 auto; }
.color-btn { display: inline-flex; align-items: center; gap: .5rem; height: 46px; padding: 0 .9rem; border: 1px solid var(--c-ddd8f5); border-radius: 12px; background: var(--card); color: var(--text); cursor: pointer; }
.color-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--c); display: inline-block; }
.color-pop { position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; display: grid; grid-template-columns: repeat(5, 28px); gap: .6rem; padding: .8rem; background: var(--card); border-radius: 14px; box-shadow: 0 16px 44px rgba(60,40,160,.22), 0 0 0 1px rgba(91,61,245,.08); }
.cat-list { display: flex; flex-direction: column; gap: .6rem; }
.cat-item { display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; transition: background .12s, border-color .12s, box-shadow .12s; }
.cat-item:hover { border-color: var(--primary); background: var(--c-f7f6fd, var(--primary-soft)); }
.cat-item .cat-chip { flex: 0 0 auto; min-width: 140px; justify-content: center; font-size: .95rem; padding: .4rem 1rem; }
.cat-item-name { flex: 1; min-width: 0; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item-count { display: inline-flex; align-items: center; gap: .55rem; color: var(--muted); white-space: nowrap; margin-right: 1.2rem; }
.cat-item-actions { display: flex; gap: .5rem; flex: 0 0 auto; }
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); cursor: pointer; }
.icon-btn:first-child { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.icon-btn:hover { border-color: var(--primary); }
.cat-item.editing { background: var(--primary-soft); border-color: var(--primary); }
.cat-item-input { flex: 1; min-width: 0; height: 42px; }
@media (max-width: 700px) {
    .card.cat-page { padding: 1rem 1rem 1.2rem; }
    .cat-hero { gap: .7rem; margin-bottom: .8rem; }
    .cat-hero-ico { width: 42px; height: 42px; border-radius: 12px; }
    .cat-hero-ico .ni { width: 20px; height: 20px; }
    .cat-hero-title h2 { font-size: 1.35rem; }
    .count-pill { font-size: .75rem; padding: .15rem .55rem; }
    .cat-hero-text p { font-size: .8rem; }
    .cat-add { padding: .7rem; gap: .5rem; border-radius: 14px; }
    .cat-add-label { width: 100%; margin: 0; gap: .6rem; font-size: .9rem; }
    .plus-tile { width: 32px; height: 32px; font-size: 1.1rem; border-radius: 10px; }
    .cat-add .input, .color-btn, .cat-add-btn { height: 40px; }
    .cat-add .input { flex: 1 1 0; }
    .cat-add-btn { flex: 1 1 100%; font-size: .88rem; }
    .cat-item { flex-wrap: wrap; gap: .4rem .7rem; padding: .6rem .7rem; }
    .cat-item .cat-chip { min-width: 0; font-size: .8rem; padding: .2rem .7rem; }
    .cat-item-name { font-size: .95rem; }
    .cat-item-count { margin-right: 0; font-size: .8rem; gap: .3rem; }
    .cat-item-count .ni { width: 14px; height: 14px; }
    .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
    .cat-item-actions { margin-left: auto; gap: .35rem; }
    .cat-item.editing .cat-item-input { flex: 1 1 140px; }
}

/* Desktop: a smaller search box above the lists */
@media (min-width: 701px) {
    .list-head .searchbox { flex: 0 1 340px; max-width: 340px; }
    .list-head .searchbox .search { height: 38px; padding-block: 0; font-size: .9rem; border-radius: 12px; padding-left: 2.2rem; }
    .list-head .searchbox-icon { left: .75rem; width: 16px; height: 16px; }
    .list-head .cal-chip { height: 34px; font-size: .85rem; }
}
.cat-hero { margin-bottom: 1rem; }
.cat-hero h2 { margin: 0; font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; }
@media (max-width: 700px) { .cat-hero h2 { font-size: 1.35rem; } }

/* A recipient's proposal of another date, as a card for the sender */
.proposal-card { display: flex; flex-direction: column; gap: .9rem; padding: 1.1rem 1.2rem; margin: 1rem 0; border-radius: 16px; border: 1px solid var(--primary); }
.proposal-head { display: flex; align-items: center; gap: .8rem; }
.proposal-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--card); font-size: 1.2rem; flex: 0 0 auto; }
.proposal-title { font-size: 1.05rem; }
.proposal-dates { display: flex; align-items: stretch; flex-wrap: wrap; gap: .7rem; }
.proposal-date { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .9rem; border-radius: 12px; background: var(--card); min-width: 150px; }
.proposal-date b { font-size: 1.05rem; }
.proposal-date.proposed { background: var(--primary); color: #fff; }
.proposal-date.proposed span { opacity: .85; }
.proposal-arrow { align-self: center; font-size: 1.3rem; color: var(--primary); }
.proposal-note { padding: .5rem .8rem; border-left: 3px solid var(--primary); background: var(--card); border-radius: 0 10px 10px 0; font-style: italic; }
.proposal-actions { margin-top: .2rem; gap: .7rem; }
@media (max-width: 700px) { .proposal-card { padding: .9rem; gap: .7rem; } .proposal-date { flex: 1 1 130px; min-width: 0; } .proposal-arrow { display: none; } }

/* "Wykonano" pinned to the top-right corner of a finished task, the same way as the number in the top-left one */
.done-ribbon { position: absolute; top: 0; right: 0; padding: .3rem .9rem .3rem .85rem; background: var(--low-bg); color: var(--low); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 0 18px 0 14px; }

/* a finished task is read-only */
.readonly-note { margin: .2rem 0 .6rem; }

/* Mobile: iOS Safari przybliża stronę po focusie pola z fontem < 16px */
@media (pointer: coarse), (max-width: 800px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  textarea,
  select,
  .input,
  .cat-input,
  .dp-time .input,
  .input.code { font-size: 16px !important; }
}

/* Home: extra categories (declined / cancelled / not done) as checkboxes */
.extra-checks { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.sheet-extra { display: none; }
@media (max-width: 800px) {
  .extra-checks { display: none; }
  .card.filters-open .row.head .sheet-extra { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; width: 100%; box-sizing: border-box; padding: .6rem 0; border-bottom: 1px solid var(--line); }
  .card.filters-open .row.head .sheet-extra b { flex: 1 0 100%; font-size: 1rem; font-weight: 500; }
  .card.filters-open .row.head .sheet-extra .cal-chip { height: 38px; padding: 0 .8rem; font-size: .9rem; border-radius: 12px; }
}

/* Minimal icons: thin outline, one colour (no emoji) */
.bell-btn, .note-ico, .ab-ico { color: var(--muted); }
.bell-btn { display: inline-grid; place-items: center; padding: 0; }
.bell-btn .ni { width: 19px; height: 19px; }
.bell-btn:hover { color: var(--primary); }
.note-ico .ni { width: 18px; height: 18px; }
.ab-ico { display: inline-grid; place-items: center; color: var(--primary); }
.ab-ico .ni { width: 20px; height: 20px; }
.seg.mini .seg-btn { display: inline-grid; place-items: center; color: var(--muted); }
.seg.mini .seg-btn.on { color: var(--primary); }
.seg.mini .seg-btn .ni { width: 16px; height: 16px; }

/* Notification settings: quiet, flat, separated by thin lines */
.notif-settings .form { gap: 0; }
.notif-settings .form > .field { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.notif-settings .form > .field:first-child { border-top: 0; padding-top: .2rem; }
.notif-settings .btn:not(.btn-primary) { background: transparent; border-color: var(--line); color: var(--text); font-weight: 500; box-shadow: none; }
.notif-settings .btn:not(.btn-primary):hover { border-color: var(--primary); color: var(--primary); }
.notif-settings .add-reminder { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .8rem; font-size: .88rem; }
.notif-settings .add-reminder .ni { width: 15px; height: 15px; }
.notif-settings .reminder-row .remove { display: inline-grid; place-items: center; padding: 0; }
.notif-settings .reminder-row .remove .ni { width: 16px; height: 16px; }

/* "Edited" tag: quiet, flat, thin pencil */
.edited-tag { display: inline-flex; align-items: center; gap: .3rem; background: transparent; color: var(--muted); font-weight: 500; padding: .15rem 0; }
.edited-tag .pen { width: 13px; height: 13px; }
.edited-tag.sm { display: inline-flex; }

/* Term icons (deadline / fixed time / proposal): thin, one colour, inline with the text */
.due-svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: .2rem; color: var(--muted); }
.seg-btn .due-svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: .35rem; color: inherit; }
.leg-kind { display: inline-flex; align-items: center; gap: .25rem; }
.leg-kind .due-svg { margin: 0; }
.pill-meta .due-svg, .cal-item-time .due-svg { width: 12px; height: 12px; vertical-align: -1px; margin-right: .1rem; color: inherit; }
.pin-chip .due-svg { color: inherit; width: 13px; height: 13px; }
.proposal-ico .due-svg { width: 22px; height: 22px; margin: 0; vertical-align: middle; color: var(--primary); }
.modal-icon .due-svg { width: 34px; height: 34px; margin: 0; color: var(--primary); }
.due-val .due-svg { margin-right: .3rem; }

/* Phone: the task ID is pinned to the top-left corner of the card, small */
@media (max-width: 800px) {
  .table .row.clickable:not(.head) { position: relative; padding-top: 2rem; overflow: hidden; }
  .table .row .code-id { position: absolute; top: 0; left: 0; padding: .2rem .65rem .2rem .75rem; background: var(--primary-soft); color: var(--primary); font-size: .66rem; font-weight: 700; letter-spacing: .04em; line-height: 1.3; border-radius: 18px 0 12px 0; }
}

/* Phone, new task: buttons and date share one line, priority and time share one line; all controls 40 px tall */
@media (max-width: 520px) {
  .three.two-up > .field { grid-column: auto; }
  .three.two-up .seg-btn { height: 40px; padding-block: 0; }
  .three.two-up .input { height: 40px; min-height: 40px; }

  .due-field .lbl-long { display: none; }
  .due-field .lbl-short { display: inline; }
  .due-row { gap: .4rem; }
  .due-row .seg { width: auto; flex: 0 0 auto; gap: .3rem; flex-wrap: nowrap; }
  .due-row .seg-btn { flex: 0 0 auto; height: 40px; padding: 0 .6rem; font-size: .82rem; }
  .due-row .seg-btn .due-svg { display: none; }
  .due-row .due-dates:not(.multi) { flex: 1 1 0; min-width: 0; }
  .form .due-row .dp .input, .due-row .dp .input { height: 40px; min-width: 0; width: 100%; padding-left: .6rem; padding-right: 36px; }
  .due-row .dp-ico { height: 40px; width: 36px; }
  .due-row select.input { height: 40px; }
}

/* User menu: thin icons, aligned with the text */
.menu-item { display: flex; align-items: center; gap: .65rem; }
.menu-item .ni { width: 18px; height: 18px; color: var(--muted); }
.menu-item.danger .ni { color: inherit; }

/* Icon in front of an automatic comment */
.cm-ico, .comment .due-svg, p > .due-svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: .35rem; color: var(--muted); }

/* the sheet of an empty list is only for the phone */
.row.head.bare { display: none; }

/* Task page: as wide as the screen allows, so all the fact chips (term, priority, sender, category) fit in one row */
.card.narrow.task-card { max-width: min(100%, 1400px); }

/* bell: same colour as the search and calendar buttons */
.bell-btn { color: var(--text); }
.bell-btn:hover { color: var(--primary); }

/* Phone: the native date/time field (iOS/Android) next to the term buttons: same height, never wider than the row */
.extra-item > input.input[type="datetime-local"], .extra-item > input.input[type="date"] {
  flex: 1 1 0; min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box;
  -webkit-appearance: none; appearance: none; text-align: left; display: block;
}
.extra-item > input.input[type="datetime-local"]::-webkit-date-and-time-value, .extra-item > input.input[type="date"]::-webkit-date-and-time-value { text-align: left; min-height: 1.2em; }
@media (max-width: 520px) {
  .due-row .extra-item > input.input[type="datetime-local"], .due-row .extra-item > input.input[type="date"] { height: 40px; min-height: 40px; padding: 0 .6rem; }
}

/* Phone, new task: lower controls (34 px) */
@media (max-width: 520px) {
  .three.two-up .seg-btn { height: 34px; }
  .three.two-up .input { height: 34px; min-height: 34px; }
  .due-row .seg-btn { height: 34px; padding: 0 .6rem; font-size: .8rem; }
  .form .due-row .dp .input, .due-row .dp .input { height: 34px; min-height: 34px; }
  .due-row .dp-ico { height: 34px; }
  .due-row select.input { height: 34px; min-height: 34px; }
  .due-row .extra-item > input.input[type="datetime-local"], .due-row .extra-item > input.input[type="date"] { height: 34px; min-height: 34px; }
}
/* a desktop browser in a narrow window: the date field needs a smaller font to show its whole mask */
@media (max-width: 520px) and (pointer: fine) {
  .due-row .extra-item > input.input[type="datetime-local"], .due-row .extra-item > input.input[type="date"] { font-size: 13px !important; padding: 0 .4rem; }
}

/* "do mnie": a plain checkbox with its label, no frame around it */
.label-row .check.pill { padding: 0; border: 0; background: transparent; border-radius: 0; }
.label-row .check.pill.on { background: transparent; border: 0; }

/* Phone: the hints inside the text boxes are smaller (the typed text stays 16 px, so iOS does not zoom) */
@media (max-width: 800px) {
  input::placeholder, textarea::placeholder, .input::placeholder { font-size: 14px; }
}

/* New task options: a checkbox with a short title and a soft grey hint underneath */
.opts { gap: .7rem; }
.opts .check.opt { align-items: flex-start; }
.opts .opt-text { display: flex; flex-direction: column; gap: .1rem; }
.opts .opt-title { font-weight: 600; }
.opts .opt-text .hint { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; line-height: 1.3; }

/* PC: the two options sit side by side (they stack when there is no room) */
@media (min-width: 801px) {
  .field.opts { flex-direction: row; flex-wrap: wrap; gap: .7rem 2.5rem; }
  .opts .check.opt { flex: 1 1 280px; min-width: 0; }
}

/* Phone: the generic ".card.narrow .input" rule (min-height 40) beat the 34 px controls; same specificity here */
@media (max-width: 520px) {
  .card.narrow:not(.task-card) .three.two-up .input,
  .card.narrow:not(.task-card) .due-row .input,
  .card.narrow:not(.task-card) .due-row select.input,
  .card.narrow:not(.task-card) .due-row .dp .input { height: 34px; min-height: 34px; padding-top: 0; padding-bottom: 0; }
  .card.narrow:not(.task-card) .three.two-up .seg-btn,
  .card.narrow:not(.task-card) .due-row .seg-btn { height: 34px; min-height: 34px; padding-top: 0; padding-bottom: 0; }
}

/* "Nowe zadanie" on a PC: the filled purple button (on a phone it keeps the quiet top-bar look) */
@media (min-width: 801px) {
  .new-task-btn { background: linear-gradient(135deg, #6a4cff, #4b2fe0); color: #fff; box-shadow: 0 6px 16px rgba(91,61,245,.35); }
  .new-task-btn:hover { background: linear-gradient(135deg, #6a4cff, #4b2fe0); color: #fff; filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(91,61,245,.42); }
  :root[data-theme="dark"] .new-task-btn { background: linear-gradient(135deg, #5a42d6, #4630b8); color: #ece9ff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
  :root[data-theme="dark"] .new-task-btn:hover { background: linear-gradient(135deg, #5a42d6, #4630b8); color: #fff; filter: brightness(1.1); box-shadow: 0 3px 10px rgba(0,0,0,.4); }
}

/* Notepad, dark theme: a soft indigo surface (one step lighter than the cards) instead of the olive paper colour */
:root[data-theme="dark"] .note-field.expanded { background: #232740; color: var(--text); box-shadow: var(--shadow-lg), 0 0 0 1.5px #4a3f94; caret-color: var(--primary); }
:root[data-theme="dark"] .note-field.expanded::placeholder { color: #7d83a0; }

/* Calendar, dark theme: a muted sage green for "done" instead of the bright one */
:root[data-theme="dark"] .cal-pill.done { background: #1d2b28; color: #86b9a2; }
:root[data-theme="dark"] .cal-dot.done { background: #5f9f84; }
:root[data-theme="dark"] .cal-dot.sent.done { background: var(--card); box-shadow: inset 0 0 0 2px #5f9f84; }
:root[data-theme="dark"] .cal-item.done { border-left-color: #5f9f84; }
:root[data-theme="dark"] .cal-item .badge.st-done { background: #1d2b28; color: #86b9a2; }

/* Calendar side panel: more air around the create button */
.cal-create { margin-top: 1.6rem; }

/* Dark theme: filled status buttons and the delete button without glowing colours or shadows */
:root[data-theme="dark"] .status-seg .seg-btn.st-btn-done.on { background: #4b8a70; border-color: #4b8a70; color: #f1faf5; box-shadow: none; }
:root[data-theme="dark"] .status-seg .seg-btn.st-btn-notdone.on { background: #a85a5f; border-color: #a85a5f; color: #fdf3f3; box-shadow: none; }
:root[data-theme="dark"] .status-seg .seg-btn.on { box-shadow: none; }

/* Notepad, light theme: plain white like the cards */
:root:not([data-theme="dark"]) .note-field.expanded { background: var(--card); }

/* The Smooflo logo replaces the purple circle with a tick */
img.logo-mark { display: block; object-fit: contain; border-radius: 22%; background: none !important; box-shadow: none; padding: 0; }
.logo img.logo-mark { width: 36px; height: 36px; }
.top-logo img.logo-mark { width: 30px; height: 30px; }
.boot-logo img.logo-mark { width: 64px; height: 64px; box-shadow: none; }
@media (max-width: 800px) { .top-logo img.logo-mark { width: 28px; height: 28px; } }

/* Sidebar: the logo starts at the same left edge as the menu icons (the padding of a menu item) */
.sidebar .logo { justify-content: flex-start; padding-left: .9rem; }

/* PC: a slightly larger logo and name in the sidebar */
@media (min-width: 801px) {
  .sidebar .logo { font-size: 1.55rem; gap: .7rem; }
  .sidebar .logo img.logo-mark { width: 44px; height: 44px; }
}

/* ===== Phone: bottom bar with the main places + a round "new task" button ===== */
.bottom-nav, .fab { display: none; }
@media (max-width: 800px) {
  .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(4, 1fr);
    padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 22px rgba(40,30,110,.08); }
  .bn-item { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .35rem .2rem; border-radius: 12px; color: var(--muted); font-size: .68rem; font-weight: 600; text-decoration: none; }
  .bn-item .ni { width: 22px; height: 22px; }
  .bn-item.active { color: var(--primary); }
  .bn-item.active .ni { stroke-width: 2.1; }
  .fab { position: fixed; z-index: 46; right: 1rem; bottom: calc(4.6rem + env(safe-area-inset-bottom)); display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #6a4cff, #4b2fe0); color: #fff; box-shadow: 0 8px 20px rgba(91,61,245,.45); text-decoration: none; }
  .fab .ni { width: 26px; height: 26px; stroke-width: 2.4; }
  .fab:active { transform: scale(.96); }
  :root[data-theme="dark"] .fab { background: linear-gradient(135deg, #5a42d6, #4630b8); box-shadow: 0 6px 16px rgba(0,0,0,.5); }
  /* room for the bar and the button under the page */
  .content { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
  /* the bar and the button get out of the way while typing */
  body:has(input:focus, textarea:focus, select:focus) .bottom-nav, body:has(input:focus, textarea:focus, select:focus) .fab { display: none; }

  /* the top bar: "new task" and the calendar moved down, so the rest gets bigger */
  .topbar .new-task-btn, .topbar .cal-btn { display: none; }
  .topbar { gap: .5rem; }
  .topbar .burger, .topbar .note-inline, .topbar .note-field, .topbar .note-ico, .topbar .bell-btn, .topbar .search-btn { width: 42px; height: 42px; }
  .topbar .note-inline { margin-left: auto; }
  .topbar .bell-btn .ni, .topbar .search-btn .ni, .topbar .burger .ni { width: 22px; height: 22px; }
  .topbar .note-ico .ni { width: 20px; height: 20px; }
  .topbar .user-btn .avatar { width: 40px; height: 40px; }
  .topbar .user { margin-left: 0; gap: .4rem; }
}
@media (max-width: 370px) {
  .topbar .burger, .topbar .note-inline, .topbar .note-field, .topbar .note-ico, .topbar .bell-btn, .topbar .search-btn { width: 38px; height: 38px; }
  .topbar .user-btn .avatar { width: 36px; height: 36px; }
}

/* Phone: the counters are one panel with equal sections, thin dividers and a label under each number */
@media (max-width: 700px) {
  .stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; overflow: visible; padding: .35rem; margin: 0 0 .75rem;
    background: var(--card); border-radius: 18px; box-shadow: var(--shadow); }
  .stats > .stat, .stats > .stat:first-child, .stats > .stat:last-child {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .2rem; flex: none; width: 100%; margin: 0;
    padding: .55rem .15rem .5rem; background: transparent; border: 0; box-shadow: none; border-radius: 14px; text-align: center; }
  .stats > .stat.alert { background: transparent; }
  .stats .stat-top { display: flex; align-items: center; justify-content: center; gap: .4rem; }
  .stats .stat-icon { display: grid; grid-column: auto; width: auto; height: auto; margin: 0; background: transparent !important; font-size: 0; }
  .stats .stat-icon .ni { width: 22px; height: 22px; }
  .stats .stat strong { grid-column: auto; grid-row: auto; font-size: 1.35rem; font-weight: 800; line-height: 1; }
  .stats > .stat > span:not(.stat-icon) { display: block; grid-column: auto; grid-row: auto; font-size: .68rem; line-height: 1.15; color: var(--muted); white-space: normal; text-align: center; }
  /* thin divider between sections (hidden next to the selected one) */
  .stats > .stat + .stat::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: var(--line); }
  .stats > .stat.selected::before, .stats > .stat.selected + .stat::before { display: none; }
  .stats > .stat.selected { background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--c-cfc8f7); }
  .stats > .stat.selected > span:not(.stat-icon) { color: var(--primary); font-weight: 600; }
}

/* Task lists: the coloured edge on the left is only for important tasks */
.row:not(.head):not(.important) { border-left-width: 1px; border-left-color: var(--line); }

/* Phone: the task cards are a little smaller */
@media (max-width: 800px) {
  .table .row.clickable:not(.head) { padding: .8rem .9rem; padding-top: 1.75rem; }
  .table .row .title { font-size: 1.02rem; }
  .table .row.clickable:not(.head) > :nth-child(1) { padding-bottom: .4rem; }
  .table .row.clickable:not(.head) > :nth-child(2) { font-size: .88rem; padding-bottom: .55rem; gap: .5rem; }
  .table .row.clickable:not(.head) > :nth-child(3) { font-size: .88rem; padding: .55rem 0; gap: .4rem .5rem; }
  .table .row.clickable:not(.head) > :nth-child(4), .table .row.clickable:not(.head) > :nth-child(5) { padding-top: .6rem; }
  .due-cell .due-date::before { width: 17px; height: 17px; margin-right: .4rem; vertical-align: -3px; }
  .due-cell .due-badge, .due-cell .date-count { font-size: .74rem; padding: .2rem .55rem; }
  .table .row .badge { font-size: .78rem; padding: .32rem .65rem; gap: .3rem; border-radius: 10px; }
  .table .row .badge::before { width: 15px; height: 15px; }
  .table .row .avatar.sm { width: 24px; height: 24px; font-size: .62rem; }
}

/* Phone: the profile button is the same size as the other buttons in the top bar */
@media (max-width: 800px) {
  .topbar .user-btn { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; border-radius: 12px; }
  .topbar .user-btn .avatar { width: 32px; height: 32px; font-size: .72rem; }
}
@media (max-width: 370px) {
  .topbar .user-btn { width: 38px; height: 38px; }
  .topbar .user-btn .avatar { width: 28px; height: 28px; }
}

/* Phone: five slots in the bottom bar, the round "new task" button sits in the middle */
@media (max-width: 800px) {
  .bottom-nav { grid-template-columns: repeat(5, 1fr); overflow: visible; }
  .bn-add { justify-self: center; align-self: start; display: grid; place-items: center; width: 54px; height: 54px; margin-top: -26px; border-radius: 50%; color: #fff; text-decoration: none;
    background: linear-gradient(135deg, #6a4cff, #4b2fe0); box-shadow: 0 0 0 5px var(--card), 0 8px 18px rgba(91,61,245,.45); }
  .bn-add .ni { width: 26px; height: 26px; stroke-width: 2.4; }
  .bn-add:active { transform: scale(.96); }
  :root[data-theme="dark"] .bn-add { background: linear-gradient(135deg, #5a42d6, #4630b8); box-shadow: 0 0 0 5px var(--card), 0 6px 14px rgba(0,0,0,.5); }
  .fab { display: none !important; }

  /* the top bar buttons a little smaller */
  .topbar .burger, .topbar .note-inline, .topbar .note-field, .topbar .note-ico, .topbar .bell-btn, .topbar .search-btn, .topbar .user-btn { width: 38px; height: 38px; }
  .topbar .bell-btn .ni, .topbar .search-btn .ni, .topbar .burger .ni { width: 20px; height: 20px; }
  .topbar .note-ico .ni { width: 18px; height: 18px; }
  .topbar .user-btn .avatar { width: 30px; height: 30px; font-size: .7rem; }
}
@media (max-width: 370px) {
  .topbar .burger, .topbar .note-inline, .topbar .note-field, .topbar .note-ico, .topbar .bell-btn, .topbar .search-btn, .topbar .user-btn { width: 35px; height: 35px; }
  .topbar .user-btn .avatar { width: 28px; height: 28px; }
}

/* Phone: "new task" is a normal item of the bar (icon + label), only its icon keeps the purple fill */
@media (max-width: 800px) {
  .bn-add { display: flex; flex-direction: column; align-items: center; justify-self: stretch; align-self: auto; gap: .15rem; width: auto; height: auto; margin-top: 0; padding: .35rem .2rem;
    border-radius: 12px; background: transparent; box-shadow: none; color: var(--primary); font-size: .68rem; font-weight: 600; }
  .bn-add .ni { width: 26px; height: 26px; padding: 5px; box-sizing: border-box; border-radius: 9px; stroke-width: 2.6; color: #fff; background: linear-gradient(135deg, #6a4cff, #4b2fe0); }
  :root[data-theme="dark"] .bn-add { background: transparent; box-shadow: none; }
  :root[data-theme="dark"] .bn-add .ni { background: linear-gradient(135deg, #5a42d6, #4630b8); }
}

/* Home: the date and the "Na dzisiaj" switch share one row */
.today-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0 0 .75rem .15rem; }
.today-row > .today-line { margin: 0 !important; }
.today-switch { display: inline-flex; align-items: center; gap: .55rem; padding: .3rem .6rem .3rem .35rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; flex: 0 0 auto; transition: background .15s, border-color .15s, color .15s; }
.today-switch .ts-track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--c-dcdaf0); transition: background .15s; flex: 0 0 auto; }
.today-switch .ts-track i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s ease; }
.today-switch.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.today-switch.on .ts-track { background: var(--primary); }
.today-switch.on .ts-track i { transform: translateX(16px); }
.today-switch .lbl-short { display: none; }
@media (max-width: 700px) {
  .today-row { margin: .1rem 0 .55rem .1rem; gap: .5rem; }
  .today-switch .lbl-long { display: none; }
  .today-switch .lbl-short { display: inline; }
  .today-switch { padding: .25rem .55rem .25rem .3rem; gap: .4rem; }
  .today-switch .ts-track { width: 34px; height: 20px; }
  .today-switch .ts-track i { width: 14px; height: 14px; }
  .today-switch.on .ts-track i { transform: translateX(14px); }
}
@media (max-width: 800px) { .bottom-nav { grid-template-columns: repeat(4, 1fr); } }

/* Phone: search moves from the top bar to the bottom bar (five slots again) */
@media (max-width: 800px) {
  .bottom-nav { grid-template-columns: repeat(5, 1fr); }
  .bn-item { border: 0; background: transparent; font-family: inherit; cursor: pointer; }
  .topbar .search-btn { display: none; }
  /* the date and the "Dzisiaj" switch fit one row */
  .today-row .today-dow { font-size: 1rem; }
  .today-row .today-date { font-size: .85rem; }
}

/* Phone: the date starts where the text inside the cards below it starts */
@media (max-width: 800px) { .today-row { margin-left: 1.05rem; margin-right: .1rem; } }

/* Notepad icon: the same dark colour and size as the bell */
.note-ico { color: var(--text); }
.note-ico .ni { width: 19px; height: 19px; }
@media (max-width: 800px) { .topbar .note-ico .ni { width: 20px; height: 20px; } }

/* Phone: a little more space between the buttons in the top bar */
@media (max-width: 800px) {
  .topbar { gap: .7rem; }
  .topbar .user { gap: .7rem; }
}
@media (max-width: 370px) {
  .topbar { gap: .45rem; }
  .topbar .user { gap: .45rem; }
}

/* Phone: no search box above the list (the bottom bar has a search); the filters become a thin bar across the width */
.home-list .filter-toggle .ft-label, .home-list .filter-toggle .ft-chev { display: none; }
@media (max-width: 800px) {
  .home-list .list-head .searchbox { display: none; }
  .home-list .list-head { gap: 0; }
  .home-list .list-head .filter-toggle { display: flex; align-items: center; gap: .55rem; width: 100%; height: 40px; padding: 0 .85rem; border-radius: 12px; justify-content: flex-start;
    font: inherit; font-size: .9rem; font-weight: 600; color: var(--text); }
  .home-list .list-head .filter-toggle > .ni:first-child { width: 18px; height: 18px; color: var(--primary); }
  .home-list .list-head .filter-toggle .ft-label { display: inline; flex: 1; text-align: left; }
  .home-list .list-head .filter-toggle .ft-chev { display: block; width: 18px; height: 18px; color: var(--muted); transition: transform .18s ease; }
  .home-list .list-head .filter-toggle.on .ft-chev { transform: rotate(180deg); }
}

/* Phone: the filter button sits at the right end of the counters panel (the thin bar and the search box above the list are gone) */
.stats-filter { display: none; }
@media (max-width: 800px) {
  .home-list .list-head { display: none; }
  .stats { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)) 52px; }
  .stats .stat .lbl-long { display: none; }
  .stats .stat .lbl-short { display: inline; }
  .stats > .stats-filter { position: relative; display: grid; place-items: center; align-self: stretch; border: 0; background: transparent; color: var(--primary); cursor: pointer; border-radius: 14px; }
  .stats > .stats-filter::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: var(--line); }
  .stats > .stats-filter .ni { width: 24px; height: 24px; }
  .stats > .stats-filter.on { background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--c-cfc8f7); }
  .stats > .stats-filter.on::before { display: none; }
  .stats > .stats-filter .sf-badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: var(--primary); color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; }
}

/* Phone: only the status badge sits in the top-right corner of the card (like the ID in the top-left), text only. Notes under the status stay in the card. */
@media (max-width: 800px) {
  .table .row.clickable:not(.head) > :nth-child(5) > .badge:not(.rc) { position: absolute; top: 0; right: 0; border-radius: 0 18px 0 12px; padding: .22rem .8rem .22rem .75rem; font-size: .68rem; font-weight: 700; letter-spacing: .03em; line-height: 1.3; gap: 0; white-space: nowrap; }
  .table .row.clickable:not(.head) > :nth-child(5) > .badge:not(.rc)::before { display: none; }
  .table .row.clickable:not(.head) > :nth-child(5) { align-self: center; }
}

/* Receipt chip next to the priority: a pill with a background like the priority badge, text only */
.badge.rc { font-weight: 700; }
.badge.rc-wait { background: var(--primary-soft); color: var(--primary); }
.badge.rc-ok { background: var(--low-bg); color: var(--low); }
.badge.rc-no { background: var(--high-bg); color: var(--high); }
.table .row .badge.rc::before { display: none; }
.table .row > :nth-child(5) { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }

/* Phone: the receipt chip gets an envelope (closed while it waits, open once received) */
@media (max-width: 800px) {
  .table .row .badge.rc::before { display: inline-block; content: ""; width: 17px; height: 17px; background: currentColor; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
  .table .row .badge.rc-wait::before { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='2'/><path d='m3 7 9 6 9-6'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='2'/><path d='m3 7 9 6 9-6'/></svg>"); }
  .table .row .badge.rc-ok::before { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M3.7 6.5A2 2 0 0 1 5 6h14a2 2 0 0 1 1.3.5L12 12.2z'/><path d='M3 8.8l9 6.2 9-6.2V17a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M3.7 6.5A2 2 0 0 1 5 6h14a2 2 0 0 1 1.3.5L12 12.2z'/><path d='M3 8.8l9 6.2 9-6.2V17a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/></svg>"); }
}

/* Receipt confirmation: on a PC a small envelope next to the title (closed while it waits, open once received; the text shows on hover),
   on a phone the chip next to the priority. Either way it stays away from the status. */
.rc-icon { display: inline-flex; vertical-align: -3px; margin-left: .45rem; }
.rc-icon .ni { width: 16px; height: 16px; }
.rc-icon.rc-wait { color: var(--primary); }
.rc-icon.rc-ok { color: var(--low); }
.rc-icon.rc-no { color: var(--high); }
@media (min-width: 801px) { .table .row .badge.rc { display: none; } }
@media (max-width: 800px) { .rc-icon { display: none; } }

/* Receipt envelope: empty (outline) while it waits, filled once the receipt is confirmed */
.rc-icon .ni.rc-filled { fill: currentColor; stroke: none; }

/* Sent tasks: no "new task" button on a phone (the bottom bar has one) */
@media (max-width: 800px) { .hide-on-phone { display: none !important; } }

/* Phone notepad: the opened note is a panel across the screen under the top bar (the small-button sizes must not shrink it), and its icon stays in the top bar */
@media (max-width: 800px) {
  .topbar .note-field.expanded { position: fixed; top: 64px; left: .75rem; right: .75rem; width: auto; height: auto; min-height: 220px; max-height: 60vh; padding: 14px 44px 14px 14px; color: var(--text); cursor: text; }
  .note-inline.open .note-ico { display: flex; background: var(--primary-soft); border-radius: 12px; color: var(--primary); }
  .note-inline.open .note-copy { top: 72px; }
}

/* Proposal of a new date: two compact columns, "Obecnie" with its button under it and "Nowy" with its button under it */
.proposal-card { gap: .7rem; padding: .85rem 1rem; }
.proposal-head { gap: .6rem; }
.proposal-ico { width: 32px; height: 32px; border-radius: 10px; }
.proposal-ico .due-svg { width: 18px; height: 18px; }
.proposal-title { font-size: .95rem; }
.proposal-dates { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.proposal-col { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.proposal-col .proposal-date { flex: 1; min-width: 0; padding: .5rem .7rem; }
.proposal-col .proposal-date b { font-size: .95rem; line-height: 1.25; }
.proposal-col .btn { width: 100%; padding: .5rem .6rem; font-size: .85rem; border-radius: 10px; }

/* The system date field on a phone: a visible hint and a calendar icon while it is empty */
.dp-native { position: relative; display: block; flex: 1; min-width: 0; }
.dp-native > input.input { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; -webkit-appearance: none; appearance: none; text-align: left; padding-right: 2.5rem; }
.dp-native.blank > input.input { color: transparent; }
.dp-native.blank > input.input::-webkit-datetime-edit { color: transparent; }
.dp-native-ph { position: absolute; left: .8rem; right: 2.5rem; top: 50%; transform: translateY(-50%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-a3a8bd); font-size: 14px; pointer-events: none; }
.dp-native-ico { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.due-row .dp-native > input.input, .form .due-row .dp-native > input.input { min-width: 0; }
@media (max-width: 520px) {
  .card.narrow:not(.task-card) .due-row .dp-native > input.input { height: 34px; min-height: 34px; padding: 0 2.2rem 0 .6rem; }
  .due-row .dp-native-ico { right: .6rem; width: 16px; height: 16px; }
  .due-row .dp-native-ph { left: .6rem; }
}

/* Calendar: a horizontal swipe changes the month, so the page must not use it for something else (vertical scrolling still works) */
.cal-main { touch-action: pan-y; }

/* The system field is invisible on a phone: the hint or the date is drawn by us (short, Polish, smaller). The field is still tapped to open the picker. */
.dp-native > input.input, .dp-native.blank > input.input { color: transparent; -webkit-text-fill-color: transparent; }
.dp-native > input.input::-webkit-datetime-edit { color: transparent; -webkit-text-fill-color: transparent; }
.dp-native-ph.has { color: var(--text); font-size: 14px; font-weight: 500; }

/* Phone: no "Dodaj nową kategorię" label with the plus tile above the new-category fields */
@media (max-width: 800px) { .cat-add-label { display: none; } }

/* Phone: the panel under the calendar has no date heading (the day is marked in the calendar) and takes less room */
@media (max-width: 800px) {
  .cal-side h3 { display: none; }
  .cal-side { padding: .7rem .8rem; gap: .5rem; }
  .cal-side > p.muted { margin: .1rem 0 0; font-size: .9rem; text-align: center; }
  .cal-side .cal-create { margin-top: .2rem; }
}

/* The system calendar button of the field is invisible and covers the whole field (one icon only, ours; a tap anywhere opens the picker) */
.dp-native > input.input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }

/* "Cykl": a heading with the list under the add-date button */
.recur-block { display: flex; flex-direction: column; gap: .35rem; margin-top: .9rem; }
.recur-block > .label { font-weight: 700; font-size: .95rem; }
@media (max-width: 700px) { .card.narrow:not(.task-card) .recur-block > .label { font-size: .85rem; } }
.recur-row { flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
@media (max-width: 520px) {
  .recur-block select.input, .card.narrow:not(.task-card) .recur-block .due-row select.input { width: 100%; }
}

/* Recipients: a short "Odebrane" chip under the name (tap for the date) instead of a long sentence */
.rc-line { display: flex; align-items: center; flex-wrap: wrap; gap: .1rem .5rem; margin-top: .2rem; }
.rc-mini { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem .12rem .45rem; border: 0; border-radius: 999px; font: inherit; font-size: .74rem; font-weight: 700; line-height: 1.3; }
.rc-mini .ni { width: 14px; height: 14px; }
.rc-mini .ni.rc-filled { fill: currentColor; stroke: none; }
.rc-mini.wait { background: var(--primary-soft); color: var(--primary); }
.rc-mini.ok { background: var(--low-bg); color: var(--low); cursor: pointer; }
.rc-when { font-size: .74rem; }
@media (max-width: 700px) {
  .assignee { flex-wrap: wrap; row-gap: .35rem; }
  .assignee .grow { flex: 1 1 160px; min-width: 0; }
}

/* Phone: the tool buttons (clone, edit, share, calendar, pin) are always in the top-right corner, above the title */
@media (max-width: 800px) {
  .task-card { padding-top: 1.9rem; }
  .task-card .td-head { flex-direction: column-reverse; flex-wrap: nowrap; align-items: stretch; gap: .45rem; margin-bottom: .8rem; }
  .task-card .td-tools { justify-content: flex-end; flex-wrap: nowrap; }
}

/* Card colours say the state: done = soft green, overdue = soft red, to do = white (no tint for "due soon") */
.row.due-soon { background: var(--card); }
.row.row-done:not(.head) { background: color-mix(in srgb, var(--low-bg) 60%, var(--card)); }
.row.due-overdue:not(.head) { background: color-mix(in srgb, var(--high-bg) 55%, var(--card)); }
.table .row.row-done:hover, .table .row.due-overdue:hover { filter: brightness(.985); }

/* The matching counters: "Wykonane" soft green, "Po terminie" soft red, "Do zrobienia" stays white */
.stat.t-done { background: color-mix(in srgb, var(--low-bg) 60%, var(--card)); }
.stat.t-overdue { background: color-mix(in srgb, var(--high-bg) 55%, var(--card)); }

/* Phone: the status stays in the corner of every card, besides the card colour */
@media (max-width: 800px) {
  .stats > .stat.t-done, .stats > .stat.t-overdue { border-radius: 14px; }
}
}

/* Three counters now (the "due soon" one is gone) */
@media (min-width: 801px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)) 52px; } }
.stats > .stat.t-done { background: color-mix(in srgb, var(--low-bg) 60%, var(--card)); }
.stats > .stat.t-overdue, .stats > .stat.t-overdue.alert { background: color-mix(in srgb, var(--high-bg) 55%, var(--card)); }

/* "Zadania do potwierdzenia" banner, dark theme: a calm dark amber strip instead of the bright orange gradient */
:root[data-theme="dark"] .accept-bar { background: linear-gradient(95deg, #2f251b 0%, #2b2720 100%); color: #eadfce; box-shadow: inset 3px 0 0 #c98a3f, 0 4px 14px rgba(0,0,0,.35); border-bottom: 1px solid rgba(201,138,63,.22); }
:root[data-theme="dark"] .ab-label { color: #d9a566; opacity: 1; }
:root[data-theme="dark"] .ab-ico { color: #d9a566; }
:root[data-theme="dark"] .ab-title { color: #f3e8d8; }
:root[data-theme="dark"] .ab-from { color: #b9ab98; opacity: 1; }
:root[data-theme="dark"] .ab-star { color: #d9a566; }
:root[data-theme="dark"] .ab-btn.ghost { background: rgba(255,255,255,.07); color: #e6d9c6; }
:root[data-theme="dark"] .ab-btn.ghost:hover { background: rgba(255,255,255,.13); }
:root[data-theme="dark"] .ab-btn.solid { background: #c98a3f; color: #1f1408; box-shadow: none; }
:root[data-theme="dark"] .ab-btn.solid:hover:not(:disabled) { background: #d6984f; }

/* Phone: a smaller comment field with the paperclip next to it (icon only), and "Wyślij" on its own row below */
@media (max-width: 700px) {
  .comment-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: stretch; }
  .comment-form .input { flex: none; width: 100%; height: 38px; min-height: 38px; padding: 0 .75rem; font-size: .88rem; border-radius: 10px; }
  .comment-form .attach-btn { width: 38px; height: 38px; min-height: 38px; padding: 0; justify-content: center; border-radius: 10px; gap: 0; }
  .comment-form .attach-btn .attach-text { display: none; }
  .comment-form .attach-btn .attach-count { position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 999px; background: var(--primary); color: #fff; font-size: .65rem; font-weight: 700; line-height: 16px; text-align: center; }
  .comment-form .btn-primary { grid-column: 1 / -1; width: 100%; height: 38px; padding: 0; font-size: .9rem; border-radius: 10px; }
}
.attach-count { display: none; }
@media (max-width: 700px) { .comment-form .attach-btn { overflow: visible; } .comment-form .attach-btn .attach-count { display: block; } }

/* Phone: the field, the paperclip and "Wyślij" are in one row */
@media (max-width: 700px) {
  .comment-form { grid-template-columns: minmax(0, 1fr) auto auto; }
  .comment-form .btn-primary { grid-column: auto; width: auto; padding: 0 .95rem; }
}

/* Task page: a thin coloured outline around the whole card tells the state (done = green, overdue = red); nothing for the rest */
.task-card.card-done { box-shadow: 0 0 0 1.5px var(--low), var(--shadow); }
.task-card.card-overdue { box-shadow: 0 0 0 1.5px var(--high), var(--shadow); }

/* Phone: the tool buttons sit in the top-right corner of the card (opposite the ID); no "Wykonano" ribbon there, the colour says it */
@media (max-width: 800px) {
  .task-card { padding-top: 3.2rem; }
  .task-card .td-head { flex-direction: row; display: block; margin-bottom: .8rem; }
  .task-card .td-tools { position: absolute; top: .4rem; right: .7rem; flex-wrap: nowrap; justify-content: flex-end; gap: .3rem; }
  .task-card .td-tools .tool-btn { width: 32px; height: 32px; }
  .task-card .done-ribbon { display: none; }
}

/* Four counters: to do, overdue, done and all */
@media (min-width: 801px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)) 52px; } }

/* "Otwórz ponownie" is a small icon next to a recipient (and a tool button at the top for one's own task), not a text link */
.reopen-btn { display: inline-grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--primary); cursor: pointer; transition: background .15s, border-color .15s; }
.reopen-btn:hover { background: var(--primary-soft); border-color: var(--primary); }
.reopen-btn .ni { width: 16px; height: 16px; }

/* Gentler tints for the done / overdue cards and counters */
.row.row-done:not(.head) { background: color-mix(in srgb, var(--low-bg) 32%, var(--card)); }
.row.due-overdue:not(.head) { background: color-mix(in srgb, var(--high-bg) 30%, var(--card)); }
.stat.t-done, .stats > .stat.t-done { background: color-mix(in srgb, var(--low-bg) 34%, var(--card)); }
.stat.t-overdue, .stats > .stat.t-overdue, .stats > .stat.t-overdue.alert { background: color-mix(in srgb, var(--high-bg) 32%, var(--card)); }

/* Phone: the priority is just a coloured flag (green / yellow / red) right after the date; its own cell is not needed, so the cards are lower */
.prio-flag { display: none; }
@media (max-width: 800px) {
  .table .row.clickable:not(.head) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "person" "due" "stat"; }
  .table .row.clickable:not(.head) > :nth-child(4) { display: none; }
  .table .row.clickable:not(.head) > :nth-child(5) { grid-area: stat; margin-left: 0; padding-top: 0; }
  .table .row.clickable:not(.head) > :nth-child(5):has(.rc, .answer-tag) { padding-top: .5rem; }
  .due-cell .prio-flag { display: inline-flex; align-items: center; flex: 0 0 auto; }
  .due-cell .prio-flag svg { width: 19px; height: 19px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .due-cell .prio-flag.prio-high { color: var(--high); }
  .due-cell .prio-flag.prio-medium { color: #e3a008; }
  .due-cell .prio-flag.prio-low { color: var(--low); }
}

/* Phone: the tool buttons sit a little higher and the title a little lower, so they do not touch */
@media (max-width: 800px) {
  .task-card { padding-top: 3.6rem; }
  .task-card .td-tools { top: .2rem; }
}

/* Phone: the title of a task starts clearly below the tool buttons (".card.narrow" had a stronger padding rule than ".task-card") */
@media (max-width: 800px) {
  .card.narrow.task-card { padding-top: 3.2rem; }
}

/* Call / write buttons next to a person (sender and recipients) */
.contact-link { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: .35rem; border-radius: 9px; background: var(--primary-soft); color: var(--primary); text-decoration: none; vertical-align: middle; transition: background .15s, color .15s; }
.contact-link:hover { background: var(--primary); color: #fff; }
.contact-link .ni { width: 15px; height: 15px; }
.fact-chip .contact-link { margin-left: .5rem; }
