:root {
  --bg: #050705;
  --bg-soft: #0b110b;
  --card: rgba(18, 25, 18, 0.95);
  --line: rgba(56, 213, 94, 0.26);
  --line-strong: rgba(56, 213, 94, 0.55);
  --txt: #e8f4e8;
  --muted: #95ab95;
  --danger: #ef5b7a;
  --accent-a: #38d55e;
  --accent-b: #2fe0c4;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--txt);
  background: var(--bg);
}

body.cookie-locked .layout,
body.cookie-locked #dirtyBar {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 10% -20%, rgba(56, 213, 94, 0.18), transparent),
    radial-gradient(900px 500px at 90% 0%, rgba(47, 224, 196, 0.16), transparent),
    linear-gradient(160deg, #050705 0%, #0a0f0a 42%, #060906 100%);
  z-index: -1;
}

.layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px;
}

#appSection {
  padding-bottom: 110px;
}

.card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(6px);
  overflow: visible;
  position: relative;
}

.card:focus-within {
  z-index: 3000;
}

.landing-card {
  max-width: 1180px;
  margin: 24px auto;
}

.landing-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

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

.brand-logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-decoration: none;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

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

.guild-header-icon {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(101, 228, 138, 0.56);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.36),
    0 0 0 4px rgba(56, 213, 94, 0.12);
  flex: 0 0 auto;
}

.topbar-logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-decoration: none;
}

.topbar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text h1 {
  margin-bottom: 2px;
  font-size: 28px;
}

.brand-text small {
  color: var(--muted);
}

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

#landingProfileChip {
  flex: 0 0 auto;
}


.lang-inline {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.lang-select {
  min-width: 130px;
}

.landing-hero {
  border: 1px solid rgba(101, 228, 138, 0.24);
  border-radius: 14px;
  padding: 18px;
  background: rgba(16, 24, 16, 0.48);
}

.login-clean-card {
  max-width: 860px;
  margin-top: 34px;
  border: 1px solid rgba(101, 228, 138, 0.35);
  background:
    radial-gradient(900px 360px at 14% -26%, rgba(56, 213, 94, 0.17), transparent 70%),
    radial-gradient(760px 300px at 86% -18%, rgba(47, 224, 196, 0.12), transparent 72%),
    linear-gradient(175deg, rgba(16, 24, 16, 0.94), rgba(12, 17, 12, 0.94));
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.48);
}

.login-clean-topbar {
  justify-content: center;
  margin-bottom: 10px;
}

.login-clean-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  justify-content: center;
  text-align: center;
}

.landing-guild-icon {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(101, 228, 138, 0.58);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.42),
    0 0 0 4px rgba(56, 213, 94, 0.14);
  flex: 0 0 auto;
}

.login-clean-brand h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3.2vw, 2.3rem);
  letter-spacing: 0.2px;
}

.login-clean-brand small {
  display: block;
  margin-top: 8px;
  color: #a8c7a8;
  font-size: 0.94rem;
}

.login-clean-hero {
  text-align: center;
  border: 1px solid rgba(101, 228, 138, 0.3);
  background: linear-gradient(160deg, rgba(16, 27, 16, 0.78), rgba(11, 16, 11, 0.86));
}

.login-clean-hero h2 {
  margin-bottom: 8px;
  font-size: clamp(1.28rem, 2.7vw, 1.95rem);
}

.login-clean-hero p {
  margin: 0 auto;
  max-width: 620px;
  color: #b7d3b7;
}

.hero-actions-center {
  justify-content: center;
}

.connect-discord-btn {
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 280px;
  min-height: 44px;
  height: auto;
  padding: 10px 20px;
  color: #f5f7ff;
  border: 1px solid #5562ea;
  background: linear-gradient(135deg, #5865f2, #4b55ce);
  box-shadow: 0 10px 24px rgba(38, 50, 168, 0.35);
  transition: transform .22s ease, box-shadow .24s ease, border-color .24s ease, filter .24s ease;
  animation: heroPulse 2.2s ease-in-out infinite;
}

.connect-discord-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 10%, rgba(255, 255, 255, .18) 50%, transparent 90%);
  transform: translateX(-130%);
  transition: transform .62s ease;
  pointer-events: none;
  z-index: -1;
}

