:root {
  color-scheme: light;
  --bg: #f6f6f5;
  --ink: #09090b;
  --muted: #66666d;
  --soft: #e7e7e4;
  --panel: #ffffff;
  --line: #d8d8d3;
  --topbar-bg: #050505;
  --control-bg: #303030;
  --control-bg-hover: #3a3a3a;
  --control-border: #464646;
  --control-text: #ffffff;
  --dark: #111113;
  --dark-2: #232326;
  --danger: #a6111b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
.link-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--dark);
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  cursor: pointer;
  padding: 0 16px;
  text-align: center;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

button:hover,
.link-button:hover {
  transform: translateY(-1px);
  border-color: #c91524;
  background: #c91524;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

select {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 650;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

label input,
label select {
  font-weight: 500;
}

label input {
  color: var(--ink);
}

label select {
  color: var(--ink);
}

.auth-shell {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(246, 246, 245, 0.92)),
    radial-gradient(circle at top left, #ffffff 0, #e9e9e5 42%, #d6d6d0 100%);
}

.public-home-shell {
  min-height: 100vh;
  background: #f7f7f5;
}

.public-home {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 28px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 0 72px;
}

.public-home-top {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 0 clamp(24px, 5vw, 76px);
}

.public-back-link,
.public-home-actions,
.public-login-button,
.public-language-button {
  display: inline-flex;
  align-items: center;
}

.public-back-link {
  gap: 7px;
  min-height: 38px;
  color: #313136;
  font-size: 14px;
  font-weight: 800;
}

.public-back-link:hover {
  color: #c91524;
}

.public-home-actions {
  gap: 10px;
}

.public-login-button,
.public-language-button {
  min-height: 40px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 850;
}

.public-login-button {
  justify-content: center;
  border: 1px solid #111113;
  background: #111113;
  color: #fff;
  padding: 0 16px;
}

.public-login-button:hover {
  border-color: #c91524;
  background: #c91524;
}

.public-language-form {
  margin: 0;
}

.public-language-menu {
  position: relative;
}

.public-language-button {
  justify-content: space-between;
  gap: 9px;
  min-width: 78px;
  border: 1px solid #d8d8d3;
  background: #ededeb;
  color: #28282c;
  cursor: pointer;
  padding: 0 12px;
  list-style: none;
}

.public-language-button::-webkit-details-marker {
  display: none;
}

.public-language-button:hover,
.public-language-button:focus-visible {
  border-color: #c7c7c2;
  background: #e6e6e2;
}

.public-language-list.menu-list {
  top: calc(100% + 7px);
  right: 0;
  left: auto;
  width: 78px;
  min-width: 78px;
  border: 1px solid #d8d8d3;
  border-radius: 8px;
  background: #fff;
  padding: 5px;
  box-shadow: 0 18px 44px rgba(20, 20, 24, 0.12);
}

.public-language-list.menu-list .menu-row {
  min-height: 36px;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #28282c;
  padding: 0 8px;
  text-align: center;
}

.public-language-list.menu-list .menu-row:hover,
.public-language-list.menu-list .menu-row.selected {
  background: #f1f1ef;
  color: #111113;
  transform: none;
}

.public-home-center {
  width: min(100% - 40px, 1060px);
  display: grid;
  justify-self: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding-top: 40px;
}

.public-logo-mark {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid #d8d8d3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(9, 9, 11, 0.06);
}

.public-logo-mark img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.public-home-center h1 {
  margin: 4px 0 0;
  font-size: 46px;
  line-height: 1;
}

.public-home-center p {
  max-width: 520px;
  margin: 0;
  color: #66666d;
  font-size: 16px;
  line-height: 1.55;
}

.public-tool-section {
  display: grid;
  gap: 16px;
  width: min(860px, calc(100vw - 40px));
  align-self: start;
  justify-self: center;
  margin-top: 4px;
}

.public-tool-section h2 {
  margin: 0;
  color: #66666d;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.public-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 258px));
  justify-content: center;
  align-items: stretch;
  gap: 16px;
}

.public-tool-card {
  position: relative;
  min-height: 256px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  overflow: hidden;
  border: 1px solid #d8d8d3;
  border-radius: 8px;
  background: #fff;
  padding: 18px 18px 0;
  box-shadow: 0 1px 0 rgba(9, 9, 11, 0.03);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.public-tool-card:hover,
.public-tool-card:focus-visible {
  border-color: #c91524;
  box-shadow: 0 18px 44px rgba(9, 9, 11, 0.1);
  transform: translateY(-1px);
}

.public-tool-dot {
  position: absolute;
  top: 28px;
  right: 18px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e0001b;
  box-shadow: 0 0 0 1px #e0e0dc;
}

.public-tool-card-copy {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-top: 22px;
}

.public-tool-card-copy strong {
  color: #111113;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.08;
}

.public-tool-card-copy small {
  color: #66666d;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
}

.public-tool-card-icon {
  display: grid;
  justify-items: start;
  align-items: center;
}

.public-tool-icon {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  border-radius: 8px;
}

.public-tool-slug {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin: 0 -18px;
  border-top: 1px solid #d8d8d3;
  background: #f6f6f4;
  color: #6d6d73;
  padding: 0 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 900;
}

.public-empty {
  margin: 0;
  border: 1px solid #d8d8d3;
  border-radius: 8px;
  background: #fff;
  color: #66666d;
  padding: 18px;
  text-align: center;
  font-weight: 750;
}

.public-home-footer {
  width: min(860px, calc(100vw - 40px));
  justify-self: center;
  margin-top: 2px;
  color: #9b9ba1;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  text-align: center;
}

.public-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
}

.public-modal:target {
  display: grid;
}

.public-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.44);
}

