/* Project hub. All visual rules are scoped to this page. */
#projectsPanel {
  --ph-ink: #1c2b44; --ph-muted: #4b5c73; --ph-blue: #4263eb; --ph-line: #eaf0f6;
  display: none; min-width: 0; height: auto !important; min-height: 0 !important;
  padding: 30px clamp(16px, 3vw, 44px) 60px !important;
  position: relative; background: transparent !important; overflow: visible !important;
}
#projectsPanel.active { display: block !important; }
#projectsPanel::before, #projectsPanel.page-panel.active::after { display: none !important; }
body:has(#projectsPanel.active) {
  overflow: hidden !important;
  background: linear-gradient(135deg, rgba(11,21,51,.72), rgba(30,58,138,.54)),
    url('/images/domenico-loia-hGV2TfOh0ns-unsplash.jpg') center / cover fixed no-repeat !important;
}
body:has(#projectsPanel.active) .content { background: transparent !important; }
#projectsPanel *, #projectsPanel *::before, #projectsPanel *::after { box-sizing: border-box; }
#projectsPanel, #projectsPanel * { font-weight: 400 !important; }
#projectsPanel :is(h1,h2,h3,h4,h5,h6,b,strong,button,select), #projectsPanel *::before, #projectsPanel *::after { font-weight: 500 !important; }
#projectsPanel :is(button, input, select) { font-family: inherit; }
#projectsPanel :is(button, input, select, a):focus-visible { outline: 3px solid #8aa8ff; outline-offset: 3px; }
#projectsPanel button { cursor: pointer; }
#projectsPanel .ph-icon { display: block; flex: 0 0 19px; width: 19px; height: 19px; }
#projectsPanel .ph-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
#projectsPanel .ph-shell { width: min(100%, 1600px); min-width: 0; margin: 0 auto; }
#projectsPanel .ph-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; font-size: 14px; font-weight: 500; line-height: 1.5; white-space: nowrap; text-decoration: none; transition: background .18s, box-shadow .18s, transform .18s; }
#projectsPanel .ph-btn:hover { transform: translateY(-1px); }
#projectsPanel .ph-btn-secondary { background: #f0f3ff; color: #4263df; border-color: #e4eaff; }
#projectsPanel .ph-btn-secondary:hover { background: #e5ebff; }
#projectsPanel #workspaceAddTaskBtn { width: auto !important; flex: none !important; min-height: 38px; padding: 0 13px; border-radius: 8px; border-color: #e4eaff; background: #f0f3ff; color: #4263df; font-size: 13px; }
#projectsPanel #workspaceAddTaskBtn:hover { background: #e5ebff; }
#projectsPanel .ph-body { display: block; width: 100%; min-width: 0; }
#projectsPanel .ph-main { display: grid; gap: 20px; min-width: 0; }
#projectsPanel .ph-collection { min-width: 0; padding: 23px; border: 1px solid rgba(255,255,255,.8); border-radius: 15px; background: #fff; box-shadow: 0 10px 35px rgba(7,22,51,.08); }
#projectsPanel .ph-collection-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 21px; }
#projectsPanel .ph-section-kicker { color: var(--ph-muted); font-size: 12px; margin-bottom: 5px; }
#projectsPanel .ph-collection-head h2 { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--ph-ink); font-size: 20px; font-weight: 500; }
#projectsPanel .ph-count { display: inline-grid; place-items: center; min-width: 24px; min-height: 23px; padding: 0 6px; border: 1px solid #e6ecf5; border-radius: 7px; color: var(--ph-muted); background: #fafbfd; font-size: 13px; font-weight: 500; }
#projectsPanel .ph-toolbar { display: flex; gap: 9px; margin-bottom: 17px; }
#projectsPanel .ph-search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid #e6ecf4; border-radius: 8px; color: #a1acc0; background: #fafbfd; transition: box-shadow .18s, border-color .18s; }
#projectsPanel .ph-search input { width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; border-radius: 0; background: transparent; color: #34445f; font-size: 13px; box-shadow: none; }
#projectsPanel .ph-search input::placeholder { color: #64748b; opacity: 1; }
#projectsPanel .ph-search:focus-within { border-color: #a6b7f4; background: #fff; box-shadow: 0 0 0 3px #eef2ff; }
#projectsPanel .ph-search input:focus-visible { outline: 0; }
#projectsPanel .ph-sort select { width: 180px; height: 44px; padding: 0 10px; border: 1px solid #e6ecf4; border-radius: 8px; color: var(--ph-muted); background: #fff; font-size: 12px; cursor: pointer; }
#projectsPanel .ph-view-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid #e6ecf4; border-radius: 8px; background: #f8fafd; }
#projectsPanel .ph-view-switch button { display: grid; place-items: center; width: 32px; border: 0; border-radius: 5px; background: transparent; color: #a4afc1; }
#projectsPanel .ph-view-switch button.active { color: #4968e3; background: #fff; box-shadow: 0 1px 4px #d9e2f3; }
#projectsPanel .ph-view-switch .ph-icon { width: 16px; height: 16px; }
#projectsPanel .ph-category-filter { margin: 0 -23px; padding: 0 23px 15px; border-bottom: 1px solid #edf1f7; }
#projectsPanel .ph-category-pills { display: flex; gap: 7px; min-width: 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; scrollbar-color: #e0e6f1 transparent; }
#projectsPanel .ph-category-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 11px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ph-muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
#projectsPanel .ph-category-pill b { font-size: 12px; font-weight: 500; opacity: 1; }
#projectsPanel .ph-category-pill.active { color: #4d67cd; background: #eef2ff; }
#projectsPanel .ph-category-pill:hover { color: #4968d4; background: #f4f6fc; }
#projectsPanel .ph-category-pill.active::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
#projectsPanel .ph-category-pills { gap: 8px; }
#projectsPanel .ph-category-pill { min-height: 38px; padding: 0 12px; border-color: #d6dfeb; background: #f5f7fb; color: #40536e; font-size: 13px; font-weight: 500 !important; transition: background .16s, border-color .16s, color .16s; }
#projectsPanel .ph-category-pill b { min-width: 17px; padding: 1px 4px; border-radius: 5px; background: #e5eaf2; color: #435875; font-size: 12px; font-weight: 500 !important; }
#projectsPanel .ph-category-pill:hover { border-color: #aebfda; background: #eaf0f8; color: #2f4f78; }
#projectsPanel .ph-category-pill.active { border-color: #365fae; background: #365fae; color: #fff; box-shadow: 0 2px 5px #244c951c; }
#projectsPanel .ph-category-pill.active b { background: #ffffff29; color: #fff; }
#projectsPanel .ph-category-pill.active::before { background: #fff; }
#projectsPanel .ph-category-pill:focus-visible { outline-color: #547dc5; }
#projectsPanel .ph-display-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 16px 0; }
#projectsPanel .ph-data-switch { display: flex; align-items: center; gap: 15px; }
#projectsPanel .ph-data-switch button { display: flex; align-items: center; gap: 5px; border: 0; padding: 0; color: var(--ph-muted); background: transparent; font-size: 12px; font-weight: 500; white-space: nowrap; }
#projectsPanel .ph-data-switch button.active { color: #4b65cd; font-weight: 500; }
#projectsPanel .ph-data-switch .ph-icon { width: 14px; height: 14px; flex-basis: 14px; }
#projectsPanel .ph-result-count { color: var(--ph-muted); font-size: 12px; }
#projectsPanel .ph-periods { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 0 15px; }
#projectsPanel .ph-periods button { padding: 5px 9px; border: 1px solid #e8edf6; border-radius: 6px; background: #fff; color: var(--ph-muted); font-size: 12px; }
#projectsPanel .ph-periods button.active { border-color: #cdd8fc; background: #f1f4ff; color: #4966ce; }
#projectsPanel .ph-project-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 14px; }
#projectsPanel .ph-card {
  --ph-accent-ink: color-mix(in srgb, var(--ph-accent) 35%, #1c2b44);
  min-width: 0; position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; padding: 20px;
  border: 1px solid color-mix(in srgb, var(--ph-accent) 18%, #e5ebf4); border-radius: 16px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--ph-accent) 9%, white), #fff 48%);
  box-shadow: 0 4px 14px rgba(38,65,117,.035);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
#projectsPanel .ph-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--ph-accent) 55%, white), var(--ph-accent)); pointer-events: none; }
#projectsPanel .ph-card::after { content: ""; position: absolute; top: -48px; inset-inline-end: -38px; width: 138px; height: 138px; border: 22px solid color-mix(in srgb, var(--ph-accent) 6%, transparent); border-radius: 50%; pointer-events: none; }
#projectsPanel .ph-card > * { position: relative; z-index: 1; }
#projectsPanel .ph-card:hover { border-color: color-mix(in srgb, var(--ph-accent) 50%, #dfe7f4); box-shadow: 0 14px 30px color-mix(in srgb, var(--ph-accent) 16%, transparent); transform: translateY(-3px); }
#projectsPanel .ph-card:focus-within { border-color: var(--ph-accent); }
#projectsPanel .ph-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
#projectsPanel .ph-card-emblem { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px; border: 1px solid color-mix(in srgb, var(--ph-accent) 24%, white); border-radius: 14px; background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--ph-accent) 19%, white)); color: var(--ph-accent-ink); box-shadow: 0 5px 12px color-mix(in srgb, var(--ph-accent) 12%, transparent); font-size: 17px; font-weight: 500; }
#projectsPanel .ph-card-category { color: var(--ph-muted); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#projectsPanel .ph-edit { margin-inline-start: auto; display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; padding: 0; border: 1px solid color-mix(in srgb, var(--ph-accent) 12%, white); border-radius: 9px; background: rgba(255,255,255,.8); color: #62738b; }
#projectsPanel .ph-edit:hover { color: var(--ph-accent-ink); background: color-mix(in srgb, var(--ph-accent) 12%, white); }
#projectsPanel .ph-edit .ph-icon { width: 15px; height: 15px; }
#projectsPanel .ph-card-title { display: flex; justify-content: space-between; align-items: start; gap: 10px; min-height: 22px; margin: 0 0 9px; color: #253650; font-size: 17px; font-weight: 500 !important; text-decoration: none; line-height: 1.65; }
#projectsPanel .ph-card-title span { overflow-wrap: anywhere; font-weight: inherit !important; }
#projectsPanel .ph-card-title > .ph-icon { width: 27px; height: 27px; flex-basis: 27px; padding: 6px; margin-top: 2px; border-radius: 50%; background: color-mix(in srgb, var(--ph-accent) 9%, white); color: var(--ph-accent-ink); transition: transform .2s, background .2s; }
#projectsPanel .ph-card-title:hover { color: var(--ph-accent-ink); }
#projectsPanel .ph-card-title:hover > .ph-icon { transform: translateX(-3px); background: color-mix(in srgb, var(--ph-accent) 18%, white); }
#projectsPanel .ph-card-state { display: inline-flex; align-items: center; gap: 6px; align-self: start; padding: 4px 9px; margin-bottom: 20px; border-radius: 999px; color: var(--ph-accent-ink); background: color-mix(in srgb, var(--ph-accent) 10%, white); font-size: 12px; font-weight: 500; line-height: 1.6; }
#projectsPanel .ph-card-state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
#projectsPanel .ph-card-state[data-status="done"] { color: #217652; background: #edf8f3; }
#projectsPanel .ph-card-state[data-status="done"]::before { content: "✓"; width: auto; height: auto; background: none; font-weight: 500; }
#projectsPanel .ph-card-state[data-status="empty"], #projectsPanel .ph-card-state[data-status="archived"] { color: var(--ph-muted); background: #f5f7fa; }
#projectsPanel .ph-card-progress { margin-top: auto; padding: 12px; border: 1px solid color-mix(in srgb, var(--ph-accent) 12%, white); border-radius: 11px; background: color-mix(in srgb, var(--ph-accent) 5%, white); }
#projectsPanel .ph-card-progress--empty { display: flex; align-items: center; gap: 8px; min-height: 0; padding: 6px 8px; border-style: dashed; border-color: color-mix(in srgb, var(--ph-accent) 32%, white); background: color-mix(in srgb, var(--ph-accent) 4%, white); }
#projectsPanel .ph-no-tasks-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border: 1px solid color-mix(in srgb, var(--ph-accent) 20%, white); border-radius: 8px; color: var(--ph-accent-ink); background: #fff; }
#projectsPanel .ph-no-tasks-copy { display: grid; gap: 2px; min-width: 0; }
#projectsPanel .ph-no-tasks-copy strong { color: var(--ph-ink); font-size: 14px; font-weight: 400 !important; line-height: 1.5; }
#projectsPanel .ph-no-tasks-copy > span { color: var(--ph-muted); font-size: 12px; line-height: 1.5; }
#projectsPanel .ph-card-progress-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--ph-muted); font-size: 12px; }
#projectsPanel .ph-card-progress-head b { color: var(--ph-accent-ink); font-size: 22px; font-weight: 500; line-height: 1.2; }
#projectsPanel .ph-track { width: 100%; height: 5px; overflow: hidden; border-radius: 5px; background: #eff3f8; }
#projectsPanel .ph-track span { display: block; height: 100%; border-radius: inherit; background: var(--ph-accent,#5d7bec); transition: width .25s; }
#projectsPanel .ph-card .ph-track { height: 7px; background: color-mix(in srgb, var(--ph-accent) 11%, white); }
#projectsPanel .ph-card .ph-track span { background: linear-gradient(90deg, color-mix(in srgb, var(--ph-accent) 65%, white), var(--ph-accent)); }
#projectsPanel .ph-card[data-project-status="done"] .ph-track span { background: linear-gradient(90deg, #78d6ac, #2da87b); }
#projectsPanel .ph-card-progress-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; min-height: 24px; padding-top: 8px; color: var(--ph-muted); font-size: 12px; }
#projectsPanel .ph-card-progress-meta strong { color: var(--ph-muted); font-size: 12px; font-weight: 500; }
#projectsPanel .ph-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #eff3f8; }
#projectsPanel .ph-task-link { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 2px 0; border: 0; color: var(--ph-muted); background: transparent; font-size: 12px; text-align: start; }
#projectsPanel .ph-task-link:hover { color: #4263cf; }
#projectsPanel .ph-task-link .ph-icon { width: 13px; height: 13px; flex-basis: 13px; }
#projectsPanel .ph-add-task { display: inline-flex; justify-content: center; align-items: center; gap: 5px; min-height: 36px; padding: 0 11px; border: 1px solid color-mix(in srgb, var(--ph-accent) 26%, white); border-radius: 8px; color: var(--ph-accent-ink); background: color-mix(in srgb, var(--ph-accent) 14%, white); font-size: 12px; font-weight: 500; white-space: nowrap; transition: background .2s, transform .2s; }
#projectsPanel .ph-add-task .ph-icon { width: 12px; height: 12px; flex-basis: 12px; }
#projectsPanel .ph-add-task:hover { background: color-mix(in srgb, var(--ph-accent) 24%, white); color: var(--ph-accent-ink); transform: translateY(-1px); }
#projectsPanel .ph-team-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 20px; padding: 12px 16px; border: 1px solid rgba(255,255,255,.8); border-radius: 13px; background: #fff; box-shadow: 0 8px 25px rgba(7,22,51,.06); }
#projectsPanel .ph-team-label { display: flex; align-items: center; gap: 8px; color: #6077bb; }
#projectsPanel .ph-team-label h2 { margin: 0; color: var(--ph-ink); font-size: 14px; white-space: nowrap; }
#projectsPanel .ph-team-actions { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
#projectsPanel .ph-team-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 10px; border: 1px solid #e6ecf5; border-radius: 8px; background: #fafbfd; color: var(--ph-muted); font-size: 12px; white-space: nowrap; }
#projectsPanel .ph-team-action .ph-icon { width: 16px; height: 16px; flex-basis: 16px; }
#projectsPanel .ph-team-action:hover, #projectsPanel .ph-team-action.active { border-color: #cbd7fc; background: #eef3ff; color: #3f5fc5; }
#projectsPanel .ph-team-action .project-btn-label { font-size: inherit; color: inherit; }
#projectsPanel .ph-team-action .project-badge { margin: 0; font-size: 12px; }
#projectsPanel .ph-team-invite { min-height: 38px; margin-inline-start: auto; padding-inline: 12px; font-size: 12px; }
#projectsPanel .ph-shared-icon { color: #b2bed3; }
#projectsPanel .ph-empty, #projectsPanel .ph-loading { grid-column: 1/-1; display: grid; justify-items: center; align-content: center; gap: 9px; min-height: 210px; padding: 28px; border: 1px dashed #dfe6f2; border-radius: 11px; background: #fafcff; text-align: center; color: var(--ph-muted); font-size: 13px; }
#projectsPanel .ph-empty > .ph-icon { width: 32px; height: 32px; margin-bottom: 5px; color: #b4c2dc; }
#projectsPanel .ph-empty h3 { margin: 0; color: var(--ph-muted); font-size: 15px; }
#projectsPanel .ph-empty p { margin: 0; color: var(--ph-muted); font-size: 12px; line-height: 1.9; }
#projectsPanel .ph-empty button { margin-top: 7px; }
#projectsPanel :is(.ph-card-category,.ph-card-state,.ph-card-progress-head,.ph-card-progress-meta,.ph-task-link,.ph-add-task) { font-size: 12px; }
#projectsPanel .ph-loading > span { width: 22px; height: 22px; border: 2px solid #e0e7f6; border-top-color: #7890de; border-radius: 50%; animation: ph-spin .7s linear infinite; }
#projectsPanel [data-project-layout="list"] .ph-project-grid { grid-template-columns: 1fr; }
#projectsPanel [data-project-layout="list"] .ph-card { display: grid; grid-template-columns: minmax(150px,1.2fr) minmax(125px,1fr) minmax(130px,.9fr); align-items: center; gap: 6px 22px; padding: 14px 17px; }
#projectsPanel [data-project-layout="list"] .ph-card::before { inset-block: 0; inset-inline: 0 auto; width: 4px; height: auto; }
#projectsPanel [data-project-layout="list"] .ph-card::after { display: none; }
#projectsPanel [data-project-layout="list"] .ph-card-emblem { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; font-size: 15px; }
#projectsPanel [data-project-layout="list"] .ph-card-progress { padding: 9px; min-width: 0; }
#projectsPanel [data-project-layout="list"] .ph-card-progress--empty { padding: 6px 8px; }
#projectsPanel [data-project-layout="list"] .ph-card-progress-head { flex-wrap: wrap; }
#projectsPanel [data-project-layout="list"] .ph-card-progress-head b { font-size: 18px; }
#projectsPanel [data-project-layout="list"] .ph-no-tasks-icon { display: none; }
#projectsPanel [data-project-layout="list"] .ph-card-top { grid-column: 1; grid-row: 1; margin: 0; }
#projectsPanel [data-project-layout="list"] .ph-card-title { grid-column: 1; grid-row: 2; margin: 0; font-size: 14px; }
#projectsPanel [data-project-layout="list"] .ph-card-state { grid-column: 2; grid-row: 1; margin: 0 0 6px; }
#projectsPanel [data-project-layout="list"] .ph-card-progress { grid-column: 2; grid-row: 2; margin: 0; }
#projectsPanel [data-project-layout="list"] .ph-card-foot { grid-column: 3; grid-row: 1 / span 2; flex-direction: column; align-items: start; gap: 10px; margin: 0; padding: 0; border: 0; }

/* The category dialog is moved to body by the shared modal controller. */
#projectCategoryModal { z-index: 1310; }
#projectCategoryModal, #projectCategoryModal * { box-sizing: border-box; font-weight: 400 !important; }
#projectCategoryModal :is(h3,h4,label), #projectCategoryModal .ph-category-primary { font-weight: 500 !important; }
#projectCategoryModal .ph-category-manager-card { width: min(680px,calc(100vw - 24px)); background: #fff; padding: 26px; }
#projectCategoryModal .project-modal-head h3 { margin: 0 0 8px; color: #1c2b44; font-size: 21px; }
#projectCategoryModal .project-modal-head p, #projectCategoryModal .ph-category-footnote { color: #4b5c73; font-size: 13px; line-height: 1.8; }
#projectCategoryModal .ph-category-form { padding: 16px; margin-top: 22px; border: 1px solid #e2e8f4; border-radius: 12px; background: #f8faff; }
#projectCategoryModal .ph-category-form label { display: block; margin-bottom: 9px; color: #1c2b44; font-size: 14px; }
#projectCategoryModal .ph-category-form-controls { display: flex; flex-wrap: wrap; gap: 8px; }
#projectCategoryModal .ph-category-form input[type="text"] { flex: 1 1 180px; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid #cdd8e9; border-radius: 8px; background: #fff; color: #1c2b44; font-family: inherit; font-size: 14px; }
#projectCategoryModal button { min-height: 36px; padding: 0 11px; border: 1px solid #dfe6f1; border-radius: 8px; background: #fff; color: #40536e; font-family: inherit; font-size: 13px; cursor: pointer; }
#projectCategoryModal button:disabled { cursor: wait; opacity: .55; }
#projectCategoryModal button:hover { background: #f0f4ff; }
#projectCategoryModal .ph-category-primary { background: #526ff5; border-color: #526ff5; color: #fff; }
#projectCategoryModal .ph-category-primary:hover { background: #405ee3; }
#projectCategoryModal .ph-category-message { min-height: 20px; margin: 12px 0; color: #346c54; font-size: 13px; line-height: 1.7; }
#projectCategoryModal .ph-category-message.error-message { color: #b83945; }
#projectCategoryModal .ph-category-delete-confirm { padding: 13px; margin-top: 14px; border: 1px solid #f1cbd0; border-radius: 10px; background: #fff6f7; }
#projectCategoryModal .ph-category-delete-confirm p { margin: 0 0 10px; color: #94333f; font-size: 13px; line-height: 1.8; }
#projectCategoryModal .ph-category-delete-confirm > div { display: flex; gap: 8px; }
#projectCategoryModal #projectCategoryConfirmDeleteBtn { background: #b83945; border-color: #b83945; color: #fff; }
#projectCategoryModal .project-modal-close { width: 32px; min-height: 32px; padding: 0; font-size: 20px; }
#projectCategoryModal .ph-category-list-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
#projectCategoryModal .ph-category-list-heading h4 { margin: 0; color: #1c2b44; font-size: 14px; }
#projectCategoryModal .ph-category-list { display: grid; gap: 8px; }
#projectCategoryModal .ph-category-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; border: 1px solid #e4eaf3; border-radius: 10px; }
#projectCategoryModal .ph-category-row-info { flex: 1; min-width: 110px; }
#projectCategoryModal .ph-category-row-info strong { display: block; color: #1c2b44; font-size: 15px; overflow-wrap: anywhere; }
#projectCategoryModal .ph-category-row-info small { display: block; margin-top: 4px; color: #4b5c73; font-size: 12px; }
#projectCategoryModal .ph-category-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
#projectCategoryModal button[data-category-delete] { color: #b83945; }
#projectCategoryModal .ph-category-empty { margin: 0; padding: 25px 16px; border: 1px dashed #ccd8eb; border-radius: 10px; text-align: center; color: #4b5c73; font-size: 14px; line-height: 1.9; }
#projectCategoryModal [hidden] { display: none !important; }
#projectCategoryModal :is(button,input):focus-visible { outline: 3px solid #8aa8ff; outline-offset: 2px; }
#projectModal .ph-category-help, #projectDetailPanel .ph-category-help { display: block; margin-top: 7px; color: #4b5c73; font-size: 12px; line-height: 1.8; }
#projectModal .ph-category-help button, #projectDetailPanel .ph-category-help button { height: auto; padding: 0; border: 0; border-radius: 0; background: none; color: #4263df; font-family: inherit; font-size: inherit; font-weight: 500; text-decoration: underline; cursor: pointer; }
#projectDetailCategoryInput { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #cdd8e9; border-radius: 10px; background: #fff; color: #1c2b44; font-family: inherit; font-size: 14px; font-weight: 400; }
@media (max-width: 600px) {
  #projectCategoryModal .ph-category-manager-card { padding: 20px 14px 14px; }
  #projectCategoryModal .ph-category-form { padding: 12px; }
  #projectCategoryModal .ph-category-form input[type="text"] { flex-basis: 100%; }
  #projectCategoryModal .ph-category-row-actions { width: 100%; }
}

/* The original, quiet card design uses the same data and actions. */
body[data-project-card-design="classic"] #projectsPanel .ph-card { padding: 17px; overflow: visible; border: 1px solid #e5ebf4; border-radius: 11px; background: #fff; box-shadow: none; }
body[data-project-card-design="classic"] #projectsPanel .ph-card::before,
body[data-project-card-design="classic"] #projectsPanel .ph-card::after { display: none; }
body[data-project-card-design="classic"] #projectsPanel .ph-card:hover { border-color: #b9c8ee; box-shadow: 0 10px 22px rgba(38,65,117,.07); transform: translateY(-2px); }
body[data-project-card-design="classic"] #projectsPanel .ph-card-top { gap: 8px; margin-bottom: 16px; }
body[data-project-card-design="classic"] #projectsPanel .ph-card-emblem { width: 36px; height: 36px; flex-basis: 36px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--ph-accent) 11%, white); box-shadow: none; font-size: 15px; }
body[data-project-card-design="classic"] #projectsPanel .ph-edit { width: 27px; height: 27px; flex-basis: 27px; border: 0; border-radius: 6px; background: transparent; }
body[data-project-card-design="classic"] #projectsPanel .ph-edit:hover { background: #f0f4ff; }
body[data-project-card-design="classic"] #projectsPanel .ph-card-title > .ph-icon { width: 15px; height: 15px; flex-basis: 15px; padding: 0; margin-top: 4px; background: transparent; color: #72849d; }
body[data-project-card-design="classic"] #projectsPanel .ph-card-state { gap: 5px; padding: 3px 7px; margin-bottom: 22px; border-radius: 4px; color: #345a9c; background: #f0f5fd; }
body[data-project-card-design="classic"] #projectsPanel .ph-card-state[data-status="done"] { color: #217652; background: #edf8f3; }
body[data-project-card-design="classic"] #projectsPanel .ph-card-state[data-status="empty"],
body[data-project-card-design="classic"] #projectsPanel .ph-card-state[data-status="archived"] { color: var(--ph-muted); background: #f5f7fa; }
body[data-project-card-design="classic"] #projectsPanel .ph-card-state::before { content: ""; width: 4px; height: 4px; background: currentColor; }
body[data-project-card-design="classic"] #projectsPanel .ph-card-progress { padding: 0; border: 0; border-radius: 0; background: transparent; }
body[data-project-card-design="classic"] #projectsPanel .ph-card-progress--empty { padding: 6px 8px; border: 1px dashed #ced8e8; border-radius: 10px; background: #f8fafd; }
body[data-project-card-design="classic"] #projectsPanel .ph-card-progress-head { margin-bottom: 8px; }
body[data-project-card-design="classic"] #projectsPanel .ph-card-progress-head b { color: var(--ph-muted); font-size: 12px; }
body[data-project-card-design="classic"] #projectsPanel .ph-card .ph-track { height: 5px; background: #eff3f8; }
body[data-project-card-design="classic"] #projectsPanel .ph-card .ph-track span { background: var(--ph-accent); }
body[data-project-card-design="classic"] #projectsPanel .ph-add-task { min-height: 32px; padding: 0 9px; border-color: #e2e9fb; border-radius: 5px; background: #f7f9fe; color: #3e5fa2; }
body[data-project-card-design="classic"] #projectsPanel .ph-add-task:hover { background: #edf2ff; color: #4263cf; transform: none; }
body[data-project-card-design="classic"] #projectsPanel [data-project-layout="list"] .ph-card { padding: 14px 17px; }

/* Design choices in the existing site settings form. */
#adminPanel .admin-project-card-field, #adminPanel .admin-project-card-field * { font-weight: 400; }
#adminPanel .admin-project-card-field b, #adminPanel #adminProjectCardDesignLabel { font-weight: 500; }
#adminPanel .admin-project-card-field .admin-deadline-card-option { display: grid; grid-template-columns: auto minmax(0,1fr) 68px; gap: 12px; }
#adminPanel .admin-project-card-field .admin-deadline-card-option:has(input:checked) { border-color: #8da5ed; background: #f8faff; }
#adminPanel .ph-design-swatch { display: flex; flex-direction: column; gap: 6px; width: 68px; height: 62px; padding: 10px; border: 1px solid #dfe7f4; border-radius: 8px; background: #fff; }
#adminPanel .ph-design-swatch i { display: block; width: 75%; height: 4px; border-radius: 4px; background: #a3b0c7; }
#adminPanel .ph-design-swatch i:first-child { width: 14px; height: 14px; border-radius: 4px; background: #e4eafa; }
#adminPanel .ph-design-swatch i:last-child { width: 100%; height: 3px; margin-top: auto; background: #89a0ed; }
#adminPanel .ph-design-swatch-energetic { border-top: 3px solid #7890e4; background: linear-gradient(145deg,#eef1ff,#fff); }
#adminPanel .ph-design-swatch-energetic i:first-child { background: #ced7fd; }
#adminPanel .ph-design-swatch-energetic i:last-child { height: 6px; }
@keyframes ph-spin { to { transform: rotate(360deg); } }
@media (max-width: 1100px) {
  #projectsPanel .ph-collection { padding: 18px; }
  #projectsPanel .ph-category-filter { margin-inline: -18px; padding-inline: 18px; }
  #projectsPanel .ph-project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
  #projectsPanel [data-project-layout="list"] .ph-card { grid-template-columns: minmax(130px,1fr) minmax(120px,1fr); }
  #projectsPanel [data-project-layout="list"] .ph-card-foot { grid-column: 1/-1; grid-row: 3; flex-direction: row; margin-top: 6px; padding-top: 8px; border-top: 1px solid #eff3f8; }
}
@media (max-width: 900px) {
  #projectsPanel { padding: 24px 16px 40px !important; }
}
@media (max-width: 600px) {
  #projectsPanel { padding: 20px 11px 35px !important; }
  #projectsPanel .ph-team-bar { gap: 10px; padding: 11px 12px; border-radius: 11px; }
  #projectsPanel .ph-team-actions { flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; overscroll-behavior-inline: contain; scrollbar-width: thin; }
  #projectsPanel .ph-team-actions > button { flex: 0 0 auto; min-height: 40px; }
  #projectsPanel .ph-team-invite { margin-inline-start: 0; }
  #projectsPanel .ph-collection { padding: 15px 13px; border-radius: 12px; }
  #projectsPanel .ph-collection-head { margin-bottom: 17px; }
  #projectsPanel .ph-collection-head h2 { font-size: 17px; }
  #projectsPanel .ph-collection-head .ph-btn { min-height: 35px; padding: 0 10px; font-size: 12px; }
  #projectsPanel .ph-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-bottom: 12px; }
  #projectsPanel .ph-search { grid-column: 1/-1; }
  #projectsPanel .ph-sort select { width: 100%; height: 35px; font-size: 12px; }
  #projectsPanel .ph-view-switch { height: 35px; }
  #projectsPanel .ph-category-filter { margin-inline: -13px; padding-inline: 13px; padding-bottom: 12px; }
  #projectsPanel .ph-display-toolbar { flex-wrap: wrap; gap: 10px; padding: 14px 0; }
  #projectsPanel .ph-result-count { margin-inline-start: auto; font-size: 12px; }
  #projectsPanel .ph-data-switch { gap: 12px; }
  #projectsPanel .ph-data-switch button { font-size: 12px; }
  #projectsPanel .ph-project-grid { grid-template-columns: 1fr; }
  #projectsPanel .ph-card { padding: 17px; }
  #projectsPanel [data-project-layout="list"] .ph-card { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 6px 14px; }
  #projectsPanel [data-project-layout="list"] .ph-card-progress { min-width: 0; }
  #projectsPanel .ph-card-title { font-size: 17px; }
  #projectsPanel .ph-card-state { font-size: 12px; }
  #projectsPanel .ph-card-progress-head, #projectsPanel .ph-card-progress-meta, #projectsPanel .ph-task-link, #projectsPanel .ph-add-task { font-size: 12px; }
  #projectsPanel .ph-add-task { min-height: 36px; padding-inline: 10px; }
  #projectsPanel .ph-edit { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  #projectsPanel *, #projectsPanel *::before, #projectsPanel *::after { animation: none !important; transition: none !important; }
}


/* Native category popup must keep readable colors in light and dark OS themes. */
#projectModal #projectCategory {
  color-scheme: light;
  color: #24364f;
  -webkit-text-fill-color: #24364f;
  background-color: #fff;
}
#projectModal #projectCategory option,
#projectModal #projectCategory optgroup {
  color: #24364f;
  -webkit-text-fill-color: #24364f;
  background-color: #fff;
}
#projectModal #projectCategory option:checked {
  color: #234eac;
  -webkit-text-fill-color: #234eac;
  background-color: #e4edff;
}

