/* Loaded last. Coordinated entrance and the quieter labels. */

/* ---- coordinated entrance: each section rises in turn when a page opens ---- */
@keyframes em-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes em-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes em-grow { from { transform: scaleX(0); } to { transform: none; } }
.page-in { animation: none; }
.page-in > .main > *, .page-in > main > *, .page-in > .sidebar,
.page-in .app-grid > *, .page-in .pmv-hz-grid > *, .page-in .pmv-dt-next > *, .page-in .pmv-dn-grid > *, .page-in .settings-pane:not([hidden]) > *, .settings-pane.page-in > * {
  animation: em-rise .55s cubic-bezier(.22, .61, .36, 1) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.page-in > .main > :nth-child(1), .page-in > main > :nth-child(1) { --i: 0; }
.page-in > .main > :nth-child(2), .page-in > main > :nth-child(2) { --i: 1; }
.page-in > .main > :nth-child(3), .page-in > main > :nth-child(3) { --i: 2; }
.page-in > .main > :nth-child(4), .page-in > main > :nth-child(4) { --i: 3; }
.page-in > .main > :nth-child(5), .page-in > main > :nth-child(5) { --i: 4; }
.page-in > .main > :nth-child(n+6), .page-in > main > :nth-child(n+6) { --i: 5; }
/* cards inside a grid follow their section, one beat apart */
.page-in :is(.app-grid, .pmv-hz-grid, .pmv-dt-next, .pmv-dn-grid) > :nth-child(1) { --i: 2; }
.page-in :is(.app-grid, .pmv-hz-grid, .pmv-dt-next, .pmv-dn-grid) > :nth-child(2) { --i: 3; }
.page-in :is(.app-grid, .pmv-hz-grid, .pmv-dt-next, .pmv-dn-grid) > :nth-child(3) { --i: 4; }
.page-in :is(.app-grid, .pmv-hz-grid, .pmv-dt-next, .pmv-dn-grid) > :nth-child(4) { --i: 5; }
.page-in :is(.app-grid, .pmv-hz-grid, .pmv-dt-next, .pmv-dn-grid) > :nth-child(n+5) { --i: 6; }
.page-in .settings-pane:not([hidden]) > :nth-child(2), .settings-pane.page-in > :nth-child(2) { --i: 1; }
.page-in .settings-pane:not([hidden]) > :nth-child(n+3), .settings-pane.page-in > :nth-child(n+3) { --i: 2; }
/* a redraw after a save is not a page opening: no replay */
.pm-still > *, .pm-still :is(.pmv-hz-grid, .pmv-dt-next, .pmv-dn-grid) > * { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .page-in > .main > *, .page-in > main > *, .page-in > .sidebar, .page-in :is(.app-grid, .pmv-hz-grid, .pmv-dt-next, .pmv-dn-grid) > *, .page-in .settings-pane > * { animation: none; }
}

/* ---- labels: smaller and lighter ---- */
.field label, .field > label, .pm-ed .pm-flabel label, .pm-notes .field label, .pm-np-grid .field label, .em-ask-field label,
.pm-compose .field label.pm-label, .pm-add-modal .field label.pm-label, .smtp-grid label, .sheet .field label, .pm-notes-head .pm-label {
  font-size: 12px; font-weight: 400; line-height: 16px; letter-spacing: .01em;
  color: color-mix(in srgb, var(--muted) 82%, transparent);
}
.pm-ed .pm-flabel .pm-count { font-size: 11px; color: color-mix(in srgb, var(--muted) 70%, transparent); }

/* ---- note boxes fit their text (projects.js pmFitText): no fixed minimum height ---- */
#pmf-note, .pm-notes #pmf-note, .pm-compose #pm-text, .pm-compose textarea#pm-text { min-height: 0; resize: none; overflow-y: hidden; }
.pm-compose #pm-text { padding-top: 12px; padding-bottom: 12px; }
.pm-compose-row:has(#pm-text) .pm-mic { width: 52px; min-height: 48px; align-self: stretch; }

/* ---- 40K View: a choreographed entrance, played once per opening (projects.js .pm-enter) ----
   head rises, the progress bar fills from the left, the key follows, the board frame fades in,
   then the cards cascade in reading order, and the tips come last. */
#projects-page.page-in > main > .pm-lanes-wrap { animation: em-fade .5s ease-out both; animation-delay: 160ms; }
#projects-page.page-in > main > .pm-principles { animation-delay: 520ms; }
.pm-enter .pm-bar { transform-origin: left center; animation: em-grow .8s cubic-bezier(.22, .61, .36, 1) both; animation-delay: 120ms; }
.pm-enter .pm-key > * { animation: em-fade .4s ease-out both; }
.pm-enter .pm-key > :nth-child(1) { animation-delay: 260ms; }
.pm-enter .pm-key > :nth-child(2) { animation-delay: 320ms; }
.pm-enter .pm-key > :nth-child(3) { animation-delay: 380ms; }
.pm-enter .pm-key > :nth-child(n+4) { animation-delay: 440ms; }
.pm-enter .pm-lanes > .pm-area, .pm-enter .pm-lanes > .pm-lh { animation: em-fade .45s ease-out both; animation-delay: 240ms; }
.pm-enter .pm-card { animation: em-rise .5s cubic-bezier(.22, .61, .36, 1) both; animation-delay: calc(300ms + var(--ci, 0) * 45ms); }
@media (prefers-reduced-motion: reduce) {
  #projects-page.page-in > main > *, .pm-enter .pm-bar, .pm-enter .pm-key > *, .pm-enter .pm-lanes > *, .pm-enter .pm-card { animation: none; }
}

/* Checklist: the generic input padding was stretching the tick box into the text */
.pm-check-row { grid-template-columns: 18px minmax(0, 1fr) 32px; column-gap: 10px; }
.pm-check-row input[type=checkbox] { box-sizing: border-box; width: 18px; min-width: 18px; height: 18px; padding: 0; justify-self: start; }
@media (max-width: 640px) { .pm-check-row { grid-template-columns: 20px minmax(0, 1fr) 40px; } .pm-check-row input[type=checkbox] { width: 20px; min-width: 20px; height: 20px; } }

/* Board cards: same light labels and tick boxes as the task popup */
.pmv-bd-notes .pmv-bd-f > label { font-size: 12px; font-weight: 400; line-height: 16px; letter-spacing: .01em; color: color-mix(in srgb, var(--muted) 82%, transparent); }
.pmv-bd-notes { gap: 10px; }
.pmv-bd-fields { column-gap: 16px; row-gap: 10px; }
.pmv-bd-subs input[type=checkbox] { -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 18px; min-width: 18px; height: 18px; margin: 1px 0 0; padding: 0; border: 1.5px solid var(--field-border-hover, rgba(255, 255, 255, .28)); border-radius: 6px; background: rgba(255, 255, 255, .04); cursor: pointer; transition: background-color .15s, border-color .15s; }
.pmv-bd-subs input[type=checkbox]:checked { border-color: transparent; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230e0f12' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat; }
.pmv-bd-subs input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:where(html[data-theme="light"]) .pmv-bd-subs input[type=checkbox]:not(:checked) { border-color: rgba(15, 23, 42, .3); background: #fff; }
:where(html[data-theme="light"]) :is(#pm-panel .pm-notes, #pm-board-main .pmv-bd-notes) :is(input:not([type=checkbox]), select, textarea):not(:disabled):hover { background-color: rgba(15, 23, 42, .04); }
/* one text size for every Board field, as in the popup (phones keep 16px so iOS doesn't zoom) */
@media (min-width: 701px) { #pm-board-main .pmv-bd-notes :is(input:not([type=checkbox]), select) { font-size: 14px; } }

/* Settings > Limits */
.limits-grid { display: flex; flex-direction: column; gap: 18px; }
.limits-grid .field input { max-width: 200px; }
.limit-note { margin: 4px 0 0; font-size: 12px; line-height: 18px; }
.limit-note.near { color: var(--warn, #ffb547); }

/* invite without email: the link, readable and copyable */
.invite-share { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.invite-link { overflow-wrap: anywhere; color: var(--accent); font-size: 13px; }
#invite-result { align-items: center; gap: 12px; }

/* Roadmap: Add project next to the Workstream Roadmap heading */
.pmv-rm-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.pmv-rm-add { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 10px; }
.pmv-rm-add svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .pmv-rm-title { flex: 1 1 100%; gap: 10px; } }
.pm-lanes-head .pmv-rm-add { margin-left: 0; }

/* Cards: the project a task serves and who it's for */
.pm-card-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; min-width: 0; }
.pm-proj { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 16px; white-space: nowrap; text-overflow: ellipsis; }
.pm-proj::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--pc, var(--muted)); }
.pm-recur { flex: none; color: var(--muted); font-size: 12px; }
/* Faces: a photo, or initials on a soft colour from the person's email */
.face { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; overflow: hidden; border-radius: 50%; background: hsl(var(--fh, 160) 45% 30%); /* dark enough for white initials at every hue, in both themes */ color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 1; user-select: none; }
.face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.face.has-photo { background: var(--surface); }
.face.sm { width: 22px; height: 22px; font-size: 9px; }
.face.lg { width: 36px; height: 36px; font-size: 13px; }
.face.xl { width: 72px; height: 72px; font-size: 24px; }
/* who a card is assigned to: face and first name, at the right of the card's foot */
.pm-who { display: inline-flex; flex: none; align-items: center; gap: 6px; margin-left: auto; max-width: 50%; color: var(--muted); font-size: 11px; font-weight: 600; }
.pm-who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-who.me .pm-who-name { color: var(--accent); }
.pm-who.me .face { box-shadow: 0 0 0 2px var(--accent); }
/* the account button and menu show your face */
.user-btn { overflow: hidden; }
#user-initial { display: contents; }
.user-btn .face { width: 100%; height: 100%; font-size: 14px; }
.avatar-lg .face { width: 100%; height: 100%; }
.avatar-lg:has(.face) { background: none; }
/* Settings: your photo, and faces in the team list (click one to change it) */
.photo-row { display: flex; align-items: center; gap: 18px; }
.face-btn { flex: none; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.face-btn:hover .face, .face-btn:focus-visible .face { box-shadow: 0 0 0 2px var(--accent); }

/* 40K: My tasks filter */
.pm-lanes-head .pm-mine.on { border-color: transparent; background: var(--accent); color: #0e0f12; }

/* Task popup: History */
.pm-history-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 4px 14px 14px; list-style: none; }
.pm-history-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 13px; line-height: 20px; }
.pm-history-list li .face { margin-top: -1px; }
.pm-history-list li p { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.pm-history-list li b { color: var(--text); font-weight: 600; }
.pm-history-list li time { flex: none; font-size: 12px; opacity: .8; white-space: nowrap; }

/* Roadmap popup: the project's tasks */
.pmv-rm-tasks { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.pmv-rm-tasks-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pmv-rm-tasks-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.pmv-rm-tasklist { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.pmv-rm-tasklist li { display: flex; align-items: center; gap: 10px; min-height: 40px; border-top: 1px solid var(--line); }
.pmv-rm-tasklist li:first-child { border-top: 0; }
.pmv-rm-tasklist li i { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.pmv-rm-tasklist li button { flex: 1; min-width: 0; overflow: hidden; padding: 8px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.pmv-rm-tasklist li button:hover { color: var(--accent); }
.pmv-rm-tasklist li.done button { color: var(--muted); text-decoration: line-through; }
.pmv-rm-tasknext { margin: 0; color: var(--muted); font-size: 13px; }

/* Search (top bar magnifier, Ctrl/Cmd K) */
.panel.pm-search { width: min(620px, calc(100vw - 32px)); margin-top: 12vh; padding: 0; border-radius: 18px; }
.pm-search-bar { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.pm-search-bar svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
.pm-search-bar input { flex: 1; min-width: 0; height: 56px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 16px; outline: none; box-shadow: none; }
.pm-search-bar input::-webkit-search-cancel-button { display: none; }
.pm-search-bar kbd { flex: none; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font: inherit; font-size: 11px; }
.pm-search-results { display: flex; flex-direction: column; max-height: min(60vh, 520px); overflow-y: auto; padding: 6px; }
.pm-search-hint { margin: 0; padding: 18px 12px; color: var(--muted); font-size: 13px; }
.pm-search-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pm-search-row:hover, .pm-search-row:focus-visible { background: rgba(255, 255, 255, .06); outline: none; }
:where(html[data-theme="light"]) .pm-search-row:hover, :where(html[data-theme="light"]) .pm-search-row:focus-visible { background: rgba(15, 23, 42, .05); }
.pm-search-row i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pm-search-txt { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.pm-search-txt b { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pm-search-txt small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.pm-search-kind { flex: none; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 640px) { .panel.pm-search { margin-top: 16px; } .pm-search-bar kbd { display: none; } }

/* Settings > Account: morning email switch */
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

/* a notice with an action (Undo) can be clicked */
.toast.has-action.show { pointer-events: auto; }
.toast-act { margin-left: 12px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Business / Personal switch in the top bar (Projects pages) */
.space-switch { display: inline-flex; gap: 2px; padding: 3px; margin-right: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface, #16181d); }
.space-switch[hidden] { display: none; }
.space-switch button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.space-switch button svg { width: 13px; height: 13px; }
.space-switch button[aria-pressed="true"] { background: var(--accent); color: #0e0f12; }
.space-switch button[data-space="personal"][aria-pressed="true"] { background: #c79bff; }
@media (hover: hover) { .space-switch button[aria-pressed="false"]:hover { color: var(--text); } }
@media (max-width: 760px) { .space-switch button { padding: 0 9px; font-size: 12px; } .space-switch button svg { display: none; } }
@media (max-width: 420px) { .space-switch { margin-right: 2px; } .space-switch button { padding: 0 7px; } }

/* Close the week: recap and one-button close-off */
.panel.pm-week-pop { width: min(560px, calc(100vw - 32px)); padding: 22px 24px 24px; border-radius: 20px; }
.pm-week-head { display: flex; align-items: center; justify-content: space-between; margin-right: -8px; }
.pm-week-eyebrow { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.pm-week-big { display: flex; align-items: baseline; gap: 12px; margin-top: 10px; }
.pm-week-big b { color: var(--accent); font-family: var(--display, inherit); font-size: 88px; font-weight: 400; line-height: .9; }
.pm-week-big span { color: var(--muted); font-size: 16px; }
.pm-week-pop h2 { margin: 6px 0 0; font-family: var(--display, inherit); font-size: 34px; font-weight: 400; letter-spacing: .01em; }
.pm-week-proj, .pm-week-note, .pm-week-more, .pm-week-wait { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 21px; }
.pm-week-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; max-height: 300px; overflow-y: auto; }
.pm-week-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--pc); border-radius: 10px; background: rgba(255, 255, 255, .03); animation: em-rise .4s both; }
.pm-week-tile { animation-delay: calc(var(--n, 0) * 40ms); }
.pm-week-tile b { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pm-week-tile small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pm-week-btns { display: flex; justify-content: flex-end; margin-top: 18px; }
@media (prefers-reduced-motion: reduce) { .pm-week-tile { animation: none; } }

/* Slipping tiles glow (late red, due-soon amber, a week untouched soft) */
.pm-card.slip-late { box-shadow: 0 0 0 1px rgba(255, 107, 107, .55), 0 0 18px -4px rgba(255, 107, 107, .55); animation: pm-slip 2.6s ease-in-out infinite; }
.pm-card.slip-soon { box-shadow: 0 0 0 1px rgba(255, 181, 71, .5), 0 0 16px -4px rgba(255, 181, 71, .5); }
.pm-card.slip-stale { box-shadow: 0 0 0 1px rgba(255, 181, 71, .25), 0 0 12px -6px rgba(255, 181, 71, .35); }
@keyframes pm-slip { 50% { box-shadow: 0 0 0 1px rgba(255, 107, 107, .75), 0 0 24px -2px rgba(255, 107, 107, .6); } }
@media (prefers-reduced-motion: reduce) { .pm-card.slip-late { animation: none; } }

/* Say tasks: the mic beside the + in the tab pill, and its sheet */
.topbar .tabs .nav-talk { display: grid; place-items: center; flex: none; width: var(--nav-add-size, 34px); height: var(--nav-add-size, 34px); margin-right: 6px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; }
.topbar .tabs .nav-talk[hidden] { display: none; }
.topbar .tabs .nav-talk svg { width: 17px; height: 17px; }
@media (hover: hover) { .topbar .tabs .nav-talk:hover { border-color: var(--accent); color: var(--accent); } }
@media (max-width: 760px) { .topbar .tabs .nav-talk { width: var(--nav-add-size-phone, 32px); height: var(--nav-add-size-phone, 32px); } }

.panel.pm-talk { width: min(600px, calc(100vw - 32px)); padding: 22px 24px 24px; border-radius: 20px; }
.pm-talk-head { display: flex; align-items: center; justify-content: space-between; margin-right: -8px; }
.pm-talk-head h2 { margin: 0; font-family: var(--display, inherit); font-size: 34px; font-weight: 400; letter-spacing: .01em; }
.pm-talk-mic { display: grid; place-items: center; width: 88px; height: 88px; margin: 14px auto 4px; border: 0; border-radius: 50%; background: var(--accent); color: #0e0f12; cursor: pointer; transition: transform .15s; }
.pm-talk-mic[hidden] { display: none; }
.pm-talk-mic svg { width: 34px; height: 34px; }
.pm-talk-mic.on { animation: pm-talk-pulse 1.4s ease-out infinite; }
@keyframes pm-talk-pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 100% { box-shadow: 0 0 0 26px rgba(52, 211, 153, 0); } }
.pm-talk-hint { margin: 8px 0 12px; color: var(--muted); font-size: 14px; text-align: center; }
.pm-talk-text { width: 100%; min-height: 72px; resize: vertical; }
.pm-talk-list { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; max-height: 40vh; overflow-y: auto; }
.pm-talk-list li { display: flex; align-items: center; gap: 8px; animation: em-rise .3s both; }
.pm-talk-list li.off { opacity: .45; }
.pm-talk-list li.off input { text-decoration: line-through; }
.pm-talk-n { flex: none; width: 18px; color: var(--muted); font-family: var(--display, inherit); font-size: 20px; text-align: center; }
.pm-talk-list input { flex: 1; min-width: 0; height: 40px; }
.pm-talk-tag { flex: none; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.pm-talk-tag.personal { border-color: transparent; background: #c79bff; color: #0e0f12; }
.pm-talk-foot { display: flex; justify-content: flex-end; margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { .pm-talk-mic.on, .pm-talk-list li { animation: none; } }
@media (max-width: 480px) { .pm-talk-tag { padding: 0 8px; } }
/* the brand stays on one line beside the switch */
.topbar .brand { white-space: nowrap; flex: none; }
/* 40K header on phones: heading on its own line, buttons in a row that keeps their words whole */
@media (max-width: 700px) {
  #projects-page .pm-lanes-head { flex-wrap: wrap; justify-content: flex-start; row-gap: 10px; column-gap: 8px; }
  #projects-page .pm-lanes-head h2 { flex: 1 1 100%; }
  #projects-page .pm-lanes-head .btn { white-space: nowrap; margin-left: 0; }
  #projects-page .pm-lanes-head #pm-add-section { margin-left: 0; }
}
/* anything scrolled into view lands clear of the sticky top bar and the floating dock */
html { scroll-padding-top: 88px; scroll-padding-bottom: 120px; }

/* ---- King of Names type for every display spot (no condensed display face): same face as the text,
   weight 500 to 600, tight tracking, normal case, sizes made for a full-width font ---- */
.pm-week-big b { font-family: var(--display); font-size: 64px; font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.pm-week-pop h2, .pm-talk-head h2, .pm-np-head h2 { font-family: var(--display); font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.pmv-rm-pop-title { font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.pm-talk-n { font-family: var(--display); font-size: 15px; font-weight: 600; }
.pmv-bd-tile .pm-big b, .pm-big b { font-family: var(--display); font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.pmv-dt-n { font-family: var(--display); font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.pmv-dn-empty b { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.pmv-map-root span { font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.main-head.spaced-head h2 { font-family: var(--display); font-size: clamp(20px, 2vw, 24px); font-weight: 600; line-height: 1.2; letter-spacing: -.02em; text-transform: none; }
.home-head h2, .settings-head h2, #vaults-page .main-head h2, #import-page .main-head h2 { font-family: var(--display); font-size: clamp(32px, 3.6vw, 44px); font-weight: 500; line-height: 1.05; letter-spacing: -.03em; text-transform: none; }
.home-head h2 { font-size: clamp(36px, 4.6vw, 56px); }
#vault-sub, #import-page .main-head .muted, .settings-head .muted, #errors-sub { font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; }

/* notes box: never shorter than one comfortable line */
#pmf-note, .pm-notes #pmf-note { min-height: 48px; flex-shrink: 0; } /* the popup column is a flex box: never squeeze the notes */
/* + Section under the sections; Close the week at the top right of the Done column */
.pm-lanes-foot { display: flex; justify-content: flex-start; margin-top: 14px; }
.pm-lh { position: relative; }
.pm-lh .pm-week-btn { margin-left: auto; height: 28px; padding: 0 12px; font-size: 12px; letter-spacing: 0; text-transform: none; }
.pm-week-phone { display: none; }
@media (max-width: 700px) { .pm-week-phone { display: inline-flex; margin-left: auto; } }

/* Field labels with an icon (task popup and New task) */
.pm-ed .pm-flabel label { display: inline-flex; align-items: center; gap: 6px; }
.pm-fi { flex: none; width: 14px; height: 14px; opacity: .75; }
/* where it's filed: Section, Map and Space side by side, at the bottom of the popup */
#pm-place { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { #pm-place { grid-template-columns: 1fr; } }

/* Compact top bar: smaller pills and buttons, tighter gaps, so every page tab fits */
.topbar { height: 56px; gap: 16px; }
.topbar .tabs { gap: 0; padding: 3px; }
.topbar .tab { height: 28px; padding: 0 11px; font-size: 11px; letter-spacing: .08em; }
.topbar .tabs .nav-add, .topbar .tabs .nav-talk { width: 28px; height: 28px; }
.topbar .tabs .nav-add svg, .topbar .tabs .nav-talk svg { width: 15px; height: 15px; }
.topbar .tabs .nav-talk { margin-right: 2px; }
.who { gap: 6px; }
.top-icon, .user-btn { width: 34px; height: 34px; }
.top-icon svg { width: 17px; height: 17px; }
.user-btn { font-size: 13px; }
.space-switch { margin-right: 4px; padding: 2px; }
.space-switch button { height: 26px; padding: 0 10px; font-size: 12px; }
.space-switch button svg { width: 12px; height: 12px; }
.os-ver { font-size: 9px; padding: 1px 5px; }
@media (max-width: 760px) { .topbar { height: auto; } .topbar .tab { height: 28px; padding: 0 9px; } }

/* Settings → Access: Project Management grid (presets, master switch, See/Add/Edit/Delete table, grouped switches) */
.pma { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pma-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pma-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pma-label { margin-right: 4px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.pma-note { margin: -4px 0 0; font-size: 13px; }
.pma-body { display: flex; flex-direction: column; gap: 10px; transition: opacity .15s; }
.pma-body.is-off { opacity: .45; }
/* the tick box used by cells, fixed cells and switches */
.pma-box { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border: 1.5px solid var(--line); border-radius: 6px; color: var(--on-accent); }
.pma-box.on { border-color: var(--accent); background: var(--accent); }
.pma-box svg { width: 14px; height: 14px; }
.pma-box.fixed.on { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
/* labelled switches: Open Project Management and the grouped ones under the grid */
.pma-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pma-opt:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.pma-opt.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.pma-opt:disabled { cursor: default; }
.pma-opt-text { display: flex; flex-direction: column; min-width: 0; }
.pma-opt-text b { font-size: 14px; font-weight: 600; }
.pma-opt-text small { color: var(--muted); font-size: 12px; line-height: 17px; }
.pma-opt.sm { gap: 10px; min-height: 52px; padding: 7px 10px; }
.pma-opt.sm .pma-opt-text b { font-size: 13px; line-height: 18px; }
.pma-opt.sm .pma-opt-text small { line-height: 16px; }
/* grouped switches under the grid: Changing tasks, Spaces, More */
.pma-groups { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.pma-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pma-group-title { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.pma-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 760px) { .pma-rows { grid-template-columns: 1fr; } .pma-opt.sm { min-height: 44px; } }
/* the grid */
.pma-grid { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.pma-grid th, .pma-grid td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pma-grid tbody tr:last-child th, .pma-grid tbody tr:last-child td { border-bottom: 0; }
.pma-grid thead th { width: 64px; padding-top: 0; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .4px; text-align: center; text-transform: uppercase; }
.pma-grid thead th:first-child { width: auto; }
.pma-grid tbody th { padding-left: 0; text-align: left; font-weight: 400; }
.pma-grid tbody th b { display: block; font-size: 13px; font-weight: 600; line-height: 18px; overflow-wrap: anywhere; }
.pma-grid tbody th small { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }
.pma-grid td { text-align: center; }
.perm-cell { display: inline-grid; place-items: center; width: 40px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.perm-cell:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.perm-cell:hover:not(:disabled) .pma-box:not(.on) { border-color: var(--accent); }
.perm-cell:disabled { cursor: default; }
.pma-na { color: var(--muted); opacity: .6; }
.pma-opt:focus-visible, .perm-cell:focus-visible, .pma-presets .perm:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* phone: narrower columns and cells so the table fits without scrolling sideways */
@media (max-width: 520px) {
  .pma-grid thead th { width: 44px; font-size: 10px; letter-spacing: .2px; }
  .pma-grid th, .pma-grid td { padding: 7px 2px; }
  .pma-grid tbody th small { font-size: 11px; line-height: 15px; }
  .perm-cell { width: 36px; height: 34px; }
  .pma-presets .perm { height: 30px; padding: 0 10px; font-size: 12px; }
}
@media (max-width: 360px) { .pma-grid thead th { width: 38px; } .perm-cell { width: 32px; } }
html[data-theme="light"] .pma-box:not(.on) { border-color: rgba(15, 23, 42, .28); }
html[data-theme="light"] .pma-na { opacity: .8; }

/* All tasks | My tasks: a two-way toggle like Business | Personal */
.pm-scope { display: inline-flex; gap: 2px; margin-left: auto; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface, #16181d); }
.pm-scope[hidden] { display: none; }
.pm-scope button { height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.pm-scope button[aria-pressed="true"] { background: rgba(255, 255, 255, .1); color: var(--text); }
@media (hover: hover) { .pm-scope button[aria-pressed="false"]:hover { color: var(--text); } }
.pm-scope button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
:where(html[data-theme="light"]) .pm-scope button[aria-pressed="true"] { background: rgba(15, 23, 42, .08); }

/* No dock: apps live in the account menu (and the home screen), so pages only clear the bottom edge */
:root { --dock-clear: calc(32px + env(safe-area-inset-bottom, 0px)); }
.toast { bottom: max(24px, env(safe-area-inset-bottom)); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--line); }

/* Task popup: the tile edits in place. Text you can change shows a soft box on hover and a
   field-like box while typing; empty pieces show what they'd say (data-ph). */
.pm-inl:empty::before { content: attr(data-ph); opacity: .55; }
.pm-poster.editable .pm-inl { border-radius: 6px; outline: 1px solid transparent; outline-offset: 2px; cursor: text; transition: background-color .12s, outline-color .12s; }
@media (hover: hover) { .pm-poster.editable .pm-inl:hover { background: rgba(255, 255, 255, .08); } }
.pm-poster.editable .pm-inl:focus { background: rgba(255, 255, 255, .1); outline-color: var(--accent); }
.pm-poster.editable .pm-inl:empty { display: inline-block; min-width: 2ch; }
.pm-big .pm-inl:empty::before { opacity: 1; } /* the automatic number looks the same as a typed one */
.pm-poster-sub .pm-arrow { color: inherit; opacity: .7; }
.pm-poster-sub .pm-from, .pm-poster-sub .pm-to { min-width: 1ch; }
/* chips: a colour dot to change the colour, the words, and × to remove */
.pm-chip.own { display: inline-flex; align-items: center; gap: 6px; }
.pm-chip-tone { flex: none; width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: currentColor; color: inherit; cursor: pointer; opacity: .9; }
.pm-chip-tone:focus-visible, .pm-chip-x:focus-visible, .pm-chip-add:focus-visible, .pm-fact-add:focus-visible, .pm-pic-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pm-chip-x { flex: none; width: 16px; height: 16px; margin-right: -4px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; font-family: inherit; font-size: 14px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s; }
.pm-chip.own:hover .pm-chip-x, .pm-chip.own:focus-within .pm-chip-x { opacity: .8; }
@media (hover: none) { .pm-chip-x { opacity: .7; } }
.pm-chip-add { border: 1px dashed rgba(255, 255, 255, .3); background: transparent; color: #c9cdd6; font-family: inherit; cursor: pointer; }
@media (hover: hover) { .pm-chip-add:hover { border-color: var(--accent); color: var(--accent); } }
/* facts in the popup's foot line */
.pm-meta .pm-fact-k { color: var(--muted); }
.pm-meta .pm-fact-v { color: var(--text); }
.pm-meta .pm-inl[contenteditable] { border-radius: 4px; padding: 0 2px; cursor: text; }
@media (hover: hover) { .pm-meta .pm-inl[contenteditable]:hover { background: rgba(255, 255, 255, .06); } }
.pm-meta .pm-inl[contenteditable]:focus { background: rgba(255, 255, 255, .08); outline: 1px solid var(--accent); }
.pm-fact-add { margin-left: 8px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
/* the picture button on the graphic, and its menu of previews */
.pm-pic-btn { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid rgba(255, 255, 255, .22); border-radius: 50%; background: rgba(10, 15, 28, .55); color: #fff; cursor: pointer; backdrop-filter: blur(6px); transition: background .12s, border-color .12s; }
.pm-pic-btn svg { width: 17px; height: 17px; }
@media (hover: hover) { .pm-pic-btn:hover { background: rgba(10, 15, 28, .8); border-color: var(--accent); } }
.pm-pic-btn[hidden] { display: none; }
.pm-pic-menu { position: absolute; top: 56px; right: 14px; z-index: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 300px; max-height: calc(100% - 70px); overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface, #16181d); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.pm-pic-menu[hidden] { display: none; }
.pm-pic-opt { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
@media (hover: hover) { .pm-pic-opt:hover { background: rgba(255, 255, 255, .06); } }
.pm-pic-opt.on { border-color: var(--accent); }
.pm-pic-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pm-pic-prev { position: relative; display: block; height: 58px; overflow: hidden; border-radius: 7px; background: #0a0f1c; }
.pm-pic-prev svg { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 760px) { .pm-pic-menu { width: calc(100% - 28px); } }

/* ==== Task Details, laid out like the original board: small uppercase labels over boxed fields.
   Row 1: Next move (wide) · Start · Due; row 2: Project · Space; row 3: Status · Priority. Then On the map, the checklist and the notes. ==== */
.pm-props { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 12px; min-width: 0; }
.pm-prop { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pm-prop[data-prop="next"] { grid-column: span 2; }
.pm-prop[data-prop="assignees"] { grid-column: 1 / -1; } /* New task only: the popup shows them on the tile */
.pm-prop[data-prop="project"], .pm-prop[data-prop="space"], .pm-prop[data-prop="status"], .pm-prop[data-prop="priority"] { grid-column: span 2; }
.pm-prop[hidden] { display: none; }
.pm-prop-label, #pm-place .pm-flabel label, .pm-note-field .pm-flabel label, #pm-task-list .pm-flabel label {
  color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; line-height: 14px; text-transform: uppercase; }
.pm-prop-value { display: flex; align-items: center; min-width: 0; }
/* the controls read as plain text until you point at one (a soft box) or use it (an emerald ring) */
#pm-panel .pm-props .pm-prop-value :is(select, input:not([type=checkbox])),
#pm-panel .pm-props .pm-assignees, #pm-panel #pm-place select {
  width: 100%; min-width: 0; height: 36px; min-height: 36px; margin: 0 0 0 -8px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 8px; background-color: transparent; background-image: none;
  color: var(--text); font: inherit; font-size: 14px; line-height: 34px; box-shadow: none; appearance: none;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; transition: border-color .12s, box-shadow .12s, background-color .12s; }
#pm-panel .pm-props .pm-prop-value :is(select, input:not([type=checkbox])), #pm-panel #pm-place select { width: calc(100% + 8px); }
#pm-panel .pm-props .pm-prop-value select, #pm-panel #pm-place select { cursor: pointer; }
@media (hover: hover) {
  #pm-panel .pm-props .pm-prop-value :is(select, input:not([type=checkbox])):not(:disabled):hover,
  #pm-panel .pm-props .pm-assignees:not(:disabled):hover, #pm-panel #pm-place select:not(:disabled):hover { background-color: rgba(255, 255, 255, .05); }
  /* a dropdown shows its arrow only while pointed at */
  #pm-panel .pm-props .pm-prop-value select:not(:disabled):hover, #pm-panel #pm-place select:not(:disabled):hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a7abb4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 12px; }
}
#pm-panel .pm-props .pm-prop-value :is(select, input:not([type=checkbox])):focus, #pm-panel .pm-props .pm-assignees:focus-visible,
#pm-panel .pm-props .pm-assignees[aria-expanded="true"], #pm-panel #pm-place select:focus {
  border-color: var(--accent); background-color: rgba(255, 255, 255, .04); box-shadow: 0 0 0 3px rgba(52, 211, 153, .16); outline: none; }
#pm-panel .pm-props :is(select, input, .pm-assignees):disabled { opacity: .7; cursor: default; }
#pm-panel .pm-props .pm-prop-value .pm-status-sel select { padding-left: 26px; }
/* Due and Start: the Due dropdown and the date box fill their cell */
#pm-panel .pm-props .pm-due, #pm-panel .pm-props .pm-date { position: relative; display: flex; width: 100%; min-width: 0; }
#pm-panel .pm-props .pm-date .pm-date-text { position: absolute; inset: 0 0 0 -8px; display: flex; align-items: center; padding: 0 9px; color: var(--text); font-size: 14px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pm-panel .pm-props .pm-date.pm-is-empty .pm-date-text { color: var(--muted); }
#pm-panel .pm-props .pm-prop-value .pm-date input { color: transparent; }
#pm-panel .pm-props .pm-prop-value .pm-date input::-webkit-datetime-edit { color: transparent; }
#pm-panel .pm-props .pm-prop-value .pm-date input:focus, #pm-panel .pm-props .pm-prop-value .pm-date input:focus::-webkit-datetime-edit { color: var(--text); }
#pm-panel .pm-props .pm-date input:focus + .pm-date-text, #pm-panel .pm-props .pm-date:focus-within .pm-date-text { visibility: hidden; }
#pm-panel .pm-props .pm-due.pm-is-empty select, #pm-panel .pm-props select.pm-unset { color: var(--muted); }
#pm-panel .pm-props .pm-prop-value .pm-flagsel select { padding-left: 30px; }
#pm-panel .pm-props .pm-flagsel input { margin-top: 8px; }
/* Assignees: faces and names in the box; the list of people opens under it */
#pm-panel .pm-props .pm-assign { position: relative; width: 100%; }
#pm-panel .pm-props .pm-assignees { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
#pm-panel .pm-props .pm-assign-empty { color: var(--muted); }
/* where it sits: On the map, across (Section follows the lane a card is in) */
#pm-place { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 12px; }
#pm-place > .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; }
#pm-place > .field[hidden] { display: none; }
#pm-place > .field > .pm-flabel { margin: 0; }
#pm-place .pm-flabel .pm-fi { display: none; }
/* phone: Next move, Assignees and Project across; the short ones two to a line */
@media (max-width: 760px) {
  .pm-props { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pm-prop[data-prop="next"], .pm-prop[data-prop="assignees"], .pm-prop[data-prop="project"], .pm-prop[data-prop="space"] { grid-column: 1 / -1; }
  .pm-prop[data-prop="status"], .pm-prop[data-prop="priority"] { grid-column: 1 / -1; } /* Status has its buttons beside it */
}
/* light theme */
:where(html[data-theme="light"]) #pm-panel :is(.pm-props .pm-prop-value :is(select, input:not([type=checkbox])), .pm-props .pm-assignees, #pm-place select):not(:disabled):hover { background-color: rgba(15, 23, 42, .04); }
/* History: the clock button by the close button, and the panel it slides in on the right */
.pm-notes-head { display: flex; align-items: center; gap: 4px; }
.pm-notes-head > .pm-label { margin-right: auto; }
#pm-history-btn.on { background: rgba(255, 255, 255, .08); color: var(--accent); }
#pm-panel .pm-modal-grid { position: relative; }
.pm-history-panel { position: absolute; top: 0; right: 0; bottom: 0; z-index: 6; display: flex; flex-direction: column; width: min(380px, 100%); border-left: 1px solid var(--line); background: var(--surface, #16181d); box-shadow: -24px 0 48px rgba(0, 0, 0, .35); animation: pm-history-in .18s ease-out; }
.pm-history-panel[hidden] { display: none; }
@keyframes pm-history-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pm-history-panel { animation: none; } }
.pm-history-head { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 0 14px 0 20px; border-bottom: 1px solid var(--line); } /* covers the task's own buttons; its ✕ closes History */
.pm-history-head b { font-size: 15px; font-weight: 600; }
.pm-history-panel .pm-history-list { flex: 1; overflow-y: auto; padding: 16px 20px 20px; }
:where(html[data-theme="light"]) .pm-history-panel { background: #fff; box-shadow: -24px 0 48px rgba(15, 23, 42, .12); }

/* the people picker (popup tile and New task): faces and names, then a list to tick people in */
.pm-assign { position: relative; min-width: 0; max-width: 100%; }
.pm-assign .pm-faces { display: inline-flex; flex: none; }
.pm-assign .pm-faces .face { box-shadow: 0 0 0 2px var(--surface, #16181d); }
.pm-assign .pm-faces .face + .face { margin-left: -6px; }
.pm-assign .pm-names { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-assign-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; display: flex; flex-direction: column; gap: 6px; width: 280px; max-width: calc(100vw - 32px); padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface, #16181d); color: var(--text); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.pm-assign-pop[hidden] { display: none; }
#pm-panel .pm-assign-pop input.pm-assign-search, #pm-add-panel .pm-assign-pop input.pm-assign-search { width: 100%; height: 36px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .04); color: var(--text); font-size: 14px; box-shadow: none; }
.pm-assign-pop input.pm-assign-search:focus { border-color: var(--accent); outline: none; }
.pm-assign-list { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; }
.pm-assign-opt { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 8px; border-radius: 8px; cursor: pointer; outline: none; }
.pm-assign-opt:is(:hover, :focus) { background: rgba(255, 255, 255, .06); }
.pm-assign-opt:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
.pm-assign-opt[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.pm-assign-opt[aria-disabled="true"]:hover { background: none; }
.pm-assign-text { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 18px; }
.pm-assign-text :is(b, small) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-assign-text b { color: var(--text); font-size: 14px; font-weight: 600; }
.pm-assign-text small { color: var(--muted); font-size: 12px; }
.pm-assign-tick { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border: 1.5px solid var(--line); border-radius: 5px; color: var(--on-accent, #0e0f12); font-size: 12px; font-weight: 700; line-height: 1; }
.pm-assign-opt.on .pm-assign-tick { border-color: var(--accent); background: var(--accent); }
.pm-assign-none { margin: 0; padding: 10px 8px; color: var(--muted); font-size: 13px; }
:where(html[data-theme="light"]) .pm-assign-pop { background: #fff; box-shadow: 0 16px 36px -10px rgba(15, 23, 42, .22); }
:where(html[data-theme="light"]) .pm-assign-opt:is(:hover, :focus) { background: rgba(15, 23, 42, .05); }
/* on the tile, under the task's name: faces and names on the dark picture, "Empty" reads "Assign" */
.pm-poster-who { position: relative; z-index: 3; margin-top: 10px; }
.pm-poster-who[hidden] { display: none; }
.pm-poster-who .pm-assignees { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 34px; padding: 0 12px 0 6px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: rgba(10, 15, 28, .45); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); }
.pm-poster-who .pm-assignees:not(:disabled):hover, .pm-poster-who .pm-assign.open .pm-assignees { border-color: var(--accent); }
.pm-poster-who .pm-assignees:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pm-poster-who .pm-assignees:disabled { cursor: default; }
.pm-poster-who .pm-assign-empty { padding-left: 6px; color: #c9cdd6; font-size: 0; }
.pm-poster-who .pm-assign-empty::before { content: "+ Assign"; font-size: 13px; }
.pm-poster-who .pm-faces .face { box-shadow: 0 0 0 2px #0a0f1c; }
/* the header: History, Delete, then close */
.pm-delete-btn:not(:disabled):hover { color: var(--danger, #ff6b6b); }
#pm-delete[hidden] { display: none; }
#pm-finish[hidden] { display: none; }

/* our own dropdowns: the choice reads as text (with its dot or flag); pointing shows a soft box
   and the arrow; the list is dark, with the current choice ticked */
.pm-menu { position: relative; width: 100%; min-width: 0; }
.pm-menu-native { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.pm-menu-btn { display: flex; align-items: center; gap: 8px; width: calc(100% + 8px); min-width: 0; height: 36px; margin: 0 0 0 -8px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: background-color .12s, border-color .12s, box-shadow .12s; }
.pm-menu-face { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; }
.pm-menu-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-menu-btn.pm-unset .pm-menu-text { color: var(--muted); }
.pm-menu-chev { flex: none; width: 12px; height: 12px; opacity: 0; transition: opacity .12s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a7abb4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / 12px no-repeat; }
@media (hover: hover) { .pm-menu-btn:not(:disabled):hover { background-color: rgba(255, 255, 255, .05); } .pm-menu-btn:not(:disabled):hover .pm-menu-chev { opacity: 1; } }
.pm-menu.open .pm-menu-btn, .pm-menu-btn:focus-visible { border-color: var(--accent); background-color: rgba(255, 255, 255, .04); box-shadow: 0 0 0 3px rgba(52, 211, 153, .16); outline: none; }
.pm-menu.open .pm-menu-chev, .pm-menu-btn:focus-visible .pm-menu-chev { opacity: 1; }
.pm-menu-btn:disabled { cursor: default; }
.pm-menu-list { position: fixed; z-index: 100; max-height: 320px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface, #16181d); box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
.pm-menu-list[hidden] { display: none; }
.pm-menu-opt { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 30px 0 10px; position: relative; border-radius: 8px; color: var(--text); font-size: 14px; cursor: pointer; white-space: nowrap; }
.pm-menu-opt:hover, .pm-menu-opt.active { background: rgba(255, 255, 255, .07); }
.pm-menu-opt.on { font-weight: 600; }
.pm-menu-opt.on::after { content: ""; position: absolute; right: 10px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.pm-menu-opt[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.pm-menu-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--sc, var(--muted)); }
.pm-flag-ic { display: inline-grid; flex: none; place-items: center; width: 14px; height: 14px; color: var(--muted); }
.pm-flag-ic svg { width: 14px; height: 14px; }
.pm-flag-ic.tone-urgent { color: #ff6b6b; }
.pm-flag-ic.tone-blocking { color: #ffb547; }
.pm-flag-ic.tone-waiting { color: #9aa3b2; }
.pm-flag-ic.tone-other { color: #ffd27a; }
:where(html[data-theme="light"]) .pm-menu-list { background: #fff; box-shadow: 0 16px 36px -10px rgba(15, 23, 42, .25); }
:where(html[data-theme="light"]) .pm-menu-opt:hover, :where(html[data-theme="light"]) .pm-menu-opt.active { background: rgba(15, 23, 42, .05); }
@media (hover: hover) { :where(html[data-theme="light"]) .pm-menu-btn:not(:disabled):hover { background-color: rgba(15, 23, 42, .04); } }
/* Status: the dropdown, then → next and ✓ done as quiet icon buttons */
.pm-status-ctl { display: flex; align-items: center; gap: 2px; width: 100%; min-width: 0; }
.pm-status-ctl .pm-menu { flex: 1; }
.pm-st-btn { display: grid; flex: none; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; transition: background-color .12s, color .12s; }
.pm-st-btn svg { width: 15px; height: 15px; }
.pm-st-btn[hidden] { display: none; }
@media (hover: hover) { .pm-st-btn:hover { background: rgba(255, 255, 255, .06); color: var(--accent); } }
.pm-st-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 760px) { .pm-st-btn { width: 34px; height: 34px; } .pm-menu-btn { height: 40px; } }
/* your own chips: outlined in their colour like the other pills (not a solid fill); typing in one
   shows one soft ring around the chip, not a box inside it */
#pm-chips .pm-chip.own.hot { border-color: rgba(255, 107, 107, .55); background: rgba(255, 107, 107, .1); color: #ff8a8a; }
#pm-chips .pm-chip.own.warn { border-color: rgba(255, 181, 71, .55); background: rgba(255, 181, 71, .08); color: #ffc56b; }
#pm-chips .pm-chip.own.cool { border-color: rgba(90, 176, 255, .5); background: rgba(90, 176, 255, .08); color: #8fc2ff; }
#pm-chips .pm-chip .pm-inl, #pm-chips .pm-chip .pm-inl:hover, #pm-chips .pm-chip .pm-inl:focus { background: transparent; outline: none; }
#pm-chips .pm-chip.own:focus-within { box-shadow: 0 0 0 3px rgba(52, 211, 153, .22); }
#pm-chips .pm-chip .pm-inl:empty::before { opacity: .65; }
span.pm-chip-tone { cursor: default; }
/* the chip's remove button: a small centred ✕ */
#pm-chips .pm-chip-x { display: inline-grid; place-items: center; width: 16px; height: 16px; line-height: 0; }
#pm-chips .pm-chip-x svg { display: block; width: 10px; height: 10px; }
/* placeholders on the tile read as hints, not data: lighter and in italics */
.pm-ph-soft:empty::before { opacity: .4; font-style: italic; }
#pm-poster-sub[hidden] { display: none; }


/* ---- vault list: the Saved by / Updated columns only when something fills them ---- */
#items-table.no-saved :is(th, td):nth-child(5), #items-table.no-updated :is(th, td):nth-child(6) { display: none; }

/* ---- Settings: the engineer's corner folds away ---- */
.adv { margin-top: 40px; }
.adv > summary { display: flex; align-items: baseline; gap: 12px; cursor: pointer; list-style: none; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary::before { content: "▸"; width: 12px; }
.adv[open] > summary::before { content: "▾"; }
.adv > summary small { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.adv .main-head.spaced-head { margin-top: 20px; }

/* ---- 40K header: one line after the first visit (the chevron swaps it back) ---- */
.pm-head-tog { display: inline-flex; flex: none; align-items: center; justify-content: center; width: var(--btn-h-sm, 36px); height: var(--btn-h-sm, 36px); border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.pm-head-tog svg { width: 16px; height: 16px; transition: transform .2s; }
.pm-head-tog:hover { color: var(--text); }
.pm-head.compact .pm-head-tog svg { transform: rotate(180deg); }
:where(html[data-theme="light"]) .pm-head-tog { border-color: rgba(15, 23, 42, .22); }
.main.pm .pm-head.compact { margin-bottom: 20px; }
.pm-head.compact .pm-alt, .pm-head.compact .pm-key { display: none; }
.pm-head.compact .pm-title-row { align-items: center; margin-top: 0; }
.main.pm .pm-head.compact h1 { flex: none; font-size: 22px; line-height: 36px; white-space: nowrap; }
.pm-head.compact .pm-head-right { flex: 1; min-width: 0; justify-content: flex-end; }
.pm-head.compact .pm-head-right { align-items: center; }
.pm-head.compact .pm-read { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 18px; max-width: none; }
.pm-head.compact .pm-bar { height: 6px; margin-top: 14px; }
@media (max-width: 760px) {
  .pm-head.compact .pm-read { justify-content: flex-start; }
}

/* ---- Map: where an unsorted item probably belongs ---- */
.pmv-map-sug { display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.pmv-map-sug b { color: var(--text); font-weight: 600; }

/* ---- Home: ask to install the extension when it's missing ---- */
.ext-nudge { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 760px; margin: 18px 0 4px; padding: 14px 16px; border: 1px solid rgba(52, 211, 153, .35); border-radius: 14px; background: rgba(52, 211, 153, .06); }
.ext-nudge-text { display: grid; gap: 2px; min-width: 0; }
.ext-nudge-text b { font-size: 15px; font-weight: 600; }
.ext-nudge-text span { color: var(--muted); font-size: 13px; line-height: 19px; }
.ext-nudge-acts { display: flex; flex: none; gap: 8px; }
#ext-install-btn.is-installed { pointer-events: none; opacity: .7; }
:where(html[data-theme="light"]) .ext-nudge { border-color: rgba(5, 150, 105, .35); background: rgba(5, 150, 105, .06); }
@media (max-width: 760px) { .ext-nudge { flex-direction: column; align-items: stretch; } }

/* ---- Home entrance, in reading order: the greeting, the date, the install note, the tiles one by
   one, then the brief section by section (its delays come from pm-brief.js, on the same clock) ---- */
#home-page.page-in > .main > * { animation: none; } /* the blocks stay put; their parts move */
#home-page.page-in .home-head > h2 { animation: em-rise .55s cubic-bezier(.22, .61, .36, 1) both; }
#home-page.page-in #brief-date { animation: em-rise .55s cubic-bezier(.22, .61, .36, 1) 80ms both; }
#home-page.page-in .ext-nudge { animation: em-rise .55s cubic-bezier(.22, .61, .36, 1) 160ms both; }
#home-page.page-in .app-grid > * { animation: em-rise .55s cubic-bezier(.22, .61, .36, 1) both; animation-delay: calc(var(--i, 0) * 80ms); }
#home-page.page-in .main:has(.ext-nudge) .app-grid > :nth-child(1) { --i: 3; }
#home-page.page-in .main:has(.ext-nudge) .app-grid > :nth-child(2) { --i: 4; }
#home-page.page-in .main:has(.ext-nudge) .app-grid > :nth-child(3) { --i: 5; }
#brief .brief-sec.brief-in { animation: em-rise .5s cubic-bezier(.22, .61, .36, 1) both; animation-delay: var(--d, 0ms); }
@media (min-width: 1000px) { #brief .brief-sec.brief-in { animation-name: em-slide; } }
@keyframes em-slide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
/* narrower screens: the brief sits between the greeting and the tiles, so the tiles come last */
@media (max-width: 999px) {
  #home-page.page-in .app-grid > :nth-child(1) { --i: 6; }
  #home-page.page-in .app-grid > :nth-child(2) { --i: 7; }
  #home-page.page-in .app-grid > :nth-child(3), #home-page.page-in .main:has(.ext-nudge) .app-grid > :nth-child(3) { --i: 8; }
  #home-page.page-in .main:has(.ext-nudge) .app-grid > :nth-child(1) { --i: 6; }
  #home-page.page-in .main:has(.ext-nudge) .app-grid > :nth-child(2) { --i: 7; }
}
@media (prefers-reduced-motion: reduce) {
  #home-page.page-in .home-head > h2, #home-page.page-in #brief-date, #home-page.page-in .ext-nudge, #home-page.page-in .app-grid > *, #brief .brief-sec.brief-in { animation: none; }
}