.public-modal-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  border: 1px solid #d8d8d3;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  padding: 30px;
}

.public-modal-panel .mark {
  margin-bottom: 18px;
}

.public-modal-panel h2 {
  margin-bottom: 10px;
  font-size: 34px;
}

.public-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #d8d8d3;
  border-radius: 8px;
  background: #f7f7f5;
  color: #111113;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.public-modal-close:hover {
  border-color: #c91524;
  color: #c91524;
}

@media (max-width: 700px) {
  .public-home {
    width: 100%;
    gap: 28px;
    padding-top: 18px;
    padding-bottom: 52px;
  }

  .public-home-top {
    align-items: flex-start;
    padding: 0 14px;
  }

  .public-home-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .public-back-link {
    min-height: 40px;
  }

  .public-login-button,
  .public-language-button {
    min-height: 38px;
    font-size: 13px;
  }

  .public-home-center {
    padding-top: 12px;
  }

  .public-logo-mark {
    width: 70px;
    height: 70px;
  }

  .public-logo-mark img {
    width: 48px;
    height: 48px;
  }

  .public-home-center h1 {
    font-size: 38px;
  }

  .public-tool-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .public-tool-card {
    min-height: 226px;
    padding: 16px 16px 0;
  }

  .public-tool-card-copy {
    padding-top: 10px;
  }

  .public-tool-card-copy strong {
    font-size: 22px;
  }

  .public-tool-card-copy small {
    font-size: 15px;
  }

  .public-tool-slug {
    margin: 0 -16px;
    padding: 0 16px;
  }

  .public-modal {
    align-items: start;
    padding: 18px;
  }

  .public-modal-panel {
    margin-top: 32px;
    padding: 24px;
  }
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-panel {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  padding: 34px;
}

.mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 22px;
}

.mark img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(32px, 7vw, 54px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 24px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.stack {
  display: grid;
  gap: 16px;
}

.compact {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.primary {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
  font-weight: 750;
}

.alert {
  border: 1px solid rgba(166, 17, 27, 0.25);
  border-radius: 8px;
  background: rgba(166, 17, 27, 0.06);
  color: var(--danger);
  padding: 12px 14px;
  font-weight: 700;
}

.serverstats-page {
  display: grid;
  gap: 18px;
}

.serverstats-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 22px;
}

.serverstats-hero h1 {
  margin-bottom: 8px;
}

.serverstats-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(37, 96, 58, 0.2);
  border-radius: 999px;
  background: rgba(37, 96, 58, 0.07);
  color: #25603a;
  font-size: 13px;
  font-weight: 850;
  padding: 8px 12px;
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #25603a;
  box-shadow: 0 0 0 4px rgba(37, 96, 58, 0.12);
}

.serverstats-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.serverstats-kpi {
  display: grid;
  gap: 9px;
  min-height: 128px;
  border: 1px solid var(--line);
  border-left: 4px solid #25603a;
  border-radius: 10px;
  background: #fff;
  padding: 18px;
}

.serverstats-kpi.warning {
  border-left-color: #76510f;
}

.serverstats-kpi.bad {
  border-left-color: var(--danger);
}

.serverstats-kpi > span,
.serverstats-kpi small,
.serverstats-row small,
.serverstats-meter small,
.serverstats-events span,
.serverstats-events small,
.serverstats-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.serverstats-kpi > span {
  font-weight: 900;
  text-transform: uppercase;
}

.serverstats-kpi strong {
  color: var(--ink);
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
}

