@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Kanit', sans-serif;
}

a:visited { color: inherit; }

/* ── Background (used by authenticated pages) ── */
.background {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% -5%, rgba(50,138,241,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(30,80,180,0.06), transparent),
    hsl(221,29%,11%);
  z-index: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.30);
  z-index: 1;
}

body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: rgba(186,217,252,0.85);
  background-color: hsl(221,29%,11%);
}

/* ── Modal (auth pages) ── */
.modal {
  width: 520px;
  max-width: 92vw;
  background: hsl(218,31%,17%);
  border: 1px solid rgba(50,138,241,0.18);
  border-radius: 20px;
  padding: 28px;
  z-index: 2;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8), 0 0 0 1px rgba(50,138,241,0.06);
  backdrop-filter: blur(16px);
}

.modal.auth-large {
  max-width: 560px;
  padding: 36px;
}

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

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255,182,0,0.3);
}

.modal.auth-large .brand-logo {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  margin-right: 4px;
}

.brand h1 {
  font-size: 18px;
  font-weight: 700;
  color: rgba(186,217,252,0.95);
}

.brand p {
  font-size: 12px;
  color: rgba(186,217,252,0.45);
  margin-top: 2px;
}

.divider {
  height: 1px;
  margin: 20px 0;
  background: linear-gradient(90deg, transparent, rgba(50,138,241,0.25), transparent);
}

/* ── Themed scrollbars ── */
.themed-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(50,138,241,0.25) transparent;
}
.themed-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.themed-scroll::-webkit-scrollbar-track { background: transparent; }
.themed-scroll::-webkit-scrollbar-thumb { background: rgba(50,138,241,0.25); border-radius: 99px; }
.themed-scroll::-webkit-scrollbar-thumb:hover { background: rgba(50,138,241,0.45); }
.themed-scroll::-webkit-scrollbar-corner { background: transparent; }

/* ── Buttons ── */
.allow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Kanit', sans-serif;
  background: #FFB600;
  color: hsl(221,29%,11%);
  transition: background 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.allow:hover { background: #F0AB00; }

.deny {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Kanit', sans-serif;
  background: rgba(255,255,255,0.04);
  color: rgba(186,217,252,0.65);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.deny:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(186,217,252,0.9);
  border-color: rgba(255,255,255,0.14);
}

/* ── Full-page dashboard layout ── */
.fullpage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  padding: 0;
  background: hsl(221,29%,11%);
  margin: 0;
  box-shadow: none;
  display: flex;
  flex-direction: row;
  z-index: 9999;
  border-radius: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 32px;
  border-bottom: 1px solid rgba(50,138,241,0.08);
  background: hsla(221,29%,11%,0.95);
  position: relative;
  z-index: 50;
  flex-shrink: 0;
}

.app-shell.full {
  display: flex;
  flex: 1;
  overflow: hidden;
  flex-direction: row;
  min-height: 0;
}

.content-col {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 0;
  background: hsl(218,28%,14%);
  border-right: 1px solid rgba(50,138,241,0.1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100vh;
  position: relative;
  z-index: 100;
}

.sidebar .brand-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(50,138,241,0.1);
  text-decoration: none;
  color: inherit;
  background: rgba(255,182,0,0.03);
  flex-shrink: 0;
}

.sidebar .brand-compact:hover { background: rgba(255,182,0,0.05); }

.sidebar .brand-compact img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid rgba(255,182,0,0.3);
  flex-shrink: 0;
}

.sidebar .brand-compact .brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar .brand-compact .brand-name {
  font-weight: 800;
  color: rgba(186,217,252,0.95);
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.sidebar .brand-compact .brand-sub {
  font-size: 10px;
  font-weight: 600;
  color: #FFB600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

.sidebar nav {
  flex: 1;
  padding: 10px 8px;
}

/* Section labels inside sidebar */
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(186,217,252,0.3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 14px 4px;
  user-select: none;
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 2px;
  border-radius: 10px;
  color: rgba(186,217,252,0.55);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.14s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.sidebar .nav-item:hover {
  background: rgba(50,138,241,0.06);
  color: rgba(186,217,252,0.85);
  border-color: rgba(50,138,241,0.12);
}

.sidebar .nav-item.active {
  background: rgba(255,182,0,0.12);
  border-color: rgba(255,182,0,0.2);
  color: #FFB600;
  border-left: 3px solid #FFB600;
  padding-left: 11px;
}

.sidebar .nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar .nav-item.active svg { opacity: 1; }

/* Sub-items (Developer section) */
.sidebar .nav-item.nav-sub {
  font-size: 12px;
  padding: 8px 14px 8px 28px;
  margin-bottom: 1px;
}

.sidebar .footer-note {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid rgba(50,138,241,0.08);
  color: rgba(186,217,252,0.25);
  font-size: 12px;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(50,138,241,0.08);
  padding: 8px 0;
}

/* ── Main content ── */
.main {
  flex: 1;
  padding: 28px 36px;
  margin: 0 auto;
  width: 100%;
  touch-action: pan-y;
}

/* ── Cards ── */
.card {
  background: hsl(218,31%,17%);
  border: 1px solid rgba(50,138,241,0.15);
  padding: 20px;
  border-radius: 14px;
  transition: border-color 0.2s ease;
}

.card-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
  color: rgba(186,217,252,0.95);
}

/* ── Profile menu ── */
.profile-menu {
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  z-index: 10002;
}

.gravatar-img {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  box-shadow: 0 0 0 0 rgba(255,182,0,0);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.profile-menu.open .gravatar-img { box-shadow: 0 0 0 3px rgba(255,182,0,0.35); }

.profile-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  padding-top: 10px;
  background: transparent;
  z-index: 10001;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform-origin: top right;
  transform: translateY(-6px) scale(0.97);
  transition: opacity 150ms ease, transform 170ms cubic-bezier(.2,.9,.2,1), visibility 150ms;
}

.profile-dropdown-inner {
  background: hsl(218,28%,14%);
  border: 1px solid rgba(50,138,241,0.12);
  border-radius: 14px;
  min-width: 240px;
  padding: 6px;
  box-shadow: 0 16px 56px rgba(0,0,0,0.8);
}

.profile-menu.open .profile-dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}

.dropdown-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
}

