/* Projects, task cards, properties, receipts, Gantt and assistant "employee"
   cards. FIOS language: warm neutral surfaces, white panels, flat colour,
   motion that explains state (a ring turns while an assistant works, a band
   flows across a running card, bars grow into the timeline). */

/* ---------------- People ---------------- */
.avatar.xs { width: 16px; height: 16px; border-radius: 5px; font-size: 9px; }
.avatar.xs svg { width: 9px; height: 9px; }
.planner-av { color: #fff; background: var(--c7); }
.me-av { color: var(--bg); background: var(--ink); font-size: 11px; }
.avatar.sm.me-av { font-size: 10px; }
.avatar.lg.me-av { font-size: 15px; }
.face { position: relative; display: inline-grid; place-items: center; flex: none; padding: 3px; border-radius: 12px; }
.face.sm { padding: 2px; border-radius: 9px; }
.face.lg { padding: 3px; border-radius: 15px; }
.face.xl { padding: 4px; border-radius: 22px; }
.face::before { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid color-mix(in srgb, var(--ac) 22%, transparent); }
.face::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid transparent; border-top-color: var(--ac); border-right-color: var(--ac); animation: orbit 1.6s linear infinite; }
.face.sm::before, .face.sm::after { border-width: 1.5px; }
.face .avatar .dot { z-index: 2; }

