:root {
  --font-ui:
    system-ui,
    -apple-system,
    sans-serif;
  --font-mono:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  --paper: #f7f7f4;
  --surface: #fff;
  --ink: #242623;
  --muted: #62665f;
  --rule: #dadcd6;
  --field-rule: #92968e;
  --wash: #efefeb;
  --accent: #405d75;
  --selected: #e6ecf0;
  --danger: #a5262b;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.5 var(--font-ui);
  accent-color: var(--accent);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration: underline;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
header {
  min-height: 56px;
  background: var(--surface);
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 8px 28px;
}
header a {
  text-decoration: none;
}
header > a + a {
  border-left: 1px solid var(--rule);
  padding-left: 18px;
  font-size: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 10px;
  font: 600 23px/1 var(--font-ui);
  letter-spacing: -.04em;
  white-space: nowrap;
}
.brand img {
  display: block;
  flex: none;
  width: 36px;
  height: 36px;
}
.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-tools .identity {
  margin-left: 0;
}
.identity {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}
.identity button {
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 8px;
}
.layout {
  display: flex;
  min-height: calc(100vh - 56px);
}
.sidebar-toggle:not([hidden]) {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--rule);
}
.sidebar-toggle:hover {
  background: var(--wash);
}
.sidebar-toggle span {
  width: 17px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}