.dropdown-user-info img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  flex-shrink: 0;
}

.dropdown-user-info .user-name  { font-weight: 700; font-size: 14px; color: rgba(186,217,252,0.95); }
.dropdown-user-info .user-email { font-size: 12px; color: rgba(186,217,252,0.4); margin-top: 1px; }

.dropdown-sep {
  height: 1px;
  margin: 6px 8px;
  background: rgba(50,138,241,0.1);
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(186,217,252,0.65);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.12s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Kanit', sans-serif;
}

.dropdown-link:hover { background: rgba(50,138,241,0.08); color: rgba(186,217,252,0.9); }
.dropdown-link.danger { color: #f87171; }
.dropdown-link.danger:hover { background: rgba(248,113,113,0.08); color: #ff8080; }
.dropdown-link svg { width: 16px; height: 16px; opacity: 0.7; flex-shrink: 0; }

/* ── Form inputs ── */
input, textarea, select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(50,138,241,0.12);
  color: rgba(186,217,252,0.9);
  font-size: 14px;
  font-family: 'Kanit', sans-serif;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.password-reveal {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(186,217,252,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s;
  padding: 0;
}
.password-reveal:hover { color: rgba(186,217,252,0.6); }
.password-reveal svg { width: 16px; height: 16px; flex-shrink: 0; }

input:focus, textarea:focus, select:focus {
  border-color: rgba(255,182,0,0.5);
  box-shadow: 0 0 0 3px rgba(255,182,0,0.08);
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(186,217,252,0.45);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Alerts ── */
.error {
  color: #fca5a5;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}

.success {
  color: #6ee7b7;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.muted       { font-size: 12px; color: rgba(186,217,252,0.45); }
.small-muted { font-size: 12px; color: rgba(186,217,252,0.45); }
.footer-note { color: rgba(186,217,252,0.3); font-size: 12px; margin-top: 12px; }
.logout { color: #FFB600; text-decoration: none; font-weight: 600; transition: color 0.15s; }
.logout:hover { color: #FFD050; }

.verified {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,182,0,0.1);
  border: 1px solid rgba(255,182,0,0.3);
  color: #FFB600;
}

.required-star { color: #f87171; margin-left: 4px; }

/* ── App grid / cards ── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.app-card-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 12px 14px;
  border-radius: 14px;
  background: hsl(218,31%,17%);
  border: 1px solid rgba(50,138,241,0.12);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(.2,.8,.2,1);
  text-decoration: none;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.app-card-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(255,182,0,0.06), transparent 70%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.app-card-tile:hover {
  border-color: rgba(255,182,0,0.3);
  background: rgba(255,182,0,0.04);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.app-card-tile:hover::before { opacity: 1; }

.app-card-tile .app-thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(50,138,241,0.15);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: transform 0.18s ease;
}

.app-card-tile:hover .app-thumb { transform: scale(1.05); }

.app-card-tile .app-tile-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(186,217,252,0.9);
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.app-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.app-detail-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid rgba(255,182,0,0.25);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.app-detail-icon:hover { border-color: rgba(255,182,0,0.6); }

.app-detail-name { font-size: 22px; font-weight: 800; color: rgba(186,217,252,0.95); }
.app-detail-id   { font-size: 12px; color: rgba(186,217,252,0.3); font-family: monospace; margin-top: 4px; }

.token-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(50,138,241,0.1);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: rgba(186,217,252,0.55);
  min-width: 0;
}

.token-box .token-val { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.token-box button     { flex-shrink: 0; padding: 4px 10px; font-size: 12px; border-radius: 6px; }

.scope-box { display: flex; flex-direction: column; gap: 8px; }

.perm {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(50,138,241,0.03);
  border: 1px solid rgba(50,138,241,0.08);
  transition: all 0.15s ease;
}

.perm:hover { border-color: rgba(255,182,0,0.2); }
.perm.no-hover { background: transparent; border: none; cursor: default; padding: 0; }
.perm.no-hover:hover { transform: none; border: none; background: transparent; }

.perm strong { display: block; font-size: 13px; color: rgba(186,217,252,0.9); }
.perm span   { display: block; font-size: 12px; color: rgba(186,217,252,0.45); margin-top: 2px; }

/* ── Section headings ── */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 18px;
  font-weight: 700;
  color: rgba(186,217,252,0.95);
}

/* ── Settings rows ── */
.settings-section       { margin-bottom: 24px; }
.settings-section-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(186,217,252,0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 10px;
  background: hsl(218,31%,17%);
  border: 1px solid rgba(50,138,241,0.12);
  margin-bottom: 8px;
}

.settings-row-label { font-size: 14px; font-weight: 600; color: rgba(186,217,252,0.9); }
.settings-row-sub   { font-size: 12px; color: rgba(186,217,252,0.45); margin-top: 2px; }

.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(239,68,68,0.3);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Kanit', sans-serif;
  background: rgba(239,68,68,0.06);
  color: #f87171;
  transition: all 0.15s ease;
}
.danger-btn:hover { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.5); }

/* ── Toggle switch ── */
.toggle-switch { position: relative; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 24px;
  cursor: pointer;
  transition: 0.2s ease;
}
.toggle-slider:before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: rgba(186,217,252,0.45);
  border-radius: 50%;
  transition: 0.2s ease;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(255,182,0,0.5); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); background: #FFB600; }

/* ── App list card ── */
.app-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: hsl(218,31%,17%);
  border: 1px solid rgba(50,138,241,0.12);
  cursor: pointer;
  transition: all 0.15s ease;
}
.app-card:hover { border-color: rgba(255,182,0,0.25); background: rgba(255,182,0,0.03); }

/* ── Animations ── */
@keyframes shake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-8px); }
  40%  { transform: translateX(8px); }
  60%  { transform: translateX(-5px); }
  80%  { transform: translateX(5px); }
  100% { transform: translateX(0); }
}
.shake { animation: shake 500ms ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.25s ease; }

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(186,217,252,0.45);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  transition: color 0.15s ease;
}
.back-link:hover { color: #FFB600; }

.app-creds-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

/* ── Hamburger ── */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(50,138,241,0.12);
  background: rgba(50,138,241,0.04);
  color: rgba(186,217,252,0.45);
  cursor: pointer;
  flex-shrink: 0;
  margin-right: auto;
  transition: background 0.15s;
}
.hamburger-btn:hover { background: rgba(50,138,241,0.1); color: rgba(186,217,252,0.9); }
.hamburger-btn svg { width: 18px; height: 18px; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
}
.sidebar-overlay.active { display: block; }

