/* People and roles (#/settings): the job cards and their "Can / Cannot"
   lists, the grouped toggles, the "i" button beside each toggle and its
   short card; and the preview band (drawn by main.js on every screen while
   the owner previews a job, so it lives here, the one page-wide sheet this
   screen owns). Builds on studio.css (.perm-row, .perm-name, .seg); only
   what those do not cover.

   The card shows when: pinned by a tap or click (.open), hovered with a
   mouse (hover-capable screens only, so a phone's sticky hover never keeps
   it up), or its button has keyboard focus. .shut (Escape) hides it until
   the pointer or focus moves away. */

.settings .perm-row { position: relative; }
.perm-name { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.perm-row.check > label { display: inline-flex; align-items: center; gap: 12px; }

/* The tree: a toggle that needs another sits indented under it. */
.perm-kids { margin-left: 10px; padding-left: 14px; border-left: 2px solid var(--line); }
.perm-row.feat { font-weight: 600; }
.perm-row.feat > .tag-on, .perm-row.feat > .tag-off { margin-left: auto; }
.perm-row.is-off > .perm-name,
.perm-row.is-off > label,
.perm-row.feat.is-off > .perm-name { color: var(--ink3); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.perm-row.check input:disabled { cursor: not-allowed; }
.perm-row.check input:disabled + span { color: var(--ink3); }
.perm-need { flex-basis: 100%; margin-top: -2px; font-size: 12px; font-weight: 700; color: var(--ink3); }

/* The "i" button and its card. */
.help-wrap { display: inline-flex; }
.help-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; margin: -4px 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink3); cursor: pointer;
}
.help-btn:hover, .help-wrap.open .help-btn { background: var(--mint); color: var(--teal-dd); }

.help-tip {
  display: none; position: absolute; left: 0; top: calc(100% - 2px); z-index: 20;
  width: min(340px, 100%); padding: 10px 12px;
  background: var(--ink); color: #fff; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(22, 49, 44, .22);
  font-size: 13px; font-weight: 600; line-height: 1.4; text-align: left; white-space: normal;
}
.help-title { display: block; margin-bottom: 6px; font-family: var(--display); font-weight: 500; font-size: 14px; color: var(--band-link); }
.help-line { display: block; padding: 3px 8px; margin: 0 -8px; border-radius: 8px; opacity: .72; }
.help-line.now { opacity: 1; background: rgba(255, 255, 255, .14); font-weight: 800; }

.help-wrap.open .help-tip,
.help-btn:focus-visible + .help-tip { display: block; }
@media (hover: hover) {
  .help-wrap:hover .help-tip { display: block; }
}
.help-wrap.shut .help-tip { display: none; }

/* What a lowered toggle also turned off. */
.role-note { margin: 0 0 8px; padding: 6px 12px; border-radius: 12px; background: var(--note-bg); color: var(--note); font-size: 13px; font-weight: 700; }

/* "Can / Cannot": two short columns. */
.cc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0; font-size: 13px; line-height: 1.35; }
.cc-h { font-family: var(--display); font-weight: 500; font-size: 13px; margin-bottom: 4px; }
.cc-can .cc-h { color: var(--teal-dd); }
.cc-no .cc-h { color: var(--warn); }
.cc ul { margin: 0; padding: 0; list-style: none; }
.cc li { position: relative; padding-left: 14px; margin-bottom: 3px; color: var(--ink2); font-weight: 600; }
.cc li::before { content: ''; position: absolute; left: 2px; top: .5em; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.cc-no li::before { background: var(--warn); border-radius: 1px; height: 2px; top: .62em; }

/* Add a person: the job cards. */
.add-person { border: 2px solid var(--teal); }
fieldset.jobs { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.jobs legend { padding: 0; margin-bottom: 8px; }
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.job-card { border: 2px solid var(--line2); border-radius: 18px; padding: 12px 14px 6px; cursor: pointer; background: #fff; }
.job-card:hover { border-color: var(--teal); }
.job-card.on { border-color: var(--teal); background: var(--ground); box-shadow: 0 0 0 2px var(--teal) inset; }
.job-pick { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.job-pick input { width: 20px; height: 20px; accent-color: var(--teal); margin: 0; }
.job-name { font-size: 18px; }
.job-tag { margin-left: auto; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--note-bg); color: var(--note); }
.job-about { margin: 8px 0; font-size: 13px; color: var(--ink2); }
.custom-job { margin-top: 4px; }

/* Jobs: one card per role. */
.job-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.job-head h3 { margin: 0; font-size: 20px; }
.job-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.job-btns .btn { gap: 6px; }

/* The toggles, in four groups. */
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin: 8px 0 12px; }
.group { border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px; min-width: 0; }
.group-h { margin: 0 0 4px; font-size: 16px; font-weight: 500; color: var(--ink); }
.perm-row.q .perm-name { flex: 1 1 180px; }
.perm-row.feat > .perm-need { font-weight: 600; }

/* Preview: across the top of every screen, above the band. */
.preview-band {
  position: sticky; top: 0; z-index: 45;
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top));
  background: var(--note-bg); color: var(--note); border-bottom: 3px solid var(--muddle);
  font-weight: 700; font-size: 14px; text-align: center;
}
.preview-band button {
  border: 0; border-radius: 999px; min-height: 36px; padding: 0 16px;
  background: var(--ink); color: #fff; font-family: var(--display); font-weight: 500; font-size: 14px; cursor: pointer;
}
body.staging .preview-band { top: var(--staging-h, 36px); } /* the STAGING band's measured height (main.js) */

@media (max-width: 520px) {
  .perm-kids { margin-left: 4px; padding-left: 10px; }
  .groups { grid-template-columns: 1fr; }
  .job-grid { grid-template-columns: 1fr; }
  .cc { gap: 8px; }
}