.sidebar-toggle span::before {
  content: "";
  display: block;
  width: 5px;
  height: 100%;
  border-right: 1px solid currentColor;
}
.sidebar-toggle[aria-expanded="true"] span::before {
  background: currentColor;
}
#project-navigation[hidden] {
  display: none;
}
nav {
  background: var(--wash);
  width: 216px;
  flex-shrink: 0;
  padding: 24px 10px;
  border-right: 1px solid var(--rule);
}
nav a {
  display: block;
  text-decoration: none;
  padding: 4px 12px;
  font-size: 14px;
}
nav a[aria-current] {
  background: var(--selected);
  color: var(--accent);
  box-shadow: inset 2px 0 var(--accent);
  font-weight: 650;
}
nav .ey {
  margin: 20px 12px 4px;
}
.nav-tree,
.nav-tree-scenes {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-tree {
  margin: 2px 0 4px 10px;
  padding-left: 4px;
  border-left: 1px solid var(--rule);
}
.nav-tree-row {
  display: flex;
  align-items: center;
  min-width: 0;
}
.nav-tree-toggle,
.nav-tree-spacer {
  width: 18px;
  flex: none;
}
.nav-tree-toggle {
  display: grid;
  place-items: center;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.nav-tree-toggle:hover {
  color: var(--ink);
  background: var(--selected);
}
.nav-tree-toggle svg {
  display: block;
  transition: transform .12s ease;
}
.nav-tree-toggle[aria-expanded="false"] svg {
  transform: rotate(-90deg);
}
.nav-tree-toggle:focus-visible,
.nav-tree-link:focus-visible {
  outline-offset: 1px;
}
.nav-tree-link {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex: 1;
  min-width: 0;
  padding: 3px 6px 3px 4px;
  font-size: 13px;
  line-height: 1.35;
}
.nav-tree-scenes {
  margin: 1px 0 3px 9px;
  padding-left: 7px;
  border-left: 1px solid var(--rule);
}
.nav-tree-scenes[hidden] {
  display: none;
}
.nav-tree-scene {
  padding: 2.5px 6px;
  font-size: 12.5px;
}
.nav-scene-code {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--muted);
}
.nav-tree-link[aria-current] .nav-scene-code {
  color: var(--accent);
}
.nav-tree-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-tooltip {
  position: fixed;
  z-index: 40;
  max-width: min(320px, calc(100vw - 24px));
  padding: 5px 9px;
  background: var(--ink);
  color: var(--surface);
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  pointer-events: none;
  box-shadow: 0 3px 10px #18191830;
}
.nav-tooltip[hidden] {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .nav-tree-toggle svg {
    transition: none;
  }
}
.ey {
  text-transform: uppercase;
  letter-spacing: .13em;
  font-family: var(--font-mono);
  font-weight: 550;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 9px;
}
main {
  width: 100%;
  min-width: 0;
  max-width: 1380px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 60px);
}
h1,
h2 {
  font-family: var(--font-ui);
  letter-spacing: -.04em;
  font-weight: 600;
  line-height: 1.15;
  margin: 12px 0 18px;
  overflow-wrap: anywhere;
}
h1 {
  font-size: clamp(30px, 4vw, 48px);
}
h2 {
  font-size: clamp(21px, 2.4vw, 28px);
}
small {
  display: block;
  color: var(--muted);
}
.row,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.row {
  justify-content: space-between;
  margin-bottom: 18px;
}
.primary,
.button {
  border: 1px solid var(--rule);
  padding: 9px 15px;
  text-decoration: none;
  display: inline-block;
  background: var(--surface);
  font-weight: 550;
  font-size: 15px;
}
.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.primary:hover {
  background: #40433f;
  text-decoration: none;
}
.button:hover,
.identity button:hover,
.board-icon:hover {
  background: var(--wash);
  text-decoration: none;
}
.button {
  background: transparent;
}
.fields {
  display: grid;
  gap: 16px;
}
.fields label {
  display: grid;
  gap: 5px;
  font-size: 14px;
  font-weight: 600;
}
.fields input:not([type=checkbox]):not([type=radio]),
textarea,
select {
  background: var(--surface);
  border: 1px solid var(--field-rule);
  padding: 10px;
  width: 100%;
}
textarea {
  resize: vertical;
  min-height: 72px;
}
.fields fieldset {
  border: 1px solid var(--rule);
}
.fields fieldset label {
  display: block;
}
.fields button {
  justify-self: start;
}
.under {
  display: inline-block;
  margin-top: 22px;
}
.auth {
  max-width: 940px;
  margin: 5vh auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--rule);
  overflow: hidden;
  background: var(--surface);
}
.auth section {
  padding: clamp(24px, 4vw, 52px);
}
.auth h1 {
  font-size: clamp(30px, 4vw, 40px);
}
.photo {
  background: #a69d80 url(cuisine.jpg) center/cover;
}
.projectphoto {
  height: 170px;
}
.hero {
  min-height: clamp(220px, 24vw, 355px);
  display: flex;
  align-items: end;
  overflow: hidden;
}
.hero > div {
  width: 100%;
  padding: 27px 32px;
  color: white;
  background: linear-gradient(transparent, #171817eb);
}
.hero .ey {
  color: white;
}
.hero h1 {
  margin: 0 0 8px;
}
.columns {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 26px;
}
.columns section + section {
  padding-left: 22px;
  border-left: 1px solid var(--rule);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr));
  gap: 18px;
}
.card,
.empty {
  background: var(--surface);
  border: 1px solid var(--rule);
}
.project {
  overflow: hidden;
  text-decoration: none;
}
.pad,
.empty {
  padding: 24px;
}
.empty {
  margin-top: 22px;
}
.narrow {
  max-width: 760px;
}
.entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 3px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.body,
.entry strong,
.project p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.notice {
  padding: 12px 16px;
  background: var(--selected);
  border-left: 3px solid var(--accent);
}
.actions {
  margin: 10px 0;
}
@media (max-width: 720px) {
  header {
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .brand {
    gap: 8px;
    font-size: 20px;
  }
  header > a + a {
    padding-left: 10px;
  }
  .header-tools {
    flex-basis: 100%;
    justify-content: flex-end;
    gap: 10px;
  }
  .identity {
    font-size: 12px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .layout {
    display: block;
  }
  nav {
    width: auto;
    display: flex;
    align-items: center;
    overflow: auto;
    white-space: nowrap;
    padding: 8px;
    border-bottom: 1px solid var(--rule);
  }
  nav .ey,
  nav .nav-tree {
    display: none;
  }
  main {
    padding: 22px 16px;
  }
  .auth,
  .columns {
    grid-template-columns: 1fr;
  }
  .auth {
    margin: 0 auto;
  }
  .photo {
    height: 145px;
  }
  .columns section + section {
    border: 0;
    padding: 0;
  }
  .hero > div {
    padding: 18px;
  }
}
.hero {
  position: relative;
  background: var(--muted);
}
.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero > div {
  position: relative;
  padding-top: 48px;
  overflow-wrap: anywhere;
}
.projectphoto {
  display: block;
  width: 100%;
  object-fit: cover;
}
.cover-form {
  margin-top: 16px;
  scroll-margin-top: 16px;
}
.fields .cover-picker {
  margin: 0;
  min-width: 0;
  padding: 12px;
}
.cover-picker legend {
  font-weight: 650;
}
.cover-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(135px, 100%), 1fr));
  gap: 8px;
}
.fields .cover-options label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--rule);
  padding: 6px;
  cursor: pointer;
}
.cover-options label:has(:checked) {
  background: var(--selected);
  border-color: var(--accent);
}
.cover-picker input[type=radio] {
  width: auto;
  accent-color: var(--accent);
  margin: 0;
}
.cover-options img {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  aspect-ratio: 2;
  object-fit: cover;
}
.cover-import {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}
.cover-preview {
  width: min(100%, 320px);
  aspect-ratio: 2;
  object-fit: cover;
}
.rich-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}
.rich-editor [hidden] {
  display: none;
}
.rich-editor .toastui-editor-defaultUI {
  background: var(--surface);
  border-color: var(--rule);
}
.rich-editor .toastui-editor-defaultUI-toolbar {
  padding: 0 6px;
}
.rich-editor .toastui-editor-popup input {
  width: 100%;
}
.rich-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rich-editor dialog {
  width: min(92vw, 480px);
  border: 1px solid var(--rule);
  color: var(--ink);
}
.rich-editor dialog::backdrop {
  background: #18191870;
}
.rich-editor dialog label + label {
  margin-top: 12px;
}
.rich-video {
  display: block;
  width: min(100%, 720px);
  aspect-ratio: 16/9;
  border: 0;
  margin: 12px 0;
  background: var(--ink);
}
.moodboard-create {
  display: flex;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
}
.moodboard-create label {
  display: block;
  font-weight: 600;
}
.moodboard-create input {
  width: min(100%, 360px);
  display: block;
  margin-top: 6px;
  border: 1px solid var(--field-rule);
  padding: 8px 10px;
}
.moodboard-list,
.moodboard-gallery {
  margin-top: 24px;
}
.moodboard-list h2 {
  margin-top: 0;
  overflow-wrap: anywhere;
}
.board-placeholder {
  height: 170px;
  display: grid;
  place-items: center;
  background: var(--selected);
  color: var(--muted);
  font-size: 36px;
}
.moodboard-gallery {
  columns: 225px;
  column-gap: 16px;
  list-style: none;
  padding: 0;
}
.moodboard-pin {
  display: inline-block;
  width: 100%;
  position: relative;
  margin-bottom: 16px;
}
.moodboard-pin a,
.moodboard-pin img {
  display: block;
}
.moodboard-pin img {
  width: 100%;
  height: auto;
}
.moodboard-mosaic-wrap {
  container-type: inline-size;
  margin-top: 24px;
}
.moodboard-mosaic {
  --mosaic-cols: 6;
  --mosaic-gap: 4px;
  display: grid;
  grid-template-columns: repeat(var(--mosaic-cols), minmax(0, 1fr));
  grid-auto-rows: calc((100cqi - (var(--mosaic-cols) - 1) * var(--mosaic-gap)) / var(--mosaic-cols));
  grid-auto-flow: dense;
  gap: var(--mosaic-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}
.moodboard-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  min-block-size: 0;
  background: var(--wash);
  grid-column: span 2;
  grid-row: span 2;
}
.moodboard-tile[data-format="landscape"] {
  grid-column: span 3;
  grid-row: span 2;
}
.moodboard-tile[data-format="portrait"] {
  grid-column: span 2;
  grid-row: span 3;
}
.moodboard-tile:has(.pin-menu[open]) {
  z-index: 3;
}
.moodboard-tile:has(.media-video) {
  background: var(--surface);
  border: 1px solid var(--rule);
}
.moodboard-tile-media {
  flex: 1 1 auto;
  min-block-size: 0;
  overflow: hidden;
}
.moodboard-tile-media > a {
  display: block;
  inline-size: 100%;
  block-size: 100%;
}
.moodboard-tile-media > a:focus-visible {
  outline-offset: -3px;
}
.moodboard-tile-media img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: center;
}
.moodboard-tile-media .media-video {
  inline-size: 100%;
  block-size: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.moodboard-tile-media .media-video > p {
  margin: 0;
  padding: 12px 50px 12px 12px;
  overflow-wrap: anywhere;
}
.moodboard-tile-media .media-video > p:has(.rich-video) {
  padding: 0;
  block-size: 100%;
}
.moodboard-tile-media .rich-video {
  inline-size: 100%;
  block-size: 100%;
  aspect-ratio: auto;
  margin: 0;
}
@media (max-width: 600px) {
  .moodboard-mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
  }
  .moodboard-tile,
  .moodboard-tile[data-format="portrait"] {
    grid-column: span 1;
    grid-row: auto;
  }
  .moodboard-tile[data-format="landscape"] {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .moodboard-tile .moodboard-tile-media {
    aspect-ratio: 1;
  }
  .moodboard-tile[data-format="landscape"] .moodboard-tile-media {
    aspect-ratio: 3 / 2;
  }
  .moodboard-tile[data-format="portrait"] .moodboard-tile-media {
    aspect-ratio: 2 / 3;
  }
}
.moodboard-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}
.moodboard-heading h1 {
  margin-bottom: 0;
}
.board-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}
.pin-menu {
  position: absolute;
  top: 8px;
  right: 8px;
}
.pin-menu.pin-menu-inline {
  position: relative;
  top: auto;
  right: auto;
  flex: none;
}
.pin-menu[open] {
  z-index: 20;
}
.pin-menu .board-icon {
  width: 30px;
  height: 30px;
  font-size: 15px;
  background: #fffffff2;
}
.pin-menu.pin-menu-header .board-icon {
  width: 38px;
  height: 38px;
  font-size: 18px;
  background: var(--surface);
}
.pin-menu summary::-webkit-details-marker {
  display: none;
}
.pin-actions {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 164px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: 0 3px 12px #202c242b;
  z-index: 25;
}
.pin-actions a,
.pin-actions button {
  text-decoration: none;
  white-space: nowrap;
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  background: transparent;
  border: 0;
  font-size: 14px;
}
.pin-actions a:hover,
.pin-actions button:hover {
  background: var(--wash);
}
.entry-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--rule);
}
.entry-row > .entry-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 3px;
  text-decoration: none;
}
.entry-row > .entry-link strong {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.entry-row:has(.pin-menu[open]) {
  position: relative;
  z-index: 10;
}
.card-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}
.card-wrap > .card {
  flex: 1;
}
.card-wrap:has(.pin-menu[open]) {
  z-index: 10;
}
.delete-dialog p {
  margin: 10px 0 0;
}
.delete-cascade-warning {
  margin-top: 14px;
  padding: 12px 14px;
  background: #faefee;
  border-left: 3px solid var(--danger);
  font-size: 14px;
}
.delete-cascade-warning p {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--danger);
}
.delete-cascade-warning ul,
.delete-preserved-note ul {
  margin: 0;
  padding-left: 18px;
}
.delete-preserved-note {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--wash);
  border-left: 3px solid var(--field-rule);
  color: var(--muted);
  font-size: 13.5px;
}
.delete-dialog .actions {
  margin: 18px 0 0;
}
.danger-button:hover {
  background: #871e22;
  border-color: #871e22;
}
.danger-text {
  color: var(--danger);
}
.danger-button {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.board-dialog {
  width: min(92vw, 480px);
  padding: 24px;
  border: 1px solid var(--rule);
  color: var(--ink);
}
.board-dialog::backdrop {
  background: #18191870;
}
.board-dialog h2 {
  margin: 0;
}
.board-dialog [hidden] {
  display: none;
}
.fields input,
.fields select,
.fields textarea,
.moodboard-create input,
button {
  border-radius: 0;
}
.notice[role=alert] {
  border-color: var(--danger);
  background: #faefee;
}
.under,
.actions > a:not([class]),
.document-actions > a:first-child {
  color: var(--accent);
}
.rich-editor .toastui-editor-defaultUI,
.rich-editor .toastui-editor-defaultUI-toolbar {
  border-radius: 0;
}
.rich-editor .toastui-editor-defaultUI-toolbar {
  background: var(--wash);
  border-color: var(--rule);
}

.hero .pin-menu { z-index: 1; }
.project-heading .button { margin-top: 12px; }
.project-overview {
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 10px;
}
.section-heading h2 {
  margin: 0;
}
.section-heading .actions {
  margin: 0;
}
.create-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.create-button:hover {
  background: #40433f;
  border-color: #40433f;
  text-decoration: none;
}
.create-button-compact {
  width: 34px;
  height: 34px;
  border-color: var(--field-rule);
  background: var(--surface);
  color: var(--ink);
  font-size: 22px;
}
.create-button-compact:hover {
  background: var(--wash);
  border-color: var(--ink);
}
.create-dialog {
  background: var(--surface);
}
.create-dialog-wide {
  width: min(92vw, 720px);
}
.dialog-lead {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 14px;
}
.dialog-list {
  margin: 0 0 14px;
  max-height: min(55vh, 380px);
  overflow-y: auto;
  border-top: 1px solid var(--rule);
}
.dialog-list .entry {
  padding: 12px 4px;
}
.dialog-list .entry:hover {
  background: var(--wash);
  text-decoration: none;
}
.create-dialog .actions {
  margin: 16px 0 0;
}
.create-dialog .reference-media-sources {
  margin-top: 16px;
}
.create-dialog .reference-media-sources > form {
  min-inline-size: 0;
  align-content: start;
}

.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;
}