/* ── Auth page ── */
.auth-subtitle { margin-top: 22px; padding-top: 4px; }
.auth-subtitle .welcome {
  font-size: 16px;
  font-weight: 600;
  color: rgba(186,217,252,0.9);
  margin-bottom: 4px;
}

/* Auth background */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: hsl(221,29%,9%);
}

.auth-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(20,40,100,0.9), transparent 60%),
    radial-gradient(ellipse 80% 60% at -10% 60%, rgba(10,30,80,0.7), transparent 55%),
    radial-gradient(ellipse 70% 50% at 110% 80%, rgba(30,60,120,0.5), transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 110%, rgba(80,50,0,0.3), transparent 50%),
    linear-gradient(160deg, #0d1424 0%, #0a1220 40%, #100d1e 70%, #0c1428 100%);
}

.auth-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 40% 30% at 15% 25%, rgba(50,138,241,0.12), transparent),
    radial-gradient(ellipse 35% 25% at 85% 20%, rgba(255,182,0,0.08), transparent),
    radial-gradient(ellipse 30% 20% at 70% 75%, rgba(50,138,241,0.08), transparent),
    radial-gradient(ellipse 25% 20% at 25% 80%, rgba(100,150,255,0.06), transparent);
  animation: authBgShift 12s ease-in-out infinite alternate;
}

@keyframes authBgShift {
  0%   { opacity: 0.7; transform: scale(1) translateY(0); }
  50%  { opacity: 1;   transform: scale(1.04) translateY(-8px); }
  100% { opacity: 0.8; transform: scale(1.02) translateY(4px); }
}

.auth-bg .auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(50,138,241,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50,138,241,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.auth-bg .auth-glow-1 {
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  top: -150px; left: -100px;
  background: radial-gradient(circle, rgba(50,138,241,0.10) 0%, transparent 70%);
  animation: floatOrb1 10s ease-in-out infinite;
  pointer-events: none;
}

.auth-bg .auth-glow-2 {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  bottom: -200px; right: -150px;
  background: radial-gradient(circle, rgba(255,182,0,0.08) 0%, transparent 70%);
  animation: floatOrb2 14s ease-in-out infinite;
  pointer-events: none;
}

.auth-bg .auth-glow-3 {
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  top: 40%; left: 55%;
  background: radial-gradient(circle, rgba(50,138,241,0.07) 0%, transparent 70%);
  animation: floatOrb3 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes floatOrb1 {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%       { transform: translate(30px,20px) scale(1.05); }
  66%       { transform: translate(-15px,35px) scale(0.97); }
}
@keyframes floatOrb2 {
  0%, 100% { transform: translate(0,0) scale(1); }
  40%       { transform: translate(-25px,-30px) scale(1.06); }
  70%       { transform: translate(20px,-10px) scale(0.96); }
}
@keyframes floatOrb3 {
  0%, 100% { transform: translate(0,0) scale(1); opacity: 0.8; }
  50%       { transform: translate(-20px,15px) scale(1.08); opacity: 1; }
}

.auth-bg .auth-noise {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
}

.auth-bg .auth-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  pointer-events: none;
}

body.auth-page::before { display: none; }
body.auth-page .background { display: none; }
body.auth-page { align-items: center; justify-content: center; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  min-width: 280px;
  max-width: 400px;
  padding: 13px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  background: hsl(218,31%,17%);
  border: 1px solid rgba(50,138,241,0.2);
  color: rgba(186,217,252,0.9);
}
.toast-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ── btn-primary (used in admin/apps) ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Kanit', sans-serif;
  background: #FFB600;
  color: hsl(221,29%,11%);
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.btn-primary:hover { background: #F0AB00; }

.auth-app-card:hover { border-color: rgba(255,182,0,0.2) !important; }

/* ── Spinner ── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(255,182,0,0.15);
  border-top-color: #FFB600;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#linkCodeDisplay { user-select: all; }

/* ════════════════════════════════════════════
   PUBLIC PAGES (top-navbar layout)
   ════════════════════════════════════════════ */

body.public-layout {
  height: auto;
  min-height: 100vh;
  display: block;
  background-color: hsl(221,29%,11%);
  background-image: radial-gradient(ellipse 80% 40% at 50% -5%, rgba(50,138,241,0.08) 0%, transparent 70%);
  background-repeat: no-repeat;
  color: rgba(186,217,252,0.85);
}

body.public-layout::before { display: none; }

/* Top navbar */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.065);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: hsla(223,24%,15%,0.85);
}

.topnav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: stretch;
  height: 64px;
  gap: 0;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: 32px;
  text-decoration: none;
  color: rgba(186,217,252,0.9);
}

.topnav-brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.topnav-brand span {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 40px;
  height: 40px;
  margin: auto 14px auto 0;
  border: 1px solid rgba(50,138,241,0.18);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger-btn span {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: rgba(186,217,252,0.85);
}

.topnav-links {
  display: flex;
  align-items: stretch;
  margin-right: auto;
}

.topnav-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color 0.15s;
  color: rgba(186,217,252,0.45);
}

.topnav-link:hover { color: rgba(186,217,252,0.9); }

.topnav-link.active { color: #fff; }

.topnav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #FFB600;
}

.topnav-discord-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color 0.15s;
  color: rgba(186,217,252,0.45);
}
.topnav-discord-link svg { width: 14px; height: 14px; flex-shrink: 0; }
.topnav-discord-link:hover { color: #FFB600; }

.topnav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.topnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Kanit', sans-serif;
  background: #FFB600;
  color: hsl(221,29%,11%);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.15s;
  white-space: nowrap;
}
.topnav-btn:hover { background: #F0AB00; }

/* ---------------- Player search ---------------- */

.nav-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(50,138,241,0.18);
  background: rgba(13,22,36,0.6);
  color: rgba(186,217,252,0.65);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.nav-search-btn:hover { background: rgba(50,138,241,0.12); color: #FFB600; border-color: rgba(255,182,0,0.3); }

.ps-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5,10,18,0.72);
  backdrop-filter: blur(3px);
  z-index: 500;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 40px;
  overflow-y: auto;
}
.ps-overlay.open { display: flex; }