#projectModal .project-category-picker { position:relative; width:100%; }
#projectModal .project-category-trigger { display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:46px;padding:11px 14px;border:1px solid #d5dfea;border-radius:11px;background:#fff;color:#24364f;-webkit-text-fill-color:#24364f;font:inherit;text-align:start;cursor:pointer; }
#projectModal .project-category-trigger::after { content:'⌄';color:#74869e;font-size:18px; }
#projectModal .project-category-trigger:disabled { opacity:.55;cursor:wait; }
#projectModal .project-category-trigger:focus-visible { outline:2px solid #799ef1;outline-offset:2px; }
#projectModal .project-category-options { position:absolute;inset-inline:0;top:calc(100% + 6px);z-index:25;max-height:240px;overflow:auto;padding:6px;border:1px solid #d5dfea;border-radius:11px;background:#fff;box-shadow:0 12px 28px #23354f24; }
#projectModal .project-category-options[hidden] { display:none !important; }
#projectModal .project-category-options button { display:block;width:100%;min-height:40px;padding:10px 12px;border:0;border-radius:7px;background:#fff;color:#24364f;-webkit-text-fill-color:#24364f;font:inherit;font-size:13px;line-height:1.6;text-align:start;white-space:normal;overflow-wrap:anywhere;cursor:pointer; }
#projectModal .project-category-options button:hover,
#projectModal .project-category-options button:focus-visible,
#projectModal .project-category-options button[aria-selected="true"] { background:#eaf1ff;color:#234eac;-webkit-text-fill-color:#234eac;outline:none; }
#projectCategoryModal .ph-category-projects { flex:1 0 100%;padding:14px;border-top:1px solid #e3e9f2;background:#f8faff;border-radius:8px; }
#projectCategoryModal .ph-category-projects > p { font-size:12px;line-height:1.9;color:#677a94; }
#projectCategoryModal .ph-category-project-search { width:100%;padding:10px;border:1px solid #d8e2f1;border-radius:8px;background:#fff;color:#24364f;font:inherit;font-size:12px; }
#projectCategoryModal .ph-category-project-checks { max-height:260px;overflow:auto;margin:12px 0; }
#projectCategoryModal .ph-category-project-checks label { display:flex;align-items:center;gap:10px;padding:10px;border-bottom:1px solid #e5ebf4;cursor:pointer;color:#24364f;font-size:13px; }
#projectCategoryModal .ph-category-project-checks label[hidden] { display:none; }
#projectCategoryModal .ph-category-project-checks input { width:17px;height:17px;accent-color:#526ff5; }
#projectCategoryModal .ph-category-project-checks small { display:block;color:#8391a5;font-size:10px;margin-top:4px; }
#projectCategoryModal .ph-category-project-actions { display:flex;flex-wrap:wrap;align-items:center;gap:8px; }

