:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0d1727;
  --panel: rgba(10, 17, 30, 0.84);
  --panel-bg: rgba(10, 17, 30, 0.8);
  --panel-strong: rgba(12, 21, 37, 0.96);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f5f7ff;
  --muted: #97a4be;
  --accent: #7ee0c1;
  --accent-2: #ffb454;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-xl-inner: 10px;
  --panel-gap: 20px;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

/* Custom Mac-like Overlay Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: transparent;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.22);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.45);
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

html,
body {
  min-height: 100%;
  overflow-x: clip;
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  background-color: var(--bg-soft);
  background-image:
    radial-gradient(circle at center center, rgba(126, 224, 193, 0.10), transparent 75%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: flex;
  flex-direction: column;
}

a {
  cursor: pointer;
}

body::before {
  content: none;
}

.bg-orb {
  display: none;
}

.bg-orb-a {
  width: 340px;
  height: 340px;
  top: -90px;
  left: -90px;
  background: rgba(126, 224, 193, 0.10);
}

.bg-orb-b {
  width: 400px;
  height: 400px;
  bottom: -150px;
  right: -140px;
  background: rgba(255, 180, 84, 0.10);
}

.layout-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: var(--shell-width);
  margin: 20px auto 32px;
  min-height: calc(100dvh - 52px);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: auto;
  padding: 40px 4px 8px;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer span:first-child {
  color: var(--text);
  font-weight: 800;
}

.flash-stack {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  pointer-events: none;
  max-width: 400px;
}

.flash {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(20, 20, 20, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  animation: flash-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.5s ease, transform 0.5s ease;
  backdrop-filter: blur(10px);
}

@keyframes flash-slide-in {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}


.flash-success {
  border-color: rgba(126, 224, 193, 0.3);
  background: rgba(126, 224, 193, 0.2);
}

.flash-error {
  border-color: rgba(255, 110, 135, 0.3);
  background: rgba(255, 110, 135, 0.2);
}

.flash-info {
  border-color: rgba(255, 180, 84, 0.3);
  background: rgba(255, 180, 84, 0.2);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 20px;

  .panel {
    border-radius: var(--radius-xl-inner);
  }
}

dialog.panel,
.panel:last-child {
  margin-bottom: 0;
}

dialog {
  color: var(--text);
  background-color: var(--panel-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  width: 90%;
  max-width: 600px;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  max-height: 85vh;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
}

/* Dialog Header Layout: Close button pinned right, title wraps */
dialog .section-head,
dialog .u-head-row,
dialog .u-head-row-15,
dialog .u-head-row-20,
dialog .modal-header {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
}

dialog .section-head h2,
dialog .section-head h3,
dialog h2,
dialog h3 {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}

dialog .section-head button,
dialog .section-head .button,
dialog button[onclick*="close()"],
dialog button[onclick*="close"] {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
  align-self: flex-start !important;
}

dialog::backdrop {
  background: rgba(4, 9, 17, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 24px;
  margin-bottom: 20px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-left {
  display: flex;
  gap: 8px;
  flex-direction: column;
}

.brand-block h1,
.panel h2,
.hero-card h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: -0.03em;
}

.brand-block p,
.hero-card p,
.entry-row p,
.character-card p,
.workspace-row span {
  color: var(--muted);
}

.brand-block .logo {
  height: 60px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.73rem;
  color: var(--accent);
}

.topbar-actions,
.hero-points,
.inline-form,
.section-head,
.content-split,
.entry-row,
.character-card,
.hero-card,
.login-footnote {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stacked-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.layout-shell:has(.auth-grid) {
  margin: 0 auto !important;
  padding: 0 !important;
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-grid {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  min-height: 100vh;
  padding: 20px 16px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
  width: 100%;
  max-width: 440px;
  margin: auto;
  box-sizing: border-box;
}

.auth-logo {
  display: block;
  width: 100%;
  max-width: 400px;
  height: auto;
  max-height: 85px;
  object-fit: contain;
  margin: 0 auto;
}

.auth-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 24px;
}

.auth-card h2 {
  font-size: clamp(1.25rem, 5vw, 1.7rem);
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: break-word;
}

.button-wide {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  text-align: center;
}

.topbar-actions {
  flex-wrap: nowrap;
  gap: 14px;
  min-height: 48px;
}

.mobile-menu-toggle,
.mobile-drawer-header,
.mobile-nav-backdrop {
  display: none;
}

.topbar.provider-nav,
.topbar.sticky-nav {
  position: sticky;
  top: 20px;
  z-index: 1000;
  background: rgba(9, 18, 31, 0.98);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.topbar-actions .nav-item.active,
.topbar-actions .button.active {
  background: linear-gradient(135deg, #7ee0c1, #b8ffe9) !important;
  color: #071912 !important;
  border-color: rgba(126, 224, 193, 0.8) !important;
  box-shadow: 0 0 16px rgba(126, 224, 193, 0.35) !important;
  font-weight: 800 !important;
}

.topbar-actions .nav-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.hero-points,
.login-footnote {
  flex-wrap: wrap;
}

.topbar-character {
  display: grid;
}

:root {
  --scroll-blur-height: 96px;
  --shell-width: min(1600px, calc(100vw - 32px));
  /* bem maior que os 90px anteriores */
}

@media (max-width: 760px) {
  :root {
    --scroll-blur-height: 120px;
  }
}

.scroll-blur-guard {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--scroll-blur-height);
  z-index: 900;
  pointer-events: none;

  background: linear-gradient(
    to bottom,
    var(--bg-color, #0a121f) 0%,
    transparent 100%
  );
}

.level-select {
  height: 38px;
  min-width: 0;
  padding-top: 8px;
  padding-bottom: 8px;
}

.char-card {
  padding: 16px;
}

.hero-points span,
.login-footnote span,
.pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  white-space: nowrap;
}

.pill {
  font-size: 0.86rem;
}

.button {
  border: 0;
  border-radius: 14px;
  min-height: 44px;
  padding: 0 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary,
.btn-gradient-green {
  background: linear-gradient(135deg, #7ee0c1, #b8ffe9);
  color: #092116;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.button-danger {
  background: rgba(255, 92, 92, 0.14);
  color: #ffb2b2;
  border: 1px solid rgba(255, 92, 92, 0.28);
}

.button-wide {
  width: 100%;
}

/* Shared Character Row Item (Fixed 40px Height) */
.char-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
}

li.char-row-item:hover,
a.char-row-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-2);
}

.char-row-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
}

.char-row-item-left strong {
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.char-row-item-right {
  color: var(--muted);
  font-size: 0.8rem;
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: 8px;
}

.char-row-status-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-block;
}

.char-row-status-dot.on {
  background: #7ee0c1;
  box-shadow: 0 0 6px #7ee0c1;
}

.char-row-status-dot.off {
  background: #eb5050;
  box-shadow: 0 0 6px #eb5050;
}

/* Custom Toggle Switch for ON/OFF Status */
.status-toggle-btn {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  width: auto !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.status-toggle-btn:hover {
  transform: scale(1.08);
}

.toggle-switch-track {
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: rgba(235, 80, 80, 0.2);
  border: 1px solid rgba(235, 80, 80, 0.4);
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  padding: 2px;
  box-sizing: border-box;
}

.toggle-switch-track.active {
  background: rgba(126, 224, 193, 0.22);
  border-color: rgba(126, 224, 193, 0.5);
  box-shadow: 0 0 8px rgba(126, 224, 193, 0.25);
}

.toggle-switch-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #eb5050;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.toggle-switch-track.active .toggle-switch-thumb {
  transform: translateX(14px);
  background: #7ee0c1;
  box-shadow: 0 0 6px #7ee0c1;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
}

.hero-card,
.auth-card,
.sidebar,
.main-stage {
  padding: 24px;
}

.hero-card h1 {
  font-size: clamp(2.4rem, 4vw, 4.5rem);
  max-width: 10ch;
}

.hero-card p {
  max-width: 60ch;
  font-size: 1.02rem;
  line-height: 1.7;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 440px;
}

.notice-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 180, 84, 0.24);
  background: rgba(255, 180, 84, 0.08);
  color: #ffe4bd;
  line-height: 1.6;
}

