/* Game settings, People, You and the person drawer (design/redesign-2026-10/theme.css "screen:
   settings", "screen: people", the role grid and their responsive rules; NOTES.md §8). */

/* ---------------------------------------------------------------- screen: settings */
.settings-layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.subnav {
  position: sticky;
  top: 130px;
  display: grid;
  gap: 2px;
}
.subnav a {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: var(--r-2);
  font-size: var(--fs-14);
  color: var(--ink-3);
}
.subnav a:hover {
  background: var(--hover);
  color: var(--ink);
}
.subnav a[aria-current='true'] {
  background: var(--surface-3);
  color: var(--ink);
  font-weight: 560;
}
.set {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px 40px;
  padding: 30px 0;
  scroll-margin-top: 130px;
}
.set + .set {
  box-shadow: inset 0 1px 0 var(--line);
}
.set:first-child {
  padding-top: 4px;
}
.set-intro {
  display: grid;
  gap: 6px;
  align-content: start;
}
.set-intro p {
  font-size: var(--fs-13);
  color: var(--ink-3);
  text-wrap: pretty;
}
.set-fields {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.set-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 10px 0;
}
.set-row + .set-row {
  box-shadow: inset 0 1px 0 var(--line);
}
.set-row .body {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 2px;
}
.set-row .body b {
  font-weight: 600;
}
.set-row .body span {
  font-size: var(--fs-13);
  color: var(--ink-3);
}
.inline-form {
  display: flex;
  gap: 8px;
}
.inline-form .input {
  flex: 1;
}
.set.is-danger .btn.is-decline {
  justify-self: start;
}

/* ---------------------------------------------------------------- screen: people */
.people-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 28px;
  align-items: start;
}
.roles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.role {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px 16px;
}
.role p {
  font-size: var(--fs-13);
  color: var(--ink-3);
  text-wrap: pretty;
}
.person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 14px;
  min-height: 64px;
  padding: 12px 16px;
  transition: background-color var(--t-fast) var(--ease);
}
.person + .person {
  box-shadow: inset 0 1px 0 var(--line);
}
a.person:hover {
  background: var(--hover);
}
.person[aria-current='true'] {
  background: var(--surface-2);
}
.person .body {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.person .body b {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: var(--fs-15);
  font-weight: 600;
}
.person .grants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.grant {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-12);
  color: var(--ink-3);
}
.person .last {
  display: grid;
  justify-items: end;
  gap: 4px;
  font-size: var(--fs-12);
  color: var(--ink-3);
  text-align: right;
  white-space: nowrap;
}
.person-panel {
  position: sticky;
  top: 24px;
  overflow: hidden;
}
.pp-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 16px;
}
.pp-head h2 {
  font-family: var(--font-serif);
  font-size: var(--fs-24);
  font-weight: 450;
  line-height: 1.1;
}
.pp-sec {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  box-shadow: inset 0 1px 0 var(--line);
}
.pp-sec h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-13);
  font-weight: 650;
  color: var(--ink-2);
}
.pp-sec h3 .status,
.pp-sec h3 .btn {
  margin-left: auto;
}
.pp-sec p {
  font-size: var(--fs-13);
  color: var(--ink-3);
  text-wrap: pretty;
}
.link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 40px;
  padding: 0 4px 0 12px;
  border-radius: var(--r-3);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-3);
}
.link-box span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grant-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-height: 44px;
  padding: 4px 0;
}
.grant-row .seg {
  width: 100%;
}
.grant-row .seg button {
  flex: 1;
  justify-content: center;
}
.grant-row .name {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-14);
  font-weight: 540;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grant-row .seg button {
  padding: 0 9px;
  font-size: 12.5px;
}
.devices {
  list-style: none;
  display: grid;
}
.device {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  transition: opacity var(--t-med) var(--ease);
}
.device + .device {
  box-shadow: inset 0 1px 0 var(--line);
}
.device > .i {
  width: 20px;
  height: 20px;
  color: var(--ink-3);
}
.device .body {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.device .body b {
  font-weight: 600;
  font-size: var(--fs-14);
}
.device .body span {
  font-size: var(--fs-12);
  color: var(--ink-3);
}
.device.is-revoked {
  opacity: 0.55;
}
.activity {
  list-style: none;
  display: grid;
  gap: 10px;
}
.activity li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  font-size: var(--fs-13);
  color: var(--ink-2);
}
.activity li span:last-child {
  color: var(--ink-4);
  font-size: var(--fs-12);
  white-space: nowrap;
}