/* ---------------- Task card ---------------- */
.tcard { position: relative; display: grid; gap: 8px; width: 100%; padding: 12px 13px 11px; border-radius: 13px; text-align: left; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.2s; animation: rise 0.42s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
.tcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--line-2); }
.tcard:active { transform: translateY(0) scale(0.99); }
.tcard:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); border-color: var(--accent); }
.tcard-top { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11.5px; }
.tcard-project { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; color: color-mix(in srgb, var(--pc) 70%, var(--ink)); }
.tcard-project i { width: 8px; height: 8px; border-radius: 3px; background: var(--pc); flex: none; }
.tcard-kind { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.tcard-kind svg { color: var(--faint); }
.tcard-age { color: var(--faint); font-size: 11px; white-space: nowrap; flex: none; }
.tcard-flag { display: inline-grid; place-items: center; height: 18px; padding: 0 5px; border-radius: 5px; font-size: 10.5px; font-weight: 700; color: var(--c-red); background: var(--c-red-bg); }
.kanban { --cols: 5; grid-template-columns: repeat(var(--cols), minmax(210px, 1fr)); }
.kanban:has(> :nth-child(6)) { --cols: 6; }
.tcard-due { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-3); white-space: nowrap; font-variant-numeric: tabular-nums; flex: none; }
.tcard-due.soon { color: var(--c-orange); background: var(--c-orange-bg); }
.tcard-due.late { color: var(--c-red); background: var(--c-red-bg); }
.tcard-title { font-size: 13.5px; font-weight: 620; line-height: 1.45; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard-status { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; line-height: 1.5; color: color-mix(in srgb, var(--tc) 72%, var(--ink-2)); }
.tcard-dot { position: relative; flex: none; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--tc); }
.tcard.live .tcard-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: breathe 1.8s ease-out infinite; }
.b-done .tcard-status, .b-closed .tcard-status { color: var(--muted); }
.ellipsis-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 0; }
.tcard-flow { position: relative; height: 3px; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--tc) 16%, var(--surface-3)); }
.tcard-flow i { position: absolute; inset: 0 auto 0 0; width: 38%; border-radius: inherit; background: var(--tc); animation: flow 1.8s var(--ease) infinite; }
@keyframes flow { from { transform: translateX(-100%); } to { transform: translateX(265%); } }
.tcard-foot { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12px; padding-top: 2px; }
.tcard-who { font-weight: 550; color: var(--ink-2); max-width: 120px; min-width: 2.6em; }
.tcard-meta { flex: none; }
.tcard-meta { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); }
.tcard-meta.waiting { color: var(--c7); }
.tcard-receipt { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-3); }
.tcard-receipt.tone-green { color: var(--c-green); background: var(--c-green-bg); }
.tcard-receipt.tone-orange { color: var(--c-orange); background: var(--c-orange-bg); }
.tcard-receipt.tone-red { color: var(--c-red); background: var(--c-red-bg); }
.tcard-receipt.tone-gray { color: var(--c-gray); }
.tcard.b-done { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); box-shadow: none; }
.tcard.b-done .tcard-title { color: var(--ink-2); }
.tcard.b-closed { opacity: 0.7; box-shadow: none; }
.tcard.b-review, .tcard.b-attention { border-color: color-mix(in srgb, var(--tc) 32%, var(--line)); }
.tcard.b-attention::before, .tcard.b-review::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tc); }
.flip-in { animation: pop-in 0.42s var(--spring) both; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.kanban-list .tcard { animation-name: rise; }

/* ---------------- Task page: title, properties, detail ---------------- */
.drawer-kicker { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.drawer-kicker > span { display: inline-flex; align-items: center; gap: 5px; }
.drawer-kicker > svg { color: var(--faint); }
.crumb-link { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 7px; font-weight: 600; color: color-mix(in srgb, var(--pc) 70%, var(--ink)); background: color-mix(in srgb, var(--pc) 10%, var(--surface)); }
.crumb-link i { width: 8px; height: 8px; border-radius: 3px; background: var(--pc); }
.crumb-link:hover { background: color-mix(in srgb, var(--pc) 18%, var(--surface)); }
.page-title-input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35; color: var(--ink); padding: 2px 0; border-radius: 6px; }
.page-title-input:hover { background: color-mix(in srgb, var(--surface-3) 60%, transparent); }
.page-title-input:focus { background: transparent; box-shadow: 0 2px 0 var(--accent); border-radius: 0; }
.page-title-input::placeholder { color: var(--faint); }
.props { display: grid; gap: 2px; padding: 6px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.prop { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; min-height: 38px; gap: 8px; }
.prop-key { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.prop-key svg { color: var(--faint); flex: none; }
.prop-val { min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.prop-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 8px 3px 4px; margin-left: -4px; border-radius: 8px; max-width: 100%; color: var(--ink-2); transition: background 0.15s; }
.prop-btn:hover:not(:disabled) { background: var(--surface-3); }
.prop-btn:disabled { cursor: default; }
.prop-btn > svg { color: var(--faint); }
.person-chip { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.person-chip b { font-weight: 600; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-chip small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.person-chip.unassigned b { color: var(--ink-2); font-weight: 550; }
.project-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.project-chip i { width: 9px; height: 9px; border-radius: 3px; background: var(--pc); flex: none; }
.date-range { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.date-range > svg { color: var(--faint); }
.date-input { height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.date-input:hover { border-color: var(--line-2); }
.date-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.date-input.late { color: var(--c-red); border-color: color-mix(in srgb, var(--c-red) 40%, var(--line)); }
.date-input.soon { color: var(--c-orange); }
.prio-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--surface-3); }
.prio-seg button { height: 24px; padding: 0 11px; border-radius: 6px; font-size: 12px; color: var(--muted); transition: background 0.15s, color 0.15s; }
.prio-seg button:hover { color: var(--ink); }
.prio-seg button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.prio-seg button.active.p-high { color: var(--c-red); }
.prio-seg button.active.p-low { color: var(--c-blue); }
.switch { position: relative; width: 34px; height: 20px; border-radius: 99px; background: var(--line-2); transition: background 0.2s var(--ease); flex: none; }
.switch i { position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.25s var(--spring); }
.switch.on { background: var(--accent); }
.switch.on i { transform: translateX(14px); }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }
.dep-chips { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dep-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; height: 26px; padding: 0 4px 0 8px; border-radius: 8px; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); }
.dep-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--tc, var(--faint)); flex: none; }
.dep-chip button { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px; color: var(--muted); }
.dep-chip button:hover { background: var(--surface-3); color: var(--ink); }
.dep-chip.b-done { color: var(--muted); }
.chip-add { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 8px; font-size: 12.5px; color: var(--muted); border: 1px dashed var(--line-2); }
.chip-add:hover:not(:disabled) { color: var(--ink); border-color: var(--ink-2); }
.chip-add:disabled { display: none; }
.menu-people { width: 320px; max-height: 380px; overflow-y: auto; }
.menu-item .avatar, .menu-item .face { flex: none; }
.menu-item small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.menu-note { padding: 10px; font-size: 12.5px; color: var(--muted); }
.detail-block { display: grid; }
.detail-input { min-height: 70px; border-color: transparent; background: transparent; padding: 8px 10px; margin: 0 -10px; font-size: 13.5px; line-height: 1.7; resize: vertical; }
.detail-input:hover { background: var(--surface); border-color: var(--line); }
.detail-input:focus { background: var(--surface); }
.receipt-hint { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.receipt-hint svg { color: var(--accent); }
.task-hero-icon.spin { position: relative; }
.task-hero-icon.spin::after { content: ""; position: absolute; inset: -4px; border-radius: 15px; border: 2px solid transparent; border-top-color: var(--tc); border-right-color: var(--tc); animation: orbit 1.4s linear infinite; }
.relations { display: grid; gap: 6px; }
.relation { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-align: left; font-size: 13px; transition: border-color 0.15s, transform 0.15s var(--ease); }
.relation:hover { border-color: var(--line-2); transform: translateX(2px); }
.relation small { font-size: 11px; font-weight: 600; color: var(--muted); width: 28px; }
.relation i { width: 8px; height: 8px; border-radius: 50%; background: var(--tc); flex: none; }

/* ---------------- Receipt chain ---------------- */
.receipt-chain { display: grid; gap: 14px; padding: 14px 16px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.rc-head { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; }
.rc-head strong { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.rc-head strong svg { color: var(--accent); }
.rc-head small { font-size: 11.5px; }
.rc-track { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rc-rail { position: absolute; left: 12.5%; right: 12.5%; top: 11px; height: 2px; border-radius: 2px; background: var(--surface-3); }
.rc-rail b { position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); border-radius: inherit; background: var(--accent); transition: width 0.8s var(--ease); animation: grow-x 0.9s var(--ease) both; transform-origin: left; }
.rc-step { position: relative; display: grid; justify-items: center; align-content: start; gap: 3px; text-align: center; min-width: 0; padding: 0 4px; }
.rc-dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--surface); border: 2px solid var(--line-2); transition: background 0.3s, border-color 0.3s; }
.rc-dot i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.rc-step.on .rc-dot { background: var(--accent); border-color: var(--accent); animation: pop 0.45s var(--spring) both; }
.rc-step.now .rc-dot { border-color: var(--accent); }
.rc-step.now .rc-dot i { background: var(--accent); }
.rc-step.now .rc-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: ripple 1.8s ease-out infinite; }
@keyframes ripple { 0% { transform: scale(0.6); opacity: 0.7; } 100% { transform: scale(1.25); opacity: 0; } }
.rc-step.bad .rc-dot { background: var(--bad); border-color: var(--bad); }
.rc-step.tone-orange.on .rc-dot { background: var(--c2); border-color: var(--c2); }
.rc-step.tone-red.on .rc-dot { background: var(--bad); border-color: var(--bad); }
.rc-step.tone-gray.on .rc-dot { background: var(--faint); border-color: var(--faint); }
.rc-step b { font-size: 12.5px; font-weight: 620; color: var(--ink-2); margin-top: 4px; }
.rc-step.on b { color: var(--ink); }
.rc-step small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rc-step em { font-style: normal; font-size: 11px; color: var(--ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.receipt-chain.complete .rc-rail b { background: var(--good); }
.receipt-chain.complete .rc-step.on:not(.tone-orange):not(.tone-red) .rc-dot { background: var(--good); border-color: var(--good); }

/* ---------------- Projects: list ---------------- */
.project-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.project-summary > div { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.ps-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--kc); background: color-mix(in srgb, var(--kc) 12%, var(--surface)); flex: none; }
.project-summary b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.project-summary small { font-size: 12px; color: var(--muted); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.pcard { position: relative; display: grid; gap: 13px; padding: 18px 18px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s; }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--pc); transform-origin: left; animation: grow-x 0.7s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 120ms); }
.pcard:hover, .pcard:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--pc) 35%, var(--line)); outline: none; }
.pcard-head { display: flex; align-items: center; gap: 12px; }
.pcard-tile { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 18px; font-weight: 700; color: #fff; background: var(--pc); flex: none; box-shadow: 0 8px 18px -10px var(--pc); }
.pcard h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-head small { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.pcard-head small .late { color: var(--c-red); font-weight: 600; }
.dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); margin: 0 2px; flex: none; }
.pcard-brief { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-plan { display: flex; height: 8px; gap: 2px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.mini-plan i { display: block; height: 100%; min-width: 4px; transform-origin: left; animation: grow-x 0.8s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 200ms); }
.mini-plan i.blank { background: transparent; }
.pcard-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pcard-stats span { display: grid; gap: 1px; font-size: 11.5px; color: var(--muted); }
.pcard-stats b { font-size: 17px; font-weight: 700; color: var(--kc); font-variant-numeric: tabular-nums; }
.pcard-stats .zero b { color: var(--faint); }
.pcard-foot { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); min-height: 30px; }
.pcard-planner { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--c7); }
.pcard.thinking::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: color-mix(in srgb, #fff 55%, transparent); transform: translateX(-100%); animation: flow 1.6s var(--ease) infinite; width: 30%; }
.member-stack { display: inline-flex; align-items: center; }
.member-stack > * + * { margin-left: -5px; }
.member-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.member-stack .face { background: var(--surface); }
.member-stack .tag { margin-left: 4px; }
.pring { position: relative; display: inline-grid; place-items: center; flex: none; }
.pring svg { position: absolute; inset: 0; }
.pring-arc { animation: ring-in 1s var(--ease) both; }
@keyframes ring-in { from { stroke-dasharray: 0 var(--c); } }
.pring b { position: relative; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.thinking-dots { display: inline-flex; gap: 3px; align-items: center; }
.thinking-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: wave 1.2s ease-in-out infinite; }
.thinking-dots i:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots i:nth-child(3) { animation-delay: 0.3s; }
.project-empty { display: grid; justify-items: center; gap: 12px; padding: 48px 24px 52px; text-align: center; }
.project-empty h2 { font-size: 20px; letter-spacing: -0.02em; }
.project-empty p { max-width: 520px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.project-empty .row { margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.pe-art { position: relative; width: 220px; height: 92px; margin-bottom: 6px; }
.pe-art i { position: absolute; height: 14px; border-radius: 6px; transform-origin: left; animation: grow-x 0.9s var(--ease) both; }
.pe-art i:nth-child(1) { left: 0; top: 6px; width: 92px; background: color-mix(in srgb, var(--c1) 70%, var(--surface)); }
.pe-art i:nth-child(2) { left: 40px; top: 30px; width: 70px; background: color-mix(in srgb, var(--c3) 70%, var(--surface)); animation-delay: 0.15s; }
.pe-art i:nth-child(3) { left: 40px; top: 54px; width: 110px; background: color-mix(in srgb, var(--c7) 70%, var(--surface)); animation-delay: 0.3s; }
.pe-art i:nth-child(4) { left: 150px; top: 78px; width: 70px; background: color-mix(in srgb, var(--c2) 70%, var(--surface)); animation-delay: 0.45s; }
.input.lg { height: 44px; font-size: 16px; font-weight: 600; border-radius: 11px; }
.date-row { flex-wrap: wrap; }
.date-row > span { display: inline-flex; align-items: center; gap: 5px; margin-right: 4px; }
.owner-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.owner-option { position: relative; display: flex; align-items: flex-start; gap: 11px; padding: 14px; border-radius: 14px; text-align: left; background: var(--surface); border: 1.5px solid var(--line); transition: border-color 0.2s, background 0.2s, transform 0.15s var(--spring); }
.owner-option:hover { border-color: var(--line-2); }
.owner-option:active { transform: scale(0.98); }
.owner-option.active { border-color: var(--accent); background: var(--accent-soft); }
.owner-option b { display: block; font-size: 13.5px; }
.owner-option small { display: block; margin-top: 3px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.owner-option .pick-check { transform: scale(0); }
.owner-option.active .pick-check { transform: scale(1); }

/* ---------------- Projects: one project ---------------- */
.project-hero { position: relative; display: grid; gap: 14px; padding: 16px 22px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.project-hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 78px; background: color-mix(in srgb, var(--pc) 10%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, var(--pc) 16%, transparent); }
.project-hero > * { position: relative; }
.back-link { display: inline-flex; align-items: center; gap: 4px; justify-self: start; height: 26px; padding: 0 8px 0 4px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.back-link svg { transform: rotate(180deg); }
.back-link:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink); }
.project-hero-main { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.project-hero-tile { width: 64px; height: 64px; border-radius: 19px; display: grid; place-items: center; font-size: 27px; font-weight: 700; color: #fff; background: var(--pc); box-shadow: 0 0 0 4px var(--surface), 0 14px 26px -14px var(--pc); flex: none; animation: pop 0.5s var(--spring) both; }
.project-title-input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 25px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); padding: 0; margin-top: 26px; border-radius: 6px; }
.project-title-input:focus { box-shadow: 0 2px 0 var(--pc); border-radius: 0; }
.project-props { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; }
.pp { display: grid; gap: 3px; }
.pp > small { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.pp .prop-btn { margin-left: -6px; min-height: 28px; }
.owner-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 9px; background: var(--surface-3); }
.owner-seg button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 4px; border-radius: 7px; font-size: 12.5px; color: var(--muted); transition: background 0.2s, color 0.2s; }
.owner-seg button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.owner-seg button:not(.active) .avatar { filter: grayscale(1); opacity: 0.55; }
.project-hero-side { display: grid; justify-items: center; gap: 4px; margin-left: auto; padding: 6px 10px 8px; border-radius: 16px; background: var(--surface); }
.project-hero-side small { font-size: 11.5px; color: var(--muted); }
.project-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.project-actions .btn-primary { margin-left: auto; }
.planner-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 4px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--c-purple); background: var(--c-purple-bg); transition: transform 0.15s var(--spring); }
.planner-pill:hover { transform: translateY(-1px); }
.planner-pill.live .avatar { animation: pulse 1.6s ease-in-out infinite; }
.follow-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; padding: 0 6px; }
.follow-toggle input { accent-color: var(--accent); }
.brief-card { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.brief-card summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 650; }
.brief-card summary::-webkit-details-marker { display: none; }
.brief-card summary > svg:first-child { color: var(--accent); }
.brief-card summary small { flex: 1; min-width: 0; font-weight: 450; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brief-card summary > svg:last-child { color: var(--faint); transition: transform 0.25s var(--ease); }
.brief-card[open] summary > svg:last-child { transform: rotate(180deg); }
.brief-input { display: block; width: 100%; border: 0; outline: 0; resize: vertical; padding: 2px 16px 16px; background: transparent; font: inherit; font-size: 13.5px; line-height: 1.75; color: var(--ink); }
.brief-input::placeholder { color: var(--faint); }
.quick-icon.project { background: var(--pc, var(--accent)); }
.project-log { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); padding: 0 16px; }
.project-log summary { display: flex; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer; list-style: none; font-size: 13px; font-weight: 650; }
.project-log summary::-webkit-details-marker { display: none; }
.project-log summary small { font-weight: 450; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-log .timeline { padding-bottom: 14px; }
.project-filter { max-width: 220px; }
.project-filter > :not(svg):not(i) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-table td { font-size: 13px; }
.nowrap { white-space: nowrap; }
.late-text { color: var(--c-red); font-weight: 600; }
.faint { color: var(--faint); }

/* ---------------- Gantt ---------------- */
.gantt2 { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.g2-empty { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 48px 16px; color: var(--muted); font-size: 13px; }
.g2-scroll { overflow: auto; max-height: min(70vh, 720px); overscroll-behavior-x: contain; }
.g2-canvas { position: relative; }
.g2-head { position: sticky; top: 0; z-index: 5; display: flex; height: 52px; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.g2-corner { position: sticky; left: 0; z-index: 2; flex: none; width: var(--g-label); display: flex; align-items: flex-end; padding: 0 12px 9px; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.g2-now-btn { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 7px; font-size: 12px; color: var(--ink-2); background: var(--surface-3); }
.g2-now-btn:hover { color: var(--ink); background: var(--bg-2); }
.g2-scale { position: relative; flex: none; }
.g2-scale-top, .g2-scale-bottom { position: absolute; left: 0; right: 0; }
.g2-scale-top { top: 0; height: 27px; }
.g2-scale-bottom { top: 27px; height: 25px; }
.g2-scale-top span { position: absolute; top: 0; height: 27px; display: flex; align-items: center; padding-left: 9px; font-size: 12px; font-weight: 620; color: var(--ink-2); white-space: nowrap; overflow: hidden; box-shadow: inset 1px 0 0 var(--chart-grid); }
.g2-scale-top span.today { color: var(--accent-ink); }
.g2-scale-bottom span { position: absolute; top: 0; height: 25px; display: flex; align-items: center; padding-left: 5px; font-size: 10.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.g2-scale-bottom span.midnight { color: var(--faint); }
.z-week .g2-scale-bottom span { justify-content: center; padding: 0; }
.z-week .g2-scale-bottom span.weekend { color: var(--faint); }
.z-week .g2-scale-bottom span.today { color: var(--on-accent); font-weight: 650; }
.z-week .g2-scale-bottom span.today::before { content: ""; position: absolute; inset: 3px 4px; z-index: -1; border-radius: 6px; background: var(--bad); }
.g2-now-flag { position: absolute; bottom: 0; transform: translateX(-50%); font-style: normal; font-size: 10px; font-weight: 700; color: #fff; background: var(--bad); padding: 2px 5px; border-radius: 5px 5px 0 0; line-height: 1.2; }
.g2-main { position: relative; }
.g2-gridwrap { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.g2-grid { position: relative; }
.g2-line { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--chart-grid) 70%, transparent); }
.g2-line.day { background: var(--chart-axis); opacity: 0.6; }
.g2-weekend { position: absolute; top: 0; bottom: 0; background: color-mix(in oklab, var(--surface-3) 50%, transparent); }
.g2-now { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px solid var(--bad); opacity: 0.8; z-index: 3; }
.g2-body { position: relative; }
.g2-row { position: absolute; left: 0; right: 0; display: flex; }
.g2-row + .g2-row { box-shadow: 0 -1px 0 color-mix(in oklab, var(--line) 70%, transparent); }
.g2-label { position: sticky; left: 0; z-index: 4; flex: none; width: var(--g-label); display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; background: var(--surface); box-shadow: 1px 0 0 var(--line); min-width: 0; }
.g2-track { position: relative; flex: none; z-index: 1; }
.g2-group .g2-label { background: var(--surface-2); font-size: 13px; }
.g2-group .g2-label b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g2-group .g2-label small { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.g2-group .g2-track { background: color-mix(in oklab, var(--surface-2) 70%, transparent); }
.g2-state { width: 14px; height: 14px; display: grid; place-items: center; flex: none; }
.g2-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 18%, transparent); }
.g2-item.st-running .g2-state i { animation: pulse 1.4s ease-in-out infinite; }
.g2-name { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; line-height: 1.3; }
.g2-name span { font-size: 13px; font-weight: 580; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.g2-name small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g2-name:hover span { color: var(--accent-ink); }
.g2-item.st-done .g2-name span, .g2-item.st-closed .g2-name span { color: var(--muted); }
.g2-item.st-closed .g2-name span { text-decoration: line-through; }
.g2-bar { position: absolute; top: 50%; height: 24px; margin-top: -14px; border-radius: 8px; overflow: hidden; cursor: pointer; touch-action: none; z-index: 2;
  background: color-mix(in oklab, var(--bar) 16%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--bar) 50%, transparent);
  transform-origin: left center; animation: grow-x 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms + 80ms);
  transition: box-shadow 0.15s, transform 0.15s var(--ease); }
.g2-bar:hover, .g2-bar:focus-visible { box-shadow: inset 0 0 0 1.5px var(--bar), 0 4px 12px -5px color-mix(in oklab, var(--bar) 70%, transparent); outline: none; }
.g2-bar.editable { cursor: grab; }
.g2-bar.dragging { cursor: grabbing; transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--bar), 0 10px 22px -8px color-mix(in oklab, var(--bar) 80%, transparent); z-index: 6; animation: none; transition: none; }
.g2-bar.inferred { background: color-mix(in oklab, var(--bar) 7%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--bar) 45%, transparent); outline: 1px dashed color-mix(in oklab, var(--bar) 55%, transparent); outline-offset: -1px; }
.g2-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--bar); opacity: 0.9; }
.g2-bar.st-done .g2-fill { width: 100%; opacity: 0.75; }
.g2-bar.st-review .g2-fill, .g2-bar.st-attention .g2-fill { width: 100%; opacity: 0.32; }
.g2-bar.st-attention { box-shadow: inset 0 0 0 1.5px var(--c8); }
.g2-bar.st-closed { opacity: 0.45; }
.g2-bar.live .g2-fill { width: 34%; opacity: 0.5; animation: flow 2.2s var(--ease) infinite; }
.g2-bar-text { position: relative; z-index: 1; display: flex; align-items: center; gap: 5px; height: 100%; padding: 0 9px; font-size: 11.5px; font-weight: 620; color: color-mix(in oklab, var(--bar) 55%, var(--ink)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.g2-bar.st-done .g2-bar-text { color: #fff; }
.g2-live { width: 6px; height: 6px; border-radius: 50%; background: var(--bar); animation: pulse 1.2s ease-in-out infinite; flex: none; }
.g2-handle { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; z-index: 2; }
.g2-handle.l { left: 0; } .g2-handle.r { right: 0; }
.g2-handle::after { content: ""; position: absolute; top: 6px; bottom: 6px; left: 3.5px; width: 2px; border-radius: 1px; background: var(--bar); opacity: 0; transition: opacity 0.15s; }
.g2-bar:hover .g2-handle::after { opacity: 0.8; }
.g2-actual { position: absolute; top: 50%; height: 4px; margin-top: 13px; border-radius: 99px; background: var(--bar); z-index: 2; transform-origin: left; animation: grow-x 0.7s var(--ease) both; animation-delay: 0.35s; }
.g2-actual.live { background: var(--bar); }
.g2-actual.live::after { content: ""; position: absolute; right: -3px; top: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--bar); animation: breathe 1.6s ease-out infinite; }
.g2-overrun { position: absolute; top: 50%; height: 0; margin-top: -2px; border-top: 2px dashed var(--bad); opacity: 0.7; z-index: 1; }
.g2-done { position: absolute; top: 50%; width: 16px; height: 16px; margin: -10px 0 0 -8px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--good); box-shadow: 0 0 0 2px var(--surface); z-index: 3; animation: pop 0.45s var(--spring) both; animation-delay: 0.5s; }
.g2-overlay { position: absolute; top: 0; left: var(--g-label); pointer-events: none; z-index: 2; }
.g2-links { position: absolute; inset: 0; overflow: visible; color: var(--faint); }
.g2-links path.dep { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-dasharray: 100; stroke-dashoffset: 100; animation: dep-draw 0.8s var(--ease) forwards; animation-delay: 0.45s; opacity: 0.85; transition: color 0.2s, stroke-width 0.2s; }
.g2-links path.dep.waiting { stroke-dasharray: 3 3; animation: dep-wait 1s linear infinite; stroke-dashoffset: 0; color: var(--c7); }
.g2-links path.dep.hot { stroke: var(--accent); stroke-width: 2; opacity: 1; }
@keyframes dep-draw { to { stroke-dashoffset: 0; } }
@keyframes dep-wait { to { stroke-dashoffset: -12; } }
.g2-tip { position: absolute; z-index: 30; display: grid; gap: 4px; min-width: 200px; max-width: 280px; padding: 9px 11px; border-radius: 10px; font-size: 12px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); pointer-events: none; animation: fade 0.12s ease both; }
.g2-tip b { font-size: 12.5px; color: var(--ink); }
.g2-tip span { display: flex; align-items: center; gap: 6px; }
.g2-tip span svg { color: var(--faint); }
.g2-tip span i { width: 7px; height: 7px; border-radius: 50%; }
.g2-tip em { font-style: normal; color: var(--faint); }
.g2-tip.drag { min-width: 0; color: var(--bg); background: var(--ink); border-color: var(--ink); }
.g2-tip.drag b { color: var(--bg); }
.g2-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.g2-legend span { display: inline-flex; align-items: center; gap: 6px; }
.g2-legend i { display: inline-block; }
.lg-plan { width: 22px; height: 10px; border-radius: 4px; background: color-mix(in srgb, var(--c1) 18%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c1) 50%, transparent); }
.lg-actual { width: 22px; height: 4px; border-radius: 99px; background: var(--c1); }
.lg-dep { width: 22px; height: 0; border-top: 1.5px solid var(--faint); }
.lg-now { width: 0; height: 12px; border-left: 1.5px solid var(--bad); }
.shake { animation: shake 0.42s var(--ease) !important; }

