:root {
  color-scheme: dark;
  --bg: #050505;
  --bg-soft: #0b0b0c;
  --surface: #101011;
  --surface-2: #161617;
  --surface-3: #1d1d1f;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f7f7f7;
  --muted: #9a9a9d;
  --muted-2: #6f6f73;
  --white: #ffffff;
  --danger: #ff6262;
  --ok: #f2f2f2;
  --warn: #d9d9d9;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 14px 42px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 340px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), transparent 72%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
}

.boot-mark,
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: #000;
  border-radius: 8px;
  font-weight: 800;
}

.brand-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.boot-screen h1 {
  margin: 0;
  font-size: 26px;
}

.boot-screen p {
  margin: 0;
  color: var(--muted);
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 220px),
    rgba(5, 5, 5, 0.86);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.brand-title {
  font-weight: 760;
  line-height: 1.1;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.tab-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.tab-button:hover {
  border-color: var(--line);
  color: var(--text);
}

.tab-button.is-active {
  border-color: var(--line-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    var(--surface);
  color: var(--text);
}

.content {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.guild-info,
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface);
}

.avatar.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.view {
  display: grid;
  gap: 22px;
  margin-top: 24px;
}

.section {
  display: grid;
  gap: 16px;
  padding-top: 2px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section h2 {
  margin: 0;
  font-size: 18px;
}

.section p {
  margin: 5px 0 0;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.stat,
.notice,
.form-band,
.item-card,
.backup-card,
.empty-state {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 92px),
    rgba(16, 16, 17, 0.78);
  box-shadow: var(--shadow-soft);
}

.stat,
.notice,
.form-band,
.item-card,
.backup-card,
.empty-state {
  border-radius: 8px;
}

.stat {
  min-height: 94px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--white), transparent);
  opacity: 0.22;
}

.stat-value {
  margin-top: 10px;
  font-size: 26px;
  font-weight: 760;
}

.notice {
  padding: 14px 16px;
  color: var(--muted);
}

.notice strong {
  color: var(--text);
}

.notice.error {
  border-color: rgba(255, 98, 98, 0.35);
  color: #ffdada;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.form-band {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
}

.control,
select,
input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), transparent),
    #090909;
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.control:focus,
select:focus,
input:focus {
  border-color: rgba(255, 255, 255, 0.42);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: #000;
  font-weight: 720;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.button.secondary {
  background: transparent;
  color: var(--text);
}

.button.danger {
  border-color: rgba(255, 98, 98, 0.45);
  background: transparent;
  color: #ffb8b8;
}

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

.button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button.secondary:not(:disabled):hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.06);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.anticrash-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090909;
}

.segmented button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented button.is-active {
  background: var(--white);
  color: #000;
}

.add-target {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(190px, 0.82fr) auto;
  gap: 10px;
  align-items: end;
}

.add-target .field {
  min-width: 0;
}

.anticrash-board {
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.target-panel,
.rule-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), transparent 110px),
    rgba(12, 12, 13, 0.82);
  box-shadow: var(--shadow-soft);
}

.target-panel {
  padding: 12px;
}

.rule-panel {
  padding: 15px;
}

.panel-head,
.rule-head,
.rule-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-head,
.rule-head {
  justify-content: space-between;
}

.panel-head {
  padding: 2px 4px 12px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.rule-head h2 {
  margin: 0;
  font-size: 16px;
}

.panel-head span {
  min-width: 28px;
  min-height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.rule-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.rule-title {
  min-width: 0;
}

.rule-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.target-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.target-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.target-row:hover,
.target-row.is-active {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.target-row strong,
.target-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-row small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 12px;
}

.mini-avatar,
.role-dot {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.mini-avatar {
  display: grid;
  place-items: center;
  object-fit: cover;
  color: var(--muted);
}

.role-dot {
  display: block;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent),
    var(--role-color, #ffffff);
}

.everyone-dot {
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent),
    #101010;
  color: var(--white);
  font-weight: 800;
  font-size: 17px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.backup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.backup-card {
  display: grid;
  gap: 9px;
  min-height: 128px;
  padding: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
}

.chip > span {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.chip button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.item-list {
  display: grid;
  gap: 12px;
}

.item-card {
  padding: 15px;
}

.item-card:hover,
.event-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.item-title {
  min-width: 0;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.item-id {
  color: var(--muted-2);
  font-size: 12px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 13px;
}

.permission-groups {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.permission-group {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 120px), #070708;
}

.permission-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.permission-group-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.permission-group-head span {
  min-width: 28px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

.permission-control {
  display: grid;
  gap: 10px;
  min-height: 116px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0b0c;
}

.permission-control.is-denied {
  border-color: rgba(255, 98, 98, 0.28);
}

.permission-control.is-allowed {
  border-color: rgba(255, 255, 255, 0.24);
}

.permission-control.is-limited {
  border-color: rgba(255, 255, 255, 0.36);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 78px), #0b0b0c;
}

.permission-name {
  min-height: 18px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.permission-description {
  min-height: 34px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(128px, 1fr) 86px;
  gap: 8px;
}

.permission-row select,
.permission-row input {
  min-height: 38px;
}

.permission-row input:disabled {
  opacity: 0.38;
}

.permission-hint {
  color: var(--muted-2);
  font-size: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0b0c;
  color: var(--muted);
  font-size: 13px;
}

.switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.slider {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #050505;
}

.slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform 0.16s ease, background 0.16s ease;
}

.switch input:checked + .slider {
  border-color: rgba(255, 255, 255, 0.7);
  background: var(--white);
}

.switch input:checked + .slider::after {
  transform: translateX(18px);
  background: #000;
}

.feed {
  display: grid;
  gap: 10px;
}

.event-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.038), transparent 112px),
    #0b0b0c;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.event-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--warn);
  opacity: 0.66;
}

.event-card.is-quarantine::before {
  background: #ffffff;
  opacity: 0.9;
}

.event-card.is-antiraid::before {
  background: #cfcfcf;
  opacity: 0.82;
}

.event-card.is-restore::before {
  background: #bdbdbd;
}

.event-card.is-decline::before {
  background: var(--danger);
}

.event-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted-2);
  font-size: 12px;
}

