/* The parts screens are built from: buttons, fields, company and department pickers, rows, tags, the People list
   with the person beside it (a sheet on a phone), role buttons, refusal notes, questions and steps. Colors come only
   from brand.css. */

/* Buttons: one navy main button per screen; quiet ones have a hairline. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 22px;
  border: 1.5px solid var(--navy);
  border-radius: 14px;
  background: var(--navy);
  color: var(--white);
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn[aria-busy="true"] { opacity: .75; }
.btn.big { width: 100%; min-height: 60px; font-size: 19px; }
.btn.small { min-height: 44px; padding: 8px 16px; }
.btn.wide { width: 100%; }
.btn.quiet { background: var(--white); color: var(--navy); border-color: var(--hair); }
.btn.quiet:hover:not(:disabled) { border-color: var(--navy); }
.btn.on-navy { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn.danger { background: var(--late); border-color: var(--late); }
.icon-btn {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--hair); border-radius: 50%; background: var(--white); cursor: pointer;
}
.link-btn { min-height: 44px; padding: 0 8px; border: 0; background: none; font-weight: 800; text-decoration: underline; cursor: pointer; }
.link-btn.flush { justify-self: start; padding: 0; }
.actions { display: grid; gap: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Fields. */
.form { display: grid; gap: 20px; margin-top: 18px; }
.field { display: grid; gap: 8px; }
.label { font-weight: 800; padding: 0; }
.input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--hair);
  border-radius: 12px;
  background: var(--white);
  font-weight: 600;
  transition: border-color .15s var(--ease);
}
.input:focus { border-color: var(--navy); outline: none; }
.input:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.input::placeholder { color: var(--slate); opacity: .8; }
textarea.input { resize: vertical; }
.pin-input { max-width: 240px; font-size: 26px; letter-spacing: .3em; }

/* Company options (each company's own logo) and department chips. */
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 10px 14px;
  border: 1.5px solid var(--hair); border-radius: 16px; background: var(--white); text-align: left; cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.opt[aria-pressed="true"] { border-color: var(--navy); background: var(--ice); }
.opt-name { flex: 1; min-width: 0; font-weight: 800; overflow-wrap: anywhere; }
.opt-check { color: var(--navy); visibility: hidden; }
.opt[aria-pressed="true"] .opt-check { visibility: visible; }
.co-logo { display: block; flex: none; width: 104px; height: 44px; object-fit: contain; object-position: left center; }
.co-tile { flex: none; display: grid; place-items: center; width: 104px; height: 48px; padding: 6px 8px; border-radius: 10px; background: var(--navy); }
.co-tile .co-logo { width: 100%; height: 100%; object-position: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 8px 16px; border: 1.5px solid var(--hair); border-radius: 999px;
  background: var(--white); font-weight: 700; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease);
}
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* Refusals, saved notes and asks, beside their buttons. */
.why { display: flex; gap: 8px; color: var(--late); font-weight: 700; }
.saved { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--ok); font-weight: 800; }
.saved .link-btn { color: var(--navy); }
.ask { font-weight: 700; }

/* Rows: an icon, words that wrap, something at the end. */
.row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 0; }
.row + .row, .row + .link-row, .link-row + .row { border-top: 1px solid var(--hair); }
.link-row { text-decoration: none; }
.row-icon { color: var(--blue); }
.row-go { color: var(--slate); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-main b { font-weight: 800; overflow-wrap: anywhere; }
.row-main small { color: var(--slate); font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.mono { font-variant-numeric: tabular-nums; }

/* Tags: words, never color alone. */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 2px 10px; border-radius: 999px;
  background: var(--paused-bg); color: var(--navy); font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
}
.tag .ic { width: 16px; height: 16px; }
.tag.new { background: var(--slip-bg); color: var(--slip); }
.tag.off { background: var(--late-bg); color: var(--late); }
.tag.role { background: var(--ice); }

/* People: the list, and the person beside it on a laptop or in a sheet on a phone. */
.list-card { padding: 8px; }
.people { list-style: none; padding: 0; display: grid; }
.people li + li { border-top: 1px solid var(--hair); }
.person-row {
  display: grid; gap: 8px; width: 100%; min-height: 64px; padding: 12px; border: 0; border-radius: 12px;
  background: none; text-align: left; cursor: pointer;
}
.person-row:hover { background: var(--off); }
.person-row[aria-current="true"] { background: var(--ice); }
.empty { padding: 12px; }
.side-panel { display: none; }
.split.has-open .side-panel {
  display: block; position: fixed; inset: auto 0 0 0; z-index: 40; max-height: 88dvh; overflow-y: auto;
  padding: 20px 20px calc(28px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0;
  animation: rise .25s var(--ease);
}
.sheet-back { position: fixed; inset: 0; z-index: 30; border: 0; background: var(--navy-soft); cursor: pointer; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.person { display: grid; gap: 24px; }
.person-head { display: flex; align-items: flex-start; gap: 12px; }
.person-title { flex: 1; min-width: 0; }
.person h2 { font-size: 26px; font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
.group { display: grid; gap: 12px; padding-top: 20px; border-top: 1px solid var(--hair); }
.group .btn:not(.wide) { justify-self: start; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-btn {
  min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--hair); border-radius: 12px; background: var(--white);
  font-weight: 800; cursor: pointer;
}
.seg-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.seg-btn:disabled { cursor: default; }
.seg-btn:disabled:not([aria-pressed="true"]) { color: var(--slate); }

/* Open questions and the Add to Home Screen steps. */
.question { display: grid; gap: 14px; align-content: start; }
.question .eyebrow { margin-bottom: 0; }
.question .form { margin-top: 0; }
.q-text { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.q-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.q-state.open { color: var(--slip); }
.q-state.done { color: var(--ok); }
.q-state .ic { width: 20px; height: 20px; }
.answer { padding: 14px 16px; border-radius: 12px; background: var(--off); border: 1px solid var(--hair); overflow-wrap: anywhere; white-space: pre-wrap; }
.question > .btn { justify-self: start; }
.state { display: grid; gap: 14px; justify-items: start; }
.steps { display: grid; gap: 12px; padding-left: 1.4em; }
.steps li { padding-left: 4px; }

@media (min-width: 640px) {
  .opts { grid-template-columns: 1fr; }
}
@media (min-width: 900px) {
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: 20px; align-items: start; }
  .side-panel, .split.has-open .side-panel {
    display: block; position: sticky; top: 24px; inset: auto; z-index: auto; max-height: calc(100dvh - 48px);
    overflow-y: auto; padding: 28px; border-radius: 24px; animation: none;
  }
  .sheet-back { display: none; }
  .actions { justify-items: start; }
  .actions .btn.big { width: auto; min-width: 280px; }
}