/* Balanced: a quiet tinted header with a neutral, readable body. */
body[data-project-card-design="balanced"] #projectsPanel .ph-card { padding:20px;border:1px solid #dfe6ef;border-radius:15px;background:linear-gradient(180deg,color-mix(in srgb,var(--ph-accent) 7%,#fff) 0px,color-mix(in srgb,var(--ph-accent) 4%,#fff) 72px,#fff 115px);box-shadow:0 3px 14px #22345006; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card::before { height:3px;opacity:.7;background:var(--ph-accent); }
body[data-project-card-design="balanced"] #projectsPanel .ph-card::after { display:none; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card:hover { transform:translateY(-2px);border-color:color-mix(in srgb,var(--ph-accent) 30%,#dfe6ef);box-shadow:0 8px 22px #2234500c; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-top { margin-bottom:17px; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-emblem { width:36px;height:36px;flex-basis:36px;border-radius:10px;font-size:14px;background:color-mix(in srgb,var(--ph-accent) 10%,#fff);border-color:color-mix(in srgb,var(--ph-accent) 16%,#fff);box-shadow:none; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-category { font-size:11px;color:#7c8ba0; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-title { font-size:17px;color:#2d405b; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-title > .ph-icon { background:#f3f6fa;color:#8493a9;width:24px;height:24px; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-state { background:#f3f6fa;color:#73859c;font-size:10px;padding:3px 8px;margin-bottom:17px; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-state[data-status="done"] { background:#eff8f3;color:#3c8b69; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-progress { background:#f8fafc;border:1px solid #edf1f6;border-radius:10px;padding:12px; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-progress-head b { color:#435774;font-size:15px; }
body[data-project-card-design="balanced"] #projectsPanel .ph-track { height:5px;background:#e8edf5; }
body[data-project-card-design="balanced"] #projectsPanel .ph-track span { background:color-mix(in srgb,var(--ph-accent) 70%,#8e9cb2);box-shadow:none; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-progress-meta { color:#8c9bb0;font-size:10px; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-foot { border-color:#eef1f6;padding-top:13px;margin-top:15px; }
body[data-project-card-design="balanced"] #projectsPanel .ph-add-task { border:1px solid color-mix(in srgb,var(--ph-accent) 18%,#fff);background:color-mix(in srgb,var(--ph-accent) 6%,#fff);color:var(--ph-accent-ink);box-shadow:none;border-radius:7px;min-height:30px; }
body[data-project-card-design="balanced"] #projectsPanel .ph-add-task:hover { background:color-mix(in srgb,var(--ph-accent) 12%,#fff);transform:none; }
body[data-project-card-design="balanced"] #projectsPanel [data-project-layout="list"] .ph-card { padding:14px 18px;background:linear-gradient(90deg,#fff,color-mix(in srgb,var(--ph-accent) 4%,#fff)); }
#adminPanel .ph-design-swatch-balanced { border-top:2px solid #a3b4e1;background:linear-gradient(180deg,#edf2fc 0 30%,#fff 60%); }
#adminPanel .ph-design-swatch-balanced i:first-child { background:#d8e1f2; }
#adminPanel .ph-design-swatch-balanced i:last-child { height:4px;background:#9fb2df; }

