/* Project settings (module "project"). Prefix: pj- */

.pj { max-width: 1120px; margin: 0 auto; padding-bottom: var(--s-6); }
.pj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); align-items: start; }
.pj-span { grid-column: 1 / -1; }
.pj-note { margin: var(--s-3) 0 0; font-size: var(--fs-sm); color: var(--text-muted); }

/* ----- panel ----- */
.pj-panel { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; padding: var(--s-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.pj-panel-head { display: flex; align-items: flex-start; gap: var(--s-3); }
.pj-panel-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; background: var(--c); color: var(--on-candy); border: var(--bw) solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-sm); }
.pj-panel-title { margin: 0; font: 600 var(--fs-xl)/1.2 var(--font-display); color: var(--text); }
.pj-panel-text { margin: 2px 0 0; font-size: var(--fs-sm); line-height: 1.4; color: var(--text-muted); }
.pj-panel .form-grid .span-2 { grid-column: 1 / -1; }

/* ----- details ----- */
.pj-logo { max-width: 280px; }
.pj-person { display: flex; flex-direction: column; gap: 4px; }
.pj-suggest {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; font: inherit; font-size: var(--fs-xs); font-weight: 700; cursor: pointer;
  color: var(--text-2); background: var(--violet-soft); border: 1px dashed var(--violet-ink); border-radius: var(--r-pill);
}
.pj-suggest:hover { border-style: solid; }

/* ----- preferences ----- */
.pj-pref { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-2) var(--s-4); padding: var(--s-3) 0; border-top: 1px solid var(--border); }
.pj-pref:first-of-type { border-top: 0; padding-top: 0; }
.pj-pref-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pj-pref-label { font-weight: 800; color: var(--text); }
.pj-pref-hint { font-size: var(--fs-sm); line-height: 1.35; color: var(--text-muted); }
.pj-pref-control { display: flex; justify-content: flex-end; min-width: 0; }
.pj-pref-control .select-wrap { min-width: 180px; max-width: 240px; }
.pj-pref-control .input-wrap.number { width: 140px; }

/* ----- appearance ----- */
.pj-themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.pj-theme {
  display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3); text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface-2); border: var(--bw) solid var(--border); border-radius: var(--r-md);
}
.pj-theme:hover { border-color: var(--line); }
.pj-theme.is-active { border-color: var(--line); box-shadow: var(--shadow-md); background: var(--surface); }
.pj-theme:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pj-theme-preview { position: relative; display: block; height: 96px; overflow: hidden; border: var(--bw) solid var(--line); border-radius: var(--r-sm); }
.pj-theme-preview span { position: absolute; border: 1.5px solid var(--line); border-radius: 6px; }
.pj-theme-preview span:nth-child(1) { left: 0; top: 0; bottom: 0; width: 26%; border-width: 0 1.5px 0 0; border-radius: 0; }
.pj-theme-preview span:nth-child(2) { left: 34%; top: 15%; width: 56%; height: 24%; }
.pj-theme-preview span:nth-child(3) { left: 34%; top: 52%; width: 34%; height: 30%; }
/* the previews are pictures of each theme, so they use that theme's own colours */
.pj-theme-light .pj-theme-preview { background: #FFF6E5; }
.pj-theme-light .pj-theme-preview span:nth-child(1) { background: #FFEBC6; }
.pj-theme-light .pj-theme-preview span:nth-child(2) { background: #3B8CFF; }
.pj-theme-light .pj-theme-preview span:nth-child(3) { background: #FF4FA3; }
.pj-theme-dark .pj-theme-preview { background: #17122D; }
.pj-theme-dark .pj-theme-preview span:nth-child(1) { background: #100C22; }
.pj-theme-dark .pj-theme-preview span:nth-child(2) { background: #3B8CFF; }
.pj-theme-dark .pj-theme-preview span:nth-child(3) { background: #FF4FA3; }
.pj-theme-system .pj-theme-preview { background: linear-gradient(135deg, #FFF6E5 0 50%, #17122D 50% 100%); }
.pj-theme-system .pj-theme-preview span:nth-child(1) { background: linear-gradient(135deg, #FFEBC6 0 50%, #100C22 50%); }
.pj-theme-system .pj-theme-preview span:nth-child(2) { background: #3B8CFF; }
.pj-theme-system .pj-theme-preview span:nth-child(3) { background: #FF4FA3; }
.pj-theme-label { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.pj-theme-check { margin-left: auto; color: var(--ok-text); }
.pj-theme-text { font-size: var(--fs-sm); color: var(--text-muted); }

/* ----- data ----- */
.pj-storage { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-3) var(--s-4); background: var(--c-soft); border-radius: var(--r-md); }
.pj-storage-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; background: var(--c); color: var(--on-candy); border: var(--bw) solid var(--line); border-radius: 50%; }
.pj-storage b { font-size: var(--fs-lg); color: var(--text); }
.pj-storage p { margin: 2px 0 0; color: var(--text-2); line-height: 1.45; }
.pj-usage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.pj-usage-item { display: flex; flex-direction: column; gap: 2px; padding: var(--s-2) var(--s-3); background: var(--surface-sunken); border-radius: var(--r-sm); min-width: 0; }
.pj-usage-item b { font: 700 var(--fs-xl)/1.1 var(--font-display); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-usage-item span { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pj-actions { display: flex; flex-direction: column; }
.pj-action { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-3) 0; border-top: 1px solid var(--border); }
.pj-actions .pj-action:first-child { border-top: 0; padding-top: 0; }
.pj-desktop .pj-action { border-top: 0; padding: 0; }
.pj-action > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pj-action b { color: var(--text); }
.pj-action span { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.35; }
.pj-action-danger b { color: var(--danger-text); }

/* ----- all projects ----- */
.pj-proj-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pj-projects { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.pj-proj { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.pj-proj.is-current { background: var(--c-soft); border: var(--bw) solid var(--line); }
.pj-proj-tile { display: grid; place-items: center; flex: none; width: 40px; height: 40px; font: 700 var(--fs-xl)/1 var(--font-display); background: var(--c); color: var(--on-candy); border: var(--bw) solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-sm); }
.pj-proj-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pj-proj-text b { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-proj-text span { font-size: var(--fs-sm); color: var(--text-muted); }

/* ----- shortcuts ----- */
.pj-shortcuts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pj-shortcuts li { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: var(--s-3); padding: 7px 0; border-top: 1px dashed var(--border); color: var(--text-2); }
.pj-shortcuts li:first-child { border-top: 0; }
.pj-keys { display: inline-flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.pj-plus { font-size: var(--fs-xs); color: var(--text-muted); }
.pj-short-group + .pj-short-group { margin-top: var(--s-3); }
.pj-short-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.pj-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); border: var(--bw-thin) solid var(--line); }

/* ----- about ----- */
.pj-about p { margin: 0; line-height: 1.55; color: var(--text-2); }
.pj-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }

@media (max-width: 1000px) {
  .pj-grid { grid-template-columns: minmax(0, 1fr); }
  .pj-themes { grid-template-columns: minmax(0, 1fr); }
  .pj-theme-preview { height: 64px; }
}
@media (max-width: 640px) {
  .pj-pref { grid-template-columns: minmax(0, 1fr); }
  .pj-pref-control { justify-content: flex-start; }
  .pj-usage { grid-template-columns: minmax(0, 1fr); }
}