.serverstats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  gap: 18px;
}

.serverstats-grid.serverstats-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.serverstats-wide {
  min-width: 0;
}

.serverstats-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.serverstats-summary.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.serverstats-summary.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.serverstats-summary > div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  padding: 12px;
}

.serverstats-summary span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.serverstats-summary strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
  line-height: 1.1;
}

.serverstats-list,
.serverstats-risk-list,
.serverstats-meter-list,
.serverstats-events,
.serverstats-traffic-list {
  display: grid;
  gap: 10px;
}

.serverstats-row,
.serverstats-risk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 13px 14px;
}

.serverstats-row span {
  min-width: 0;
}

.serverstats-row strong,
.serverstats-risk strong,
.serverstats-events strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.serverstats-row b {
  color: var(--ink);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.serverstats-risk {
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
}

.serverstats-risk.good {
  border-color: rgba(37, 96, 58, 0.22);
  background: rgba(37, 96, 58, 0.06);
}

.serverstats-risk.warning {
  border-color: rgba(118, 81, 15, 0.24);
  background: rgba(118, 81, 15, 0.08);
}

.serverstats-risk.bad {
  border-color: rgba(166, 17, 27, 0.25);
  background: rgba(166, 17, 27, 0.06);
}

.serverstats-risk span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.serverstats-meter {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 13px 14px;
}

.serverstats-meter > div,
.serverstats-counts > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.serverstats-meter strong,
.serverstats-meter span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.serverstats-meter i {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eeeeeb;
}

.serverstats-meter i span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #c91524;
}

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

.serverstats-counts {
  display: grid;
  gap: 8px;
}

.serverstats-counts h3 {
  margin: 0;
  font-size: 14px;
}

.serverstats-counts > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  padding: 10px 12px;
}

.serverstats-counts span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serverstats-counts strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.serverstats-events > div {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--line);
  background: #fafafa;
  padding: 10px 12px;
}

.serverstats-events > div.accepted {
  border-left-color: #25603a;
}

.serverstats-events > div.failed,
.serverstats-events > div.invalid-user {
  border-left-color: #c91524;
}

.serverstats-events > div.blocked {
  border-left-color: #76510f;
  background: rgba(118, 81, 15, 0.08);
}

.serverstats-traffic-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 13px 14px;
}

.serverstats-traffic-head,
.serverstats-traffic-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.serverstats-traffic-head span {
  min-width: 0;
}

.serverstats-traffic-head strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serverstats-traffic-head small,
.serverstats-traffic-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.serverstats-traffic-head b {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

.serverstats-traffic-meta {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.serverstats-sparkline {
  height: 48px;
  display: flex;
  align-items: end;
  gap: 3px;
  border-radius: 8px;
  background: #f5f5f3;
  padding: 7px;
}

.serverstats-sparkline i {
  flex: 1 1 0;
  min-width: 4px;
  border-radius: 999px 999px 3px 3px;
  background: #c91524;
  opacity: 0.86;
}

.serverstats-note {
  margin: 12px 0 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: var(--topbar-bg);
  color: #fff;
  padding: 8px max(16px, calc((100vw - 1180px) / 2));
}

.topbar-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.24);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-title {
  display: grid;
  gap: 1px;
  font-size: 14px;
  line-height: 0.9;
}

.topbar nav,
.desktop-nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.topbar nav a,
.topbar nav button {
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.topbar nav a.active,
.topbar nav button.active,
.subnav a.active {
  border-color: transparent;
  background: var(--control-bg);
  color: var(--control-text);
}

.topbar nav a,
.topbar nav button {
  border: 1px solid transparent;
  background: var(--control-bg);
  color: var(--control-text);
  transition: border-color 160ms ease, background 160ms ease;
}

.topbar nav a:hover,
.topbar nav button:hover,
.topbar nav a:focus-visible,
.topbar nav button:focus-visible {
  border-color: #8d8d8d;
  background: var(--control-bg-hover);
  transform: none;
}

.topbar nav a.notification-link.active,
.topbar nav a.notification-link:hover,
.topbar nav a.notification-link:focus-visible,
.topbar nav a[href="/settings"].active,
.topbar nav a[href="/settings"]:hover,
.topbar nav a[href="/settings"]:focus-visible {
  border-color: #8d8d8d;
}

.notification-link {
  position: relative;
  min-width: 44px;
}

.notification-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #c91524;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 0 5px;
}

.topbar form {
  margin: 0;
}

.tool-switcher {
  position: relative;
  min-width: min(320px, 44vw);
}

.mobile-nav,
.mobile-nav-wrap,
.mobile-top-actions {
  display: none;
}

.custom-menu {
  position: relative;
}

.custom-menu summary {
  list-style: none;
}

.custom-menu summary::-webkit-details-marker {
  display: none;
}

.menu-button {
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--control-bg);
  color: var(--control-text);
  cursor: pointer;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.menu-button:hover,
.menu-button:focus-visible {
  border-color: #8d8d8d;
  background: var(--control-bg-hover);
}

.menu-caret {
  width: 9px;
  height: 9px;
  display: inline-block;
  flex: 0 0 9px;
  border-right: 2px solid rgba(255, 255, 255, 0.78);
  border-bottom: 2px solid rgba(255, 255, 255, 0.78);
  transform: translateY(-2px) rotate(45deg);
}

.menu-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  min-width: 260px;
  overflow: hidden;
  border: 1px solid var(--control-border);
  border-radius: 10px;
  background: var(--control-bg);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.22);
  padding: 6px;
}