body[data-project-card-design="balanced"] #projectsPanel .ph-card-progress { border:0;background:transparent;box-shadow:none;padding:12px 0; }

#projectsPanel .ph-card-clear-state { display:none; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-clear-state { display:flex;align-items:center;justify-content:center;min-height:100px;margin-top:auto;color:#26a477; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-clear-state svg { width:68px;height:68px; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card-clear-state + .ph-card-progress { display:none; }
body[data-project-card-design="balanced"] #projectsPanel [data-project-layout="list"] .ph-card-clear-state { grid-column:2;grid-row:2;min-height:52px;margin:0; }
body[data-project-card-design="balanced"] #projectsPanel [data-project-layout="list"] .ph-card-clear-state svg { width:48px;height:48px; }

/* Keep the collection title and controls in one desktop row. */
@media (min-width: 901px) {
  #projectsPanel .ph-collection:has(#workspaceAddTaskBtn) { display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:20px;align-items:center; }
  #projectsPanel .ph-collection:has(#workspaceAddTaskBtn) > * { grid-column:1 / -1;min-width:0; }
  #projectsPanel .ph-collection:has(#workspaceAddTaskBtn) > .ph-collection-head { display:contents; }
  #projectsPanel .ph-collection:has(#workspaceAddTaskBtn) > .ph-collection-head > div { grid-column:1;grid-row:1;margin-bottom:16px; }
  #projectsPanel .ph-collection:has(#workspaceAddTaskBtn) > .ph-collection-head > button { grid-column:3;grid-row:1;margin-bottom:16px;white-space:nowrap; }
  #projectsPanel .ph-collection:has(#workspaceAddTaskBtn) > .ph-toolbar { grid-column:2;grid-row:1;margin-bottom:16px;flex-wrap:nowrap; }
  #projectsPanel .ph-collection:has(#workspaceAddTaskBtn) .ph-section-kicker { display:none; }
  #projectsPanel .ph-collection:has(#workspaceAddTaskBtn) #phCollectionTitle { margin:0;white-space:nowrap; }
}