.connect-discord-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.26) 50%, transparent 80%);
  transform: translateX(-120%);
  animation: heroShine 2.8s ease-in-out infinite;
  pointer-events: none;
}

.connect-discord-btn:hover {
  transform: translateY(-2px) scale(1.01);
  filter: saturate(1.08);
  border-color: #8891ff;
  box-shadow: 0 12px 28px rgba(55, 67, 194, 0.46);
}

.connect-discord-btn:hover::before {
  transform: translateX(130%);
}

.discord-btn-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  position: relative;
}

.discord-btn-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.connect-discord-btn span:last-child {
  position: relative;
  z-index: 1;
}

@keyframes heroPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(56, 213, 94, 0); }
  50% { box-shadow: 0 0 0 6px rgba(56, 213, 94, 0.18); }
}

@keyframes heroShine {
  0%, 70%, 100% { transform: translateX(-120%); }
  85% { transform: translateX(120%); }
}

.landing-hero h2 {
  margin: 0 0 8px;
}

.hero-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-actions.left {
  justify-content: flex-start;
}

.hero-btn {
  min-width: 190px;
  height: 42px;
}

.hero-link-btn {
  height: 42px;
  border-radius: 10px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--txt);
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(135deg, #65e48a 0%, #38d55e 40%, #2aa954 70%, #1f8e3e 100%);
}

.landing-nav {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.landing-nav-btn {
  background: rgba(16, 28, 16, 0.9);
  border: 1px solid rgba(101, 228, 138, 0.28);
  border-radius: 999px;
  padding: 0 14px;
  height: 34px;
}

.landing-nav-btn.active {
  background: linear-gradient(90deg, rgba(56, 213, 94, 0.95), rgba(47, 224, 196, 0.95));
  color: #041107;
}

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

.landing-page {
  margin-top: 12px;
}

.landing-feature-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.landing-feature-list li {
  margin-bottom: 6px;
}

.dashboard-title {
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: 0.2px;
}

.landing-stat {
  position: relative;
  overflow: hidden;
}

.landing-stat::after {
  content: '';
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 213, 94, 0.18), transparent 68%);
}

.landing-box {
  border: 1px solid rgba(101, 228, 138, 0.24);
  border-radius: 12px;
  padding: 12px;
  background: rgba(16, 24, 16, 0.48);
}

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

.guild-card {
  border: 1px solid rgba(101, 228, 138, 0.25);
  border-radius: 12px;
  background: rgba(16, 24, 16, 0.55);
  padding: 10px;
}

.guild-head {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
}

.guild-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(101, 228, 138, 0.35);
  object-fit: cover;
}

.guild-icon-fallback {
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--txt);
  background: linear-gradient(90deg, rgba(56, 213, 94, 0.25), rgba(47, 224, 196, 0.25));
}

.guild-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.guild-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.guild-status.ok {
  color: #65e48a;
}

.guild-status.missing {
  color: #f7b06f;
}

.guild-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.guild-dashboard-card {
  max-width: 1180px;
  margin: 18px auto;
}

.guild-topbar {
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(101, 228, 138, 0.24);
  border-radius: 12px;
  background: rgba(16, 24, 16, 0.55);
}

.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(101, 228, 138, 0.35);
}

.profile-meta {
  display: grid;
  line-height: 1.05;
}

.profile-meta strong {
  font-size: 13px;
}

.profile-meta small {
  margin-top: 2px;
  font-size: 11px;
}

h1, h2, h3, h4 { margin: 0 0 8px; }
p { margin: 0 0 12px; color: var(--muted); line-height: 1.5; }

form { display: flex; gap: 10px; }

input, select, textarea, button {
  border-radius: 10px;
  border: 1px solid rgba(101, 228, 138, 0.35);
  background: #101710;
  color: var(--txt);
}

input, select, button {
  height: 40px;
  padding: 0 10px;
}