.login-footnote {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.92rem;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.sidebar,
.main-stage {
  /*min-height: 78vh;*/
}

.sidebar {
  display: grid;
  gap: 24px;
}

.main-stage {
  display: grid;
  gap: 22px;
}

.section-head {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: flex-start;
}

.section-head.slim {
  margin-bottom: 15px;
}

.section-head.horizontal {
  justify-content: space-between;
}

.chart-header-control {
  margin-left: auto;
  width: min(200px, 100%);
}

.inline-form,
.stacked-form,
.entry-form {
  display: grid;
  gap: 10px;
}

.inline-form {
  grid-template-columns: 1fr auto auto;
  margin-bottom: 14px;
}

.stacked-form {
  margin-bottom: 14px;
}

.entry-form {
  grid-template-columns: 1fr 1fr 1fr 1fr;
  align-items: center;
}

.entry-form input,
.entry-form select,
.entry-form .button {
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
}

.entry-form textarea {
  grid-column: 1 / -1;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  padding: 9px 14px;
  min-height: 44px;
  height: 44px;
  box-sizing: border-box;
  outline: none;
}

input[type="checkbox"],
input[type="radio"] {
  min-height: initial !important;
  height: 16px !important;
  width: 16px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 4px !important;
  cursor: pointer;
  vertical-align: middle;
}

input[type="date"],
input[type="datetime-local"],
input[type="time"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  min-height: 44px !important;
  height: 44px !important;
  max-height: 44px !important;
  line-height: 44px !important;
  padding: 0 12px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Force calendar icon to far right */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  margin-left: auto !important;
  cursor: pointer;
  opacity: 0.8;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
  text-align: left !important;
  min-height: 44px !important;
  height: 44px !important;
  line-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  padding: 0 !important;
  margin: 0 !important;
  height: 100% !important;
}

input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 44px;
  height: 44px;
  box-sizing: border-box;
}

select:not([multiple]),
.select:not([multiple]) {
  min-height: 44px;
  height: 44px;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  padding-right: 36px !important;
}

select option {
  background-color: #0d1727;
  color: #f5f7ff;
  padding: 10px 12px;
  min-height: 36px;
}

.compact-select {
  width: 200px;
  padding: 9px 35px 9px 14px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  min-height: 44px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 84px;
}

input::placeholder,
textarea::placeholder {
  color: #8791a7;
}