/* Team actions: restrained individual colors and a stronger invitation action. */
#projectsPanel #toggleMembersListBtn { color:#396bd4;background:#edf3ff;border-color:#d2dfff; }
#projectsPanel #toggleProjectCategoryModalBtn { color:#8057bd;background:#f4effc;border-color:#e4d7f6; }
#projectsPanel #toggleInvitationsBtn { color:#17876d;background:#eaf8f2;border-color:#ccebdd; }
#projectsPanel #toggleArchiveProjectsBtn { color:#ad7726;background:#fff6e7;border-color:#f2e1bc; }
#projectsPanel #toggleInviteFormBtn { color:#fff;background:#5774dd;border-color:#4d68cd;box-shadow:0 3px 9px rgb(87 116 221 / 16%); }
#projectsPanel :is(#toggleMembersListBtn,#toggleProjectCategoryModalBtn,#toggleInvitationsBtn,#toggleArchiveProjectsBtn,#toggleInviteFormBtn) { border-radius:9px;transition:background .15s,border-color .15s,box-shadow .15s; }
#projectsPanel #toggleMembersListBtn:hover { background:#dfeaff;border-color:#abc4fb; }
#projectsPanel #toggleProjectCategoryModalBtn:hover { background:#eadef9;border-color:#cdb4ed; }
#projectsPanel #toggleInvitationsBtn:hover { background:#d8f1e6;border-color:#a8d9c6; }
#projectsPanel #toggleArchiveProjectsBtn:hover { background:#ffedcc;border-color:#e8cb94; }
#projectsPanel #toggleInviteFormBtn:hover { background:#4663cc;border-color:#3e59bd;box-shadow:0 4px 12px rgb(87 116 221 / 23%); }
#projectsPanel :is(#toggleMembersListBtn,#toggleProjectCategoryModalBtn,#toggleInvitationsBtn,#toggleArchiveProjectsBtn,#toggleInviteFormBtn):focus-visible { outline:2px solid currentColor;outline-offset:3px; }
#projectsPanel #toggleArchiveProjectsBtn[aria-pressed="true"] { background:#f7dfb2;border-color:#d8ae68;color:#8a5a18; }