.ps-modal {
  width: 100%;
  max-width: 640px;
  background: hsl(221,29%,11%);
  border: 1px solid rgba(50,138,241,0.18);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
  font-family: 'Kanit', sans-serif;
}

.ps-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(50,138,241,0.1);
}
.ps-search-icon { color: rgba(186,217,252,0.4); flex-shrink: 0; }
.ps-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: rgba(186,217,252,0.95);
  font-size: 16px;
  font-family: 'Kanit', sans-serif;
}
.ps-input::placeholder { color: rgba(186,217,252,0.3); }
.ps-close {
  background: none;
  border: none;
  color: rgba(186,217,252,0.4);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}
.ps-close:hover { color: #FFB600; }

.ps-body { max-height: 70vh; overflow-y: auto; padding: 8px; }
.ps-hint { padding: 24px; text-align: center; color: rgba(186,217,252,0.4); font-size: 13px; }
.ps-hint.ps-error { color: #f87171; }
.ps-group { padding: 8px 0; }
.ps-group + .ps-group { border-top: 1px solid rgba(50,138,241,0.08); }
.ps-group-title { padding: 2px 12px 6px; color: rgba(186,217,252,0.42); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.ps-result > span:nth-child(2) { min-width: 0; flex: 1; }
.ps-result strong, .ps-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-result small { margin-top: 1px; color: rgba(186,217,252,0.46); font-size: 11px; font-weight: 500; }
.ps-result-symbol { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 6px; background: rgba(50,138,241,0.12); color: #8dbbff; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.ps-external { color: rgba(186,217,252,0.42); font-size: 16px; }
.ps-section-note { margin: -2px 0 10px; color: rgba(186,217,252,0.46); font-size: 11px; line-height: 1.4; }

.ps-results { display: flex; flex-direction: column; gap: 2px; }
.ps-result {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: rgba(186,217,252,0.9);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Kanit', sans-serif;
  text-align: left;
}
.ps-result:hover { background: rgba(50,138,241,0.1); }
.ps-result-avatar { width: 28px; height: 28px; border-radius: 6px; image-rendering: pixelated; }
.ps-result-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; }
.ps-result-icon .ps-item-icon-sm { width: 28px; height: 28px; border-radius: 6px; font-size: 16px; }
.ps-result-icon .ps-item-icon-sm .ps-item-icon-img { width: 20px; height: 20px; }
.ps-community-result { align-items: flex-start; }
.ps-community-result .ps-result-symbol { margin-top: 2px; }
.ps-result-copy { display: block; flex: 1; min-width: 0; }
.ps-result-title { display: -webkit-box; overflow: hidden; color: rgba(186,217,252,0.94); font-size: 14px !important; font-weight: 700; line-height: 1.25; text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ps-result-snippet { display: -webkit-box; overflow: hidden; margin-top: 3px; color: rgba(186,217,252,0.5); font-size: 11px !important; font-weight: 500; line-height: 1.35; text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ps-community-result:hover .ps-result-title { color: #c7dcff; text-decoration: none; }

.ps-back {
  background: none;
  border: none;
  color: rgba(186,217,252,0.45);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  font-family: 'Kanit', sans-serif;
}
.ps-back:hover { color: #FFB600; }

.ps-sheet { padding: 4px 16px 20px; }
.ps-sheet-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(50,138,241,0.1);
}
.ps-avatar {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  image-rendering: pixelated;
  border: 1px solid rgba(255,182,0,0.25);
  box-shadow: 0 0 0 4px rgba(255,182,0,0.06);
}
.ps-sheet-name {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.ps-sheet-sub { font-size: 12px; color: rgba(186,217,252,0.45); margin-top: 4px; }

.ps-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.ps-stat {
  background: rgba(13,22,36,0.5);
  border: 1px solid rgba(50,138,241,0.1);
  border-radius: 10px;
  padding: 10px 12px;
}
.ps-stat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(186,217,252,0.4); margin-bottom: 4px; }
.ps-stat-value { font-size: 18px; font-weight: 800; color: #FFB600; }
.ps-stat-value-sm { font-size: 14px; color: rgba(186,217,252,0.9); }

.ps-section { margin-bottom: 16px; }
.ps-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(186,217,252,0.4);
  margin-bottom: 8px;
}
.ps-section-body { font-size: 13px; color: rgba(186,217,252,0.8); }
.ps-muted { color: rgba(186,217,252,0.4); }
.ps-empty { color: rgba(186,217,252,0.35); font-size: 12px; font-style: italic; }

.ps-badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ps-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
  border: 1px solid;
}
.ps-badge-muted { color: rgba(186,217,252,0.5); background: rgba(186,217,252,0.06); border-color: rgba(186,217,252,0.1); }

.ps-corp-list { display: flex; flex-direction: column; gap: 8px; }
.ps-corp-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13,22,36,0.5);
  border: 1px solid rgba(50,138,241,0.1);
  border-radius: 8px;
  padding: 8px 12px;
}
.ps-corp-name { font-size: 13px; font-weight: 700; color: rgba(186,217,252,0.9); }
.ps-corp-ticker { font-size: 10px; font-weight: 700; color: #FFB600; background: rgba(255,182,0,0.1); padding: 1px 6px; border-radius: 4px; margin-left: 4px; }

.ps-mode-dropdown { position: relative; flex-shrink: 0; }

.ps-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(50,138,241,0.08);
  border: 1px solid rgba(50,138,241,0.18);
  border-radius: 8px;
  color: rgba(186,217,252,0.85);
  font-size: 12px;
  font-weight: 700;
  font-family: 'Kanit', sans-serif;
  padding: 7px 10px;
  outline: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.ps-mode-btn:hover { background: rgba(50,138,241,0.14); border-color: rgba(50,138,241,0.3); }
.ps-mode-chevron { color: rgba(186,217,252,0.4); flex-shrink: 0; transition: transform 0.15s; }
.ps-mode-btn[aria-expanded="true"] .ps-mode-chevron { transform: rotate(180deg); }

.ps-mode-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 120px;
  background: hsl(221,29%,13%);
  border: 1px solid rgba(50,138,241,0.2);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  padding: 4px;
  z-index: 10;
}
.ps-mode-menu.open { display: block; }

.ps-mode-option {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 6px;
  color: rgba(186,217,252,0.75);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Kanit', sans-serif;
  padding: 7px 10px;
  cursor: pointer;
}
.ps-mode-option:hover { background: rgba(50,138,241,0.12); color: rgba(186,217,252,0.95); }
.ps-mode-option.active { color: #FFB600; background: rgba(255,182,0,0.08); }

.ps-search-divider {
  width: 1px;
  height: 22px;
  background: rgba(50,138,241,0.15);
  flex-shrink: 0;
}

.ps-item-icon {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: rgba(13,22,36,0.5);
  border: 1px solid rgba(255,182,0,0.25);
  box-shadow: 0 0 0 4px rgba(255,182,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}
.ps-item-icon-img {
  width: 44px;
  height: 44px;
  image-rendering: pixelated;
  object-fit: contain;
}

.ps-range-row { display: flex; gap: 6px; margin-bottom: 12px; }
.ps-range-btn {
  background: rgba(13,22,36,0.5);
  border: 1px solid rgba(50,138,241,0.14);
  border-radius: 6px;
  color: rgba(186,217,252,0.6);
  font-size: 11px;
  font-weight: 700;
  font-family: 'Kanit', sans-serif;
  padding: 4px 12px;
  cursor: pointer;
}
.ps-range-btn:hover { color: rgba(186,217,252,0.9); }
.ps-range-btn.active { background: rgba(255,182,0,0.12); border-color: rgba(255,182,0,0.35); color: #FFB600; }

.ps-shop-list { display: flex; flex-direction: column; gap: 8px; }
.ps-shop-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(13,22,36,0.5);
  border: 1px solid rgba(50,138,241,0.1);
  border-radius: 8px;
  padding: 8px 12px;
}
.ps-shop-name { font-size: 13px; font-weight: 700; color: rgba(186,217,252,0.9); }
.ps-shop-kind { font-size: 10px; color: rgba(186,217,252,0.4); margin-top: 2px; }
.ps-shop-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.ps-shop-mode { display: inline-block; border-radius: 4px; padding: 2px 6px; font-size: 9px; font-weight: 800; line-height: 1.2; text-transform: uppercase; letter-spacing: .04em; }
.ps-shop-mode.buying { color: #7dd3fc; background: rgba(56,189,248,.12); border: 1px solid rgba(56,189,248,.2); }
.ps-shop-mode.selling { color: #86efac; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.2); }
.ps-shop-stock { color: #FFB600; font-size: 11px; font-weight: 700; }
.ps-shop-stock.unknown { color: rgba(186,217,252,.4); font-weight: 500; }
.ps-copy-btn {
  background: rgba(50,138,241,0.12);
  border: 1px solid rgba(50,138,241,0.25);
  border-radius: 6px;
  color: rgba(186,217,252,0.85);
  font-size: 11px;
  font-weight: 700;
  font-family: 'Kanit', sans-serif;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.ps-copy-btn:hover { background: rgba(255,182,0,0.15); border-color: rgba(255,182,0,0.35); color: #FFB600; }

.mobile-nav {
  display: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: hsla(223,24%,15%,0.96);
}

.mobile-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-nav-link {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(186,217,252,0.62);
  background: rgba(255,255,255,0.02);
}

.mobile-nav-link.active {
  color: #fff;
  background: rgba(50,138,241,0.14);
  box-shadow: inset 0 0 0 1px rgba(50,138,241,0.22);
}

/* Developer sub-navigation (used on developer pages instead of sidebar) */
.dev-subnav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: hsl(218,28%,14%);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.dev-subnav-link {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Kanit', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
  background: transparent;
  color: rgba(186,217,252,0.45);
  display: block;
}

.dev-subnav-link:hover:not(.active) { color: rgba(186,217,252,0.75); }

.dev-subnav-link.active {
  background: hsl(218,31%,21%);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(50,138,241,0.25);
}

/* Public main content */
.public-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  min-height: calc(100vh - 60px - 80px);
}

/* Public breadcrumb */
.pub-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: rgba(186,217,252,0.5);
  padding: 6px 14px;
  border-radius: 10px;
  background: rgba(0,0,0,0.15);
  margin-bottom: 20px;
}
.pub-breadcrumb a { color: inherit; text-decoration: none; }
.pub-breadcrumb a:hover { color: #FFB600; }
.pub-breadcrumb .sep { color: rgba(186,217,252,0.25); margin: 0 2px; }
.pub-breadcrumb .current { font-weight: 600; color: rgba(186,217,252,0.9); }

/* Public page header banner */
.pub-header {
  background: hsl(218,31%,17%);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  transition: background 0.3s;
}
.pub-header:hover { background: hsl(218,28%,14%); }
.pub-header .sup {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #FFB600;
  margin-bottom: 4px;
}
.pub-header h1 {
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
  background: linear-gradient(270deg, #21c8f6, #637bff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.pub-header .sub {
  font-size: 14px;
  color: rgba(186,217,252,0.55);
  margin-top: 4px;
}
.pub-header .stat-large {
  font-size: 28px;
  font-weight: 700;
  color: #FFB600;
  line-height: 1;
}
.pub-header .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(186,217,252,0.45);
  margin-top: 2px;
}

/* Panel boxes (public pages) */
.pub-panel {
  background: hsl(218,31%,17%);
  border: 1px solid rgba(50,138,241,0.15);
  border-radius: 12px;
  overflow: hidden;
  transition: background 0.3s;
}
.pub-panel:hover { background: hsl(218,28%,14%); }
.pub-panel-head {
  background: hsl(218,28%,14%);
  border-bottom: 1px solid rgba(50,138,241,0.15);
  padding: 10px 18px;
}
.pub-panel-head h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(186,217,252,0.9);
}
.pub-panel-body { padding: 18px; }

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: hsl(218,31%,17%);
  border: 1px solid rgba(50,138,241,0.15);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-card .kpi-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(186,217,252,0.45);
}

.kpi-card .kpi-value {
  font-size: 22px;
  font-weight: 900;
  color: #FFB600;
  line-height: 1.1;
}

.kpi-card .kpi-sub {
  font-size: 11px;
  color: rgba(186,217,252,0.35);
}

/* Tab bar (public pages) */
.pub-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: hsl(218,28%,14%);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.pub-tab {
  flex: 1;
  min-width: 80px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Kanit', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.15s;
  background: transparent;
  color: rgba(186,217,252,0.45);
}

.pub-tab.active {
  background: hsl(218,31%,21%);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(50,138,241,0.25);
}

.pub-tab:hover:not(.active) { color: rgba(186,217,252,0.75); }

/* Table (public pages) */
.pub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pub-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(186,217,252,0.45);
  border-bottom: 1px solid rgba(50,138,241,0.12);
}
.pub-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(50,138,241,0.06);
  color: rgba(186,217,252,0.8);
}
.pub-table tr:hover td { background: rgba(50,138,241,0.04); }
.pub-table tr:last-child td { border-bottom: none; }

/* Tag badges */
.pub-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Public footer */
.pub-footer {
  border-top: 1px solid rgba(255,255,255,0.065);
  background: hsl(218,31%,13%);
  padding: 32px 24px 24px;
}
.pub-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.pub-footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.pub-footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pub-footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.pub-footer-brand-text {
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.3px;
}
.pub-footer-brand-sub {
  font-size: 11px;
  color: rgba(186,217,252,0.35);
  margin-top: 1px;
}
.pub-footer-meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.pub-footer-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(186,217,252,0.55);
}
.pub-footer-meta-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}
.pub-footer-ip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255,182,0,0.25);
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
}
.pub-footer-ip .ip-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: rgba(186,217,252,0.35);
  margin-left: 14px;
}
.pub-footer-ip code {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #FFB600;
  padding: 7px 12px 7px 8px;
  letter-spacing: 0.05em;
}
.pub-footer-copy-ip-btn {
  background: none;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  color: rgba(186,217,252,0.45);
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  transition: color 0.15s;
  white-space: nowrap;
  align-self: stretch;
}
.pub-footer-copy-ip-btn:hover { color: #FFB600; }
.pub-footer-players {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(186,217,252,0.55);
  transition: color 0.15s;
  position: relative;
}
.pub-footer-players:hover { color: rgba(186,217,252,0.88); }
.pub-footer-players:hover .dot { box-shadow: 0 0 8px rgba(34,197,94,0.9); }
.pub-footer-players[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: hsl(218,31%,20%);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(186,217,252,0.85);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
}
.pub-footer-players .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
  flex-shrink: 0;
  transition: box-shadow 0.15s;
}
.pub-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.pub-footer-links {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: rgba(186,217,252,0.35);
  transition: color 0.15s;
}
.pub-footer-links a { color: inherit; text-decoration: none; transition: color 0.15s; }
.pub-footer-links a:visited { color: inherit; }
.pub-footer-links a:hover { color: #FFB600; }
.pub-footer-links a:active { color: inherit; }
.pub-footer-links .footer-discord-link { display: inline-flex; align-items: center; }
.pub-footer-links .footer-discord-link:active { color: rgba(186,217,252,0.35); }
.pub-footer-copy { font-size: 12px; color: rgba(186,217,252,0.25); }
.pub-footer-meta-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 12px;
  font-size: 12px;
}
.pub-footer-meta-bottom .pub-footer-ip code,
.pub-footer-meta-bottom .pub-footer-copy-ip-btn { font-size: 13px; }
.pub-footer-meta-bottom .pub-footer-players { font-size: 12px; }