.workspace-list,
.character-grid,
.entry-list {
  display: grid;
  gap: 12px;

  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.character-manager {
  display: grid;
  gap: 12px;
}

.manager-help {
  margin: 0;
  color: var(--muted);
}

.character-create {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 130px auto;
  gap: 10px;
  align-items: center;
}

.character-list {
  display: grid;
  gap: 10px;
}

.character-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.character-edit-panel {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.character-summary {
  min-width: 0;
}

.character-pick {
  display: grid;
  gap: 4px;
  text-align: left;
}

.character-pick strong {
  font-size: 1rem;
}

.character-pick span {
  color: var(--muted);
  font-size: 0.9rem;
}

.character-actions {
  display: flex;
  align-items: start;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.character-edit {
  min-width: 80px;
}

.character-edit summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
}

.character-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 120px auto;
  gap: 8px;
  margin-top: 8px;
}

.character-edit-form input {
  min-width: 0;
}

.character-edit-form .button,
.delete-character-form .button {}

.delete-character-form {
  margin: 0;
}

.delete-character-form .button {
  white-space: nowrap;
}

.workspace-row button {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.workspace-row.active button {
  border-color: rgba(126, 224, 193, 0.42);
  background: rgba(126, 224, 193, 0.08);
}

.workspace-row strong,
.character-card h3,
.entry-row strong {
  display: block;
  margin-bottom: 4px;
}

.workspace-row span {
  font-size: 0.88rem;
}

.character-card,
.entry-row,
.link-card {
  justify-content: space-between;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  padding: 14px 16px;
}

.character-card {
  align-items: flex-start;
}

.character-card h3 {
  margin: 0;
}

.entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.entry-meta-actions {
  display: flex;
  align-items: start;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.entry-edit-panel {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.entry-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 140px auto;
  gap: 8px;
  margin-top: 8px;
}

.entry-edit-form textarea {
  grid-column: 1 / -1;
}

.delete-entry-form {
  margin: 0;
}

.link-card {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  text-decoration: none;
}

.entry-edit {
  margin-top: 10px;
}

.entry-edit summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}

.content-split {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.chart-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  width: 100%;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.72);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}

[hidden] {
  display: none !important;
}

.modal-card {
  width: min(1500px, calc(100vw - 32px));
  max-height: min(90vh, 900px);
  overflow: auto;
  padding: 24px;
}

.character-pick {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}

.chart-card canvas {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 1200px) {

  .dashboard-grid,
  .content-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar,
  .main-stage {
    min-height: auto;
  }

  .entry-form {
    grid-template-columns: 1fr 1fr;
  }

  .character-create {
    grid-template-columns: 1fr 1fr;
  }

  .character-edit-form {
    grid-template-columns: 1fr 1fr;
  }
}

/* Admin Stats Grid & Badges */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 140ms ease, border-color 140ms ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
}

.stat-subtext {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-active {
  background: rgba(126, 224, 193, 0.15);
  color: #7ee0c1;
  border: 1px solid rgba(126, 224, 193, 0.3);
}

.badge-inactive {
  background: rgba(255, 92, 92, 0.15);
  color: #ff8c8c;
  border: 1px solid rgba(255, 92, 92, 0.3);
}

.badge-role {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Groups (Parties) Grid - 1/3 width per column */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.active-clients-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .active-clients-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .active-clients-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .groups-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .active-clients-grid {
    grid-template-columns: 1fr;
  }

  .groups-grid {
    grid-template-columns: 1fr;
  }
}

/* Payment badge pulse animation */
@keyframes pulse-badge {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(255, 180, 84, 0);
  }

  50% {
    opacity: 0.85;
    box-shadow: 0 0 0 4px rgba(255, 180, 84, 0.15);
  }
}

/* Unified Table Styles Across All Screens (Dashboard, Provider, Client, Billing) */
table th,
table td {
  padding: 6px 12px !important;
  vertical-align: middle !important;
  font-size: 0.88rem !important;
  line-height: 1.3 !important;
  box-sizing: border-box !important;
}

table thead tr {
  background: rgba(255, 255, 255, 0.03);
  height: 36px !important;
}

table thead th {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  vertical-align: middle !important;
}

table tbody tr {
  height: 38px !important;
  transition: background 0.18s ease-in-out;
}

table tbody tr:last-child {
  border-bottom: none;
}

table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03) !important;
}

table td .button,
table td button,
table .button-compact {
  min-height: 28px !important;
  height: 28px !important;
  padding: 0 10px !important;
  font-size: 0.8rem !important;
  border-radius: 6px !important;
  line-height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
}








/* Daily Progress OCR Dropzone */
.ocr-dropzone {
  margin-bottom: 15px;
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease-in-out;
  overflow: hidden;
  cursor: pointer;
}

.ocr-dropzone.dragover {
  border-color: #7ee0c1;
  background: rgba(126, 224, 193, 0.06);
}

.ocr-dropzone-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  color: var(--muted);
  user-select: none;
  pointer-events: none;
}

.ocr-dropzone-inner * {
  pointer-events: none;
}

.ocr-dropzone-inner .dropzone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7ee0c1;
}

.ocr-dropzone-inner .dropzone-text {
  font-size: 0.9rem;
}

.ocr-dropzone-inner .dropzone-text strong {
  color: #fff;
}

.ocr-dropzone-inner .dropzone-text .browse-link {
  color: #7ee0c1;
  text-decoration: underline;
}

.ocr-status-badge {
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.4;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-word;
}

.ocr-status-badge.loading {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.ocr-status-badge.success {
  background: rgba(46, 204, 113, 0.12);
  color: #2ecc71;
  border-top-color: rgba(46, 204, 113, 0.3);
}

.ocr-status-badge.warning {
  background: rgba(231, 76, 60, 0.12);
  color: #ff6b6b;
  border-top-color: rgba(231, 76, 60, 0.3);
}

.ocr-status-badge.info {
  background: rgba(241, 196, 15, 0.12);
  color: #f1c40f;
  border-top-color: rgba(241, 196, 15, 0.3);
}

/* --- Premium Custom Tooltip --- */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 99999;
}

/* Tooltip bubble */
[data-tooltip]::after {
  content: attr(data-tooltip);
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(15, 20, 30, 0.95);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(126, 224, 193, 0.25);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(126, 224, 193, 0.12);
  white-space: normal;
  width: max-content;
  max-width: 260px;
  text-align: center;
  backdrop-filter: none;
}

/* Tooltip arrow */
[data-tooltip]::before {
  content: '';
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(15, 20, 30, 0.95) transparent transparent transparent;
}