.tool-list {
  max-height: min(420px, calc(100vh - 76px));
  max-height: min(420px, calc(100dvh - 76px - env(safe-area-inset-bottom, 0px)));
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: #858585 transparent;
}

.language-list {
  right: 0;
  left: auto;
  min-width: 130px;
}

.menu-row {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--control-text);
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.menu-row:hover,
.menu-row.selected {
  background: var(--control-bg-hover);
  transform: none;
}

.overview-row {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  font-size: 15px;
  font-weight: 900;
}

.menu-divider {
  height: 1px;
  margin: 6px 4px;
  background: rgba(255, 255, 255, 0.24);
}

.flag-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  line-height: 1;
}

.tool-button {
  max-width: 320px;
  font-size: 14px;
  font-weight: 900;
}

.tool-button-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-app-icon,
.menu-list-icon,
.app-list-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 7px;
}

.app-list-icon {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  grid-template-rows: repeat(2, 5px);
  place-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  background: #fff;
}

.app-list-icon span {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: #4b4b4b;
}

.menu-list-icon {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: #424248;
  font-size: 14px;
}

.mobile-menu-button {
  width: auto;
  min-width: 94px;
  justify-content: center;
}

.mobile-nav > summary.mobile-menu-button,
.mobile-nav-wrap > .mobile-menu-button {
  width: 96px;
  height: 44px;
  display: flex;
}

.mobile-nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mobile-menu-icon {
  width: 18px;
  display: grid;
  gap: 4px;
}

.mobile-menu-icon span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: #fff;
}

.mobile-menu-list {
  display: none;
  right: 0;
  left: auto;
  min-width: 230px;
}

.mobile-menu-list .language-form,
.mobile-menu-list form {
  width: 100%;
}

.mobile-menu-list > a,
.mobile-menu-list > form button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--control-text);
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 800;
}

.mobile-menu-list > a:hover,
.mobile-menu-list > form button:hover {
  background: var(--control-bg-hover);
  transform: none;
}

.mobile-language-form {
  margin-top: 8px;
}

.mobile-language-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.mobile-language-row button {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--control-text);
  padding: 0 4px;
  font-size: 12px;
  font-weight: 850;
}

.mobile-language-row .flag-icon {
  width: 20px;
  height: 20px;
  font-size: 13px;
}

.mobile-language-row button.active,
.mobile-language-row button:hover {
  border-color: #8d8d8d;
  background: var(--control-bg-hover);
  transform: none;
}

.subnav {
  position: sticky;
  top: 58px;
  z-index: 10;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  padding: 14px max(16px, calc((100vw - 1180px) / 2)) 12px;
}

.subnav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.subnav a.active {
  border-color: var(--control-border);
  background: var(--control-bg);
  color: var(--control-text);
}

.page {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 80px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.page-head h1 {
  margin: 0;
}

.dashboard-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(480px, auto);
  align-items: end;
}

.dashboard-head > div:first-child {
  min-width: 0;
}

.dashboard-head h1 {
  max-width: 11ch;
  overflow-wrap: anywhere;
}

.dashboard-head .view-actions {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto auto;
  justify-self: end;
  align-items: center;
  width: min(620px, 100%);
}

.dashboard-head .view-actions > * {
  min-width: 0;
}

.dashboard-head .group-filter {
  min-width: 0;
}

.dashboard-head .view-actions .link-button {
  white-space: nowrap;
}

.dashboard-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dashboard-meta .eyebrow {
  margin: 0;
}

.pill,
.mode {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--control-text);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.view-actions,
.card-actions,
.table-actions,
.section-title,
.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.view-actions .link-button {
  border-color: #c9c9c4;
  background: transparent;
  color: var(--ink);
}