#projectsPanel .ph-collection-actions { display:flex;align-items:center;gap:8px;flex-shrink:0; }
#projectsPanel .ph-create-project { color:#fff;background:#168569;border:1px solid #10755c;border-radius:9px;white-space:nowrap; }
#projectsPanel .ph-create-project:hover { background:#0e7057; }
@media(min-width:901px) {
 #projectsPanel .ph-collection:has(#workspaceAddTaskBtn) > .ph-collection-head > .ph-collection-actions { grid-column:3;grid-row:1;margin-bottom:16px; }
 #projectsPanel .ph-collection:has(#workspaceAddTaskBtn) .ph-sort select { width:155px; }
}
@media(max-width:480px) { #projectsPanel .ph-collection-head { flex-wrap:wrap; } }

/* Compact project cards: status shares the title row. */
#projectsPanel .ph-card .ph-card-title { align-items:center;gap:10px;margin-bottom:12px; }
#projectsPanel .ph-card .ph-card-title > .ph-card-state { flex-shrink:0;margin:0;font-size:10px;white-space:nowrap;font-weight:400 !important;padding:3px 7px; }
#projectsPanel .ph-card .ph-card-title > span:first-child { min-width:0; }
#projectsPanel .ph-card .ph-card-progress { padding:7px 9px; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card .ph-card-progress { padding:5px 0; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card .ph-card-clear-state { min-height:65px; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card .ph-card-top { margin-bottom:12px; }
body[data-project-card-design="balanced"] #projectsPanel .ph-card .ph-card-foot { margin-top:10px;padding-top:10px; }