/* Hover trigger */
[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =============================================================
   UTILITY CLASS LIBRARY
   Extracted from repeated inline styles across all templates.
   ============================================================= */

/* ---- Layout: Flex ---- */
.u-flex {
  display: flex;
}

.u-flex-col {
  display: flex;
  flex-direction: column;
}

.u-flex-wrap {
  flex-wrap: wrap;
}

.u-items-center {
  align-items: center;
}

.u-items-start {
  align-items: flex-start;
}

.u-items-end {
  align-items: flex-end;
}

.u-justify-between {
  justify-content: space-between;
}

.u-justify-center {
  justify-content: center;
}

.u-justify-end {
  justify-content: flex-end;
}

.u-flex-1 {
  flex: 1;
}

/* ---- Flex + Gap combos (most common patterns) ---- */
.u-col-5 {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.u-col-8 {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.u-col-12 {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.u-col-14 {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.u-col-15 {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.u-col-20 {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.u-row-8 {
  display: flex;
  gap: 8px;
  align-items: center;
}

.u-row-10 {
  display: flex;
  gap: 10px;
  align-items: center;
}

.u-row-12 {
  display: flex;
  gap: 12px;
  align-items: center;
}

.u-row-15 {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.u-row-20 {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---- Section head pattern ---- */
.u-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.u-head-row-15 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

/* ---- Width / Height ---- */
.u-w-full {
  width: 100%;
}

.u-h-38 {
  height: 38px;
}

/* ---- Margin ---- */
.u-m-0 {
  margin: 0;
}

.u-mt-5 {
  margin-top: 5px;
}

.u-mt-10 {
  margin-top: 10px;
}

.u-mt-15 {
  margin-top: 15px;
}

.u-mt-20 {
  margin-top: 20px;
}

.u-mb-5 {
  margin-bottom: 5px;
}

.u-mb-10 {
  margin-bottom: 10px;
}

.u-mb-12 {
  margin-bottom: 12px;
}

.u-mb-15 {
  margin-bottom: 15px;
}

.u-mb-20 {
  margin-bottom: 20px;
}

.u-mb-25 {
  margin-bottom: 25px;
}

.u-mb-30 {
  margin-bottom: 30px;
}

.u-ml-auto {
  margin-left: auto;
}

/* ---- Padding ---- */
.u-p-8 {
  padding: 8px;
}

.u-p-614 {
  padding: 6px 14px;
}

.u-p-512 {
  padding: 5px 12px;
}

.u-p-514 {
  padding: 5px 14px;
}

/* ---- Text ---- */
.u-text-center {
  text-align: center;
}

.u-text-right {
  text-align: right;
}

.u-no-wrap {
  white-space: nowrap;
}

.u-break-word {
  word-break: break-word;
}

.u-text-xs {
  font-size: 0.75rem;
}

.u-text-sm {
  font-size: 0.8rem;
}

.u-text-88 {
  font-size: 0.88rem;
}

.u-text-9e {
  font-size: 0.9em;
}

.u-text-9r {
  font-size: 0.9rem;
}

.u-text-95 {
  font-size: 0.95em;
}

.u-text-lg {
  font-size: 1.2rem;
}

.u-text-xl {
  font-size: 1.3rem;
}

.u-text-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.u-font-bold {
  font-weight: bold;
}

.u-font-600 {
  font-weight: 600;
}

.u-lh-15 {
  line-height: 1.5;
}

/* ---- Color ---- */
.u-muted {
  color: var(--muted);
}

.u-accent {
  color: var(--accent);
}

.u-accent-orange {
  color: #ffb86c;
}

.u-accent-red {
  color: #eb5050;
}

.u-white {
  color: #fff;
}

.u-success {
  color: #7ee0c1;
}

/* ---- Combined text+color helpers ---- */
.u-label-muted {
  font-size: 0.9em;
  color: var(--muted);
}

.u-label-muted2 {
  font-size: 0.88rem;
  color: var(--muted);
}

.u-label-xs-muted {
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.u-label-muted-block {
  color: var(--muted);
  font-size: 0.9em;
  margin-bottom: -5px;
}

.u-label-muted-sub {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 10px 0 6px 0;
}

.u-val-bold {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--foreground);
}

.u-val-muted-sm {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}

.u-accent-bold {
  margin-left: auto;
  color: #7ee0c1;
  font-weight: bold;
}

/* ---- Border / Divider ---- */
.u-divider {
  border-bottom: 1px solid #333;
}

.u-divider-dark {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.u-border-top-fade {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  margin-top: 15px;
}

/* ---- Display ---- */
.u-hidden {
  display: none;
}

.u-block {
  display: block;
}

/* ---- Decorations ---- */
.u-no-decor {
  text-decoration: none;
  color: inherit;
}

.u-pointer {
  cursor: pointer;
}

/* ---- Table ---- */
.u-table-full {
  width: 100%;
  border-collapse: collapse;
}

.u-table-sm {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9em;
}

.u-th-nowrap {
  padding: 6px 14px;
  white-space: nowrap;
}

.u-th-compact {
  padding: 5px 12px;
  white-space: nowrap;
}

.u-td-nowrap {
  padding: 6px 14px;
  white-space: nowrap;
}

.u-td-compact {
  padding: 5px 12px;
  white-space: nowrap;
}

.u-td-p8 {
  padding: 8px;
}

.u-thead-sticky {
  position: sticky;
  top: 0;
  background: var(--panel-bg);
  z-index: 5;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  backdrop-filter: none;
}

/* ---- Image ---- */
.u-img-entry {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #333;
}

.u-img-crop-xp {
  height: 180px;
  border-radius: 4px;
  border: 1px solid #444;
}

.u-img-crop-date {
  max-height: 50px;
  border-radius: 4px;
  border: 1px solid #444;
}

.u-img-crop-sm {
  max-height: 120px;
  border-radius: 4px;
  border: 1px solid #444;
}

.u-img-crop-60 {
  max-height: 60px;
  max-width: 260px;
  border-radius: 4px;
  border: 1px solid #444;
}

.u-img-crop-65 {
  max-height: 65px;
  border-radius: 4px;
  border: 1px solid #444;
}

.u-img-crop-200 {
  max-height: 200px;
  border-radius: 4px;
  border: 1px solid #444;
}

/* ---- Status Badges & Payment History Actions (Matching Service Quest "Configurar" button: 30px height, 0.8rem font) ---- */
.badge-paid,
.badge-pending,
.badge-unpaid,
.badge-waiting {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 14px !important;
  border-radius: 20px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  line-height: 30px !important;
}

.badge-paid {
  background: rgba(126, 224, 193, 0.15) !important;
  color: #7ee0c1 !important;
  border: 1px solid rgba(126, 224, 193, 0.35) !important;
}

.badge-pending {
  background: rgba(255, 180, 84, 0.15) !important;
  color: #ffb454 !important;
  border: 1px solid rgba(255, 180, 84, 0.35) !important;
}

.badge-unpaid {
  background: rgba(235, 80, 80, 0.15) !important;
  color: #eb5050 !important;
  border: 1px solid rgba(235, 80, 80, 0.35) !important;
}

.badge-waiting {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #a0aec0 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Payment History & Compact Action Buttons */
.button-mini,
button.button-mini,
.button.button-mini {
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 14px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  border-radius: 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  line-height: 30px !important;
}

/* Character Selector Pill Bar */
.character-selector-bar {
  display: flex;
  gap: 10px;
  margin: 0 !important;
  padding: 0 !important;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.character-selector-split {
  justify-content: space-between;
}

/* Quest Summary Box */
.quest-summary-container {
  background: rgba(126, 224, 193, 0.08);
  border: 1px solid rgba(126, 224, 193, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.quest-summary-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quest-summary-val-green {
  font-size: 1.15rem;
  font-weight: 700;
  color: #7ee0c1;
}

.quest-summary-val-orange {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-2);
}

.quest-summary-col-right {
  text-align: right;
}

.badge-level {
  font-size: 0.75rem;
  color: #7ee0c1;
  background: rgba(126, 224, 193, 0.12);
  border: 1px solid rgba(126, 224, 193, 0.25);
  padding: 2px 8px;
  border-radius: 12px;
}

/* ---- Progress bar ---- */
.u-progress-track {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}

.u-progress-fill {
  background: linear-gradient(90deg, #7ee0c1, #52a382);
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease;
}

/* ---- Scroll container ---- */
.u-scroll-table {
  overflow-y: auto;
  max-height: 480px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---- Status dot ---- */
.u-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.u-status-dot-on {
  background: #7ee0c1;
  box-shadow: 0 0 6px #7ee0c1;
}

.u-status-dot-off {
  background: #eb5050;
  box-shadow: 0 0 6px #eb5050;
}

/* ---- Modal / Dialog ---- */
dialog {
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.modal-sm {
  max-width: 450px;
  width: 90%;
  padding: 25px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  margin: auto;
  background: var(--panel-bg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-md {
  max-width: 550px;
  width: 90%;
  padding: 25px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  margin: auto;
  background: var(--panel-bg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-lg {
  max-width: 800px;
  width: 90%;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  margin: auto;
  background: var(--panel-bg);
  color: var(--text);
}

.modal-xl {
  max-width: 1100px;
  width: 90%;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  margin: auto;
  background: var(--panel-bg);
  color: var(--text);
}

/* ---- Form field group ---- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 0.9em;
  color: var(--muted);
}

/* ---- Nav card (portal) ---- */
.nav-card {
  padding: 30px;
  text-align: center;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  background: rgba(255, 255, 255, 0.02);
}

.nav-card:hover {
  transform: translateY(-4px);
}

/* ---- Crop preview box ---- */
.crop-box {
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ---- Checkbox accent ---- */
.u-checkbox {
  accent-color: var(--accent);
  transform: scale(1.25);
  cursor: pointer;
}

/* ---- Details / collapsible ---- */
.details-row {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid #333;
  border-radius: 10px;
  padding: 12px 16px;
}

.details-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---- Sub-panel inset ---- */
.inset-panel {
  background: rgba(0, 0, 0, 0.25);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.inset-panel-green {
  border-color: rgba(126, 224, 193, 0.2);
}

.inset-panel-orange {
  border-color: rgba(255, 184, 108, 0.2);
}

/* ---- Info / data block ---- */
.info-block {
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.pay-entries-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 15px;
  margin-bottom: 15px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.pay-entries-title {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
}

.pay-entries-header p {
  margin: 0;
}

.pay-entries-header h2 {
  margin-bottom: 5px;
}

.button-details {
  text-decoration: none;
  font-size: 0.82rem;
  padding: 5px 14px;
  align-self: center;
}

.pix-key-box {
  text-align: right;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  flex: 0 1 400px;
  overflow: hidden;
}

.pix-key-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(126, 224, 193, 0.08);
  border: 1px solid rgba(126, 224, 193, 0.25);
  border-radius: 8px;
  padding: 6px 6px 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  user-select: none;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.pix-key-badge:hover {
  background: rgba(126, 224, 193, 0.16);
  border-color: rgba(126, 224, 193, 0.45);
  transform: translateY(-1px);
}

.pix-code-wrapper {
  display: block;
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.pix-code {
  font-family: var(--font-mono, monospace);
  font-size: 0.92rem;
  font-weight: 600;
  color: #7ee0c1;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

.copy-btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 5px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  min-width: 76px;
  text-align: center;
  box-sizing: border-box;
}

.pix-key-badge:hover .copy-btn-inner {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   MOBILE & RESPONSIVE IMPROVEMENTS (Pure CSS)
   ========================================================================== */

/* Touch Target Sizes & Input Optimization */
@media (max-width: 768px) {

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 22px;
  }

  html,
  body {
    overflow-x: clip !important;
    max-width: 100vw !important;
  }

  /* Prevent automatic zoom on input focus in iOS */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }

  button,
  .btn,
  select,
  input[type="submit"],
  input[type="button"] {
    min-height: 44px;
  }

  /* Table responsiveness & Horizontal Scrolling */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Modal responsiveness & vertical centering on mobile screens */
  dialog,
  .modal-sm,
  .modal-md,
  .modal-lg,
  .modal-xl {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    padding: 16px !important;
    max-height: 85vh !important;
    max-height: 85dvh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  /* Form grid columns inside modals on mobile stack cleanly into 1 column */
  dialog form div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* XP calculation preview box on mobile: stack spans in separate lines aligned to the left */
  .xp-calc-preview-box {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    text-align: left !important;
  }



  /* Quest item rows layout on mobile screens */
  .quest-item-row {
    flex-wrap: wrap !important;
    gap: 6px 10px !important;
    padding: 10px 8px !important;
  }

  .quest-item-name {
    flex: 1 1 calc(100% - 30px) !important;
    width: calc(100% - 30px) !important;
    font-size: 0.86rem !important;
  }

  .quest-item-meta {
    display: flex !important;
    width: 100% !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-left: 24px !important;
    margin-top: 2px !important;
  }

  .quest-summary-container {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  .quest-summary-col-right {
    text-align: left !important;
  }

  /* Compact modal title on mobile */
  dialog h2,
  dialog h3,
  dialog .section-head h2,
  dialog .section-head h3 {
    font-size: 1.25rem !important;
    line-height: 1.35 !important;
  }
}

/* Navigation & Topbar Responsiveness (Drawer menu when viewport width < 1100px) */
@media (max-width: 1099px) {
  .scroll-blur-guard {
    display: none !important;
  }

  .topbar {
    position: sticky !important;
    top: env(safe-area-inset-top, 0px) !important;
    z-index: 1000 !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 16px !important;
    margin: 0 0 14px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-sizing: border-box !important;
    background: rgba(9, 18, 31, 0.95) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .topbar.provider-nav,
  .topbar.sticky-nav {
    position: sticky !important;
    top: env(safe-area-inset-top, 0px) !important;
    z-index: 1000 !important;
    margin-top: 0 !important;
    border-radius: 0 !important;
    background: rgba(9, 18, 31, 0.95) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Hamburger Toggle Button */
  .mobile-menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s, border-color 0.2s;
  }

  .mobile-menu-toggle:active {
    background: rgba(255, 255, 255, 0.18);
  }

  /* Slide-out Side Drawer Navigation */
  .topbar-actions,
  .provider-nav-actions {
    position: fixed !important;
    top: env(safe-area-inset-top, 0px) !important;
    right: -320px !important;
    width: 270px !important;
    height: calc(100dvh - env(safe-area-inset-top, 0px)) !important;
    background: #09121f !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
    visibility: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 20px !important;
    gap: 12px !important;
    z-index: 100000 !important;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease !important;
    overflow-y: auto !important;
  }

  .topbar-actions.open,
  .provider-nav-actions.open {
    right: 0 !important;
    visibility: visible !important;
    box-shadow: -15px 0 35px rgba(0, 0, 0, 0.8) !important;
  }

  .mobile-drawer-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-drawer-close {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--muted) !important;
    border-radius: 8px !important;
    width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
  }

  .mobile-drawer-close:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
  }

  .mobile-nav-backdrop {
    display: none;
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(4, 9, 17, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .mobile-nav-backdrop.open {
    display: block !important;
    opacity: 1;
  }

  /* Prevent page scrolling when menu is active */
  body.mobile-menu-active {
    overflow: hidden !important;
  }

  body.mobile-menu-active .layout-shell {
    filter: none;
    -webkit-filter: none;
    pointer-events: none;
  }

  .topbar-actions .button,
  .topbar-actions .nav-item,
  .provider-nav-actions .button,
  .provider-nav-actions .nav-item,
  .topbar-actions button:not(.mobile-drawer-close),
  .provider-nav-actions button:not(.mobile-drawer-close),
  #mobile-nav-drawer .nav-item,
  #mobile-nav-drawer a,
  #mobile-nav-drawer button:not(.mobile-drawer-close) {
    width: 100% !important;
    height: 46px !important;
    min-height: 46px !important;
    justify-content: flex-start !important;
    font-size: 0.92rem !important;
    padding: 10px 16px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  .topbar-actions .nav-item span,
  .provider-nav-actions .nav-item span,
  #mobile-nav-drawer .nav-item span {
    font-size: 0.92rem !important;
  }

  /* Container & Layout Shell Adjustments */
  :root {
    --panel-gap: 14px;
  }

  .layout-shell {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 16px 0 !important;
    padding: 0 !important;
    min-height: calc(100dvh - 16px) !important;
    box-sizing: border-box !important;
  }

  .site-footer {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    padding: 24px 12px 8px;
    text-align: center;
  }

  main,
  .dashboard-grid,
  .flash-stack {
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
  }

  .character-selector-bar {
    padding: 0 !important;
    margin: 0 !important;
  }

  .panel {
    padding: 14px !important;
    border-radius: var(--radius-lg) !important;
  }

  dialog.panel,
  .panel .panel,
  .panel:last-child {
    margin-bottom: 0 !important;
  }

  .button-details {
    padding: 10px;
    min-height: 36px;
  }

  /* Grid Stackings & Container Gaps */
  .dashboard-grid,
  .content-split,
  .groups-grid,
  .active-clients-grid,
  .contract-quest-grid,
  .entry-form,
  .character-create,
  .character-edit-form,
  .inline-form,
  .u-col-20,
  .u-col-15,
  .stacked-panels {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: var(--panel-gap) !important;
  }

  /* Admin stats cards grid on mobile (2 columns) */
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .stat-card {
    padding: 12px 14px !important;
  }

  /* Flex wrap adjustments for action buttons and header rows */
  /* Hide 4 metrics overview cards on mobile provider screen */
  .provider-metrics-cards {
    display: none !important;
  }

  /* Form fields on mobile (44px height for text inputs and selects) */
  .entry-form input:not([type="date"]):not([type="datetime-local"]):not([type="time"]),
  .entry-form select:not([multiple]),
  .inline-form input:not([type="date"]):not([type="datetime-local"]):not([type="time"]),
  .inline-form select:not([multiple]),
  input:not([type="checkbox"]):not([type="radio"]):not([type="date"]):not([type="datetime-local"]):not([type="time"]),
  select:not([multiple]) {
    height: 44px !important;
    min-height: 44px !important;
    font-size: 0.9rem !important;
    padding: 8px 12px !important;
    box-sizing: border-box !important;
  }

  /* Multi-select boxes (e.g. Criar/Editar Grupo) display multiple items with clean scroll */
  select[multiple] {
    height: 240px !important;
    min-height: 200px !important;
    padding: 6px !important;
  }

  select[multiple] option {
    padding: 8px 10px !important;
    margin-bottom: 2px !important;
    font-size: 0.88rem !important;
    border-radius: 4px !important;
  }

  input[type="date"],
  input[type="datetime-local"],
  input[type="time"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    font-size: 0.9rem !important;
    padding: 0 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Standard action buttons on mobile (38px height, 0.82rem font-size) */
  .button:not(.nav-item):not([style*="30px"]):not(table *),
  button:not(.status-toggle-btn):not(.mobile-drawer-close):not(.nav-item):not(#btn-nav-notifications):not(#btn-nav-pix):not([style*="30px"]):not(table *),
  input[type="submit"]:not([style*="30px"]):not(table *) {
    font-size: 0.82rem !important;
    min-height: 38px !important;
    height: 38px !important;
    padding: 0 14px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Table buttons on mobile - maintain exact desktop size and padding */
  table td .button,
  table td button,
  table .button-compact {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 10px !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    line-height: 28px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Compact button styling for "Criar Grupo", "Ligar/Desligar", "Editar", "Configurar", "Marcar como Pago" and "Deletar" on mobile */
  .section-head.slim.horizontal .button-primary,
  .party-actions .button,
  .party-actions button,
  button[style*="30px"],
  .button[style*="30px"],
  [style*="height: 30px"],
  [style*="min-height: 30px"] {
    padding: 4px 14px !important;
    font-size: 0.8rem !important;
    min-height: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
  }

  .party-actions {
    gap: 6px !important;
    margin-top: 12px !important;
  }

  /* Responsive fixes for "Meus Clientes" (xp_service_clients) page */
  div[style*="grid-template-columns: repeat(auto-fill, minmax(640px, 1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  div[style*="grid-template-columns: repeat(auto-fill, minmax(320px, 1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .client-card {
    padding: 14px !important;
  }

  .client-card > div[style*="display: flex; justify-content: space-between"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  /* Grid 2x2 exclusivo para os botões do cliente no mobile */
  .client-card .client-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .client-card .client-actions .button,
  .client-card .client-actions form {
    width: 100% !important;
    margin: 0 !important;
  }

  .client-card .client-actions .button {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  .client-card div[style*="height: 42px"] {
    height: auto !important;
  }

  /* Responsive fixes for "Ver Cliente / Personagem" (xp_service_character) page */
  main,
  .dashboard-grid,
  .panel,
  .layout-shell {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  div[style*="display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  div[style*="display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  .character-selector-bar {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;

    div:nth-child(2) {
      margin-left: initial !important;
    }

  }

  .char-action-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .char-action-buttons>.button,
  .char-action-buttons>form {
    flex: 0 0 auto !important;
    width: auto !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    display: inline-block !important;
  }

  .char-action-buttons .button {
    width: auto !important;
    white-space: nowrap !important;
    font-size: 0.78rem !important;
    padding: 0 10px !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    display: inline-flex !important;
    height: 32px !important;
    min-height: 32px !important;
    box-sizing: border-box !important;
  }

  /* Form and Crop section overflow fixes */
  .entry-form,
  #crop-preview-section,
  #crop-preview-section>div {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .u-img-crop-xp,
  .u-img-crop-60,
  .u-img-crop-date {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Canvas & Chart container mobile responsiveness */
  #xpChart,
  canvas {
    max-width: 100% !important;
  }

  div[style*="position: relative; height: 360px"] {
    height: 240px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }


  /* Hide image upload fields and crop preview section on mobile screens */
  .mobile-hide-upload {
    display: none !important;
  }

  /* Hide character pill details (level and server) and topbar server name on mobile screens */
  .char-pill-details,
  .topbar-server-name {
    display: none !important;
  }

  /* Shrink logo size on mobile screens */
  .brand-block .logo {
    height: 44px !important;
    width: auto !important;
  }

  /* Responsive fixes for "Pagar Entradas Selecionadas" on mobile */
  .pay-entries-panel,
  .pay-entries-header {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .pay-entries-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .pay-entries-header p {
    font-size: 0.9em;
  }

  .pay-entries-title {
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .pay-entries-header>div {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .pay-entries-header>div:last-child,
  .pix-key-box {
    flex: none !important;
    text-align: left !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .pix-key-badge {
    display: flex !important;
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .pix-code-wrapper {
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 0% !important;
    overflow: hidden !important;
  }

  .pix-code {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .pay-entries-panel form,
  .pay-entries-panel div[style*="display: flex; gap: 10px; align-items: center; flex-wrap: wrap"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .pay-entries-panel input[type="file"],
  .pay-entries-panel input[type="text"],
  .pay-entries-panel button {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .details-summary {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .details-summary>div:last-child {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }

  .details-summary button {
    flex: 1 1 auto !important;
  }

  details,
  .details-row {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Flash notifications on mobile */
  .flash-stack {
    left: 12px;
    right: 12px;
    bottom: 16px;
    max-width: calc(100vw - 24px);
  }

  .btn-label-desktop {
    display: none !important;
  }

  /* Auth & Login responsiveness for mobile */
  .layout-shell:has(.auth-grid) {
    margin: 0 auto !important;
    padding: 0 !important;
    min-height: 100dvh !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .auth-grid {
    padding: 16px 12px !important;
    min-height: 100dvh !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    margin: 0 auto !important;
  }

  .auth-container {
    max-width: 100% !important;
    gap: 16px !important;
    margin: auto !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .auth-logo {
    max-width: 80% !important;
    margin: 0 auto !important;
  }

  .auth-card {
    padding: 18px 16px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .auth-card h2 {
    font-size: 1.25rem !important;
  }

  .auth-card p {
    font-size: 0.85rem !important;
  }

  /* Service Quest card responsive styles for mobile */
  .quest-card-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .quest-card-header h3 {
    font-size: 0.95rem !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  /* Empty state responsiveness */
  .empty-state-panel {
    padding: 30px 16px !important;
  }

  .empty-state-icon {
    font-size: 2.8rem !important;
    margin-bottom: 10px !important;
  }

  .empty-state-title {
    font-size: 1.15rem !important;
  }

  .empty-state-text {
    font-size: 0.88rem !important;
    margin-bottom: 18px !important;
  }

  .empty-state-btn {
    width: auto !important;
    max-width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 10px 20px !important;
    display: inline-flex !important;
  }
}

/* Empty State Panel System */
.empty-state-panel {
  padding: 45px 30px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  opacity: 0.9;
  line-height: 1;
}

.empty-state-title {
  margin: 0 0 10px 0;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 600;
}

.empty-state-text {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 500px;
  margin: 0 auto 22px auto;
  line-height: 1.5;
}

.empty-state-btn {
  padding: 10px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Responsive Desktop vs Mobile Display Helpers */
.ios-pull-refresh-indicator {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(11, 18, 31, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, -120%, 0);
  transition: transform 160ms ease, opacity 160ms ease;
  backdrop-filter: none;
}

.ios-pull-refresh-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #7ee0c1;
  animation: ios-pull-refresh-spin 800ms linear infinite;
}

@keyframes ios-pull-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
}

@media (min-width: 768px) {
  .desktop-only {
    display: block !important;
  }

  .mobile-only {
    display: none !important;
  }
}

/* Auth Centering & Mobile Layout Rules */
.layout-shell:has(.auth-grid) {
  padding: 0 !important;
  margin: 0 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 100dvh !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.layout-shell:has(.auth-grid) .site-footer {
  display: none;
}

.auth-grid {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100dvh !important;
  width: 100% !important;
  padding: 20px 16px !important;
  box-sizing: border-box !important;
}

.auth-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 440px !important;
  margin: 0 auto !important;
}

.auth-logo {
  display: block;
  width: 100%;
  max-width: 80%;
  height: auto;
  max-height: 85px;
  object-fit: contain;
  margin: 0 auto;
}

.auth-card {
  width: 100% !important;
  max-width: 440px !important;
  padding: 24px 20px !important;
  box-sizing: border-box !important;
  border-radius: 20px !important;
  background: rgba(10, 17, 30, 0.92) !important;
  backdrop-filter: none !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

@media (max-width: 480px) {
  .auth-grid {
    padding: 12px 10px !important;
    align-items: center !important;
  }

  .auth-card {
    padding: 16px 12px !important;
    border-radius: 16px !important;
  }
}

/* Hide navbar menu icons when viewport width is below 1600px (except inside side drawer) */
@media (max-width: 1599px) {
  .nav-item .nav-icon {
    display: none !important;
  }

  #mobile-nav-drawer .nav-icon,
  .topbar-actions.open .nav-icon,
  .provider-nav-actions.open .nav-icon {
    display: inline-block !important;
  }
}

/* Reduce font size and padding of navbar menu items when viewport width is below 1400px */
@media (max-width: 1399px) {
  .nav-item {
    font-size: 0.78rem !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    min-height: 36px;
  }
}


@media (prefers-reduced-motion: reduce), (hover: none) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .bg-orb {
    display: none !important;
  }

  .scroll-blur-guard,
  .topbar,
  .panel,
  .flash,
  .ios-pull-refresh-indicator,
  .auth-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.mobile-menu-active .layout-shell {
    filter: none !important;
    -webkit-filter: none !important;
    opacity: 0.32;
  }
}

@media (max-width: 760px) {
  .layout-shell {
    width: min(100vw - 20px, 100vw);
    margin: 10px auto 20px;
  }

  .site-footer {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding: 32px 20px 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    text-align: center;
  }

  .topbar,
  .hero-card,
  .auth-card,
  .sidebar,
  .main-stage {
    padding: 18px;
  }

  .inline-form,
  .entry-form,
  .character-create {
    grid-template-columns: 1fr;
  }

  .character-row {
    grid-template-columns: 1fr;
  }

  .character-actions {
    justify-content: flex-start;
  }

  .character-edit-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
