.workspace.is-projects .view-switcher,
.workspace.is-projects .control-bar,
.workspace.is-projects .status-jump,
.workspace.is-projects .applied-filters { display: none; }

.projects-view { min-height: 0; padding: 0 28px 28px; overflow: hidden; }
.projects-view.is-active { display: flex; }
#projects-root { width: 100%; min-height: 0; display: flex; }
.projects-shell, .project-detail { width: 100%; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; box-shadow: 0 10px 30px rgba(31,49,62,.05); }

.projects-toolbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.projects-toolbar nav { min-width: 0; display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 4px; border-radius: 11px; background: #eaf0f2; scrollbar-width: none; }
.projects-toolbar nav::-webkit-scrollbar { display: none; }
.projects-toolbar nav button { height: 37px; display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; border: 0; border-radius: 8px; padding: 0 11px; background: transparent; color: #74828e; cursor: pointer; font-size: 10.5px; font-weight: 760; }
.projects-toolbar nav button.is-active { background: var(--surface); color: var(--accent-dark); box-shadow: 0 2px 8px rgba(35,53,66,.1); }
.projects-toolbar nav span { min-width: 19px; height: 19px; display: grid; place-items: center; border-radius: 999px; padding: 0 5px; background: #dfe8eb; font-size: 8.5px; }
.project-create, .project-tasks-tab > header button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 10px; padding: 0 13px; background: var(--accent); color: #fff; cursor: pointer; font-size: 10.5px; font-weight: 780; white-space: nowrap; }
.project-create svg, .project-tasks-tab > header button svg { width: 15px; height: 15px; }

.project-portfolio-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; padding: 13px 16px 0; }
.project-portfolio-summary > div { min-height: 70px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 2px 12px; border: 1px solid #e1e8eb; border-radius: 12px; padding: 11px 13px; background: #fafcfc; }
.project-portfolio-summary small { color: #71808c; font-size: 9px; font-weight: 780; text-transform: uppercase; letter-spacing: .06em; }
.project-portfolio-summary strong { grid-row: span 2; color: #304450; font-size: 24px; letter-spacing: -.04em; }
.project-portfolio-summary span { color: #9aa5ad; font-size: 9px; }
.project-grid { min-height: 0; flex: 1; display: grid; grid-template-columns: repeat(3,minmax(250px,1fr)); align-content: start; gap: 11px; overflow-y: auto; padding: 14px 16px 20px; background: #f7f9fa; }
.project-card { min-width: 0; min-height: 252px; position: relative; display: flex; flex-direction: column; gap: 9px; overflow: hidden; border: 1px solid #dbe4e7; border-radius: 14px; padding: 15px 15px 13px 18px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; box-shadow: 0 5px 16px rgba(35,51,62,.04); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.project-card:hover { transform: translateY(-2px); border-color: #a9c6c8; box-shadow: 0 12px 26px rgba(35,51,62,.09); }
.project-priority-rail { position: absolute; inset: 0 auto 0 0; width: 4px; background: #8297a2; }
.project-card.is-now .project-priority-rail { background: #c9605f; }
.project-card.is-next .project-priority-rail { background: #c08a42; }
.project-card.is-planned .project-priority-rail { background: #3c8e95; }
.project-card.is-paused .project-priority-rail { background: #89959d; }
.project-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-priority, .project-stage { display: inline-flex; align-items: center; min-height: 23px; border-radius: 999px; padding: 0 8px; font-size: 8.5px; font-weight: 820; white-space: nowrap; }
.project-priority.is-now { background: #fae7e5; color: #a64948; }
.project-priority.is-next { background: #fff1dc; color: #906126; }
.project-priority.is-planned { background: #e2f1f1; color: #2c747a; }
.project-priority.is-paused { background: #edf1f3; color: #6a7881; }
.project-stage { background: #edf2f4; color: #657680; }
.project-stage.is-active { background: #e0f0f2; color: #26737b; }
.project-stage.is-approval, .project-stage.is-acceptance { background: #fff0df; color: #90642f; }
.project-stage.is-completed { background: #e5f3e9; color: #49795b; }
.project-stage.is-paused { background: #f4ece4; color: #876d4e; }
.project-card h2 { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 16px; line-height: 1.25; letter-spacing: -.02em; }
.project-card > p { display: -webkit-box; min-height: 39px; margin: 0; overflow: hidden; color: #778591; font-size: 10.5px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.project-next { display: grid; gap: 4px; border: 1px solid #e3eaec; border-radius: 10px; padding: 9px 10px; background: #f8fafb; }
.project-next small { color: #95a0a8; font-size: 8px; font-weight: 780; text-transform: uppercase; letter-spacing: .07em; }
.project-next strong { overflow: hidden; color: #4a5d68; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.project-blocker { display: flex; align-items: center; gap: 6px; color: #a15b55; font-size: 9.5px; }
.project-blocker svg { width: 13px; height: 13px; flex: 0 0 auto; }
.project-blocker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card > footer { display: grid; grid-template-columns: minmax(74px,1fr) auto auto 24px; align-items: center; gap: 11px; margin-top: auto; padding-top: 10px; border-top: 1px solid #edf1f2; }
.project-card > footer > span:not(.project-avatar-stack):not(.project-card-arrow) { display: grid; justify-items: end; }
.project-card > footer strong { font-size: 12px; }
.project-card > footer small { color: #9aa4ac; font-size: 8px; }
.project-card-arrow { color: #91a0a9; }
.project-card-arrow svg { width: 15px; height: 15px; }
.project-avatar-stack { display: flex; align-items: center; }
.project-avatar, .project-task-avatar { width: 28px; height: 28px; display: inline-grid; place-items: center; overflow: hidden; border: 2px solid var(--surface); border-radius: 50%; margin-left: -7px; background: #dfe9eb; color: #477079; font-size: 8px; font-style: normal; font-weight: 800; }
.project-avatar:first-child, .project-task-avatar:first-child { margin-left: 0; }
.project-avatar-stack em { min-width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; margin-left: -6px; background: #edf2f3; color: #697983; font-size: 8px; font-style: normal; font-weight: 800; }
.projects-empty { grid-column: 1 / -1; min-height: 300px; display: grid; place-items: center; align-content: center; gap: 8px; color: #89969f; text-align: center; }
.projects-empty > span { width: 55px; height: 55px; display: grid; place-items: center; border-radius: 17px; background: var(--accent-soft); color: var(--accent); }
.projects-empty h2 { margin: 4px 0 0; color: var(--ink); font-size: 17px; }
.projects-empty p { max-width: 430px; margin: 0; font-size: 11px; line-height: 1.5; }
.projects-empty button { min-height: 38px; border: 0; border-radius: 9px; padding: 0 13px; background: var(--accent); color: #fff; cursor: pointer; font-size: 10px; font-weight: 760; }
.projects-empty i { width: 20px; height: 20px; border: 2px solid #d2dfe2; border-top-color: var(--accent); border-radius: 50%; animation: project-spin .8s linear infinite; }
@keyframes project-spin { to { transform: rotate(360deg); } }

.projects-error { display: flex; align-items: center; gap: 8px; margin: 10px 16px 0; border: 1px solid #edcfca; border-radius: 10px; padding: 10px 12px; background: #fff5f3; color: #9d5852; font-size: 10.5px; }
.projects-error svg { width: 15px; height: 15px; }
.project-detail-head { min-height: 89px; display: grid; grid-template-columns: 38px minmax(0,1fr) 1fr auto auto; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(115deg,#f8fbfb 0%,var(--surface) 72%); }
.project-back, .project-detail-head > button { height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #d8e2e5; border-radius: 9px; padding: 0 11px; background: var(--surface); color: #637580; cursor: pointer; font-size: 10px; font-weight: 760; }
.project-back { width: 38px; padding: 0; }
.project-detail-head .project-delete { width: 38px; padding: 0; border-color: #eed2cf; color: #ae5e58; }
.project-detail-head button svg { width: 15px; height: 15px; }
.project-detail-head > div { min-width: 0; }
.project-detail-head p { display: flex; gap: 6px; margin: 0 0 6px; }
.project-detail-head h2 { margin: 0; overflow: hidden; font-size: 19px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.project-detail-head small { display: block; margin-top: 5px; color: #929ea7; font-size: 9px; }
.project-tabs { min-height: 50px; display: flex; align-items: end; gap: 2px; overflow-x: auto; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface); scrollbar-width: none; }
.project-tabs::-webkit-scrollbar { display: none; }
.project-tabs button { height: 49px; position: relative; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; border: 0; padding: 0 12px; background: transparent; color: #7a8791; cursor: pointer; font-size: 10.5px; font-weight: 740; }
.project-tabs button::after { content: ""; position: absolute; right: 10px; bottom: -1px; left: 10px; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.project-tabs button.is-active { color: var(--accent-dark); }
.project-tabs button.is-active::after { background: var(--accent); }
.project-tabs span { min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 999px; padding: 0 5px; background: #e8eef0; font-size: 8px; }
.project-detail-body { min-height: 0; flex: 1; overflow-y: auto; padding: 14px 16px 20px; background: #f7f9fa; }
.project-overview-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 11px; }
.project-detail-card { min-width: 0; border: 1px solid #dfe7e9; border-radius: 14px; padding: 15px; background: var(--surface); }
.project-detail-card > header { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; }
.project-detail-card > header > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.project-detail-card > header svg { width: 16px; height: 16px; }
.project-detail-card h3 { margin: 0; font-size: 13px; }
.project-detail-card h4 { margin: 15px 0 5px; color: #81909a; font-size: 8.5px; text-transform: uppercase; letter-spacing: .07em; }
.project-rich-copy { color: #4e606b; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.project-rich-copy p, .project-rich-copy ul, .project-rich-copy ol { margin: 0 0 10px; }
.project-rich-copy h3, .project-rich-copy h4 { margin: 18px 0 8px; color: var(--ink); font-size: 13px; text-transform: none; letter-spacing: 0; }
.project-rich-copy a { color: var(--accent); }
.project-rich-copy code { border-radius: 4px; padding: 2px 4px; background: #edf3f4; color: #39545f; }
.project-rich-copy.has-blocker { border-left: 3px solid #c46a64; padding-left: 10px; color: #82524e; }
.project-empty-copy { margin: 0; color: #98a3ab; font-size: 10.5px; line-height: 1.5; }
.project-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-content: start; gap: 8px; }
.project-metrics > header { grid-column: 1 / -1; }
.project-metrics > div { display: grid; gap: 3px; border: 1px solid #e5ebed; border-radius: 10px; padding: 10px; background: #fafcfc; }
.project-metrics > div strong { overflow-wrap: anywhere; color: #34505a; font-size: 15px; }
.project-metrics > div span { color: #94a0a8; font-size: 8.5px; }
.project-people > div { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid #edf1f2; }
.project-person-avatar, .project-option-avatar, .project-comment-avatar { width: 32px; height: 32px; display: inline-grid; place-items: center; overflow: hidden; flex: 0 0 auto; border-radius: 50%; background: #dce9e9; color: #47727a; font-size: 9px; font-weight: 800; }
.project-people > div > span { min-width: 0; display: grid; gap: 2px; }
.project-people small { color: #98a2aa; font-size: 8px; }
.project-people strong { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }

.project-tasks-tab, .project-journal, .project-files, .project-discussion { border: 1px solid #dfe7e9; border-radius: 14px; background: var(--surface); overflow: hidden; }
.project-tasks-tab > header, .project-journal > header, .project-files > header, .project-discussion > header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid #e4eaec; }
.project-tasks-tab h3, .project-journal h3, .project-files h3, .project-discussion h3 { margin: 0; font-size: 13px; }
.project-tasks-tab header p, .project-files header p { margin: 4px 0 0; color: #89969f; font-size: 9px; }
.project-tasks-tab > section { padding: 13px 14px; }
.project-tasks-tab > section + section { border-top: 1px solid #e6ecee; }
.project-tasks-tab h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 10px; }
.project-tasks-tab h4 span, .project-discussion > header span { min-width: 19px; height: 19px; display: grid; place-items: center; border-radius: 999px; background: #e9eff1; color: #697985; font-size: 8px; }
.project-task-row { width: 100%; min-height: 54px; display: grid; grid-template-columns: 4px minmax(0,1fr) auto 110px 18px; align-items: center; gap: 10px; border: 0; border-top: 1px solid #eef2f3; padding: 8px 7px; background: transparent; text-align: left; cursor: pointer; }
.project-task-row:hover { background: #f6f9f9; }
.project-task-status { width: 3px; height: 31px; border-radius: 999px; background: #8095a2; }
.project-task-status.is-work { background: var(--work); }
.project-task-status.is-planned { background: var(--planned); }
.project-task-status.is-deferred { background: var(--deferred); }
.project-task-status.is-control { background: var(--control); }
.project-task-row > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.project-task-row strong { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.project-task-row small { color: #99a4ac; font-size: 8.5px; }
.project-task-row time { color: #798790; font-size: 9px; text-align: right; }
.project-task-row time.is-late { color: #b55a55; }
.project-task-row > svg { width: 14px; height: 14px; color: #9aa6ad; }
.project-task-assignees { display: flex; }
.project-journal > header button, .project-files > header button { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d7e1e4; border-radius: 9px; padding: 0 10px; background: var(--surface); color: #61737e; cursor: pointer; font-size: 9.5px; font-weight: 750; }
.project-journal > header button svg, .project-files > header button svg { width: 14px; height: 14px; }
.project-journal > article { max-width: 930px; padding: 18px 20px 30px; }
.project-files > div { display: grid; gap: 7px; padding: 13px 14px 18px; }
.project-file { min-height: 56px; display: grid; grid-template-columns: 38px minmax(0,1fr) 34px 34px; align-items: center; gap: 9px; border: 1px solid #e0e8ea; border-radius: 11px; padding: 7px 8px; background: #fafcfc; }
.project-file > span { width: 36px; height: 36px; position: relative; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.project-file > span svg { width: 17px; height: 17px; }
.project-file > span em { position: absolute; right: 2px; bottom: 1px; border-radius: 3px; padding: 1px 2px; background: var(--accent); color: #fff; font-size: 5px; font-style: normal; }
.project-file > div { min-width: 0; display: grid; gap: 3px; }
.project-file strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.project-file small { color: #98a3aa; font-size: 8.5px; }
.project-file > a, .project-file > button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #7b8b94; cursor: pointer; }
.project-file > a:hover, .project-file > button:hover { background: #edf3f4; color: var(--accent); }
.project-file > a svg, .project-file > button svg { width: 15px; height: 15px; }

.project-comments { display: grid; gap: 11px; padding: 14px; }
.project-comment { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 9px; }
.project-comment > div { min-width: 0; border: 1px solid #e1e8ea; border-radius: 11px; padding: 9px 10px; background: #fafcfc; }
.project-comment header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.project-comment strong { font-size: 9.5px; }
.project-comment time { color: #9ba5ad; font-size: 8px; }
.project-comment p { margin: 7px 0 0; color: #536671; font-size: 10px; line-height: 1.5; }
.project-comment > div > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.project-comment a { display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; padding: 5px 7px; background: #eaf3f3; color: var(--accent-dark); font-size: 8.5px; text-decoration: none; }
.project-comment a svg { width: 12px; height: 12px; }
.project-comment-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.project-comment-files span { display: inline-flex; align-items: center; gap: 5px; border-radius: 8px; padding: 5px 7px; background: #edf3f4; color: #65757f; font-size: 8.5px; }
.project-comment-files svg { width: 12px; height: 12px; }
.project-comment-files button { width: 18px; height: 18px; display: grid; place-items: center; border: 0; padding: 0; background: transparent; color: #89959d; cursor: pointer; }
.project-comment-box { display: grid; grid-template-columns: 36px minmax(0,1fr) 36px; align-items: end; gap: 6px; margin: 0 14px 14px; border: 1px solid #d9e3e5; border-radius: 12px; padding: 6px; background: #fafcfc; }
.project-comment-box textarea { min-height: 34px; max-height: 110px; resize: vertical; border: 0; outline: 0; padding: 8px 4px; background: transparent; color: var(--ink); font-size: 10.5px; }
.project-comment-box button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: #7b8b94; cursor: pointer; }
.project-comment-box button:last-of-type { background: var(--accent); color: #fff; }
.project-comment-box svg { width: 15px; height: 15px; }

.project-dialog { width: min(920px,calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 0; border-radius: 17px; padding: 0; background: transparent; box-shadow: var(--shadow); }
.project-dialog::backdrop { background: rgba(18,31,39,.48); backdrop-filter: blur(2px); }
.project-dialog form { max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 14px; overflow-y: auto; border: 1px solid var(--line); border-radius: 17px; padding: 18px; background: var(--surface); }
.project-dialog form > header { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.project-dialog h2 { margin: 0; font-size: 20px; }
.project-dialog header > button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: #72818b; cursor: pointer; }
.project-dialog header > button:hover { background: #edf2f4; }
.project-dialog label, .project-dialog section > label { display: grid; gap: 7px; color: #596b76; font-size: 9.5px; font-weight: 760; }
.project-dialog label > span { color: #b45e58; }
.project-dialog input, .project-dialog textarea { width: 100%; border: 1px solid #d5e0e3; border-radius: 10px; padding: 10px 11px; outline: 0; background: var(--surface); color: var(--ink); font-size: 11px; line-height: 1.5; }
.project-dialog input:focus, .project-dialog textarea:focus { border-color: #70aeb2; box-shadow: 0 0 0 3px rgba(20,123,130,.1); }
.project-dialog textarea { resize: vertical; }
.project-form-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.project-option-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.project-option-grid button { min-height: 35px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d9e2e5; border-radius: 9px; padding: 0 9px; background: var(--surface); color: #6c7b85; cursor: pointer; font-size: 9px; font-weight: 730; }
.project-option-grid button i { width: 7px; height: 7px; border-radius: 50%; background: #8297a2; }
.project-option-grid button i.is-now { background: #c9605f; }
.project-option-grid button i.is-next, .project-option-grid button i.is-approval, .project-option-grid button i.is-acceptance { background: #c08a42; }
.project-option-grid button i.is-active, .project-option-grid button i.is-planned { background: #3c8e95; }
.project-option-grid button i.is-completed { background: #5a966f; }
.project-option-grid button.is-active { border-color: #78afb2; background: #eaf5f4; color: var(--accent-dark); box-shadow: inset 0 0 0 1px #78afb2; }
.project-option-grid button:disabled { cursor: default; opacity: .72; }
#project-priority-section > small { display: block; margin-top: 6px; color: #98a3aa; font-size: 8.5px; font-weight: 500; }
.project-people-options { display: flex; flex-wrap: wrap; gap: 6px; }
.project-people-options button { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #dce4e7; border-radius: 10px; padding: 4px 9px 4px 5px; background: var(--surface); color: #5f707b; cursor: pointer; font-size: 9px; font-weight: 720; }
.project-people-options button.is-active { border-color: #7dafb3; background: #edf7f6; color: var(--accent-dark); }
.project-people-options button > svg { width: 13px; height: 13px; }
.project-people-options button:disabled { cursor: default; }
.project-form-error { min-height: 0; border-radius: 9px; color: #a6554f; font-size: 10px; }
.project-form-error:empty { display: none; }
.project-form-error:not(:empty) { border: 1px solid #edcfca; padding: 9px 10px; background: #fff5f3; }
.project-dialog footer { display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: -18px; margin: 3px -18px -18px; border-top: 1px solid var(--line); padding: 12px 18px; background: var(--surface); }
.project-dialog footer button { min-height: 39px; border: 1px solid #d6e0e3; border-radius: 9px; padding: 0 14px; background: var(--surface); color: #687985; cursor: pointer; font-size: 10px; font-weight: 760; }
.project-dialog footer .project-save { border-color: var(--accent); background: var(--accent); color: #fff; }
.project-dialog footer button:disabled { cursor: wait; opacity: .6; }
.task-project-context { display: flex; align-items: center; gap: 9px; border: 1px solid #cce1e1; border-radius: 10px; padding: 8px 10px; background: #f0f8f7; }
.task-project-context > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #dceeee; color: var(--accent); }
.task-project-context svg { width: 15px; height: 15px; }
.task-project-context > div { min-width: 0; display: grid; gap: 2px; }
.task-project-context small { color: #7f919a; font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.task-project-context strong { overflow: hidden; color: #315b60; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

html.dark-theme body :is(.projects-shell,.project-detail,.project-card,.project-detail-card,.project-tasks-tab,.project-journal,.project-files,.project-discussion,.project-dialog form) { border-color: var(--line); background: var(--surface); }
html.dark-theme body .projects-toolbar,
html.dark-theme body .project-detail-body,
html.dark-theme body .project-grid { background: #142029; }
html.dark-theme body .projects-toolbar nav { background: #22313a; }
html.dark-theme body .projects-toolbar nav button.is-active { background: #2a3a44; color: #8bc6ca; }
html.dark-theme body :is(.project-portfolio-summary > div,.project-next,.project-metrics > div,.project-task-row:hover,.project-file,.project-comment > div,.project-comment-box) { border-color: #31424c; background: #1d2b34; }
html.dark-theme body :is(.project-card > p,.project-rich-copy,.project-comment p) { color: #aebac1; }
html.dark-theme body :is(.project-card > footer,.project-tabs,.project-detail-head,.project-tasks-tab > header,.project-journal > header,.project-files > header,.project-discussion > header,.project-tasks-tab > section + section) { border-color: var(--line); background: var(--surface); }
html.dark-theme body .project-detail-head { background: linear-gradient(115deg,#173038 0%,var(--surface) 72%); }
html.dark-theme body :is(.project-back,.project-detail-head > button,.project-journal > header button,.project-files > header button,.project-option-grid button,.project-people-options button,.project-dialog input,.project-dialog textarea,.project-dialog footer button) { border-color: #344650; background: #1b2932; color: #b7c3ca; }
html.dark-theme body :is(.project-option-grid button.is-active,.project-people-options button.is-active) { border-color: #4e8d91; background: #18383b; color: #8bc6ca; }
html.dark-theme body .project-dialog footer { border-color: var(--line); background: var(--surface); }
html.dark-theme body .project-dialog footer .project-save { border-color: var(--accent); background: var(--accent); color: #fff; }
html.dark-theme body .task-project-context { border-color: #315257; background: #173236; }
html.dark-theme body .task-project-context strong { color: #9ad0d3; }

@media (max-width: 1120px) {
  .project-grid { grid-template-columns: repeat(2,minmax(240px,1fr)); }
  .project-portfolio-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .projects-view { padding: 0 10px 82px; overflow-y: auto; }
  .projects-shell, .project-detail { min-height: 100%; overflow: visible; }
  .projects-toolbar { align-items: stretch; flex-direction: column; }
  .projects-toolbar nav button { flex: 1 0 auto; }
  .project-create { width: 100%; }
  .project-portfolio-summary { grid-template-columns: 1fr 1fr; padding: 10px 10px 0; }
  .project-portfolio-summary > div { min-height: 60px; }
  .project-grid { grid-template-columns: 1fr; overflow: visible; padding: 10px; }
  .project-card { min-height: 232px; }
  .project-detail-head { grid-template-columns: 36px minmax(0,1fr) auto auto; }
  .project-detail-head > span { display: none; }
  .project-detail-head > button:not(.project-back):not(.project-delete) { width: 38px; padding: 0; font-size: 0; }
  .project-tabs { padding: 0 8px; }
  .project-detail-body { overflow: visible; padding: 10px; }
  .project-overview-grid { grid-template-columns: 1fr; }
  .project-task-row { grid-template-columns: 4px minmax(0,1fr) 18px; }
  .project-task-assignees, .project-task-row time { display: none; }
  .project-form-columns { grid-template-columns: 1fr; }
  .project-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
  .project-dialog form { max-height: 100dvh; min-height: 100dvh; border: 0; border-radius: 0; padding: 14px; }
  .project-dialog footer { bottom: -14px; margin: 3px -14px -14px; padding: 11px 14px calc(11px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .project-card { transition: none; }
  .project-card:hover { transform: none; }
}