.channel-search,
.role-search {
  height: 34px;
}

.channel-live-list,
.role-live-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #101710;
  z-index: 999;
  padding: 4px;
}

.channel-live-item,
.role-live-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--txt);
  font-weight: 500;
}

.channel-live-item:hover,
.role-live-item:hover {
  background: rgba(56, 213, 94, 0.18);
}

.channel-live-item span,
.role-live-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  resize: vertical;
}

button {
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, #65e48a 0%, #38d55e 40%, #2aa954 70%, #1f8e3e 100%);
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(56, 213, 94, 0.14);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
button.secondary { background: #17311c; }
button.danger { background: #5f2230; }
button:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 12px rgba(56, 213, 94, 0.18); }

.hidden { display: none !important; }
#switchServerBtn { display: none !important; }
.error { color: #ff829f; min-height: 20px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  overflow: visible;
  padding: 10px 12px;
  border: 1px solid rgba(101, 228, 138, 0.22);
  background: rgba(16, 24, 16, 0.6);
}

.tab-btn {
  height: 40px;
  min-width: 0;
  width: 100%;
  background: rgba(16, 28, 16, 0.75);
  border: 1px solid rgba(101, 228, 138, 0.2);
  border-radius: 999px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.16s ease, box-shadow 0.22s ease;
}

.tab-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 213, 94, 0.45);
  background: rgba(18, 38, 20, 0.82);
}

.tab-btn.active {
  background: linear-gradient(90deg, rgba(56, 213, 94, 0.95), rgba(47, 224, 196, 0.95));
  color: #041107;
  border-color: rgba(56, 213, 94, 0.95);
  box-shadow: 0 5px 12px rgba(47, 224, 196, 0.14);
}

.tab-page {
  margin-top: 8px;
  animation: tabPageIn 0.24s ease;
}

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

.intro-card {
  border-color: var(--line-strong);
}

[data-page="overview"] {
  display: grid;
  gap: 12px;
  align-content: start;
}

[data-page="overview"] > section {
  margin: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg-soft);
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 24px; font-weight: 700; }

.info-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
}

.card-grid-2 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  align-items: stretch;
}

.card-grid-2 .card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.giveaway-stack {
  display: grid;
  gap: 12px;
}

.giveaway-stack .card {
  margin-bottom: 0;
}

.info-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(17, 29, 18, 0.8);
  min-height: 108px;
  display: flex;
  flex-direction: column;
}

.overview-visuals {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: stretch;
}

.visual-card {
  margin-bottom: 0;
}

.visual-main {
  font-size: 34px;
  font-weight: 800;
  margin: 4px 0 10px;
}

.progress-row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

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

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(101, 228, 138, 0.2);
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
}