.event-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.event-title {
  font-weight: 760;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.event-summary {
  color: #dddddd;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.event-description {
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.event-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted-2);
  font-size: 12px;
}

.event-meta-line span {
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  overflow-wrap: anywhere;
  word-break: break-all;
}

.event-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 9px;
  margin-top: 2px;
}

.event-field {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.032);
}

.event-field-name {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.event-field-value {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.mention,
code {
  display: inline-block;
  max-width: 100%;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.quarantine-card {
  display: grid;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 130px),
    #0b0b0c;
}

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.pager .button {
  min-height: 34px;
}

.feed-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0b0c;
}

.invite-card {
  min-height: 72px;
}

.invite-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.invite-card-top .feed-meta {
  flex: 1 1 auto;
}

.invite-delete {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.feed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted-2);
  font-size: 12px;
  margin-bottom: 8px;
}

.invite-code,
.invite-role {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-weight: 700;
}

.invite-role {
  color: var(--muted);
  font-weight: 650;
}

.invite-role.has-role {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--white);
}

.backup-segmented {
  max-width: 420px;
}

.backup-browser {
  display: grid;
  grid-template-columns: minmax(240px, 310px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.backup-discord,
.backup-detail {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), transparent 110px),
    rgba(12, 12, 13, 0.86);
  box-shadow: var(--shadow-soft);
}

.backup-discord {
  padding: 12px;
}

.backup-detail {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.backup-server,
.backup-channel,
.backup-category-title,
.backup-role-row,
.backup-mini-list button,
.backup-mini-list > div {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

.backup-server {
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
}

.backup-server span {
  color: var(--muted);
  font-size: 12px;
}

.backup-tree {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.backup-category {
  display: grid;
  gap: 4px;
}

.backup-category-title {
  padding: 9px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
}

.backup-channel {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 0 8px;
  color: var(--muted);
  text-align: left;
}

.backup-channel span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-channel span:first-child {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
}

.backup-channel small {
  min-width: 24px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
}

.backup-server.is-active,
.backup-channel.is-active,
.backup-category-title.is-active,
.backup-role-row:hover,
.backup-mini-list button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.backup-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.backup-detail-head h2 {
  margin: 0;
  font-size: 19px;
}

.backup-detail-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.backup-detail-head > span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.backup-subnav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 8px;
}

.backup-subnav button {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
}

.backup-subnav button:hover,
.backup-subnav button.is-active {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.075);
}

.backup-subnav span {
  font-weight: 800;
}

.backup-subnav small {
  color: var(--muted);
  font-size: 12px;
}

.backup-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.backup-kv {
  display: grid;
  gap: 6px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.backup-kv span {
  color: var(--muted);
  font-size: 12px;
}

.backup-kv strong {
  overflow-wrap: anywhere;
}

.compact-section {
  gap: 12px;
}

.backup-role-list,
.backup-mini-list,
.backup-member-list {
  display: grid;
  gap: 8px;
}

.backup-role-row,
.backup-mini-list button,
.backup-mini-list > div,
.backup-member-list > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
}

.backup-mini-list button,
.backup-mini-list > div,
.backup-member-list > div {
  grid-template-columns: minmax(0, 1fr) auto;
}

.backup-mini-list span,
.backup-member-list small,
.backup-role-row small {
  color: var(--muted);
  font-size: 12px;
}

.backup-mini-list .backup-nested-row {
  margin-left: 14px;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.024);
}

.role-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
}

.backup-permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.permission-chip.allow {
  border-color: rgba(255, 255, 255, 0.28);
}

.permission-chip.deny {
  border-color: rgba(255, 98, 98, 0.35);
  color: #ffcbcb;
}

.compact-empty {
  padding: 14px;
  text-align: left;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #111;
  color: var(--text);
  box-shadow: var(--shadow);
}

.toast.error {
  border-color: rgba(255, 98, 98, 0.42);
  color: #ffdada;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content {
    padding: 20px;
  }

  .topbar,
  .split,
  .form-grid,
  .anticrash-toolbar,
  .anticrash-board,
  .add-target,
  .backup-browser {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .content,
  .sidebar {
    padding: 16px;
  }

  .tabs,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .item-head,
  .rule-head {
    align-items: stretch;
    flex-direction: column;
  }

  .actions,
  .pager {
    width: 100%;
  }

  .button,
  .pager .button {
    width: 100%;
  }

  .invite-card .invite-delete {
    width: auto;
  }

  .permission-grid,
  .permission-row {
    grid-template-columns: 1fr;
  }
}