/* ---------------- Assistants as employees ---------------- */
.agent-card.emp { gap: 12px; }
.agent-card.emp::before { height: 3px; }
.emp-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.emp-top strong { display: block; font-size: 15px; font-weight: 700; }
.emp-top small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.emp-status { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 650; white-space: nowrap; color: var(--c-gray); background: var(--c-gray-bg); }
.emp-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.emp-status.idle { color: var(--c-green); background: var(--c-green-bg); }
.emp-status.busy { color: var(--c-blue); background: var(--c-blue-bg); }
.emp-status.busy i { animation: pulse 1.2s ease-in-out infinite; }
.emp-status.view { color: var(--c-yellow); background: var(--c-yellow-bg); }
.agent-now { position: relative; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 11px; border-radius: 11px; text-align: left; overflow: hidden; font-size: 13px; font-weight: 580;
  color: var(--ink); background: color-mix(in srgb, var(--tc, var(--ac)) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tc, var(--ac)) 20%, transparent); transition: transform 0.15s var(--ease), border-color 0.15s; }
button.agent-now:hover { transform: translateX(2px); border-color: color-mix(in srgb, var(--tc, var(--ac)) 45%, transparent); }
.agent-now small { flex: none; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 650; color: #fff; background: var(--tc, var(--ac)); }
.agent-now > span { flex: 1; min-width: 0; }
.agent-now > svg { color: var(--faint); flex: none; }
.agent-now.idle { font-weight: 450; background: var(--surface-2); border-color: var(--line); }
.agent-now.idle small { color: var(--muted); background: var(--surface-3); }
.agent-now-flow { position: absolute; left: 0; bottom: 0; height: 2px; width: 34%; background: var(--tc); animation: flow 1.9s var(--ease) infinite; }
.agent-card.emp.working { border-color: color-mix(in srgb, var(--ac) 30%, var(--line)); }
.agent-card.emp.offline .emp-top, .agent-card.emp.offline .agent-card-chart { opacity: 0.6; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .project-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-hero-side { margin-left: 0; }
}
@media (max-width: 640px) {
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .project-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .project-summary > div { padding: 12px; gap: 9px; }
  .project-summary b { font-size: 18px; }
  .owner-pick { grid-template-columns: minmax(0, 1fr); }
  .prop { grid-template-columns: 88px minmax(0, 1fr); }
  .project-hero { padding: 14px 14px 16px; }
  .project-hero-tile { width: 52px; height: 52px; font-size: 22px; }
  .project-title-input { font-size: 21px; margin-top: 2px; }
  .g2-label > .avatar { display: none; }
  .project-hero-main { align-items: center; }
  .project-hero-main > .grow { order: 3; flex-basis: 100%; }
  .project-hero-side { margin-left: auto; padding: 4px; }
  .project-props { gap: 10px 16px; }
  .project-actions .planner-pill { flex: 1 1 100%; justify-content: flex-start; }
  .project-actions .btn-primary { margin-left: 0; }
  .rc-step b { font-size: 11.5px; }
  .pcard-stats b { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .face::after, .tcard-flow i, .agent-now-flow, .g2-bar.live .g2-fill, .pcard.thinking::after, .rc-step.now .rc-dot::after, .g2-links path.dep.waiting { animation: none; }
  .g2-links path.dep { animation: none; stroke-dashoffset: 0; }
}

/* Wide content (Gantt, tables) scrolls inside its card, never the page. */
.page > *, .projects-page > *, .projects-page { min-width: 0; }
.gantt2 { max-width: 100%; }
.drawer:focus { outline: none; }

/* ---------------- Planner side: projects it owns ---------------- */
.side-projects { display: grid; gap: 4px; }
.side-project { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; margin: 0 -8px; border-radius: 10px; text-align: left; transition: background 0.15s; }
.side-project:hover { background: var(--surface-3); }
.side-project > svg { color: var(--faint); flex: none; }
.side-project strong { display: block; font-size: 13px; }
.side-project small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.side-project-tile { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--pc); flex: none; }
.side-project-bar { display: block; height: 4px; margin-top: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.side-project-bar i { display: block; height: 100%; border-radius: inherit; background: var(--pc); transform-origin: left; animation: grow-x 0.8s var(--ease) both; }
.side-here { border-color: color-mix(in srgb, var(--pc) 30%, var(--line)); }
.menu { z-index: 90; }  /* menus also open from drawers and dialogs */
.device-av { color: var(--ink-2); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); }
