:root {
  color-scheme: light;
  --bg: #08111b;
  --bg-2: #162338;
  --panel: rgba(247, 243, 232, 0.88);
  --panel-solid: #f6f1e5;
  --line: rgba(53, 68, 44, 0.16);
  --line-strong: rgba(53, 68, 44, 0.3);
  --ink: #1a241d;
  --muted: #5f6d62;
  --accent: #6f9d2d;
  --accent-soft: rgba(111, 157, 45, 0.14);
  --accent-2: #d7b23e;
  --danger: #ae2f30;
  --shadow: 0 24px 70px rgba(3, 10, 22, 0.28);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Space Grotesk", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(111, 157, 45, 0.24), transparent 26%),
    radial-gradient(circle at 86% 12%, rgba(215, 178, 62, 0.18), transparent 24%),
    radial-gradient(circle at 68% 72%, rgba(122, 146, 181, 0.12), transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(238, 234, 223, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(238, 234, 223, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.44), transparent 82%);
}

a {
  color: var(--accent);
}

code {
  padding: 0.15rem 0.38rem;
  border-radius: 999px;
  background: var(--accent-soft);
  font-family: var(--mono);
  font-size: 0.88em;
}

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

p {
  color: var(--muted);
  line-height: 1.62;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-shell {
  width: min(1540px, calc(100% - 30px));
  margin: 14px auto;
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  transition: grid-template-columns 240ms ease;
}

.sidebar,
.hero,
.panel-card,
.stat-card,
.shell,
.notice,
.feed-item,
.sidebar-card,
.system-card,
.runtime-stat,
.status-shell {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(246, 241, 229, 0.95), rgba(233, 227, 212, 0.88)),
    var(--panel);
}

.workspace {
  display: grid;
  gap: 16px;
  padding-bottom: 24px;
}

.brand-block h1 {
  margin-top: 6px;
  font-size: clamp(1.2rem, 1.8vw, 1.85rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 10ch;
}

.brand-lockup {
  position: relative;
  margin-top: 12px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  border: 1px solid rgba(95, 113, 69, 0.16);
  background:
    radial-gradient(circle at 85% 24%, rgba(215, 178, 62, 0.16), transparent 28%),
    radial-gradient(circle at 12% 86%, rgba(111, 157, 45, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(252, 249, 241, 0.96), rgba(240, 235, 221, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  display: grid;
  gap: 10px;
}

.brand-kss {
  display: block;
  font-size: clamp(2.3rem, 4.2vw, 3.2rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
  color: #203018;
}

.brand-divider {
  width: 64px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6f9d2d, #d7b23e);
}

.brand-subtitle {
  display: block;
  max-width: 12ch;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #44533f;
}

.brand-block p {
  margin-top: 10px;
  font-size: 0.9rem;
  line-height: 1.55;
  max-width: 28ch;
}

.nav-tabs {
  display: grid;
  gap: 10px;
}

.tab-btn {
  width: 100%;
  border: 1px solid rgba(95, 113, 69, 0.14);
  border-radius: 18px;
  padding: 12px 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 241, 228, 0.84));
  color: var(--ink);
  text-align: left;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.tab-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 0.92rem;
  color: #5b8422;
  border: 1px solid rgba(111, 157, 45, 0.28);
  background: linear-gradient(180deg, rgba(111, 157, 45, 0.16), rgba(111, 157, 45, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.tab-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tab-copy > span:first-child {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.tab-hint {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.tab-arrow {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1;
  text-align: right;
}

.tab-btn:hover,
.tab-btn:focus-visible,
.tab-btn.active {
  border-color: rgba(111, 157, 45, 0.34);
  background: linear-gradient(135deg, rgba(111, 157, 45, 0.16), rgba(239, 245, 231, 0.94));
  transform: translateX(2px);
  box-shadow: 0 10px 24px rgba(67, 95, 25, 0.14);
  outline: none;
}

.tab-btn.active .tab-arrow {
  color: var(--accent);
  font-weight: 700;
}

.sidebar-card {
  padding: 16px;
  border-radius: 18px;
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, rgba(252, 250, 244, 0.88), rgba(244, 239, 227, 0.82));
}

.nav-card {
  gap: 12px;
}

.sidebar-card.compact {
  gap: 8px;
}

.sidebar-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

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

.chip,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
}

.meter {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(111, 157, 45, 0.12);
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4f7f19, #84b331, #d7b23e);
  transition: width 260ms ease;
}

.sidebar-metrics {
  display: grid;
  gap: 10px;
}

.sidebar-metrics div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-metrics span {
  color: var(--muted);
  font-size: 0.94rem;
}

.sidebar-metrics strong {
  font-size: 1rem;
}

.runtime-card {
  gap: 14px;
}

.runtime-card .hint {
  font-size: 0.88rem;
  line-height: 1.6;
}

.hero {
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  background:
    radial-gradient(circle at 16% 34%, rgba(111, 157, 45, 0.14), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(215, 178, 62, 0.16), transparent 26%),
    linear-gradient(135deg, rgba(248, 243, 230, 0.98), rgba(238, 234, 221, 0.92)),
    var(--panel-solid);
  border: 1px solid rgba(43, 61, 74, 0.1);
}

.hero h2 {
  margin-top: 0;
  font-size: clamp(1.7rem, 2.8vw, 2.45rem);
  line-height: 1.02;
  max-width: none;
  letter-spacing: -0.03em;
}

.hero p {
  margin-top: 4px;
  max-width: 58ch;
  font-size: 0.98rem;
  color: #5f7380;
}

.hero-top {
  display: grid;
  gap: 6px;
  align-content: start;
  flex: 1;
}

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

.hero-actions form {
  margin: 0;
}

.hero-user-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(95, 113, 69, 0.18);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 24px rgba(5, 11, 24, 0.06);
}

.hero-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(95, 113, 69, 0.16);
  background: linear-gradient(135deg, rgba(111, 157, 45, 0.18), rgba(215, 178, 62, 0.18));
  color: #32452a;
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-user-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.hero-user-copy strong {
  font-size: 0.88rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-user-copy span {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
}

.hero-actions button,
.hero-api-link {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
}

.hero-actions button i,
.hero-api-link i {
  font-size: 0.92rem;
}

.hero-logout-btn {
  width: 48px;
  min-width: 48px;
  padding: 0;
  border-radius: 50%;
  box-shadow: none;
}

.stats-grid,
.overview-grid,
.overview-top-grid,
.list-layout,
.settings-layout,
.overview-shell,
.overview-status-grid,
.overview-system-grid,
.overview-runtime-grid,
.trend-grid,
.overview-note-list,
.grid,
.runtime-grid,
.systems,
.form-grid,
.toggle-panel,
.detail-list {
  display: grid;
  gap: 14px;
}

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

.overview-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.overview-shell {
  gap: 16px;
}

.overview-top-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

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

.compact-list {
  align-items: start;
}

.panel-card {
  padding: 18px;
  border-radius: var(--radius-xl);
  container-type: inline-size;
}

.spotlight {
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.13), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(251, 248, 241, 0.92));
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h3 {
  margin-top: 6px;
  font-size: 1.22rem;
}

.stat-card {
  border-radius: var(--radius-lg);
  padding: 16px;
  display: grid;
  gap: 8px;
}

.overview-stat-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 241, 229, 0.88));
  border: 1px solid rgba(95, 113, 69, 0.16);
  box-shadow: 0 14px 30px rgba(5, 11, 24, 0.06);
}

.stat-card strong {
  font-size: clamp(1.12rem, 2vw, 1.7rem);
  line-height: 1.08;
}

.overview-stat-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.overview-stat-card p {
  font-size: 0.8rem;
  line-height: 1.5;
}

.overview-toolbar p {
  max-width: 74ch;
}

.trend-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.trend-card,
.overview-status-card,
.overview-system-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(95, 113, 69, 0.12);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 26px rgba(5, 11, 24, 0.05);
}

.trend-card {
  display: grid;
  gap: 12px;
}

.trend-card-top {
  display: grid;
  gap: 4px;
}

.trend-card-top strong {
  font-size: 1rem;
  line-height: 1.05;
}

.trend-stats {
  display: grid;
  gap: 8px;
}

.trend-stats div,
.overview-runtime-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(95, 113, 69, 0.1);
}

.trend-stats span,
.overview-runtime-grid span {
  color: var(--muted);
  font-size: 0.79rem;
}

.trend-stats strong,
.overview-runtime-grid strong {
  font-size: 0.9rem;
}

.runtime-overview-card {
  display: grid;
  gap: 14px;
}

.overview-runtime-meter {
  margin-top: 4px;
}

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

.overview-inline-note {
  margin-top: 14px;
  font-size: 0.86rem;
}

.overview-detail-list {
  margin-top: 12px;
}

.overview-status-grid,
.overview-system-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 14px;
}