/* people: the roles grid (people by games, each cell a role picker) */
.role-grid {
  --rg-cols: minmax(120px, 1.2fr) repeat(4, minmax(96px, 1fr)) 108px;
  overflow: hidden;
}
.rg-row {
  display: grid;
  grid-template-columns: var(--rg-cols);
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 16px;
}
.rg-row + .rg-row {
  box-shadow: inset 0 1px 0 var(--line);
}
.rg-row[aria-current='true'] {
  background: var(--surface-2);
}
.rg-row.is-head {
  min-height: 44px;
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--ink-4);
  line-height: 1.25;
}
.rg-row.is-head > span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.rg-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 600;
}
.rg-person:hover b {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rg-cell {
  min-width: 0;
}
.rg-who {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}
.rg-who span {
  font-size: var(--fs-12);
  font-weight: 400;
  color: var(--ink-3);
}
.rg-last {
  font-size: var(--fs-12);
  color: var(--ink-3);
  text-align: right;
  white-space: nowrap;
}
.rg-row.is-head .rg-last {
  justify-content: flex-end;
}
.role-pick {
  position: relative;
  gap: 3px;
  height: 24px;
  padding: 0 5px 0 8px;
  cursor: pointer;
}
.role-pick::after {
  content: '';
  position: absolute;
  inset: -8px -4px;
}
.role-pick .i {
  opacity: 0.7;
}
.role-pick.is-none {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--r-1);
  font-size: var(--fs-12);
  font-weight: 560;
  color: var(--ink-4);
  box-shadow: inset 0 0 0 1px var(--line);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
}
.rg-row:hover .role-pick.is-none,
.role-pick.is-none:focus-visible {
  opacity: 1;
}
@media (pointer: coarse) {
  .role-pick.is-none {
    opacity: 1;
  }
}
@media (max-width: 1279px) and (min-width: 721px) {
  .role-grid {
    --rg-cols: minmax(110px, 1.2fr) repeat(4, minmax(96px, 1fr)) 100px;
  }
}
@media (max-width: 720px) {
  .rg-row.is-head {
    display: none;
  }
  .rg-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 14px 16px;
  }
  .rg-person {
    grid-column: 1;
  }
  .rg-last {
    grid-column: 2;
    grid-row: 1;
  }
  .rg-cell {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-left: 38px;
    font-size: var(--fs-13);
    color: var(--ink-2);
  }
  .rg-cell::before {
    content: attr(data-game);
  }
  .rg-cell.is-none {
    display: none;
  }
}