.mini-stats {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.feature-pill-grid {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: stretch;
  grid-auto-rows: minmax(46px, auto);
}

.feature-pill {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(101, 228, 138, 0.25);
  background: rgba(16, 24, 16, 0.6);
}

.feature-pill > span:last-child {
  line-height: 1.2;
  font-weight: 600;
}

.feature-pill.on {
  border-color: rgba(56, 213, 94, 0.34);
  background: rgba(16, 40, 23, 0.62);
}

.feature-pill.off {
  border-color: rgba(239, 91, 122, 0.34);
  background: rgba(43, 19, 34, 0.52);
}

.feature-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.feature-pill.on .dot { background: #38d55e; }
.feature-pill.off .dot { background: #ef5b7a; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
}

[data-page="jointocreate"] .settings-grid {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  align-items: start;
}

[data-page="jointocreate"] .setting-tile {
  min-height: 0;
}

[data-page="jointocreate"] .jtc-switches {
  grid-column: 1 / -1;
}

[data-page="jointocreate"] .jtc-block {
  height: 100%;
}

[data-page="jointocreate"] .jtc-block .field > label {
  white-space: nowrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.setting-tile {
  padding: 10px;
  border: 1px solid rgba(101, 228, 138, 0.22);
  border-radius: 12px;
  background: rgba(16, 24, 16, 0.55);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.16s ease;
}

.setting-tile:hover {
  border-color: rgba(56, 213, 94, 0.42);
  background: rgba(16, 24, 16, 0.62);
}

.setting-tile.is-disabled {
  opacity: 0.7;
}

.nested-field {
  margin-top: 8px;
}

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

.tile-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.tiny-btn {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.lang-inline .tiny-btn.active {
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  color: #041107;
}

.field:focus-within {
  z-index: 120;
}

.tab-page .card {
  position: relative;
  z-index: 1;
}

.welcome-preview-tile {
  grid-column: 1 / -1;
}

.welcome-advanced-tile {
  grid-column: 1 / -1;
}

.welcome-settings-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
}

.welcome-tile {
  min-height: 118px;
}

.welcome-tile-welcome-channel,
.welcome-tile-leave-channel,
.welcome-tile-text-stack {
  grid-column: span 4;
}

.welcome-tile-text-stack {
  gap: 10px;
}

.welcome-tile-welcome-message,
.welcome-tile-leave-message {
  grid-column: span 6;
}

.welcome-tile-bg-url,
.welcome-tile-upload {
  grid-column: span 6;
}

.welcome-tile-welcome-message textarea,
.welcome-tile-leave-message textarea {
  min-height: 96px;
}

.welcome-advanced-details {
  border: 1px solid rgba(101, 228, 138, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(16, 24, 16, 0.42);
}

.welcome-advanced-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
}

.welcome-advanced-details summary::-webkit-details-marker {
  display: none;
}

.welcome-advanced-grid {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.welcome-preview-canvas {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(101, 228, 138, 0.28);
  background: rgba(16, 24, 16, 0.4);
  cursor: grab;
}

.welcome-preview-canvas:active {
  cursor: grabbing;
}

.welcome-preview-status {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.welcome-preview-status.loading {
  color: #8ccf9e;
}

.welcome-preview-status.ok {
  color: #65e48a;
}

.welcome-preview-status.error {
  color: #ff9bad;
}
.field label {
  font-size: 13px;
  color: var(--muted);
}

.field {
  position: relative;
  z-index: 1;
}

.field:focus-within {
  z-index: 2000;
}

.check-row {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.check-row .switch-row {
  padding: 10px;
  border: 1px solid rgba(101, 228, 138, 0.22);
  border-radius: 12px;
  background: rgba(16, 24, 16, 0.55);
}

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

.switch-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--txt);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex: 0 0 auto;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(118, 145, 118, 0.35);
  border: 1px solid rgba(118, 145, 118, 0.45);
  transition: all 0.18s ease;
}

.switch-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #edf7ed;
  transition: transform 0.18s ease;
}

.switch input:checked + .switch-slider {
  background: linear-gradient(90deg, rgba(56, 213, 94, 0.9), rgba(47, 224, 196, 0.9));
  border-color: rgba(56, 213, 94, 0.95);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(22px);
}

.switch input:disabled + .switch-slider {
  opacity: 0.55;
  cursor: not-allowed;
}

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

.list-grid,
.panel-list,
.warnings-list {
  display: grid;
  gap: 10px;
}

.ticket-card,
.panel-card,
.role-row,
.warn-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(17, 29, 18, 0.75);
}

.ticket-grid,
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  align-items: start;
}

.giveaway-form-grid > .field {
  padding: 10px;
  border: 1px solid rgba(101, 228, 138, 0.22);
  border-radius: 12px;
  background: rgba(16, 24, 16, 0.55);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.selfrole-panel-summary {
  width: 100%;
  border: 1px solid rgba(101, 228, 138, 0.24);
  background: rgba(16, 24, 16, 0.62);
  color: inherit;
  text-align: left;
  cursor: pointer;
  align-items: center;
  margin-bottom: 0;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: none;
  filter: none;
  transform: none;
  appearance: none;
  height: auto;
  min-height: 46px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.selfrole-panel-summary:hover,
.selfrole-panel-summary:focus-visible {
  box-shadow: none;
  filter: none;
  transform: none;
  border-color: rgba(56, 213, 94, 0.42);
  background: rgba(16, 24, 16, 0.72);
}

.selfrole-panel-toolbar {
  margin-top: 0;
  margin-bottom: 10px;
  justify-content: flex-end;
}

.role-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.ticket-panel-send-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.ticket-panel-send-row > button {
  height: 40px;
  min-width: 190px;
}

.role-chip-input {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 24, 16, 0.4);
}

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

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(56, 213, 94, 0.35);
  background: rgba(56, 213, 94, 0.12);
  font-size: 12px;
}

.role-chip-remove {
  border: none;
  background: transparent;
  color: var(--txt);
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
}

.role-chip-search {
  flex: 1 1 160px;
  min-width: 140px;
  background: transparent;
  border: none;
  color: var(--txt);
  outline: none;
  padding: 4px 2px;
}

.role-chip-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 24, 16, 0.98);
  max-height: 220px;
  overflow: auto;
  padding: 6px;
}