.overview-status-card,
.overview-system-card {
  display: grid;
  gap: 10px;
}

.overview-status-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.overview-status-head strong {
  display: block;
  margin-top: 4px;
  font-size: 0.98rem;
  line-height: 1.08;
}

.overview-status-value {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
}

.state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(95, 113, 69, 0.18);
  white-space: nowrap;
}

.state-badge.is-active {
  color: #3b6a10;
  background: rgba(111, 157, 45, 0.16);
  border-color: rgba(111, 157, 45, 0.28);
}

.state-badge.is-inactive {
  color: #6a716a;
  background: rgba(95, 109, 98, 0.12);
  border-color: rgba(95, 109, 98, 0.18);
}

.state-badge.is-error {
  color: var(--danger);
  background: rgba(174, 47, 48, 0.12);
  border-color: rgba(174, 47, 48, 0.22);
}

.overview-note-list p {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(95, 113, 69, 0.1);
  background: rgba(255, 255, 255, 0.78);
}

.actionable-card,
.feed-item,
.inline-btn,
.icon-btn {
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.actionable-card {
  cursor: pointer;
}

.actionable-card:hover,
.actionable-card:focus-visible,
.feed-item:hover,
.feed-item:focus-visible {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.workspace > *,
.panel-card > *,
.feed > *,
.card-feed > *,
.stats-grid > *,
.overview-grid > *,
.list-layout > *,
.settings-layout > *,
.detail-list > * {
  min-width: 0;
}

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

.detail-list div {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.detail-list span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.detail-list strong {
  font-size: 0.94rem;
}

.status-shell {
  padding: 12px;
  margin-top: 12px;
  border-radius: var(--radius-md);
}

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

.feed-item {
  width: 100%;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.feed-item-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.feed-item-head strong {
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.feed-item-meta {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
}

.feed-item p {
  margin-top: 9px;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-item .cta {
  display: inline-flex;
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.card-feed {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

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

.admin-role-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(95, 113, 69, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(246, 242, 232, 0.86));
  box-shadow: 0 12px 26px rgba(5, 11, 24, 0.045);
  display: grid;
  gap: 10px;
  align-content: start;
}

.admin-role-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-role-title {
  min-width: 0;
}

.admin-role-head h4 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.1;
}

.admin-role-subtitle {
  margin: 4px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.admin-role-count {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
}

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

.admin-member {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 8px;
  border-radius: 999px;
  border: 1px solid rgba(95, 113, 69, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.admin-member:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 162, 40, 0.28);
  box-shadow: 0 10px 22px rgba(5, 11, 24, 0.06);
}

.admin-member-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 30px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
}

.admin-member-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-member-avatar-fallback {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
}

.admin-member-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.admin-member-copy strong {
  font-size: 0.84rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.admin-member-copy span {
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.admin-role-empty {
  margin: 0;
  padding: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-check-sheet {
  display: grid;
  gap: 12px;
}

.admin-check-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 0 4px;
}

.admin-check-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 54px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent);
}

.admin-check-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-check-identity {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-check-identity strong {
  font-size: 1.05rem;
}

.admin-check-identity span {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.admin-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.admin-check-card {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(95, 113, 69, 0.12);
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 8px;
}

.admin-check-card h4 {
  margin: 0;
  font-size: 0.92rem;
}

.admin-check-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.admin-check-card div span {
  color: var(--muted);
  font-size: 0.77rem;
}

.admin-check-card div strong {
  text-align: right;
  font-size: 0.83rem;
  overflow-wrap: anywhere;
}

.admin-check-card p {
  color: var(--muted);
  line-height: 1.5;
}

.admin-check-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.admin-check-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.server-control-shell,
.server-control-grid,
.server-control-note-list {
  display: grid;
  gap: 12px;
}

.server-control-head,
.server-control-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.server-control-head h4,
.server-control-card-head h4 {
  margin: 4px 0 0;
  font-size: 1.02rem;
}

.server-control-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.server-control-card {
  align-content: start;
}

.server-control-card-copy {
  display: grid;
  gap: 4px;
}

.server-control-card-copy strong {
  font-size: 1rem;
  line-height: 1.08;
}

.server-control-card-copy span,
.server-control-inline-note {
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.server-control-actions {
  margin-top: 2px;
}

.server-control-empty {
  padding: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(95, 113, 69, 0.18);
  background: rgba(255, 255, 255, 0.68);
}

.server-control-note-list p {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(95, 113, 69, 0.1);
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  line-height: 1.55;
}

.user-profile-shell {
  display: grid;
  gap: 16px;
}

.user-profile-hero,
.user-profile-section,
.user-profile-card {
  border-radius: 22px;
  border: 1px solid rgba(95, 113, 69, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 243, 233, 0.9));
  box-shadow: 0 16px 36px rgba(5, 11, 24, 0.05);
}

.user-profile-hero,
.user-profile-section {
  padding: 18px;
}

.user-profile-card {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.user-profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(95, 113, 69, 0.16);
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  flex: 0 0 72px;
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 800;
}

.user-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-profile-identity {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.user-profile-identity strong {
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  line-height: 1.02;
}

.user-profile-identity span:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.user-profile-status-row {
  margin-top: 14px;
}

.user-profile-chip-danger {
  color: #a92e2f;
  border-color: rgba(169, 46, 47, 0.24);
  background: rgba(169, 46, 47, 0.1);
}

.user-profile-quick-grid,
.user-profile-stat-grid,
.user-profile-history-grid {
  display: grid;
  gap: 12px;
}

.user-profile-quick-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.user-profile-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.user-profile-history-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 14px;
}

.user-profile-quick-card,
.user-profile-stat-card,
.user-profile-history-card,
.user-profile-stream-card {
  border-radius: 18px;
  border: 1px solid rgba(95, 113, 69, 0.12);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 24px rgba(5, 11, 24, 0.04);
}

.user-profile-quick-card,
.user-profile-stat-card {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.user-profile-quick-card strong,
.user-profile-stat-card strong {
  font-size: 1.18rem;
  line-height: 1.05;
}

.user-profile-quick-card p,
.user-profile-stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.user-profile-quick-label,
.user-profile-stat-card span {
  font-size: 0.84rem;
  font-weight: 700;
}

.user-profile-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(95, 113, 69, 0.14);
  background: rgba(250, 248, 241, 0.92);
  backdrop-filter: blur(12px);
}

.user-profile-nav-btn {
  min-height: 44px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(111, 157, 45, 0.2);
  box-shadow: none;
  justify-content: space-between;
  padding-inline: 14px;
  flex: 1 1 160px;
}

.user-profile-nav-btn strong {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
}

.user-profile-nav-btn:hover,
.user-profile-nav-btn:focus-visible {
  box-shadow: 0 10px 24px rgba(91, 132, 34, 0.14);
}

.user-profile-section {
  display: grid;
  gap: 14px;
}

.user-profile-card .section-heading,
.user-profile-section .section-heading {
  margin-bottom: 0;
}

.user-profile-detail-list {
  margin-top: 2px;
}

.user-profile-empty,
.user-profile-empty-inline {
  color: var(--muted);
  font-size: 0.84rem;
}

.user-profile-empty {
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed rgba(95, 113, 69, 0.18);
  background: rgba(255, 255, 255, 0.6);
}

.user-profile-empty-error {
  color: var(--danger);
  border-style: solid;
  border-color: rgba(174, 47, 48, 0.18);
  background: rgba(174, 47, 48, 0.06);
}

.user-profile-history-card {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.user-profile-history-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.user-profile-history-trigger {
  width: 100%;
  padding: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(95, 113, 69, 0.12);
  box-shadow: 0 12px 24px rgba(5, 11, 24, 0.04);
  text-align: left;
  justify-content: stretch;
}

.user-profile-history-trigger:hover,
.user-profile-history-trigger:focus-visible {
  box-shadow: 0 14px 28px rgba(91, 132, 34, 0.12);
}

.user-profile-history-reason {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.user-profile-history-head,
.user-profile-stream-head,
.user-profile-stream-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.user-profile-history-head {
  align-items: baseline;
}

.user-profile-history-head strong,
.user-profile-stream-head strong {
  font-size: 0.95rem;
}

.user-profile-history-head span,
.user-profile-stream-head span,
.user-profile-stream-foot span {
  color: var(--muted);
  font-size: 0.78rem;
}

.user-profile-stream-list {
  display: grid;
  gap: 10px;
}

.user-profile-stream-card {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.user-profile-stream-head > div:first-child {
  display: grid;
  gap: 3px;
}

.user-profile-message-content,
.user-profile-event-summary,
.user-profile-event-details {
  margin: 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.user-profile-message-content {
  font-family: var(--mono);
  font-size: 0.82rem;
  white-space: normal;
}

.user-profile-event-summary {
  font-weight: 700;
}

.user-profile-event-details {
  color: var(--muted);
  font-size: 0.84rem;
}

.user-profile-stream-meta {
  margin-top: -2px;
}

.user-profile-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.user-profile-inline-alert {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(174, 47, 48, 0.16);
  background: rgba(174, 47, 48, 0.08);
  color: var(--danger);
  font-size: 0.82rem;
}

.user-profile-detail-copy {
  margin: 0;
  color: var(--ink);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.user-profile-stream-foot {
  align-items: center;
}

.user-profile-more-btn {
  justify-self: start;
  margin-top: 2px;
}

.user-profile-note-list {
  display: grid;
  gap: 10px;
}

.user-profile-note-list p {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(95, 113, 69, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  line-height: 1.55;
}

.user-profile-loading-card h4,
.user-profile-loading-card p {
  margin: 0;
}

.user-profile-loading-card {
  min-height: 180px;
  align-content: center;
}

.discussion-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discussion-item {
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.discussion-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.discussion-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.discussion-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 36px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.discussion-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.discussion-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
}

.discussion-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.discussion-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  justify-content: flex-start;
}

.discussion-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.discussion-author strong {
  font-size: 0.95rem;
}

.discussion-time {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.discussion-content {
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.discussion-open-btn {
  margin-left: auto;
  white-space: nowrap;
  flex: 0 0 auto;
  align-self: center;
}

.deleted-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.deleted-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.deleted-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 34px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.deleted-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.deleted-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
}

.deleted-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.deleted-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.deleted-time {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.deleted-message {
  font-size: 0.9rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.deleted-meta {
  font-size: 0.8rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.deleted-source-pill {
  margin-left: auto;
  white-space: nowrap;
}

.user-sort-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0 4px;
}

.user-search-wrap {
  margin-top: 10px;
}

.user-search-input {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.user-search-input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.2);
  border-color: rgba(15, 118, 110, 0.34);
}

.user-sort-btn {
  border: 1px solid rgba(15, 118, 110, 0.2);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 160ms ease;
}

.user-sort-btn:hover,
.user-sort-btn:focus-visible,
.user-sort-btn.active {
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.32);
  background: rgba(15, 118, 110, 0.12);
  outline: none;
}

.users-count {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
}

.log-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.log-tab-btn {
  border: 1px solid rgba(15, 118, 110, 0.2);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 160ms ease;
}

.log-tab-btn:hover,
.log-tab-btn:focus-visible,
.log-tab-btn.active {
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.32);
  background: rgba(15, 118, 110, 0.12);
  outline: none;
}

.log-subpage {
  display: none;
}

.log-subpage.active {
  display: block;
}

.app-log-toolbar {
  margin-top: 16px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(43, 61, 74, 0.12);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.92)),
    rgba(255, 255, 255, 0.78);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-log-filters,
.app-log-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.app-log-sort-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.app-log-sort-select {
  min-width: 150px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  outline: none;
}

.app-log-sort-select:focus-visible {
  border-color: rgba(15, 118, 110, 0.38);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.app-log-card {
  padding: 16px 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(250, 249, 244, 0.9));
  border: 1px solid rgba(43, 61, 74, 0.12);
}

.app-log-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-log-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-log-title-row strong {
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.app-log-time {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.app-log-card p {
  margin-top: 10px;
  color: #3e515f;
  -webkit-line-clamp: 4;
}

.app-log-level-pill {
  min-width: 76px;
}

.app-log-level-info {
  color: #0b6f8d;
  border-color: rgba(11, 111, 141, 0.24);
  background: rgba(11, 111, 141, 0.11);
}

.app-log-level-warning {
  color: #9a5b00;
  border-color: rgba(154, 91, 0, 0.24);
  background: rgba(255, 184, 77, 0.16);
}

.app-log-level-error {
  color: #a92e2f;
  border-color: rgba(169, 46, 47, 0.24);
  background: rgba(169, 46, 47, 0.11);
}

.app-log-info {
  box-shadow: 0 16px 36px rgba(11, 111, 141, 0.08);
}

.app-log-warning {
  box-shadow: 0 16px 36px rgba(154, 91, 0, 0.08);
}

.app-log-error {
  box-shadow: 0 16px 36px rgba(169, 46, 47, 0.1);
}

.user-card {
  padding: 10px 12px;
}

.user-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 38px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
}

.user-main {
  min-width: 0;
  display: grid;
  gap: 3px;
  flex: 1;
}

.user-name {
  display: block;
  font-size: 0.9rem;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.user-account-name {
  display: block;
  font-size: 0.74rem;
  line-height: 1.15;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: anywhere;
}

.user-id {
  display: block;
  font-size: 0.72rem;
  line-height: 1.15;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: anywhere;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  flex-wrap: wrap;
}

.status-pill {
  text-transform: lowercase;
}

.status-online {
  color: #4a7418;
  border-color: rgba(74, 116, 24, 0.28);
  background: rgba(111, 157, 45, 0.14);
}

.status-offline {
  color: #6b7280;
  border-color: rgba(88, 96, 105, 0.26);
  background: rgba(88, 96, 105, 0.11);
}

.bot-pill {
  color: #9e7200;
  border-color: rgba(215, 178, 62, 0.38);
  background: rgba(215, 178, 62, 0.16);
}

.user-voice-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: #78b52f;
  box-shadow: 0 0 0 3px rgba(120, 181, 47, 0.16);
  flex: 0 0 10px;
}

label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

.field-title {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(111, 157, 45, 0.2);
  border-color: rgba(111, 157, 45, 0.34);
}

textarea {
  min-height: 200px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.55;
}

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

.toggle-group {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--ink);
  font-weight: 600;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

button,
.alt {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #5b8422, #7dab31);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover,
button:focus-visible,
.alt:hover,
.alt:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(91, 132, 34, 0.24);
  outline: none;
}

.ghost,
.inline-btn {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(111, 157, 45, 0.24);
}

.modal-action-danger {
  color: #fff;
  background: linear-gradient(135deg, #c43b3d, var(--danger));
  border: 1px solid rgba(174, 47, 48, 0.4);
}

.action-feedback {
  font-size: 0.82rem;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
}

.inline-btn {
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  box-shadow: none;
}

.icon-refresh-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 0.95rem;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(255, 255, 255, 0.92));
}

.icon-refresh-btn i {
  pointer-events: none;
}

.users-panel > summary {
  align-items: center;
  padding-bottom: 4px;
}

.users-panel > summary::after {
  display: none;
}

.users-panel .summary-copy {
  display: grid;
  gap: 2px;
}

.users-panel .summary-copy h3 {
  margin-top: 2px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.settings-intro-card p,
.settings-system-head p,
.settings-guild-block .section-heading p {
  max-width: 780px;
}

.settings-systems-shell {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.settings-section-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.settings-bootstrap-card,
.settings-guild-block,
.settings-system-card {
  border: 1px solid rgba(120, 135, 120, 0.18);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(148, 163, 184, 0.12), transparent 28%),
    rgba(255, 255, 255, 0.76);
  padding: 16px;
}

.settings-guild-block {
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(250, 248, 242, 0.78));
}

.settings-system-grid,
.settings-field-grid,
.settings-threshold-grid,
.settings-inline-form,
.settings-threshold-fields {
  display: grid;
  gap: 12px;
}

.settings-system-grid {
  margin-top: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.settings-system-card-wide {
  grid-column: 1 / -1;
}

.settings-system-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.settings-system-head h4 {
  margin-top: 6px;
  font-size: 1.18rem;
}

.settings-system-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

.settings-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(100, 130, 45, 0.3);
  background: rgba(146, 176, 91, 0.14);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.settings-status-pill.is-default {
  border-color: rgba(120, 135, 120, 0.22);
  background: rgba(120, 135, 120, 0.08);
  color: var(--muted);
}

.settings-system-meta {
  margin-top: 10px;
}

.settings-system-form {
  margin-top: 14px;
}

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

.settings-field-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-inline-form {
  margin-top: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.settings-toggle-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.settings-toggle-bar .check {
  margin-top: 0;
}

.settings-subsection,
.settings-json-preview {
  margin-top: 14px;
}

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

.settings-threshold-card {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(120, 135, 120, 0.16);
  background: rgba(255, 255, 255, 0.72);
}

.settings-threshold-card h4 {
  margin-top: 0;
  font-size: 0.98rem;
}

.settings-threshold-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.settings-json-preview pre {
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(19, 32, 53, 0.92);
  color: #eef6ff;
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.5;
}

.settings-json-preview summary::after,
.settings-subsection summary::after {
  margin-left: auto;
}

.notice {
  padding: 12px 14px;
  border-radius: var(--radius-md);
}

.ok {
  border-color: rgba(15, 118, 110, 0.26);
  background: rgba(15, 118, 110, 0.1);
  color: #0d5751;
}

.bad {
  border-color: rgba(174, 47, 48, 0.28);
  background: rgba(174, 47, 48, 0.09);
  color: var(--danger);
}

.hint {
  font-size: 0.84rem;
  color: var(--muted);
}

summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  min-width: 22px;
  min-height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid rgba(15, 118, 110, 0.28);
  background: var(--accent-soft);
  font-weight: 700;
}

details[open] > summary::after {
  content: "−";
}

.summary-copy h3 {
  margin-top: 6px;
  font-size: 1.1rem;
}

.accordion > :not(summary) {
  margin-top: 12px;
}

.settings-accordion {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.66);
  padding: 12px;
}

.settings-accordion + .settings-accordion {
  margin-top: 10px;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: grid;
  gap: 14px;
  animation: fade-up 200ms ease;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-modal {
  width: min(760px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 0;
  background: rgba(252, 251, 246, 0.98);
  box-shadow: 0 28px 80px rgba(28, 47, 61, 0.26);
}

.detail-modal::backdrop {
  background: rgba(18, 24, 29, 0.42);
  backdrop-filter: blur(6px);
}

.detail-modal.user-profile-modal {
  width: min(1120px, calc(100% - 24px));
}

.detail-modal.user-profile-focus-modal {
  width: min(760px, calc(100% - 24px));
}

.modal-frame {
  padding: 18px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 24px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.modal-header h3 {
  margin-top: 6px;
  font-size: 1.3rem;
}

.icon-btn {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 1.2rem;
  line-height: 1;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.modal-body {
  display: grid;
  gap: 10px;
}

.detail-modal.user-profile-modal .modal-frame {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.detail-modal.user-profile-modal .modal-body {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
}

.modal-body p,
.modal-body pre {
  margin: 0;
}

.modal-body pre {
  overflow: auto;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.shell {
  width: min(620px, 100%);
  padding: 24px;
  border-radius: var(--radius-xl);
}

.login-shell {
  width: min(520px, 100%);
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.login-simple-card {
  padding: 34px 32px;
  border-radius: 30px;
  border: 1px solid rgba(95, 113, 69, 0.14);
  background:
    radial-gradient(circle at 84% 14%, rgba(215, 178, 62, 0.12), transparent 22%),
    radial-gradient(circle at 14% 86%, rgba(111, 157, 45, 0.1), transparent 24%),
    linear-gradient(135deg, rgba(247, 243, 232, 0.98), rgba(239, 235, 223, 0.94));
  box-shadow: 0 24px 60px rgba(5, 11, 24, 0.12);
  display: grid;
  gap: 18px;
}

.login-simple-card h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.login-simple-card > p {
  max-width: 30ch;
  margin-top: -6px;
  font-size: 1rem;
  color: #617266;
}

.login-shell .notice {
  margin-top: 0;
  border-radius: 18px;
  padding: 14px 16px;
}

.login-shell .alt {
  min-height: 52px;
}

.discord-login-card {
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(95, 113, 69, 0.14);
  background:
    radial-gradient(circle at 86% 18%, rgba(88, 101, 242, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 241, 249, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  display: grid;
  gap: 14px;
  align-content: start;
}

.discord-login-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.16), rgba(88, 101, 242, 0.08));
  color: #5865f2;
  font-size: 1.4rem;
}

.discord-login-card h2 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.discord-login-card p {
  max-width: 28ch;
  font-size: 0.95rem;
  color: #66756c;
}

.auth-discord-btn {
  width: 100%;
  min-width: 0;
  background: linear-gradient(135deg, #5865f2, #4752c4);
  border: 1px solid rgba(71, 82, 196, 0.34);
  color: #fff;
  padding-inline: 18px;
}

.auth-discord-btn:hover,
.auth-discord-btn:focus-visible {
  box-shadow: 0 12px 26px rgba(88, 101, 242, 0.24);
}

.discord-login-card-empty {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 243, 233, 0.9));
}

.db-browser-shell,
.db-browser-main {
  display: grid;
  gap: 16px;
}

.db-browser-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.db-browser-toolbar-card,
.db-browser-sidebar-card,
.db-browser-table-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 242, 232, 0.9));
}

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

.db-browser-summary-card {
  padding: 15px;
  border-radius: 18px;
  border: 1px solid rgba(95, 113, 69, 0.12);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 24px rgba(5, 11, 24, 0.045);
  display: grid;
  gap: 6px;
}

.db-browser-summary-card strong {
  font-size: 1.28rem;
  line-height: 1.06;
}

.db-browser-summary-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
}

.db-browser-summary-card p {
  font-size: 0.8rem;
  line-height: 1.5;
}

.db-browser-controls {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.db-browser-search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.db-browser-search-input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.2);
  border-color: rgba(15, 118, 110, 0.34);
}

.db-browser-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.db-browser-schema-list {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  max-height: 960px;
  overflow: auto;
  padding-right: 4px;
}

.db-browser-schema-group {
  display: grid;
  gap: 10px;
}

.db-browser-schema-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(95, 113, 69, 0.12);
}

.db-browser-schema-head strong {
  font-size: 0.94rem;
}

.db-browser-schema-head span,
.db-browser-table-meta,
.db-browser-inline-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.db-browser-table-list {
  display: grid;
  gap: 8px;
}

.db-browser-table-btn {
  width: 100%;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid rgba(95, 113, 69, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 7px;
  box-shadow: 0 12px 24px rgba(5, 11, 24, 0.04);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.db-browser-table-btn:hover,
.db-browser-table-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(111, 157, 45, 0.24);
  box-shadow: 0 14px 28px rgba(91, 132, 34, 0.1);
  outline: none;
}

.db-browser-table-btn.active {
  border-color: rgba(111, 157, 45, 0.3);
  background: linear-gradient(135deg, rgba(111, 157, 45, 0.16), rgba(255, 255, 255, 0.94));
  box-shadow: 0 16px 30px rgba(91, 132, 34, 0.12);
}

.db-browser-table-btn p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.db-browser-table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.db-browser-table-head strong {
  font-size: 0.94rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.db-browser-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.db-browser-meta-grid div,
.db-browser-columns-card,
.db-browser-records-card {
  border-radius: 18px;
  border: 1px solid rgba(95, 113, 69, 0.12);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 24px rgba(5, 11, 24, 0.04);
}

.db-browser-meta-grid div {
  padding: 12px 13px;
  display: grid;
  gap: 5px;
}

.db-browser-meta-grid span {
  color: var(--muted);
  font-size: 0.78rem;
}

.db-browser-meta-grid strong {
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.db-browser-columns-card,
.db-browser-records-card {
  margin-top: 14px;
  padding: 14px;
}

.db-browser-inline-note {
  margin-top: 10px;
}

.db-browser-records-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(95, 113, 69, 0.1);
  background: rgba(255, 255, 255, 0.9);
}

.db-browser-records-table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
}

.db-browser-records-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(242, 237, 226, 0.96);
}

.db-browser-records-table th,
.db-browser-records-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(95, 113, 69, 0.1);
  text-align: left;
  vertical-align: top;
  font-size: 0.82rem;
}

.db-browser-records-table th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.db-browser-records-table tbody tr:hover {
  background: rgba(111, 157, 45, 0.06);
}

.db-browser-cell {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-browser-cell-null {
  color: var(--muted);
  font-style: italic;
}

.db-browser-row-open-btn,
.db-browser-load-more-btn {
  white-space: nowrap;
}

.db-browser-load-more-btn {
  margin-top: 12px;
}

@container (max-width: 760px) {
  .detail-list {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: static;
  }

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

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

  .stats-grid,
  .overview-grid,
  .list-layout,
  .settings-layout,
  .db-browser-layout {
    grid-template-columns: 1fr;
  }

  .settings-system-grid,
  .settings-threshold-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 16px, 1540px);
    margin: 8px auto;
  }

  .hero {
    padding: 18px;
    flex-direction: column;
    align-items: start;
  }

  .hero h2 {
    max-width: none;
  }

  .stats-grid,
  .overview-top-grid,
  .overview-runtime-grid,
  .db-browser-summary-grid,
  .db-browser-meta-grid,
  .form-grid,
  .toggle-panel,
  .settings-field-grid,
  .settings-inline-form,
  .settings-threshold-fields {
    grid-template-columns: 1fr;
  }

  .settings-field-grid.compact {
    grid-template-columns: 1fr;
  }

  .settings-system-head {
    flex-direction: column;
  }

  .settings-system-pills {
    justify-content: start;
  }

  .user-profile-quick-grid,
  .user-profile-stat-grid,
  .user-profile-history-grid {
    grid-template-columns: 1fr;
  }

  .detail-modal.user-profile-modal {
    width: min(100% - 12px, 1120px);
  }

  .db-browser-schema-list {
    max-height: 420px;
  }
}

@media (max-width: 640px) {
  .sidebar,
  .hero,
  .panel-card,
  .shell {
    padding: 14px;
  }

  .login-shell {
    width: min(100%, 520px);
  }

  .login-simple-card {
    padding: 24px 22px;
  }

  .login-simple-card h1 {
    font-size: 1.8rem;
  }

  .login-simple-card > p {
    max-width: none;
    font-size: 0.94rem;
  }

  .discord-login-card {
    padding: 20px;
  }

  .brand-block h1 {
    font-size: 1.35rem;
    max-width: none;
  }

  .brand-block p {
    font-size: 0.84rem;
    max-width: none;
  }

  .brand-lockup {
    padding: 16px;
    border-radius: 18px;
  }

  .brand-kss {
    font-size: 2.15rem;
  }

  .brand-subtitle {
    max-width: none;
    font-size: 0.94rem;
  }

  .tab-btn {
    padding: 11px 12px;
  }

  .feed-item-head {
    flex-direction: column;
  }

  .card-feed {
    grid-template-columns: 1fr;
  }

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

  summary {
    flex-wrap: wrap;
  }

  summary::after {
    order: -1;
  }

  .users-count {
    margin-left: 0;
    width: 100%;
  }

  .app-log-toolbar {
    align-items: stretch;
  }

  .app-log-toolbar-right,
  .app-log-sort-select {
    width: 100%;
  }

  .app-log-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-log-time {
    white-space: normal;
  }

  .detail-modal {
    width: min(100% - 12px, 760px);
    border-radius: 22px;
  }

  .modal-frame {
    padding: 14px;
  }

  .user-profile-top,
  .user-profile-history-head,
  .user-profile-stream-head,
  .user-profile-stream-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-profile-nav {
    top: -2px;
  }

  .user-profile-nav-btn {
    width: 100%;
    flex: 1 1 100%;
  }

  .user-profile-inline-actions {
    justify-content: flex-start;
  }

  .db-browser-records-table th,
  .db-browser-records-table td {
    padding: 10px;
    font-size: 0.78rem;
  }

  .db-browser-cell {
    max-width: 180px;
  }
}