.view-actions .link-button:hover {
  border-color: #c91524;
  background: #c91524;
  color: #fff;
}

.view-actions .link-button.active {
  border-color: #c91524;
  background: #c91524;
  color: #fff;
}

@media (max-width: 1100px) {
  .dashboard-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .dashboard-head h1 {
    max-width: 100%;
  }

  .dashboard-head .view-actions {
    justify-self: stretch;
    width: 100%;
  }
}

.content-menu {
  position: relative;
}

.content-menu > summary {
  list-style: none;
}

.content-menu > summary::-webkit-details-marker {
  display: none;
}

.content-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(320px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
}

.group-select {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 210px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 0 12px;
  font-weight: 850;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.group-select:hover,
.group-select:focus-visible {
  border-color: #b9b9b4;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.group-select .button-icon {
  color: var(--muted);
}

.menu-caret.dark {
  border-color: rgba(9, 9, 11, 0.58);
}

.group-filter .content-menu-list {
  border-radius: 8px;
}

.group-filter-options {
  max-height: min(360px, 50vh);
  overflow-y: auto;
  display: grid;
  gap: 4px;
}

.group-filter-options .check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
}

.group-option-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.group-filter .check:hover,
.group-filter .check:focus-within {
  background: #f2f3f4;
  color: var(--ink);
}

.group-filter .check:has(input:checked) {
  background: #fff1f2;
}

.group-filter-reset {
  padding: 8px;
  font-weight: 700;
}