.role-chip-suggest button {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  border: 1px solid transparent;
}

.role-chip-suggest button:hover {
  border-color: rgba(56, 213, 94, 0.4);
}

.welcome-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 1280px) {
  .welcome-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .welcome-tile-welcome-channel,
  .welcome-tile-leave-channel,
  .welcome-tile-text-stack,
  .welcome-tile-bg-url,
  .welcome-tile-welcome-message,
  .welcome-tile-leave-message,
  .welcome-tile-upload {
    grid-column: span 1;
  }
}

@media (max-width: 760px) {
  .welcome-settings-grid {
    grid-template-columns: 1fr;
  }

  .welcome-tile-welcome-channel,
  .welcome-tile-leave-channel,
  .welcome-tile-text-stack,
  .welcome-tile-bg-url,
  .welcome-tile-welcome-message,
  .welcome-tile-leave-message,
  .welcome-tile-upload {
    grid-column: 1 / -1;
  }
}

.warn-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 6px;
}

.dirty-bar {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(13, 21, 13, 0.95);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.dirty-bar.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dirty-actions {
  display: flex;
  gap: 10px;
}

.dirty-actions button.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: wait;
  opacity: 0.94;
}

.dirty-actions button.is-loading:hover {
  transform: none;
  filter: none;
}

.loading-dots {
  display: inline-flex;
  align-items: center;
  min-width: 34px;
  gap: 5px;
  margin-left: 2px;
}

.loading-dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f0fff3;
  box-shadow: 0 0 0 1px rgba(56, 213, 94, 0.45);
  opacity: 0.3;
  animation: loadingDotPulse 1s infinite ease-in-out;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes loadingDotPulse {
  0%, 70%, 100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

.cookie-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(5, 10, 5, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.cookie-gate.hidden {
  display: none;
}

.cookie-gate-card {
  width: min(660px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(14, 22, 14, 0.98), rgba(10, 17, 10, 0.98));
  padding: 18px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.4);
  transform: translateY(10px) scale(0.985);
  opacity: 0;
  animation: cookieSlideIn .22s ease forwards;
}

.cookie-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(101, 228, 138, 0.45);
  background: rgba(24, 47, 24, 0.55);
  color: #b7d9b7;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  margin-bottom: 8px;
}

.cookie-gate-card h3 {
  margin: 0;
  font-size: 22px;
}

.cookie-gate-card p {
  margin: 0;
  color: var(--muted);
}

.cookie-gate-sub {
  margin-top: 2px !important;
  font-size: 13px;
  color: #afc7af !important;
}

.cookie-gate-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cookie-gate-actions a {
  text-decoration: none;
}

.cookie-gate-hint {
  margin-top: 10px !important;
  font-size: 12px;
  color: #8fa98f !important;
  text-align: right;
}

.cookie-btn {
  height: 40px;
  border-radius: 10px;
  padding: 0 14px;
  font-weight: 700;
  border: 1px solid rgba(101, 228, 138, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, filter 0.16s ease, background 0.16s ease;
}

.cookie-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(101, 228, 138, 0.65);
}