/* Heatmap */
.heatmap-grid { overflow-x: auto; }
.heatmap-row  { display: flex; align-items: center; gap: 3px; margin-bottom: 2px; }
.heatmap-label { font-size: 10px; font-family: monospace; width: 28px; text-align: right; flex-shrink: 0; color: rgba(186,217,252,0.3); }
.heatmap-cell  { flex: 1; height: 14px; min-width: 22px; border-radius: 2px; cursor: default; }
.heatmap-dow-row { display: flex; gap: 3px; margin-left: 31px; margin-bottom: 4px; }
.heatmap-dow   { flex: 1; text-align: center; font-size: 10px; font-weight: 600; color: rgba(186,217,252,0.45); min-width: 22px; }

/* Loading spinner (public pages) */
.pub-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: rgba(186,217,252,0.45);
  font-size: 14px;
  gap: 12px;
}

/* My CityRP detail pages and search discovery */
.detail-main { max-width: 1120px; }
.detail-content { display: block; width: 100%; min-width: 0; }
.detail-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding: 26px;
  border: 1px solid rgba(50,138,241,0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(18,31,50,0.96), rgba(13,22,36,0.82));
}
.detail-avatar { width: 82px; height: 82px; object-fit: contain; border-radius: 14px; image-rendering: pixelated; background: #0d1624; border: 1px solid rgba(255,182,0,.25); }
.detail-hero-copy { flex: 1; min-width: 0; }
.detail-hero .sup { color: #FFB600; text-transform: uppercase; font-size: 10px; letter-spacing: .12em; font-weight: 800; }
.detail-hero h1 { margin: 4px 0 3px; color: rgba(225,238,255,.98); font-size: clamp(28px,4vw,44px); line-height: 1.05; overflow-wrap: break-word; word-break: normal; }
.detail-hero .sub { color: rgba(186,217,252,.55); font-size: 14px; }
.detail-actions, .detail-inline-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.detail-actions button { white-space: nowrap; }
.detail-kpi-link { text-decoration: none; transition: border-color .15s, transform .15s; }
.detail-kpi-link:hover { border-color: rgba(50,138,241,.42); transform: translateY(-1px); }
.detail-two-col, .detail-shop-layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 18px; align-items: start; }
.detail-list { display: grid; gap: 8px; }
.detail-list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 9px; border: 1px solid rgba(50,138,241,.12); color: rgba(186,217,252,.82); text-decoration: none; }
.detail-list-row small { display: block; color: rgba(186,217,252,.42); margin-top: 2px; }
.detail-definition { display: grid; grid-template-columns: minmax(120px,.45fr) 1fr; gap: 12px; margin: 0; }
.detail-definition dt { color: rgba(186,217,252,.42); font-size: 12px; }
.detail-definition dd { margin: 0; color: rgba(225,238,255,.88); min-width: 0; overflow-wrap: break-word; }
.detail-definition a { color: #77b6ff; }
.detail-role-list { display: flex; flex-wrap: wrap; gap: 5px; }
.detail-role-list span { display: inline-flex; padding: 3px 7px; border: 1px solid rgba(50,138,241,.18); border-radius: 999px; background: rgba(50,138,241,.08); color: rgba(186,217,252,.72); font-size: 10px; line-height: 1.25; }
.detail-muted-value { color: rgba(186,217,252,.4); }
.detail-empty { padding: 28px 16px; text-align: center; color: rgba(186,217,252,.42); }
.detail-controls-panel { padding: 14px 16px; margin-bottom: 16px; }
.detail-shop-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-filter-group, .ps-source-row { display: flex; gap: 5px; }
.detail-filter-group button, .ps-source-row button {
  border: 1px solid rgba(50,138,241,.16); border-radius: 8px; padding: 7px 11px; cursor: pointer;
  background: rgba(13,22,36,.8); color: rgba(186,217,252,.55); font-family: inherit; font-size: 11px; font-weight: 700;
}
.detail-filter-group button.active, .ps-source-row button.active { background: rgba(50,138,241,.18); border-color: rgba(50,138,241,.45); color: #bad9fc; }
.detail-check, .detail-min-stock { color: rgba(186,217,252,.6); font-size: 12px; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.detail-shop-toolbar #copyRoute { margin-left: auto; }
.detail-min-stock input, .detail-alert-panel input { width: 90px; padding: 8px 9px; }
.detail-freshness { display: flex; flex-wrap: wrap; gap: 7px 16px; color: rgba(186,217,252,.35); font-size: 11px; margin-top: 12px; }
.detail-shop-layout { grid-template-columns: minmax(0,1.25fr) minmax(300px,.75fr); align-items: start; }
.detail-shop-list { display: grid; gap: 9px; max-height: 660px; overflow-y: auto; }
.detail-shop-row { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid rgba(50,138,241,.13); background: rgba(13,22,36,.54); border-radius: 10px; }
.detail-route-number { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 50%; color: #FFB600; background: rgba(255,182,0,.1); font-weight: 800; font-size: 11px; }
.detail-shop-copy { flex: 1; min-width: 0; }
.detail-shop-copy > strong { color: rgba(225,238,255,.92); }
.detail-shop-copy > small { display: block; color: rgba(186,217,252,.38); margin: 2px 0 7px; }
.detail-copy-gps { flex: 0 0 auto; }
.detail-stale { font-size: 10px; color: #f59e0b; }
.detail-map-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-map-head a { color: #77b6ff; font-size: 11px; font-weight: 600; text-decoration: none; text-transform: none; letter-spacing: 0; }
.detail-map-head a:hover { color: #FFB600; }
.detail-map-body { padding: 0; }
.shop-pl3x-map { height: 520px; border-radius: 0 0 10px 10px; }
.shop-map-tooltip { display: none; position: absolute; z-index: 20; max-width: 220px; padding: 8px 11px; border: 1px solid rgba(50,138,241,.24); border-radius: 8px; background: hsl(218,28%,14%); color: rgba(225,238,255,.92); font-size: 12px; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.map-tooltip-muted { color: rgba(186,217,252,.55); font-size: 10px; }
.map-tooltip-coords { color: #FFB600; font-size: 10px; }
.shop-map-legend { display: flex; flex-direction: column; gap: 4px; font-size: 10px; }
.shop-map-legend span { display: flex; align-items: center; gap: 6px; }
.shop-map-legend i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.4); }
.detail-shop-row.is-map-selected { border-color: rgba(255,182,0,.65); background: rgba(255,182,0,.08); }
.detail-alert-panel { margin-top: 16px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.detail-alert-panel h3 { color: rgba(225,238,255,.92); margin: 0 0 3px; }
.detail-alert-panel p, .detail-description { color: rgba(186,217,252,.5); margin: 0; line-height: 1.6; }
.detail-alert-panel form { display: flex; gap: 8px; }
.detail-open-dashboard { display: inline-flex; margin-top: 20px; text-decoration: none; }
.detail-not-found { text-align: center; padding: 50px; }
.detail-not-found p { color: rgba(186,217,252,.5); margin: 8px 0 22px; }
.ps-source-row { padding: 8px 14px; border-bottom: 1px solid rgba(50,138,241,.1); }
.ps-save-search { border: 0; background: transparent; color: rgba(186,217,252,.45); font-size: 24px; cursor: pointer; padding: 3px 6px; }
.ps-save-search:hover, .ps-save-search.saved { color: #FFB600; }
.ps-result-meta { display: block; color: rgba(186,217,252,.32); font-size: 10px; margin-top: 4px; }
.ps-result mark { background: rgba(255,182,0,.18); color: #ffd570; border-radius: 2px; padding: 0 1px; }
.ps-group[hidden] { display: none; }
.my-cityrp-overview { margin-bottom: 24px; }
.my-cityrp-overview .pub-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.my-cityrp-overview .pub-panel-head a { color: #77b6ff; font-size: 11px; text-decoration: none; }
.my-cityrp-overview .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.my-cityrp-connections { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.my-cityrp-chip { display: inline-flex; align-items: center; gap: 7px; color: rgba(225,238,255,.85); text-decoration: none; border: 1px solid rgba(50,138,241,.16); background: rgba(13,22,36,.55); border-radius: 999px; padding: 7px 11px; font-size: 12px; }
.my-cityrp-chip small { color: rgba(186,217,252,.38); }
.my-cityrp-saved-list { display: grid; gap: 7px; }
.my-cityrp-saved-row, .my-cityrp-alert { display: flex; align-items: center; gap: 8px; border: 1px solid rgba(50,138,241,.12); border-radius: 9px; background: rgba(13,22,36,.48); padding: 6px 9px 6px 5px; }
.my-cityrp-saved-row > a, .my-cityrp-alert > a { display: flex; align-items: center; gap: 10px; color: rgba(225,238,255,.88); text-decoration: none; flex: 1; min-width: 0; padding: 5px; }
.my-cityrp-saved-row small, .my-cityrp-alert small { display: block; color: rgba(186,217,252,.4); overflow-wrap: anywhere; }
.my-cityrp-remove { border: 0; background: transparent; color: rgba(186,217,252,.35); cursor: pointer; font: inherit; font-size: 10px; }
.my-cityrp-remove:hover { color: #f87171; }
.my-cityrp-alert.triggered { border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.05); }
.my-cityrp-alert-status { color: rgba(186,217,252,.4); font-size: 10px; white-space: nowrap; }
.my-cityrp-alert.triggered .my-cityrp-alert-status { color: #4ade80; font-weight: 800; }
.my-cityrp-subheading { color: rgba(186,217,252,.45); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; margin: 18px 0 8px; }
.starter-guide { max-width: 1000px; margin: 0 auto 72px; }
.starter-guide-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 16px; }
.starter-guide-heading span { color: #FFB600; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.starter-guide-heading h2 { margin: 3px 0 0; color: rgba(225,238,255,.95); font-size: 25px; }
.starter-guide-heading p { max-width: 420px; color: rgba(186,217,252,.42); font-size: 13px; text-align: right; }
.starter-guide-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.starter-guide-grid > a, .starter-guide-grid > button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-height: 150px; padding: 18px; border: 1px solid rgba(50,138,241,.15); border-radius: 12px; background: rgba(18,31,50,.72); color: inherit; text-decoration: none; cursor: pointer; font-family: inherit; transition: border-color .15s, transform .15s; }
.starter-guide-grid > a:hover, .starter-guide-grid > button:hover { border-color: rgba(50,138,241,.42); transform: translateY(-2px); }
.starter-guide-grid strong { color: rgba(225,238,255,.9); font-size: 14px; }
.starter-guide-grid small { color: rgba(186,217,252,.42); line-height: 1.5; margin-top: 6px; }
.starter-guide-grid span { color: #77b6ff; font-size: 11px; font-weight: 700; margin-top: auto; }

/* Map canvas wrapper */
.map-canvas-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(50,138,241,0.15);
  background: hsl(218,28%,14%);
  height: 520px;
}
.map-canvas-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}
.map-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(50,138,241,0.2);
  background: hsl(218,28%,14%);
  color: rgba(186,217,252,0.7);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.map-btn:hover { background: hsl(218,31%,21%); color: rgba(186,217,252,0.95); }

.map-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: hsla(218,28%,14%,0.9);
  border: 1px solid rgba(50,138,241,0.15);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  color: rgba(186,217,252,0.7);
}

.map-loader {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: #0d1624;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; z-index: 30;
  color: rgba(186,217,252,0.75);
  font-family: 'Kanit', sans-serif; font-size: 13px; font-weight: 500; letter-spacing: 0.03em;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.map-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.map-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(50,138,241,0.1);
  border-top-color: #FFB600;
  border-radius: 50%;
  animation: mapSpin 1s linear infinite;
}
@keyframes mapSpin { to { transform: rotate(360deg); } }
.map-fullscreen {
  position: fixed !important; inset: 0 !important;
  width: 100vw !important; height: 100vh !important;
  border-radius: 0 !important; z-index: 999 !important; border: none !important;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .modal { width: 94vw; }
  .sidebar { width: 200px; }
  .main { padding: 18px 20px; }
  .pub-tabs { flex-wrap: wrap; }
  .hamburger-btn { display: inline-flex; }
  .topnav-links { display: none; }
  .mobile-nav.open { display: block; }
  .dev-subnav { gap: 3px; padding: 3px; }
  .dev-subnav-link { flex: 0 1 auto; min-width: 0; padding: 8px 10px; font-size: 10px; white-space: nowrap; overflow: visible; text-overflow: clip; }
}

@media (max-width: 680px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: 240px !important;
    z-index: 100;
    transition: left 0.25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: none;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 4px 0 32px rgba(0,0,0,0.6);
  }

  .main { padding: 16px; }
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .app-creds-grid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 10px; }
  .section-heading .btn-primary { width: 100%; justify-content: center; }
  .modal { width: 96vw; padding: 20px; }
  .modal.auth-large { padding: 24px; }

  .topnav-dev-link { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .topnav-inner { padding: 0 16px; }
  .topnav-brand { margin-right: 14px; }
  .topnav-right { gap: 8px; }
  .mobile-nav-inner { padding: 12px 16px 18px; }
  .detail-hero { align-items: flex-start; flex-wrap: wrap; padding: 18px; }
  .detail-actions { width: 100%; }
  .detail-two-col, .detail-shop-layout { grid-template-columns: 1fr; }
  .detail-map-panel { order: -1; }
  .shop-pl3x-map { height: 340px; }
  .detail-alert-panel { align-items: flex-start; flex-direction: column; }
  .detail-shop-row { align-items: flex-start; flex-wrap: wrap; }
  .detail-copy-gps { margin-left: 36px; }
  .detail-shop-toolbar { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
  .detail-filter-group { grid-column: 1 / -1; }
  .detail-min-stock { align-items: flex-start; flex-direction: column; }
  .detail-min-stock input { width: 100%; }
  .detail-shop-toolbar #copyRoute { width: 100%; margin-left: 0; }
  .starter-guide-heading { align-items: flex-start; flex-direction: column; }
  .starter-guide-heading p { text-align: left; }
  .starter-guide-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Swagger UI isolation ──────────────────────────────────────────────────
   Undo style.css global resets inside .swagger-wrap so swagger-ui renders
   correctly. The scoped rules here have specificity 0,1,1 which beats the
   universal selector * at 0,0,0. */
.swagger-wrap * {
  margin: revert;
  padding: revert;
  box-sizing: revert;
  font-family: revert;
}
.swagger-wrap input,
.swagger-wrap textarea,
.swagger-wrap select,
.swagger-wrap button {
  all: revert;
}
.swagger-wrap label {
  all: revert;
}
