:root {
  --paper: #f6f0e6;
  --paper-deep: #ebe1d2;
  --ink: #24231f;
  --ink-soft: #615d55;
  --rust: #a54f32;
  --rust-dark: #7d3924;
  --sage: #60705a;
  --brass: #c69a55;
  --line: rgba(36, 35, 31, 0.16);
  --border: var(--line);
  --muted: var(--ink-soft);
  --white: #fffdf8;
  --shadow: 0 24px 70px rgba(65, 48, 32, 0.12);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 12% 9%,
      rgba(198, 154, 85, 0.18),
      transparent 27rem
    ),
    linear-gradient(
      115deg,
      transparent 49.85%,
      rgba(36, 35, 31, 0.035) 50%,
      transparent 50.15%
    ),
    var(--paper);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.icon-sprite {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
}

.auth-story {
  position: relative;
  min-height: 100vh;
  padding: clamp(2rem, 6vw, 6.5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.auth-story::before {
  content: "";
  position: absolute;
  width: min(44vw, 680px);
  aspect-ratio: 1;
  right: -16%;
  bottom: -24%;
  border: 1px solid rgba(165, 79, 50, 0.22);
  border-radius: 50%;
  box-shadow:
    0 0 0 46px rgba(165, 79, 50, 0.035),
    0 0 0 92px rgba(165, 79, 50, 0.025);
}

.auth-story::after {
  content: "家庭 / 记录 / 设备";
  position: absolute;
  right: 2.5rem;
  top: 46%;
  writing-mode: vertical-rl;
  letter-spacing: 0.38em;
  font-size: 0.68rem;
  color: rgba(36, 35, 31, 0.42);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.brand-lockup.compact {
  align-items: flex-start;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.brand-lockup.compact b {
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.brand-mark {
  position: relative;
  width: 3rem;
  aspect-ratio: 1;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 32% 32% 38% 38%;
  background: var(--rust);
  box-shadow: inset 0 -8px 18px rgba(54, 24, 14, 0.22);
}

.brand-mark.small {
  width: 2.4rem;
}

.horn {
  position: absolute;
  top: 0.5rem;
  width: 0.72rem;
  height: 0.98rem;
  border: 2px solid var(--white);
  border-bottom: 0;
  border-radius: 1rem 1rem 0 0;
}

.horn-left {
  left: 0.68rem;
  transform: rotate(-20deg);
}

.horn-right {
  right: 0.68rem;
  transform: rotate(20deg);
}

.book-mark {
  width: 1.45rem;
  height: 0.8rem;
  border: 2px solid var(--white);
  border-top: 0;
  border-radius: 0 0 0.7rem 0.7rem;
}

.book-mark::after {
  content: "";
  display: block;
  height: 2px;
  width: 70%;
  margin: 0.28rem auto 0;
  background: var(--white);
}

.story-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 47rem;
  margin: auto 0;
}

.eyebrow,
.section-kicker,
.folio {
  margin: 0;
  color: var(--rust);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.story-copy h1 {
  margin: 1rem 0 1.5rem;
  max-width: 12ch;
  font-family: var(--serif);
  font-size: clamp(3rem, 6.2vw, 7.4rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.story-lead {
  width: 100%;
  max-width: 34rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 1.25vw, 1.16rem);
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.story-rule {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 2rem auto 2rem auto 2rem auto;
  align-items: center;
  gap: 0.8rem;
  max-width: 42rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.story-rule span {
  font-family: var(--mono);
  color: var(--rust);
  font-size: 0.7rem;
}

.story-rule p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    linear-gradient(rgba(255, 253, 248, 0.88), rgba(255, 253, 248, 0.88)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 31px,
      rgba(36, 35, 31, 0.035) 32px
    );
}

.auth-panel-inner {
  width: min(100%, 26rem);
  animation: settle 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.auth-panel h2 {
  margin: 0.75rem 0 0.45rem;
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 500;
}

.auth-hint {
  margin: 0 0 2rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.field {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.field span {
  color: var(--ink-soft);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.field input {
  width: 100%;
  padding: 0.95rem 0.2rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(36, 35, 31, 0.3);
  border-radius: 0;
  outline: none;
  transition: border-color 180ms ease;
}

.field input:focus {
  border-color: var(--rust);
  box-shadow: 0 1px 0 var(--rust);
}

.field select {
  width: 100%;
  padding: 0.8rem 0.2rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(36, 35, 31, 0.3);
  outline: none;
}

.form-error,
.global-error {
  color: var(--rust-dark);
  font-size: 0.82rem;
  line-height: 1.6;
}

.form-error {
  min-height: 1.3rem;
  margin: 0.8rem 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3rem;
  padding: 0.8rem 1rem;
  border-radius: 0.2rem;
  border: 1px solid transparent;
  font-size: 0.86rem;
  font-weight: 700;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.button-primary {
  width: 100%;
  color: var(--white);
  background: var(--rust);
}

.button-primary:hover {
  background: var(--rust-dark);
}

.button-secondary {
  color: var(--rust);
  border-color: rgba(165, 79, 50, 0.35);
  background: transparent;
}

.security-note {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
  font-size: 0.77rem;
  line-height: 1.6;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
}

.side-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2.1rem 1.7rem;
  border-right: 1px solid var(--line);
  background: rgba(246, 240, 230, 0.74);
  backdrop-filter: blur(16px);
}

.rail-nav {
  display: grid;
  gap: 0.25rem;
  margin-top: clamp(4rem, 13vh, 9rem);
}

.rail-link {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.95rem 0.7rem;
  color: var(--ink-soft);
  border-left: 2px solid transparent;
  text-decoration: none;
  font-size: 0.84rem;
  transition: 160ms ease;
}

.rail-link span {
  color: var(--brass);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.rail-link:hover,
.rail-link.active {
  color: var(--rust);
  border-left-color: var(--rust);
  background: rgba(255, 253, 248, 0.56);
}

.rail-foot {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.rail-foot p {
  margin: 0 0 0.25rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.rail-foot strong {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
}

.text-button {
  display: block;
  margin-top: 0.9rem;
  padding: 0;
  color: var(--rust);
  background: transparent;
  border: 0;
  font-size: 0.78rem;
}

.workspace {
  min-width: 0;
  padding: clamp(1.5rem, 4vw, 4rem);
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 2rem;
}

.workspace-head h1 {
  margin: 0.3rem 0 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.055em;
}

.head-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-bottom: 0.7rem;
}

.updated-at {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.66rem;
}

.icon-button {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.icon-button:hover {
  color: var(--rust);
  border-color: var(--rust);
}

.global-error {
  margin: -0.75rem 0 1.5rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--rust);
  background: rgba(165, 79, 50, 0.08);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(2, minmax(120px, 0.7fr));
  gap: 1rem;
}

.feature-card {
  position: relative;
  grid-row: span 2;
  min-height: 20rem;
  padding: 2rem;
  color: var(--white);
  background:
    linear-gradient(140deg, rgba(36, 35, 31, 0.96), rgba(52, 51, 44, 0.94)),
    var(--ink);
  overflow: hidden;
}

.feature-card::after {
  content: "";
  position: absolute;
  width: 19rem;
  aspect-ratio: 1;
  right: -8rem;
  bottom: -9rem;
  border: 1px solid rgba(246, 240, 230, 0.23);
  border-radius: 50%;
  box-shadow:
    0 0 0 36px rgba(246, 240, 230, 0.035),
    0 0 0 72px rgba(246, 240, 230, 0.025);
}

.feature-index {
  position: absolute;
  right: 1.7rem;
  top: 0.7rem;
  color: rgba(246, 240, 230, 0.09);
  font-family: var(--serif);
  font-size: 8rem;
  line-height: 1;
}

.feature-card .section-kicker {
  color: var(--brass);
}

.feature-card h2 {
  position: relative;
  margin: 7rem 0 1rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.7rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.feature-card > p {
  position: relative;
  max-width: 28rem;
  margin: 0;
  color: rgba(255, 253, 248, 0.68);
  line-height: 1.75;
}

.status-pill {
  position: absolute;
  left: 2rem;
  bottom: 2rem;
  display: flex;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.status-pill span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #9caf8a;
  box-shadow: 0 0 0 5px rgba(156, 175, 138, 0.14);
}

.metric-card {
  min-height: 9.5rem;
  padding: 1.35rem;
  background: rgba(255, 253, 248, 0.68);
  border: 1px solid var(--line);
}

.metric-card > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.metric-card > strong {
  display: block;
  margin: 1rem 0 0.3rem;
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 500;
  line-height: 1;
}

.metric-card > span {
  color: var(--rust);
  font-size: 0.67rem;
  letter-spacing: 0.08em;
}

.metric-wide {
  grid-column: 2 / 4;
}

.record-line {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.7rem;
  margin-top: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.record-line b {
  margin-right: 0.25rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
}

.paper-panel {
  position: relative;
  margin-top: 1.25rem;
  padding: clamp(1.3rem, 3vw, 2.25rem);
  background:
    linear-gradient(rgba(255, 253, 248, 0.93), rgba(255, 253, 248, 0.93)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 35px,
      rgba(36, 35, 31, 0.03) 36px
    );
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.paper-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3.5rem;
  height: 3px;
  background: var(--rust);
}

.panel-intro {
  max-width: 56rem;
  margin: -0.65rem 0 1.5rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.75;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.panel-heading h2 {
  margin: 0.25rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  font-weight: 500;
}

.folio {
  color: rgba(36, 35, 31, 0.2);
  font-size: 2.2rem;
}

.table-wrap {
  overflow-x: auto;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.feishu-integration-card {
  grid-column: 1 / -1;
}

.feishu-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.integration-card {
  display: grid;
  gap: 1rem;
  padding: clamp(1.15rem, 2.5vw, 1.7rem);
  background: rgba(246, 240, 230, 0.55);
  border: 1px solid var(--line);
}

.integration-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.3rem;
}

.integration-head h3 {
  margin: 0.2rem 0 0;
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 500;
}

.integration-card .field {
  margin-top: 0;
}

.quota-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.integration-card select {
  width: 100%;
  padding: 0.9rem 0.2rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(36, 35, 31, 0.3);
  border-radius: 0;
  outline: none;
}

.integration-card select:focus {
  border-color: var(--rust);
}

.field-hint {
  min-height: 1rem;
  margin: -0.55rem 0 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.toggle-row input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--rust);
}

.inline-result {
  margin: 0;
  padding: 0.65rem 0.75rem;
  color: var(--sage);
  background: rgba(96, 112, 90, 0.08);
  font-size: 0.72rem;
  line-height: 1.5;
}

.inline-result.error {
  color: var(--rust-dark);
  background: rgba(165, 79, 50, 0.08);
}

.config-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.2rem;
}

.config-actions .button {
  width: 100%;
  min-height: 2.8rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 1rem 0.8rem;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

td {
  font-size: 0.82rem;
}

.device-name {
  display: grid;
  gap: 0.3rem;
}

.device-name strong {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
}

.device-name span,
.muted {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.device-meta {
  display: grid;
  gap: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.55;
}

.device-meta strong {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.device-meta span {
  font-family: var(--sans);
}

.device-name .device-meta {
  margin-top: 0.15rem;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.72rem;
}

.device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.device-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
}

.device-status::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--sage);
}

.device-status.revoked {
  color: var(--ink-soft);
}

.device-status.revoked::before {
  background: #99958c;
}

.revoke-button {
  padding: 0.45rem 0.65rem;
  color: var(--rust);
  background: transparent;
  border: 1px solid rgba(165, 79, 50, 0.26);
  font-size: 0.7rem;
}

.rename-button {
  padding: 0.45rem 0.65rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 0.7rem;
}

.rename-button:hover {
  color: var(--rust);
  border-color: rgba(165, 79, 50, 0.35);
}

.revoke-button:disabled {
  color: var(--ink-soft);
  border-color: var(--line);
  cursor: not-allowed;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 0.7rem;
  min-height: 8rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.empty-state .icon {
  width: 1.8rem;
  height: 1.8rem;
  color: var(--brass);
}

.audit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.audit-item {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}

.audit-time {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.66rem;
}

.audit-main strong {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
}

.audit-main p {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.audit-target {
  max-width: 18rem;
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 20;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.9rem 1.1rem;
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  animation: toast-in 180ms ease both;
}

.toast.error {
  background: var(--rust-dark);
}

.reveal {
  animation: settle 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.reveal:nth-of-type(2) {
  animation-delay: 60ms;
}

.reveal:nth-of-type(3) {
  animation-delay: 110ms;
}

.reveal:nth-of-type(4) {
  animation-delay: 160ms;
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-story {
    min-height: 52vh;
    padding: 2rem;
  }

  .story-copy h1 {
    font-size: clamp(2.7rem, 10vw, 5rem);
  }

  .story-rule {
    display: none;
  }

  .auth-panel {
    min-height: 48vh;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: relative;
    height: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1.1rem 1.3rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-nav {
    display: flex;
    justify-content: center;
    margin: 0;
    overflow-x: auto;
  }

  .rail-link {
    padding: 0.7rem;
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }

  .rail-link:hover,
  .rail-link.active {
    border-left-color: transparent;
    border-bottom-color: var(--rust);
  }

  .rail-foot {
    margin: 0;
    padding: 0;
    border: 0;
    text-align: right;
  }

  .rail-foot p {
    display: none;
  }

  .text-button {
    margin-top: 0.3rem;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 1.4rem;
  }

  .workspace-head {
    align-items: flex-start;
  }

  .workspace-head h1 {
    font-size: 2.8rem;
  }

  .updated-at {
    display: none;
  }

  .overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .feature-card {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 0;
    padding-bottom: 1.8rem;
  }

  .feature-card .status-pill {
    position: static;
    margin-top: 1.5rem;
  }

  .metric-wide {
    grid-column: 1 / -1;
  }

  .integration-grid {
    grid-template-columns: 1fr;
  }

  .quota-grid {
    grid-template-columns: 1fr;
  }

  .feishu-config-grid {
    grid-template-columns: 1fr;
  }

  .side-rail {
    grid-template-columns: 1fr auto;
  }

  .rail-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    overflow: visible;
  }

  .rail-link {
    justify-content: center;
    padding: 0.7rem 0.2rem;
    font-size: 0.73rem;
  }

  .rail-link span {
    display: none;
  }

  .rail-foot strong {
    display: none;
  }

  .audit-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .audit-target {
    max-width: 100%;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    padding: 1rem 0;
    border-top: 1px solid var(--line);
  }

  td {
    padding: 0.25rem 0;
    border: 0;
  }
}

.segmented-filter {
  display: inline-flex;
  gap: 4px;
  margin: 4px 0 18px;
  padding: 4px;
  background: rgba(235, 225, 210, 0.72);
  border-radius: 999px;
}

.segmented-filter-button {
  padding: 8px 14px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.74rem;
}

.segmented-filter-button span {
  margin-left: 4px;
  font-family: var(--mono);
  font-size: 0.64rem;
}

.segmented-filter-button.active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 2px 8px rgba(65, 48, 32, 0.08);
}

.record-status.blocked {
  color: #8b4d27;
}

.record-status.blocked::before {
  background: #b97a42;
}

.record-status.available {
  color: var(--sage);
}

.record-status.available::before {
  background: var(--sage);
}

.member-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.member-toggle.edit {
  color: var(--sage);
}

.member-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9rem, 0.6fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: rgba(246, 240, 230, 0.72);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.member-edit label {
  display: grid;
  gap: 5px;
}

.member-edit label span {
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 700;
}

.member-edit input,
.member-edit select {
  min-width: 0;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.member-edit-actions {
  display: flex;
  gap: 6px;
}

.secret-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-danger {
  padding: 0;
  color: var(--rust);
  background: transparent;
  border: 0;
  font-size: 0.7rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.audit-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.audit-filter-field {
  display: grid;
  gap: 5px;
  min-width: 12rem;
}

.audit-filter-field span,
.audit-count {
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.audit-filter-field select {
  padding: 8px 30px 8px 10px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.audit-load-more {
  width: auto;
  margin: 14px auto 0;
}

@media (max-width: 720px) {
  .segmented-filter {
    display: flex;
    width: 100%;
  }

  .segmented-filter-button {
    flex: 1;
  }

  .member-edit {
    grid-template-columns: 1fr;
  }

  .member-card-actions {
    justify-content: stretch;
  }

  .member-card-actions .member-toggle {
    flex: 1;
  }

  .audit-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-filter-field {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.role-summary-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.role-summary {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 253, 248, 0.5);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.role-summary:hover {
  transform: translateY(-2px);
  border-color: rgba(165, 79, 50, 0.45);
}

.role-summary.is-selected {
  background: rgba(255, 253, 248, 0.9);
  border-color: var(--rust);
  box-shadow: inset 0 3px 0 var(--rust);
}

.role-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.role-summary-top > span:first-child {
  display: grid;
  gap: 3px;
}

.role-summary-top strong {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
}

.role-summary-top small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.role-summary-copy {
  min-height: 3.8em;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.55;
}

.role-summary-metrics {
  display: flex;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.role-summary-metrics b {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
}

.role-editor {
  margin-top: 20px;
  padding: clamp(18px, 3vw, 28px);
  background:
    linear-gradient(rgba(255, 253, 248, 0.88), rgba(255, 253, 248, 0.88)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 31px,
      rgba(36, 35, 31, 0.03) 32px
    );
  border: 1px solid var(--line);
  border-radius: 18px;
}

#role-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.role-editor-title h3 {
  margin: 6px 0 4px;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.5vw, 3rem);
  font-weight: 500;
}

.role-editor-title > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.role-editor-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 14px;
  max-width: 28rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.role-editor-status .toggle-row {
  width: 100%;
  justify-content: flex-end;
}

.role-editor-error {
  margin: 16px 0 0;
  padding: 12px 14px;
  color: var(--rust-dark);
  background: rgba(165, 79, 50, 0.08);
  border-left: 3px solid var(--rust);
  font-size: 0.78rem;
  line-height: 1.55;
}

.role-editor-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.role-permission-group {
  padding: 16px;
  background: rgba(246, 240, 230, 0.5);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.role-group-head h4 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
}

.role-group-head p {
  margin: 4px 0 14px;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.5;
}

.role-group-controls {
  display: grid;
  gap: 8px;
}

.permission-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 10px 12px;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid transparent;
  border-radius: 10px;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.permission-control:focus-within {
  border-color: rgba(165, 79, 50, 0.5);
}

.permission-control.is-high-risk {
  border-color: rgba(165, 79, 50, 0.2);
}

.permission-copy {
  display: grid;
  gap: 2px;
}

.permission-copy strong {
  font-size: 0.8rem;
  font-weight: 650;
}

.permission-copy small {
  color: var(--ink-soft);
  font-size: 0.68rem;
  line-height: 1.45;
}

.permission-copy em {
  width: fit-content;
  margin-top: 3px;
  padding: 2px 6px;
  color: var(--rust-dark);
  background: rgba(165, 79, 50, 0.08);
  border-radius: 999px;
  font-size: 0.58rem;
  font-style: normal;
  letter-spacing: 0.08em;
}

.permission-toggle {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--rust);
}

.permission-scope-select {
  max-width: 9rem;
  padding: 8px 28px 8px 9px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.7rem;
  outline: none;
}

.permission-scope-select:focus {
  border-color: var(--rust);
}

.role-editor-footer {
  position: sticky;
  z-index: 2;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 18px -8px -8px;
  padding: 14px;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(65, 48, 32, 0.1);
  backdrop-filter: blur(14px);
}

.role-editor-footer strong {
  font-size: 0.8rem;
}

.role-editor-footer p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.role-editor-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.role-editor-actions .button {
  width: auto;
  min-height: 2.75rem;
  white-space: nowrap;
}

.role-editor-save.is-confirming,
.button.is-confirming {
  background: var(--rust-dark);
  box-shadow: 0 0 0 3px rgba(165, 79, 50, 0.16);
}

.join-role,
.join-label,
.join-member,
.join-actor,
.device-role,
.device-actor {
  width: 100%;
  box-sizing: border-box;
  margin: 4px 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
}

.member-create {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(10rem, 0.5fr) auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.member-create .field {
  margin-top: 0;
}

.member-card {
  display: grid;
  gap: 0.45rem;
}

.member-avatar-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.member-avatar-name > span:first-child {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--rust);
  background: rgba(168, 82, 48, 0.1);
  font-family: var(--serif);
  font-size: 1.15rem;
}

.member-actions {
  display: flex;
  justify-content: flex-end;
}

.environment-bar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  box-shadow: 0 8px 24px rgba(55, 42, 28, 0.1);
  font-size: 0.78rem;
}

.environment-bar select {
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  color: var(--ink);
  background: var(--paper-deep);
}

@media (max-width: 720px) {
  .member-create {
    grid-template-columns: 1fr;
  }

  .environment-bar {
    top: auto;
    right: 0.75rem;
    bottom: 0.75rem;
  }
}

/* Admin information architecture refinements */
.app-shell {
  transition: grid-template-columns 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.side-rail {
  transition:
    padding 220ms ease,
    background 160ms ease;
}

.rail-collapse-button {
  position: absolute;
  top: 1.55rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.62);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition:
    color 160ms ease,
    transform 220ms ease,
    background 160ms ease;
}

.rail-collapse-button:hover {
  color: var(--rust);
  background: var(--white);
}

.rail-label {
  font-weight: 500;
}

.sidebar-collapsed .app-shell {
  grid-template-columns: 5.2rem minmax(0, 1fr);
}

.sidebar-collapsed .side-rail {
  padding-inline: 0.85rem;
  overflow: hidden;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .rail-label,
.sidebar-collapsed .rail-foot p,
.sidebar-collapsed .rail-foot strong,
.sidebar-collapsed .rail-foot .text-button {
  display: none;
}

.sidebar-collapsed .brand-lockup {
  justify-content: center;
}

.sidebar-collapsed .rail-collapse-button {
  top: 0.65rem;
  right: 0.55rem;
  transform: rotate(180deg);
}

.sidebar-collapsed .rail-nav {
  margin-top: clamp(4.5rem, 14vh, 9rem);
}

.sidebar-collapsed .rail-link {
  justify-content: center;
  padding-inline: 0.3rem;
}

.sidebar-collapsed .rail-index {
  font-size: 0.74rem;
}

.sidebar-collapsed .rail-foot {
  min-height: 1px;
}

#members-list {
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 1rem;
}

.member-card {
  min-height: 13rem;
  gap: 1.15rem;
  padding: 1.2rem;
  color: var(--ink);
  background: linear-gradient(
    155deg,
    rgba(255, 253, 248, 0.9),
    rgba(246, 240, 230, 0.45)
  );
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 14px 40px rgba(65, 48, 32, 0.055);
}

.member-card.is-disabled {
  opacity: 0.72;
  filter: saturate(0.55);
}

.member-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.member-avatar-name {
  align-items: center;
  gap: 0.85rem;
}

.member-avatar-name > .member-avatar {
  width: 2.9rem;
  height: 2.9rem;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 38%;
  color: var(--rust-dark);
  background:
    radial-gradient(
      circle at 32% 26%,
      rgba(255, 253, 248, 0.95),
      transparent 36%
    ),
    rgba(165, 79, 50, 0.12);
  border: 1px solid rgba(165, 79, 50, 0.16);
  font-family: var(--serif);
  font-size: 1.25rem;
}

.member-title h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.2;
}

.member-title p {
  margin: 0.28rem 0 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.member-card .device-status {
  flex: none;
  padding-top: 0.25rem;
  color: var(--sage);
  font-size: 0.68rem;
}

.member-card .device-status.revoked {
  color: var(--ink-soft);
}

.member-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin: 0;
  padding: 0.9rem 0;
  border-block: 1px solid var(--line);
}

.member-facts div {
  min-width: 0;
}

.member-facts dt {
  margin-bottom: 0.28rem;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.member-facts dd {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
}

.member-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-top: auto;
}

.member-card-foot > span {
  max-width: 13rem;
  color: var(--ink-soft);
  font-size: 0.65rem;
  line-height: 1.5;
}

.member-toggle,
.table-action {
  min-height: 2.2rem;
  padding: 0.45rem 0.75rem;
  color: var(--rust);
  background: transparent;
  border: 1px solid rgba(165, 79, 50, 0.3);
  border-radius: 2px;
  font-size: 0.7rem;
  white-space: nowrap;
}

.member-toggle:hover,
.member-toggle.restore {
  color: var(--rust-dark);
  background: rgba(165, 79, 50, 0.06);
}

.member-toggle.restore {
  color: var(--sage);
  border-color: rgba(96, 112, 90, 0.35);
  background: rgba(96, 112, 90, 0.06);
}

.empty-state {
  grid-template-columns: auto minmax(0, 1fr);
  justify-items: start;
  align-items: center;
  place-items: initial;
  min-height: 7.2rem;
  padding: 1.25rem 1.4rem;
  border: 1px dashed rgba(36, 35, 31, 0.18);
  background: rgba(255, 253, 248, 0.36);
}

.empty-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  color: var(--brass);
  border: 1px solid rgba(198, 154, 85, 0.28);
  border-radius: 50%;
  background: rgba(198, 154, 85, 0.08);
}

.empty-state .icon {
  width: 1.35rem;
  height: 1.35rem;
}

.empty-copy {
  display: grid;
  gap: 0.28rem;
}

.empty-copy strong {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
}

.empty-copy p {
  max-width: 34rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.73rem;
  line-height: 1.6;
}

#joins table,
#devices table {
  border-collapse: separate;
  border-spacing: 0;
}

#joins th,
#devices th {
  padding: 0.75rem 0.9rem;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

#joins td,
#devices td {
  padding: 1.15rem 0.9rem;
}

.device-record,
.join-record {
  transition: background 150ms ease;
}

.device-record:hover,
.join-record:hover {
  background: rgba(255, 253, 248, 0.48);
}

.device-record.is-revoked {
  opacity: 0.66;
}

.device-identity {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.record-glyph {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--rust);
  border: 1px solid rgba(165, 79, 50, 0.2);
  border-radius: 36%;
  background: rgba(165, 79, 50, 0.07);
}

.record-glyph.pending {
  color: var(--brass);
  border-color: rgba(198, 154, 85, 0.3);
  background: rgba(198, 154, 85, 0.08);
}

.record-glyph .icon {
  width: 1rem;
  height: 1rem;
}

.device-name {
  gap: 0.22rem;
}

.device-name strong {
  font-size: 1.05rem;
}

.record-status {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
  color: var(--sage);
  font-size: 0.65rem;
}

.record-status::before {
  content: "";
  width: 0.36rem;
  height: 0.36rem;
  border-radius: 50%;
  background: currentColor;
}

.record-status.revoked {
  color: var(--ink-soft);
}

.record-status.pending {
  color: var(--brass);
}

.record-stack {
  display: grid;
  gap: 0.28rem;
  color: var(--ink-soft);
  font-size: 0.69rem;
  line-height: 1.45;
}

.record-stack strong {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 600;
}

.actor-assignment {
  display: grid;
  gap: 0.35rem;
}

.device-role,
.device-actor,
.join-role,
.join-member,
.join-actor {
  min-height: 2.35rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.58);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 0.72rem;
}

.device-timeline {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.65rem;
}

.device-timeline span {
  display: flex;
  gap: 0.4rem;
}

.device-timeline b {
  min-width: 2.6rem;
  color: var(--ink);
  font-weight: 600;
}

.table-action {
  width: fit-content;
}

.table-action.subtle {
  color: var(--ink-soft);
  border-color: var(--line);
}

.table-action.danger {
  color: var(--rust);
}

.table-action.approve {
  color: var(--white);
  background: var(--rust);
  border-color: var(--rust);
}

.table-action:disabled {
  color: var(--ink-soft);
  background: transparent;
  border-color: var(--line);
  cursor: not-allowed;
}

.request-note {
  max-width: 16rem;
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  font-size: 0.66rem;
  line-height: 1.5;
}

.join-assignment {
  display: grid;
  gap: 0.55rem;
  min-width: 12rem;
}

.assignment-field {
  display: grid;
  gap: 0.25rem;
}

.assignment-field > span {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
}

.request-actions {
  display: grid;
  gap: 0.45rem;
}

@media (max-width: 980px) {
  .rail-collapse-button {
    display: none;
  }

  .sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-collapsed .brand-copy,
  .sidebar-collapsed .rail-label {
    display: initial;
  }

  .sidebar-collapsed .side-rail {
    padding: 1.1rem 1.3rem;
    overflow: visible;
  }

  .sidebar-collapsed .rail-nav {
    margin: 0;
  }

  .sidebar-collapsed .rail-link {
    justify-content: center;
    padding: 0.7rem 0.2rem;
  }

  .sidebar-collapsed .rail-foot .text-button {
    display: block;
  }

  .sidebar-collapsed .rail-foot strong {
    display: initial;
  }
}

@media (max-width: 720px) {
  #members-list {
    grid-template-columns: 1fr;
  }

  .member-card-head {
    align-items: center;
  }

  .member-card-foot {
    align-items: flex-end;
  }

  .sidebar-collapsed .rail-foot strong {
    display: none;
  }

  .empty-state {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  #joins table,
  #devices table {
    min-width: 0;
  }

  #joins tbody,
  #devices tbody {
    display: grid;
    gap: 0.85rem;
  }

  #joins tr,
  #devices tr {
    padding: 1rem;
    border: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.45);
  }

  #joins td,
  #devices td {
    display: grid;
    grid-template-columns: 5.4rem minmax(0, 1fr);
    gap: 0.7rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--line);
  }

  #joins td:first-child,
  #devices td:first-child {
    border-top: 0;
  }

  #joins td::before,
  #devices td::before {
    content: attr(data-label);
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }
}

@media (max-width: 1120px) {
  .role-summary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .role-editor-groups {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .role-summary-list {
    grid-template-columns: 1fr;
  }

  .role-summary-copy {
    min-height: 0;
  }

  #role-editor-head,
  .role-editor-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .role-editor-status {
    justify-content: flex-start;
  }

  .role-editor-status .toggle-row {
    justify-content: flex-start;
  }

  .role-editor-footer {
    bottom: 4.25rem;
  }

  .role-editor-actions {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
  }

  .role-editor-actions .button {
    width: 100%;
  }

  .permission-control {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 58px;
  }

  .permission-scope-select {
    max-width: 7.8rem;
  }
}