.cookie-btn-ghost {
  background: rgba(16, 24, 16, 0.72);
  color: var(--txt);
}

.cookie-btn-primary {
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  color: #041107;
  border-color: rgba(101, 228, 138, 0.75);
}

.cookie-btn-neutral {
  background: rgba(16, 29, 16, 0.92);
  color: #d8ebd8;
}

@keyframes cookieSlideIn {
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.custom-command-item {
  border: 1px solid rgba(125, 157, 125, 0.25);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(15, 23, 15, 0.35);
}

.custom-command-item > .accordion-body,
.warn-user-item > .accordion-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  will-change: max-height, opacity, transform;
  transition: max-height 0.32s ease, opacity 0.22s ease, transform 0.22s ease;
}

.custom-command-item.is-open > .accordion-body,
.warn-user-item.is-open > .accordion-body {
  max-height: 2600px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: max-height 0.36s ease, opacity 0.24s ease, transform 0.24s ease;
}

.selfrole-panel-card > .accordion-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-12px);
  pointer-events: none;
  will-change: max-height, opacity, transform;
  transition: max-height 0.34s ease, opacity 0.24s ease, transform 0.24s ease;
}

.selfrole-panel-card.is-open > .accordion-body {
  max-height: 2600px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: max-height 0.42s ease, opacity 0.3s ease, transform 0.3s ease;
}

.accordion-inner {
  overflow: hidden;
  min-height: 0;
  padding-top: 2px;
}

.custom-command-summary {
  width: 100%;
  border: 1px solid rgba(101, 228, 138, 0.24);
  background: rgba(16, 24, 16, 0.62);
  text-align: left;
  display: grid;
  grid-template-columns: 220px 1fr 120px;
  gap: 14px;
  align-items: center;
  color: #e2efe2;
  font-size: 14px;
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 12px;
  box-shadow: none;
  filter: none;
  transform: none;
  appearance: none;
  height: auto;
  min-height: 46px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.custom-command-summary:hover,
.custom-command-summary:focus-visible {
  box-shadow: none;
  filter: none;
  transform: none;
  border-color: rgba(56, 213, 94, 0.42);
  background: rgba(16, 24, 16, 0.72);
}

.custom-command-item.is-open .custom-command-summary {
  margin-bottom: 10px;
  border-color: rgba(56, 213, 94, 0.5);
  background: rgba(16, 24, 16, 0.74);
}

.custom-command-item.is-open .custom-command-grid,
.custom-command-item.is-open .custom-command-response {
  animation: tabPageIn 0.22s ease;
}

.custom-command-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: stretch;
}

.custom-command-grid > .custom-cell {
  min-height: 96px;
  padding: 8px;
  border: 1px solid rgba(101, 228, 138, 0.2);
  border-radius: 10px;
  background: rgba(16, 24, 16, 0.38);
}

.custom-command-grid > .custom-cell.custom-switches {
  justify-content: space-between;
}

.custom-command-grid > .custom-cell.custom-span-2 {
  grid-column: span 2;
  min-height: 118px;
}