.team-section {
  margin-top: 28px;
}

.team-section + .team-section {
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.team-confirm,
.role-editor-card {
  margin: 16px 0 20px;
  scroll-margin-top: 16px;
}

.team-confirm h3,
.role-editor-card h3,
.role-card h3 {
  margin: 0 0 6px;
  font-size: 19px;
  letter-spacing: -.02em;
}

.team-members {
  border-top: 1px solid var(--rule);
}

.team-member-row {
  flex-wrap: wrap;
  gap: 14px;
}

.team-member-info {
  display: grid;
  gap: 2px;
  min-width: 220px;
}

.team-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.team-member-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.team-role-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.team-role-form select {
  width: auto;
  min-width: 170px;
  padding: 7px 10px;
  font-size: 14px;
}

.team-role-form .button,
.team-member-controls > .button {
  padding: 7px 12px;
  font-size: 14px;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  border: 1px solid var(--rule);
  white-space: nowrap;
}

.role-pill-write {
  background: var(--selected);
  border-color: var(--accent);
  color: var(--accent);
}

.role-pill-read {
  background: var(--surface);
  border-color: var(--field-rule);
  color: var(--ink);
}

.role-pill-none {
  background: var(--wash);
  border-style: dashed;
  border-color: var(--rule);
  color: var(--muted);
}

.role-cards {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.role-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

.role-card-header .actions {
  margin: 0;
}

.role-card-header .button {
  padding: 6px 12px;
  font-size: 14px;
}

.role-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 18px;
  margin-top: 16px;
}

.role-summary-group .ey {
  margin-bottom: 8px;
}

.role-summary-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.role-summary-group li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

.role-matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: var(--surface);
}

.role-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.role-matrix th,
.role-matrix td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}

.role-matrix thead th {
  background: var(--wash);
  font-weight: 600;
  font-size: 13px;
}

.role-matrix tbody th[scope="row"],
.role-matrix thead th:first-child {
  text-align: left;
  font-weight: 500;
}

.role-matrix thead th:first-child {
  font-weight: 600;
}

.role-matrix-group th {
  text-align: left;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 12px;
  padding-bottom: 6px;
}

.role-matrix tbody tr:last-child th,
.role-matrix tbody tr:last-child td {
  border-bottom: 0;
}

.fields .role-radio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  cursor: pointer;
}

.role-radio input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.role-admin-options {
  padding: 12px 14px;
  margin: 0;
}

.role-admin-options legend {
  font-weight: 600;
  font-size: 14px;
  padding: 0 4px;
}

.fields .role-admin-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin-top: 8px;
}

.role-admin-options input[type="checkbox"] {
  width: auto;
  margin: 0;
}