.group-select .filter-count {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-count {
  min-width: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(9, 9, 11, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  padding: 3px 7px;
}

.section-title {
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title h2,
.section-title p,
.inline-form {
  margin: 0;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.app-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.app-card {
  position: relative;
  min-width: 0;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 18px 0;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.app-card:focus-visible {
  outline: 3px solid rgba(201, 21, 36, 0.24);
  outline-offset: 3px;
  border-color: #c91524;
}

.app-card.disabled {
  opacity: 0.58;
}

.app-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.app-card-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.app-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  padding: 6px;
}

.app-icon.fallback {
  display: grid;
  place-items: center;
  background: var(--dark);
  color: #fff;
  font-weight: 850;
  padding: 0;
}

.app-icon.menu-app-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 7px;
  padding: 3px;
}

.lock-badge {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
}

.lock-badge svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: #9d9d9d;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.08);
}

.app-card h2 {
  font-size: clamp(21px, 1.8vw, 24px);
  line-height: 1.12;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.app-card p {
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.app-group-badges,
.app-group-assignments {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.app-card-badges .app-group-badges {
  justify-content: flex-end;
}

.app-group-badge {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #dde0e3;
  border-radius: 4px;
  background: #f4f5f6;
  color: #525a63;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.table-title-text .app-group-badges {
  margin-top: 6px;
}

.app-group-count {
  min-height: 24px;
  width: auto;
  white-space: nowrap;
  cursor: help;
}

.app-group-count:hover,
.app-group-count:focus-visible {
  border-color: #aeb5bd;
  background: #e9ecef;
  color: #30363d;
}

.app-group-count:focus-visible {
  outline: 2px solid #c91524;
  outline-offset: 2px;
}

.app-groups-tooltip {
  position: fixed;
  z-index: 200;
  width: max-content;
  max-width: min(260px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 9px 12px;
  border: 1px solid #34383d;
  border-radius: 6px;
  background: #17191c;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.65;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.app-groups-tooltip[hidden] {
  display: none;
}

.group-manage-link {
  margin-left: auto;
  font-weight: 700;
}

.group-settings-panel {
  scroll-margin-top: 150px;
}

.group-settings-panel:target {
  border-color: #c91524;
}

.app-group-assignments a:hover {
  color: #c91524;
  border-color: #c91524;
}

.admin-card-actions {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
}

.admin-open-action {
  width: 100%;
  min-height: 46px;
}

.admin-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-secondary-actions form {
  display: block;
  margin: 0;
}

.admin-secondary-actions .link-button,
.admin-secondary-actions button {
  width: 100%;
  min-height: 46px;
}

.outline-action {
  border-color: var(--control-border);
  background: transparent;
  color: var(--dark);
}

.outline-action:hover {
  border-color: #c91524;
  background: #c91524;
  color: #fff;
}

.app-slug {
  margin: 16px -18px 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  background: #f3f3f1;
  color: #77777c;
  font-size: 12px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 10px 18px;
  overflow-wrap: anywhere;
  word-break: normal;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.data-table {
  min-width: 760px;
}

.data-head,
.data-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) minmax(90px, 0.55fr) minmax(150px, 0.85fr) minmax(92px, 0.45fr) max-content;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.data-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  background: #fafafa;
}

.data-row:last-child {
  border-bottom: 0;
}

.data-row > span,
.data-head > span {
  min-width: 0;
}

.actions-head {
  text-align: right;
}

.table-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.table-title-text {
  min-width: 0;
}

.table-title strong {
  display: block;
  line-height: 1.18;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.table-title small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.table-path {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: normal;
}

.access-badge {
  position: relative;
  width: fit-content;
  max-width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f7f5;
  color: var(--dark);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.access-badge svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: currentColor;
}

.access-open {
  color: #25603a;
}

.access-tools {
  color: #3d3d45;
}

.access-restricted {
  color: #a6111b;
}

.access-shared_password {
  color: #76510f;
}

.access-app_auth {
  color: #24538a;
}

.tooltip::after {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 60;
  width: max-content;
  max-width: 280px;
  content: attr(data-tooltip);
  transform: translateX(-50%) translateY(4px);
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: normal;
}

.tooltip:hover::after,
.tooltip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.status-dot {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 850;
}

.status-dot.enabled {
  background: rgba(37, 96, 58, 0.1);
  color: #25603a;
}

.status-dot.disabled {
  background: rgba(102, 102, 109, 0.12);
  color: var(--muted);
}

.data-row .table-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.data-row .table-actions .link-button {
  min-height: 36px;
  padding: 0 12px;
}

.backlog-table {
  min-width: 900px;
}

.backlog-head,
.backlog-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(260px, 1.35fr) minmax(150px, 0.65fr) minmax(96px, 0.45fr) max-content;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.backlog-head {
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.backlog-row:last-child {
  border-bottom: 0;
}

.backlog-head > span,
.backlog-row > span {
  min-width: 0;
}

.backlog-title strong,
.backlog-title small,
.read-preview strong,
.read-preview small {
  display: block;
}

.backlog-title small,
.backlog-preview,
.read-preview small {
  color: var(--muted);
}

.backlog-title,
.backlog-preview,
.read-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.translations-wrap {
  margin-bottom: 16px;
}

.translations-table {
  min-width: 1100px;
}

.translations-head,
.translations-row {
  display: grid;
  grid-template-columns: 180px 180px repeat(4, minmax(180px, 1fr));
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.translations-head {
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.translations-row:last-child {
  border-bottom: 0;
}

.translations-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.translations-row input {
  min-width: 0;
}

.translation-save-bar {
  display: flex;
  justify-content: flex-end;
}

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

.panel {
  padding: 22px;
}

.narrow {
  width: min(860px, calc(100% - 40px));
}

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

.form-grid.single {
  grid-template-columns: 1fr;
}

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

.icon-upload-panel {
  margin-bottom: 18px;
}

.upload-form {
  align-items: end;
}

input[type="file"] {
  height: auto;
  min-height: 44px;
  padding: 8px;
}

.translation-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  padding: 14px;
}

.span-2 {
  grid-column: 1 / -1;
}

fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 0 6px;
}

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

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

.table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.row:last-child {
  border-bottom: 0;
}

.row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.row form {
  margin: 0;
}

.check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  flex-direction: row;
  color: var(--ink);
  font-weight: 650;
}

.check input {
  width: auto;
  height: auto;
  min-height: auto;
}

.success {
  border: 1px solid #b7c7b8;
  border-radius: 8px;
  background: #eef5ee;
  color: #244828;
  padding: 12px 14px;
  font-weight: 750;
}

.user-list {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.user-edit {
  display: grid;
  gap: 18px;
}

.compact-list {
  gap: 12px;
}

.user-row-card {
  padding: 16px 18px;
}

.password-panel {
  margin-top: 18px;
}

.wysiwyg-form label {
  gap: 10px;
}

.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wysiwyg-toolbar button {
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  border-color: var(--line);
  background: #fff;
  color: var(--dark);
}

.wysiwyg-toolbar button:hover {
  border-color: #c91524;
  background: #c91524;
  color: #fff;
}

.wysiwyg-editor {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 14px;
  line-height: 1.55;
}

.wysiwyg-editor:focus {
  outline: 3px solid rgba(35, 101, 220, 0.25);
  border-color: #6e96e8;
}

.rich-text {
  color: var(--ink);
  line-height: 1.6;
}

.rich-text.preview {
  max-height: 140px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  padding: 12px;
}

.rich-text img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.timeline-item time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  padding-top: 22px;
}

.timeline-content h2 {
  margin-top: 0;
}

.notification-source {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.notification-app-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.notification-action {
  margin-top: 16px;
}

.notification-admin-card {
  display: grid;
  gap: 14px;
}

.read-details summary {
  cursor: pointer;
  color: var(--dark);
  font-weight: 850;
}

.read-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.read-list span {
  display: inline-grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f7f5;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 850;
}

.read-list small {
  color: var(--muted);
  font-weight: 700;
}

.activity-table {
  min-width: 880px;
}

.activity-head,
.activity-row {
  display: grid;
  grid-template-columns: 150px minmax(200px, 1.2fr) minmax(150px, 0.8fr) minmax(120px, 0.7fr) 120px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 13px 16px;
}

.activity-head {
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.backup-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f7f5;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.backup-stats strong {
  color: var(--ink);
}

.danger-form button {
  border-color: #c91524;
  background: #c91524;
}

.backup-preview-wrap {
  margin-bottom: 16px;
}

.backup-preview-table {
  min-width: 760px;
}

.backup-preview-head,
.backup-preview-row {
  display: grid;
  grid-template-columns: 48px 120px minmax(240px, 1fr) minmax(180px, 0.5fr);
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.backup-preview-head {
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.backup-preview-row:last-child {
  border-bottom: 0;
}

.backup-preview-row.conflict {
  background: #fff7f7;
}

.backup-preview-row input {
  width: auto;
  height: auto;
}

.backup-preview-row strong,
.backup-preview-row small {
  display: block;
}

.backup-preview-row small {
  color: var(--muted);
}

.backup-section-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.app-shell-body {
  --app-topbar-height: 50px;
  overflow: hidden;
}

.public-app-shell-body {
  --app-topbar-height: 40px;
}

.public-app-topbar {
  height: var(--app-topbar-height);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--topbar-bg);
  color: #fff;
  padding: 5px max(14px, calc((100vw - 1180px) / 2));
}

.public-app-brand {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  color: #fff;
  font-weight: 850;
  white-space: nowrap;
}

.public-app-brand:hover,
.public-app-brand:focus-visible {
  color: #fff;
}

.public-app-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.public-app-brand .brand-title {
  display: grid;
  gap: 1px;
  color: #fff;
  font-size: 12px;
  line-height: 0.9;
  font-weight: 850;
}

.app-frame-wrap {
  height: calc(100vh - var(--app-topbar-height));
  background: #fff;
}

.app-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #fff;
}

.not-found {
  min-height: 100vh;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
}

.not-found img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}

.not-found h1 {
  max-width: 680px;
  margin: 0;
}

@media (max-width: 860px) {
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    position: sticky;
    display: flex;
    align-items: center;
    width: 100dvw;
    max-width: 100dvw;
    padding: 8px;
  }

  .topbar-left {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
  }

  .topbar nav.desktop-nav {
    display: none;
  }

  .mobile-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    order: 4;
    flex: 0 0 auto;
    min-width: 0;
  }

  .mobile-nav-wrap {
    display: block;
    position: relative;
    z-index: 80;
    width: auto;
    flex: 0 0 auto;
  }

  .mobile-top-actions .notification-link {
    position: relative;
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--control-bg);
    color: var(--control-text);
  }

  .mobile-top-actions .notification-link:hover,
  .mobile-top-actions .notification-link:focus-visible {
    border-color: #8d8d8d;
    background: var(--control-bg-hover);
  }

  .mobile-nav-toggle:checked + .mobile-menu-button + .mobile-menu-list {
    display: block;
  }

  .tool-switcher {
    width: clamp(156px, calc(100vw - 164px), 240px);
    min-width: 0;
    max-width: clamp(156px, calc(100vw - 164px), 240px);
    flex: 1 1 0;
    order: 2;
  }

  .tool-button {
    min-width: 0;
    max-width: none;
    min-height: 40px;
    height: 40px;
    padding: 0 7px;
  }

  .tool-button-label {
    white-space: normal;
    line-height: 1.05;
    font-size: clamp(11px, 3.3vw, 14px);
  }

  .tool-list {
    position: fixed;
    top: 60px;
    right: 12px;
    left: 12px;
    width: auto;
    min-width: 0;
  }

  .bar-divider {
    display: none;
  }

  .brand {
    flex: 0 0 auto;
    min-width: 0;
    order: 1;
  }

  .mobile-nav-wrap {
    order: 5;
  }

  .mobile-menu-list {
    position: fixed;
    top: 56px;
    right: 8px;
    left: 8px;
    z-index: 90;
    display: none;
    width: auto;
    min-width: 0;
    padding: 8px;
  }

  .mobile-menu-list > a,
  .mobile-menu-list > form button {
    width: 100%;
  }

  .mobile-menu-list > form button {
    justify-content: center;
    background: #101012;
  }

  .mobile-menu-list .language-form {
    display: none;
  }

  .mobile-menu-label {
    display: none;
  }

  .mobile-menu-button {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    height: 40px;
    padding: 0;
  }

  .mobile-nav-wrap > .mobile-menu-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .mobile-nav-toggle:checked + .mobile-menu-button .mobile-menu-icon {
    position: relative;
  }

  .mobile-nav-toggle:checked + .mobile-menu-button .mobile-menu-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .mobile-nav-toggle:checked + .mobile-menu-button .mobile-menu-icon span:nth-child(2) {
    opacity: 0;
  }

  .mobile-nav-toggle:checked + .mobile-menu-button .mobile-menu-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .mobile-menu-icon span {
    transition: transform 160ms ease, opacity 160ms ease;
  }

  .brand {
    gap: 8px;
    width: auto;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .brand-title {
    display: none;
  }

  .subnav {
    top: 60px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .page {
    width: min(100% - 32px, 1080px);
    padding-top: 28px;
  }

  .dashboard-meta {
    flex-wrap: wrap;
    gap: 8px;
  }

  .view-actions,
  .dashboard-head .view-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .view-actions > * {
    min-width: 0;
  }

  .group-filter {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .group-select {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .group-select > span:not(.menu-caret):not(.filter-count) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .group-select .filter-count {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .view-actions > .link-button {
    width: 100%;
    min-width: 0;
    padding: 0 10px;
  }

  .app-card {
    min-height: 0;
  }

  .app-card p {
    overflow-wrap: anywhere;
  }

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

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

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .timeline-item time {
    padding-top: 0;
  }

  .form-grid,
  .checks.two-col,
  .translation-grid,
  .serverstats-kpis,
  .serverstats-grid,
  .serverstats-summary,
  .serverstats-summary.three,
  .serverstats-columns {
    grid-template-columns: 1fr;
  }

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

  .serverstats-hero,
  .serverstats-row {
    align-items: stretch;
    flex-direction: column;
  }

  .serverstats-row b {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .view-actions {
    grid-template-columns: 1fr;
  }

  .group-select .filter-count {
    max-width: 118px;
  }

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

@media (max-width: 860px) {
  .topbar {
    display: block;
    padding: 8px;
  }

  .topbar-left {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
  }

  .brand {
    order: initial;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .tool-switcher {
    order: initial;
    width: auto;
    min-width: 0;
    max-width: none;
  }

  .tool-button {
    height: 44px;
    min-height: 44px;
    padding: 0 10px;
  }

  .tool-button-label {
    font-size: 14px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .mobile-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .mobile-top-actions .notification-link,
  .mobile-nav-wrap > .mobile-menu-button,
  .mobile-menu-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--control-bg);
  }

  .mobile-nav-toggle:checked ~ .topbar-left .mobile-menu-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .mobile-nav-toggle:checked ~ .topbar-left .mobile-menu-icon span:nth-child(2) {
    opacity: 0;
  }

  .mobile-nav-toggle:checked ~ .topbar-left .mobile-menu-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .mobile-menu-list {
    position: static;
    display: none;
    width: 100%;
    min-width: 0;
    margin-top: 8px;
    border: 1px solid var(--control-border);
    border-radius: 10px;
    background: #171717;
    padding: 8px;
    box-shadow: none;
  }

  .mobile-nav-toggle:checked ~ .mobile-menu-list {
    display: grid;
    gap: 8px;
  }

  .mobile-menu-main-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-menu-list > a,
  .mobile-menu-list > form button,
  .mobile-menu-list .mobile-menu-main-actions > a,
  .mobile-menu-list .mobile-menu-main-actions > form button {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    background: #101012;
    color: var(--control-text);
    font-size: 14px;
    font-weight: 850;
  }

  .mobile-menu-main-actions form {
    margin: 0;
  }

  .mobile-language-form {
    margin-top: 0;
  }

  .mobile-language-row {
    gap: 8px;
  }

  .mobile-language-row button {
    min-height: 40px;
    border-radius: 8px;
    background: #101012;
  }

  .mobile-language-row button.active {
    background: var(--control-bg-hover);
  }

  .tool-list {
    top: 60px;
  }

  .subnav {
    position: static;
    top: auto;
    padding: 10px 16px;
  }

  .page {
    padding-top: 28px;
  }
}

@media (max-width: 430px) {
  .topbar-left {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .tool-button {
    padding: 0 8px;
  }

  .tool-button-label {
    font-size: 13px;
  }

  .app-list-icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