/* ---------------------------------------------------------------- responsive (theme.css "screens on tablets and phones") */
@media (max-width: 1279px) {
  .people-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .person-panel {
    position: static;
  }
  .roles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .subnav {
    position: static;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .subnav::-webkit-scrollbar {
    display: none;
  }
  .subnav a,
  .subnav button {
    flex: none;
    min-height: 32px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px var(--line-2);
    white-space: nowrap;
  }
  .set {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 24px 0;
  }
}
@media (max-width: 720px) {
  .roles {
    grid-template-columns: minmax(0, 1fr);
  }
  .person {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .person .last {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }
}

/* ---------------------------------------------------------------- built on the screens above */
/* buttons that read as rows */
button.person,
button.rg-person,
button.set-person {
  width: 100%;
  text-align: left;
}
button.person:hover {
  background: var(--hover);
}
.person .body b .t-tiny {
  font-weight: 500;
}
.person .body b .label {
  font-size: var(--fs-12);
}
.people-main {
  min-width: 0;
}
.removed-list {
  margin-top: 8px;
}
.fold-btn > .i,
.pp-fold > summary > .i,
.limits > summary > .i {
  transition: rotate var(--t-med) var(--ease);
}
.fold-btn[aria-expanded='true'] > .i,
.pp-fold[open] > summary > .i,
.limits[open] > summary > .i {
  rotate: 90deg;
}

/* the role grid scrolls inside itself when the games don't fit */
.rg-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
}
.rg-rows {
  min-width: var(--rg-min, 0);
}
.rg-row.is-head > span .trunc {
  min-width: 0;
}
.rg-person-cell {
  min-width: 0;
}
button.rg-person {
  width: auto;
  max-width: 100%;
  border-radius: var(--r-2);
}
.rg-person b {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-pick.label:hover {
  box-shadow: inset 0 0 0 1px oklch(var(--tone-dot-l) calc(var(--tone-dot-c) * var(--chroma)) var(--h) / 0.6);
}
.role-pick.is-inherited {
  background: none;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--ink-3);
}
.role-pick.is-none:hover {
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
@media (max-width: 720px) {
  .rg-rows {
    min-width: 0;
  }
  .rg-person-cell {
    grid-column: 1;
  }
}

/* a neutral mark for "every other game" */
.mark.every-mark {
  color: var(--ink-3);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
}

/* the person panel */
.pp-id {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.pp-id h2 {
  overflow-wrap: anywhere;
}
.pp-head > .label,
.pp-head > .status {
  align-self: flex-start;
  margin-top: 4px;
}
.pp-sec h3 .count {
  margin-left: 0;
}
.pp-sec h3 .btn {
  margin-left: auto;
}
.pp-sec .grant-row + .grant-row {
  box-shadow: inset 0 1px 0 var(--line);
}
.device .body b {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.device .body span {
  overflow-wrap: anywhere;
}
.device > .btn {
  flex: none;
}
.pp-link {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 4px 12px;
  padding: 10px 0;
}
.pp-link > .i {
  margin-top: 2px;
}
.pp-acts {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: -10px;
}
.link-edit {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 0 2px;
}
.link-edit .btn-row {
  grid-column: 1 / -1;
}
.pp-fold > summary,
.limits > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  font-size: var(--fs-13);
  font-weight: 560;
  color: var(--ink-3);
  cursor: pointer;
  list-style: none;
  border-radius: var(--r-2);
}
.pp-fold > summary::-webkit-details-marker,
.limits > summary::-webkit-details-marker {
  display: none;
}
.pp-fold > summary:hover,
.limits > summary:hover {
  color: var(--ink);
}
.pp-new {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.limits {
  width: 100%;
}
.limits-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 8px 0 4px;
}
.limits-fields .t-tiny {
  grid-column: 1 / -1;
}

/* a sign-in link, shown once */
.link-once {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r-4);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.link-once-h {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-14);
}
.link-once-h > .i {
  color: oklch(var(--tone-ink-l) var(--tone-ink-c) var(--hue-green));
}
.link-once-h .btn {
  margin-left: auto;
}
.link-once .link-box {
  background: var(--surface);
}
.link-box > span {
  cursor: text;
  user-select: all;
}
.link-warn {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: var(--fs-12);
  color: oklch(var(--tone-ink-l) var(--tone-ink-c) var(--hue-amber));
  text-wrap: pretty;
}
.link-warn .i {
  margin-top: 2px;
}

/* a button asking "are you sure?" */
.btn.is-armed {
  --h: var(--hue-red);
  color: oklch(var(--tone-ink-l) var(--tone-ink-c) var(--h));
  background: oklch(var(--tone-dot-l) var(--tone-dot-c) var(--h) / var(--tone-fill-a));
  box-shadow: inset 0 0 0 1px oklch(var(--tone-dot-l) var(--tone-dot-c) var(--h) / 0.4);
}

/* the invite dialog */
.invite-dialog .grant-row {
  padding: 2px 0;
}
.set-row.is-tight {
  min-height: 44px;
  padding: 0;
}

/* what someone did: by day (the drawer, You), or the newest few (the People panel) */
.history {
  display: grid;
  gap: 16px;
}
.history-day {
  display: grid;
  gap: 4px;
}
.history-day h4 {
  font-size: var(--fs-12);
  font-weight: 650;
  color: var(--ink-3);
}
.history-list {
  list-style: none;
  display: grid;
}
.history-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 6px 0;
  font-size: var(--fs-14);
  color: var(--ink-2);
}
.history-row + .history-row {
  box-shadow: inset 0 1px 0 var(--line);
}
.history-ico {
  display: grid;
  place-items: center;
  height: 21px;
  color: var(--ink-4);
}
.history-main {
  min-width: 0;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.history-link:hover,
.activity a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.history-time {
  font-size: var(--fs-12);
  color: var(--ink-4);
  padding-top: 2px;
}
.history-more {
  justify-self: start;
}
.history.is-compact .activity li > :first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* the person drawer */
.person-sheet .sheet-head .grow {
  gap: 8px;
}
.person-sheet .sheet-head .avatar {
  margin-top: 2px;
}

/* game settings */
.settings-page .set-list {
  min-width: 0;
}
.subnav button {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: var(--r-2);
  font-size: var(--fs-14);
  color: var(--ink-3);
  text-align: left;
  transition-property: background-color, color;
  transition-duration: var(--t-fast);
}
.subnav button:hover {
  background: var(--hover);
  color: var(--ink);
}
.subnav button[aria-current='true'] {
  background: var(--surface-3);
  color: var(--ink);
  font-weight: 560;
}
.set-intro h2:focus {
  outline: none;
}
.field > label > span {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--ink-2);
}
.field > label {
  display: grid;
}
.set-card {
  padding: 4px 16px;
}
.set-card-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-height: 48px;
  padding: 8px 0;
  box-shadow: inset 0 -1px 0 var(--line);
}
.set-card-h .t-tiny {
  margin-left: auto;
}
.set-row > .i {
  color: var(--ink-3);
}
.set-row .body span {
  overflow-wrap: anywhere;
}
button.set-person {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 2px;
  border-radius: var(--r-2);
}
button.set-person b {
  font-weight: 600;
}
button.set-person span {
  font-size: var(--fs-13);
  color: var(--ink-3);
}
button.set-person:hover b {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.limit-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 12px 16px;
}
.limit-fields .field {
  align-content: start;
}
.limit-fields .btn {
  justify-self: start;
}
.radio-cards {
  display: grid;
  gap: 10px;
}
.radio-card b {
  font-weight: 600;
}
.radio-card .status {
  justify-self: end;
}
.set-writes {
  padding: 6px 0;
  box-shadow: inset 0 1px 0 var(--line);
}
.set-pre {
  margin: 4px 0 8px;
  padding: 10px 12px;
  border-radius: var(--r-3);
  background: var(--surface-2);
  font: 12px/1.55 var(--font-mono);
  color: var(--ink-2);
  overflow-x: auto;
  white-space: pre;
}
.set-notes {
  list-style: none;
  display: grid;
  gap: 4px;
  padding: 8px 0;
  font-size: var(--fs-13);
  color: var(--ink-2);
  box-shadow: inset 0 1px 0 var(--line);
}
.set-notes li {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.set-notes .dot {
  flex: none;
  translate: 0 -1px;
}

/* you */
.me-id {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.me-id .t-small {
  margin-top: 4px;
}
.me-rows,
.me-devices {
  padding: 4px 16px;
}
.me-devices .pp-fold {
  padding: 4px 0 8px;
}
.me-history {
  padding: 16px 18px;
}
.me-note {
  padding: 18px 20px;
}
.me-page .section:first-of-type {
  margin-top: 8px;
}

@media (max-width: 720px) {
  .limits-fields,
  .link-edit,
  .limit-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .radio-card .status {
    grid-column: 2 / -1;
    justify-self: start;
  }
  .set-row {
    flex-wrap: wrap;
  }
  .set-row .body {
    flex-basis: 160px;
  }
  .grant-row .name {
    flex-basis: calc(100% - 40px);
  }
}
.field small { display: block; }