.selfrole-panel-grid {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.custom-command-response {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(101, 228, 138, 0.2);
  border-radius: 10px;
  background: rgba(16, 24, 16, 0.38);
}

.custom-command-response textarea {
  min-height: 110px;
}

.warn-summary {
  width: 100%;
  border: 1px solid rgba(101, 228, 138, 0.24);
  background: rgba(16, 24, 16, 0.62);
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: none;
  filter: none;
  transform: none;
  appearance: none;
  height: auto;
  min-height: 46px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.warn-summary:hover,
.warn-summary:focus-visible {
  box-shadow: none;
  filter: none;
  transform: none;
  border-color: rgba(56, 213, 94, 0.42);
  background: rgba(16, 24, 16, 0.72);
}

.warn-user-item.is-open .warn-summary,
.selfrole-panel-card.is-open .selfrole-panel-summary {
  margin-bottom: 8px;
  border-color: rgba(56, 213, 94, 0.5);
  background: rgba(16, 24, 16, 0.74);
}

.selfrole-panel-card {
  overflow: hidden;
}

.custom-command-grid input[type="color"],
.selfrole-panel-grid input[type="color"] {
  height: 36px;
  padding: 0;
  border-radius: 8px;
}

[data-page="levels"] .settings-grid {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  align-items: stretch;
}

[data-page="levels"] .level-tile {
  min-height: 128px;
}

[data-page="levels"] .level-tile-rewards {
  grid-column: 1 / -1;
  min-height: 220px;
}

[data-page="levels"] .level-tile-xp .inline-grid {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.level-reward-card {
  min-height: 96px;
}

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

@media (max-width: 900px) {
  .layout { padding: 12px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .landing-topbar { flex-direction: column; align-items: flex-start; }
  .topbar-brand { width: 100%; align-items: center; }
  .topbar-brand > div { min-width: 0; }
  .landing-actions { width: 100%; }
  .landing-actions > * { flex: 1; }
  .landing-nav { width: 100%; }
  .landing-nav-btn { flex: 1 1 calc(50% - 8px); }
  .hero-btn { width: 100%; min-width: 0; }
  .dirty-bar { left: 12px; right: 12px; bottom: 12px; flex-direction: column; align-items: stretch; }
  .dirty-actions { width: 100%; }
  .dirty-actions button { flex: 1; }
  [data-page="jointocreate"] .settings-grid { grid-template-columns: 1fr; }
  [data-page="jointocreate"] .jtc-switches { grid-column: auto; }
  .overview-visuals,
  .stats,
  .info-grid,
  .feature-pill-grid {
    grid-template-columns: 1fr;
  }
  .custom-command-summary {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .custom-command-grid {
    grid-template-columns: 1fr 1fr;
  }
  .custom-command-grid > .custom-cell.custom-span-2 {
    grid-column: 1 / -1;
  }
  .ticket-panel-send-row {
    grid-template-columns: 1fr;
  }
  .ticket-panel-send-row > button {
    width: 100%;
    min-width: 0;
  }
  .selfrole-panel-grid {
    grid-template-columns: 1fr 1fr;
  }
  [data-page="levels"] .settings-grid {
    grid-template-columns: 1fr;
  }
  [data-page="levels"] .level-tile-rewards {
    grid-column: auto;
  }
  [data-page="levels"] .level-tile-xp .inline-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stat,
  .visual-card,
  .info-box {
    min-height: 0;
  }
  .guild-actions {
    grid-template-columns: 1fr;
  }
  .profile-chip {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .layout { padding: 10px; }
  .card { padding: 12px; }
  .landing-card { margin: 14px auto; }

  .brand { gap: 12px; }
  .brand-logo { width: 52px; height: 52px; border-radius: 12px; }
  .landing-guild-icon { width: 74px; height: 74px; }
  .guild-header-icon { width: 48px; height: 48px; }
  .brand-text h1 { font-size: 22px; }
  .brand-text small { font-size: 12px; }

  .topbar-brand { gap: 10px; }
  .topbar-logo { width: 52px; height: 52px; border-radius: 12px; }

  .dashboard-title { font-size: 24px; }
  .landing-hero h2 { font-size: 22px; }

  .landing-actions { gap: 8px; }
  .landing-actions > * { width: 100%; }
  .landing-nav-btn { flex: 1 1 100%; }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tab-btn { white-space: nowrap; }

  .top-actions { width: 100%; }
  .top-actions button { flex: 1 1 auto; }
  .lang-inline { width: 100%; }
  .lang-inline button { flex: 1 1 auto; }

  .landing-grid,
  .guild-cards,
  .settings-grid,
  .stats,
  .info-grid,
  .feature-pill-grid {
    grid-template-columns: 1fr;
  }
  .custom-command-grid {
    grid-template-columns: 1fr;
  }
  .custom-command-grid > .custom-cell.custom-span-2 {
    grid-column: auto;
  }
  .selfrole-panel-grid {
    grid-template-columns: 1fr;
  }
  [data-page="levels"] .level-tile-xp .inline-grid {
    grid-template-columns: 1fr;
  }
}
