:root {
  --sand: #0b0c11;
  --sky: #11141f;
  --mint: #1f212b;
  --ink: #f5f6fb;
  --muted: #aeb2c2;
  --card: rgba(31, 33, 43, 0.9);
  --stroke: rgba(245, 246, 251, 0.08);
  --primary: #7a39ff;
  --primary-strong: #5f46d9;
  --accent: #8e5bff;
  --danger: #ff5a6e;
  --radius: 18px;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
  --header-surface-gradient:
    radial-gradient(130% 180% at 98% -22%, rgba(119, 41, 255, 0.55) 0%, rgba(19, 141, 255, 0.2) 24%, rgba(119, 41, 255, 0) 52%),
    radial-gradient(110% 150% at -12% -42%, rgba(38, 82, 178, 0.34) 0%, rgba(38, 82, 178, 0) 58%),
    linear-gradient(135deg, #05080f 0%, #090f1b 42%, #121322 74%, #151515 100%);
  --user-color: #8e5bff;
  --user-color-rgb: 142, 91, 255;
  --bottom-nav-height: 84px;
  --map-top-bar-height: 84px;
  --account-top-bar-height: 84px;
  --app-height: 100dvh;
  --visual-viewport-height: 100dvh;
  --keyboard-height: 0px;
  --app-safe-top: env(safe-area-inset-top);
  --app-safe-bottom: env(safe-area-inset-bottom);
  --ranking-modal-max-width: 760px;
  --ranking-modal-max-height: 700px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
}

body {
  min-height: var(--app-height);
  background: #161616;
}

body.platform-android {
  --app-safe-top: var(--native-safe-top, env(safe-area-inset-top));
}

body.platform-ios {
  --app-safe-top: var(--native-safe-top, env(safe-area-inset-top));
}

body.platform-ios .mobile-app,
body.platform-ios .mobile-app *,
body.platform-android .mobile-app,
body.platform-android .mobile-app * {
  -webkit-touch-callout: none !important;
  -webkit-user-drag: none;
}

body.platform-ios .mobile-app :not(input):not(textarea):not(select):not([contenteditable="true"]),
body.platform-android .mobile-app :not(input):not(textarea):not(select):not([contenteditable="true"]) {
  -webkit-user-select: none !important;
  user-select: none !important;
}

body.platform-ios .auth-screen,
body.platform-ios .auth-screen *,
body.platform-android .auth-screen,
body.platform-android .auth-screen * {
  -webkit-touch-callout: none !important;
  -webkit-user-drag: none;
}

body.platform-ios .auth-screen :not(input):not(textarea):not(select):not([contenteditable="true"]),
body.platform-android .auth-screen :not(input):not(textarea):not(select):not([contenteditable="true"]) {
  -webkit-user-select: none !important;
  user-select: none !important;
}

body.platform-ios input,
body.platform-ios textarea,
body.platform-ios select,
body.platform-ios [contenteditable="true"],
body.platform-android input,
body.platform-android textarea,
body.platform-android select,
body.platform-android [contenteditable="true"] {
  -webkit-touch-callout: default !important;
  -webkit-user-select: text !important;
  user-select: text !important;
}

body.modal-open {
  overflow: hidden;
}

body.app-visible {
  overflow: hidden;
}

body.modal-open #appView[aria-hidden="true"],
body.modal-open #authView[aria-hidden="true"] {
  pointer-events: none;
}

.session-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(9, 10, 15, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.session-loading-dialog {
  width: min(100%, 360px);
  border: 1px solid rgba(245, 246, 251, 0.12);
  border-radius: 16px;
  background: linear-gradient(156deg, rgba(32, 35, 47, 0.98), rgba(24, 27, 36, 0.98));
  padding: 16px;
  display: grid;
  justify-items: center;
  gap: 12px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.5);
}

.session-loading-dialog p {
  margin: 0;
  font-size: 0.92rem;
  color: #d6d8e1;
  text-align: center;
}

.session-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(245, 246, 251, 0.18);
  border-top-color: #7a39ff;
  border-right-color: #8e5bff;
  border-radius: 999px;
  animation: session-loading-spin 0.95s linear infinite;
}

@keyframes session-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: transparent;
}

.auth-screen,
.mobile-app {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: calc(var(--app-safe-top) + 15px) 12px calc(12px + var(--app-safe-bottom));
  position: relative;
  min-height: var(--app-height);
  min-width: 0;
}

.auth-screen {
  min-height: var(--app-height);
  display: grid;
  align-content: center;
  gap: 12px;
}

.auth-hero,
.auth-card,
.card {
  background: #242424;
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(5px);
}

.auth-hero,
.auth-card,
.card {
  padding: 14px;
}

.auth-hero h1 {
  margin: 4px 0;
  font-size: clamp(2rem, 8vw, 2.9rem);
  letter-spacing: 0.02em;
}

.auth-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.auth-hero-art {
  display: block;
  width: 100%;
  max-width: none;
  height: clamp(128px, 24vh, 176px);
  margin: 10px 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(245, 246, 251, 0.1);
  box-shadow: none;
  object-fit: cover;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #37363b;
  color: var(--ink);
  padding: 10px;
  font-weight: 700;
}

.tab-btn.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
}

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

label {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 400;
}

.required-label::after {
  content: " *";
  color: var(--danger);
  font-weight: 700;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #303030;
  border-radius: 12px;
  background: #202020;
  color: var(--ink);
  padding: 10px 12px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(142, 91, 255, 0.35);
  border-color: transparent;
}

.badge-picker {
  position: relative;
}

.badge-picker-trigger {
  width: 100%;
  border: 1px solid rgba(245, 246, 251, 0.42);
  border-radius: 12px;
  background: rgba(24, 27, 36, 0.82);
  color: var(--ink);
  padding: 8px 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.badge-picker-trigger:focus {
  outline: 2px solid rgba(142, 91, 255, 0.35);
  border-color: transparent;
}

.badge-picker-value {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.badge-picker-caret {
  color: var(--muted);
  font-size: 0.92rem;
}

.badge-picker-thumb {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(245, 246, 251, 0.25);
  background: rgba(255, 255, 255, 0.1);
  flex: 0 0 auto;
}

.badge-picker-thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e7edf5;
  font-size: 0.86rem;
}

.badge-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  border: 1px solid rgba(245, 246, 251, 0.42);
  border-radius: 12px;
  background: rgba(24, 27, 36, 0.98);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.36);
  max-height: 240px;
  overflow: auto;
  padding: 6px;
}

.badge-picker-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.badge-picker-option:hover,
.badge-picker-option:focus {
  background: rgba(142, 91, 255, 0.16);
  outline: none;
}

.badge-picker-option.is-selected {
  background: rgba(142, 91, 255, 0.22);
}

input.is-invalid,
textarea.is-invalid,
select.is-invalid {
  border-color: rgba(255, 90, 110, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 90, 110, 0.4);
}

.date-picker-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.date-picker-field input[type="date"] {
  min-width: 0;
  flex: 1 1 auto;
}

.date-picker-field input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.95;
}

.date-picker-trigger {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border: 1px solid rgba(245, 246, 251, 0.42);
  border-radius: 12px;
  background: rgba(24, 27, 36, 0.82);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.date-picker-trigger:focus-visible {
  outline: 2px solid rgba(142, 91, 255, 0.35);
  border-color: transparent;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn.is-loading {
  position: relative;
  padding-left: 34px;
}

.btn.is-loading::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(215, 198, 255, 0.32);
  border-top-color: var(--primary);
  border-radius: 999px;
  transform: translateY(-50%);
  animation: geo-spin 0.8s linear infinite;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
}

.btn-primary:active {
  background: var(--primary-strong);
}

.btn-secondary {
  color: #e7edf5;
  background: rgba(142, 91, 255, 0.18);
  border: 1px solid rgba(142, 91, 255, 0.38);
}

.btn-ghost {
  color: #e7edf5;
  background: rgba(174, 126, 255, 0.2);
  border: 1px solid rgba(174, 126, 255, 0.42);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.auth-link-btn {
  border: none;
  background: transparent;
  color: #ffffff;
  text-decoration: underline;
  justify-self: start;
  padding: 0;
  font-weight: 400;
  cursor: pointer;
}

.auth-link-btn:active {
  color: #ffffff;
}

.msg {
  min-height: 1.2rem;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 0.88rem;
}

.mobile-app {
  --app-side-padding: 12px;
  --app-top-padding: calc(var(--app-safe-top) + 15px);
  min-height: var(--app-height);
  height: var(--app-height);
  max-height: var(--app-height);
  overflow: hidden;
  display: block;
}

.offline-indicator {
  width: 36px;
  height: 36px;
  background: rgba(245, 189, 61, 0.96);
  color: #2a1e00;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(34, 24, 0, 0.22);
  flex: 0 0 auto;
  pointer-events: none;
}

.offline-indicator svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.group-switch {
  display: grid;
  gap: 6px;
}

.map-group-bar {
  position: fixed;
  top: calc(var(--app-safe-top) + 15px);
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 16px), 860px);
  z-index: 980;
  padding: 10px 12px;
  background: #161616;
  border: none;
  border-radius: 14px;
  backdrop-filter: blur(8px);
  box-shadow: none;
}

.map-group-bar label {
  font-size: 0.8rem;
}

.map-group-bar .muted {
  font-size: 0.82rem;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.content {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--bottom-nav-height) + 15px);
  min-width: 0;
  overscroll-behavior-y: contain;
}

.view {
  display: grid;
  gap: 10px;
  min-height: 100%;
  align-content: start;
  min-width: 0;
}

#viewGroups,
#viewgroups,
#viewImpulse,
#viewTemplateGroups,
#viewMap,
#viewAccount,
#viewStreak {
  background: #161616 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  opacity: 1;
}

#viewMap {
  padding-top: calc(var(--map-top-bar-height) + 15px);
}

#viewAccount {
  padding-top: calc(var(--account-top-bar-height) + 15px);
}

#viewStreak {
  padding-top: calc(var(--account-top-bar-height) + 32px);
  padding-inline: 0;
  padding-bottom: 0;
  gap: 0;
}

.card h3 {
  margin: 0 0 10px;
}

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

.top-gap-sm {
  margin-top: 8px;
}

.groups-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.group-plus-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(122, 57, 255, 0.56);
  border-radius: 999px;
  background: rgba(36, 39, 52, 0.9);
  color: #e7edf5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.group-plus-btn:active {
  transform: scale(0.97);
}

.group-plus-close {
  font-size: 1.4rem;
}

.group-detail-form {
  margin-bottom: 10px;
}

.group-form-grid {
  gap: 12px;
}

.group-form-grid > label {
  margin: 0;
}

.group-image-picker {
  display: grid;
  gap: 8px;
}

.group-image-preview {
  width: 100%;
  max-height: 180px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(245, 246, 251, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

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

.group-image-actions .btn {
  flex: 1 1 180px;
}

#groupDetailImagePicker {
  position: relative;
}

#groupDetailImagePicker .group-detail-image-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

#groupDetailImagePicker .group-detail-image-btn {
  width: 36px;
  height: 36px;
  padding: 0;
}

#groupDetailImagePicker.has-image .group-detail-image-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  margin: 0;
}

#createGroupImageInput,
#groupDetailImageInput {
  display: none;
}

.group-detail-code-btn {
  margin-left: 0;
  min-height: 34px;
  border: 1px solid rgba(122, 57, 255, 0.56);
  border-radius: 999px;
  background: rgba(31, 33, 43, 0.82);
  color: #e7edf5;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 7px 12px;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  cursor: pointer;
}

#openGroupInviteModalBtn {
  margin-left: 0;
}

.group-detail-code-btn:active {
  transform: scale(0.99);
}

.group-detail-code-btn[disabled] {
  opacity: 0.62;
  cursor: default;
}

.group-detail-color-top {
  width: 36px;
  height: 36px;
  margin-right: 0;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #37363b;
  border: none;
  cursor: pointer;
}

.group-detail-color-top input[type="color"] {
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.group-detail-color-top input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.group-detail-color-top input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 999px;
}

.group-detail-color-top input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 999px;
}

.group-detail-color-top input[type="color"]:disabled {
  cursor: default;
  opacity: 0.6;
}

.group-detail-core-fields {
  display: grid;
  gap: 10px;
}

.group-detail-extra-wrap {
  display: grid;
  gap: 8px;
}

.group-detail-extra-toggle {
  border: none;
  border-radius: 999px;
  background: #37363b;
  color: #e7edf5;
  min-height: 34px;
  padding: 7px 12px;
  text-align: center;
  cursor: pointer;
}

.group-detail-extra-toggle.is-active {
  border: none;
  background: #37363b;
}

.group-detail-extra-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #161616;
  padding: 10px;
}

.group-detail-extra-panel > label {
  margin: 0;
}

.group-template-meta-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(122, 57, 255, 0.36);
  border-radius: 12px;
  background: rgba(36, 39, 52, 0.6);
  padding: 10px;
}

.group-template-meta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-template-season-name {
  color: #e7edf5;
  font-weight: 600;
}

.group-template-meta-body {
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-template-badge-image {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(245, 246, 251, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.group-template-badge-name {
  color: var(--muted);
  font-size: 0.9rem;
}

#createGroupForm .color-row,
#groupDetailForm .color-row {
  margin-top: 2px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.group-members-wrap {
  margin-top: 10px;
}

.group-members-wrap h4 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.group-members-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: stretch;
}

.group-members-list.list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#groupMembersList {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: stretch;
}

.member-list-item {
  padding: 20px 12px;
  height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.member-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.member-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.member-row-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.member-avatar {
  width: 80px;
  height: 80px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(31, 33, 43, 0.2);
  background: #e7edf5;
  flex: 0 0 auto;
}

.member-row-name {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-row-meta {
  margin-top: 4px;
  margin-left: 88px;
  font-size: 0.8rem;
}

.account-avatar-block {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.account-card {
  padding: 16px;
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

#viewAccount .account-card,
#viewAccount .account-tabs,
#viewAccount .account-tab-panel,
#viewAccount .account-color-card,
#viewAccount .account-llm-pane,
#viewAccount .account-llm-panel,
#viewAccount .account-badges-toggle,
#viewAccount .account-badge-item {
  background: #161616;
}

#viewAccount .account-lifetime-section {
  background: #242426;
}

.account-head {
  display: block;
  gap: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.account-profile-block {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.account-avatar-area {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.account-avatar-trigger {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.account-avatar-trigger:focus-visible {
  outline: 2px solid rgba(142, 91, 255, 0.45);
  outline-offset: 2px;
}

.account-head-tools input[type="color"] {
  width: 52px;
  height: 52px;
  padding: 1px;
  border-radius: 12px;
  flex: 0 0 auto;
}

.account-avatar-upload-btn {
  flex: 0 0 auto;
}

.account-head-text {
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  padding-top: 2px;
}

.account-head-text h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-head-text p {
  margin: 3px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-head-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  align-self: auto;
  justify-self: auto;
  padding: 0;
  margin: 0;
}

.account-head .group-icon-btn {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.account-head .group-icon-btn svg {
  width: 24px;
  height: 24px;
}

.account-logout-head-btn {
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 760px) {
  .account-head-tools {
    justify-content: flex-start;
  }
}

#accountHeaderCard .account-head {
  background: transparent;
  border: none;
}

#accountHeaderCard .account-tabs {
  background: transparent;
  border: 1px solid rgba(245, 246, 251, 0.18);
  box-shadow: none;
}

#accountHeaderCard .account-tabs .tab-btn:not(.is-active) {
  background: rgba(55, 54, 59, 0.58);
}

.account-friends-row {
  margin-top: 2px;
}

.account-friends-launch-wide {
  width: 100%;
}

.account-friends-btn {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.account-friends-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.account-friends-launch-wide .chat-badge {
  top: -6px;
  right: 10px;
  z-index: 70;
}

.account-lifetime-section {
  display: grid;
  gap: 8px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(24, 27, 36, 0.9);
  padding: 10px 12px;
}

.account-lifetime-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.account-lifetime-label {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 400;
}

.account-lifetime-value {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.account-streak-card {
  display: grid;
  gap: 8px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(245, 246, 251, 0.16);
}

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

.account-streak-title {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 400;
}

.account-streak-today-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 246, 251, 0.28);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--muted);
  background: rgba(245, 246, 251, 0.06);
}

.account-streak-today-badge.is-complete {
  color: #bbffe7;
  border-color: rgba(126, 224, 186, 0.45);
  background: rgba(52, 124, 95, 0.34);
}

.account-streak-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.account-streak-metric {
  border: 1px solid rgba(245, 246, 251, 0.18);
  border-radius: 10px;
  background: rgba(245, 246, 251, 0.05);
  padding: 8px;
  display: grid;
  gap: 4px;
}

.account-streak-metric-label {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.account-streak-metric-value {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.account-streak-repair-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.34;
}

.account-streak-repair-btn {
  width: 100%;
  min-height: 40px;
}

.streak-overview-card {
  display: grid;
  gap: 12px;
  width: 100%;
  min-height: calc(var(--visual-viewport-height) - var(--account-top-bar-height) - var(--bottom-nav-height) - 34px);
  border: none;
  border-radius: 0;
  background:
    radial-gradient(circle at 84% 10%, rgba(142, 91, 255, 0.2), rgba(142, 91, 255, 0) 52%),
    radial-gradient(circle at 14% 22%, rgba(95, 70, 217, 0.16), rgba(95, 70, 217, 0) 58%),
    #1f2024;
  padding: 16px 16px 24px;
}

.streak-overview-head {
  margin-bottom: 0;
}

.streak-overview-head h3 {
  margin-bottom: 0;
}

.streak-overview-status {
  margin: 0;
  color: #cfb9ff;
  font-size: 0.88rem;
  line-height: 1.35;
}

.streak-overview-status,
.streak-overview-status ~ * {
  position: relative;
  top: -10px;
}

.streak-overview-status.is-complete {
  color: #9df2ce;
}

.streak-overview-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.streak-overview-progress-ring {
  --streak-progress: 0deg;
  width: 118px;
  height: 118px;
  border-radius: 999px;
  padding: 8px;
  background: conic-gradient(var(--accent) var(--streak-progress), rgba(255, 255, 255, 0.08) 0deg);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 24px rgba(0, 0, 0, 0.24);
}

.streak-overview-progress-core {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 26%, rgba(142, 91, 255, 0.24), rgba(142, 91, 255, 0) 58%),
    #17181c;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.streak-overview-progress-core svg {
  width: 42px;
  height: 42px;
  fill: var(--accent);
  filter: drop-shadow(0 4px 12px rgba(142, 91, 255, 0.34));
}

.streak-overview-hero-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.streak-overview-label {
  margin: 0;
  color: #b8bdc8;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.streak-overview-current-value {
  color: #f1eaff;
  font-size: 1.5rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.streak-overview-progress-meta {
  margin: 0;
  color: #c7ccd6;
  font-size: 0.82rem;
}

.streak-overview-timeline {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(245, 246, 251, 0.16);
  border-radius: 16px;
  background: rgba(11, 13, 18, 0.58);
  padding: 12px 10px 10px;
}

.streak-overview-timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.streak-overview-timeline-head h4 {
  margin: 0;
  color: #f1eaff;
  font-size: 0.84rem;
  line-height: 1.25;
}

.streak-overview-timeline-scale-meta {
  color: #aeb6c8;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
}

.streak-overview-timeline-wrap {
  display: grid;
  gap: 8px;
}

.streak-overview-timeline-track {
  position: relative;
  height: 110px;
  border-radius: 14px;
  border: 1px solid rgba(245, 246, 251, 0.12);
  background:
    repeating-linear-gradient(
      to right,
      rgba(255, 255, 255, 0.06) 0,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px,
      transparent calc(100% / 30)
    ),
    linear-gradient(180deg, rgba(142, 91, 255, 0.16), rgba(27, 29, 39, 0.88));
  overflow: hidden;
}

.streak-overview-timeline-progress {
  position: absolute;
  left: 0;
  bottom: 4px;
  height: 8px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  box-shadow: 0 0 0 1px rgba(142, 91, 255, 0.2), 0 4px 14px rgba(95, 70, 217, 0.38);
  width: 0;
  transition: width 220ms ease;
}

.streak-overview-timeline-marker {
  position: absolute;
  bottom: 18px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 4px;
  z-index: 2;
}

.streak-overview-timeline-marker.is-current {
  bottom: 54px;
}

.streak-overview-timeline-marker.is-longest {
  bottom: 34px;
  gap: 3px;
}

.streak-overview-timeline-marker.is-hidden {
  display: none;
}

.streak-overview-marker-label {
  color: #e8ebf5;
  font-size: 0.68rem;
  line-height: 1.1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.46);
  white-space: nowrap;
}

.streak-overview-marker-avatar-wrap {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid rgba(231, 237, 245, 0.88);
  box-shadow: 0 0 0 2px rgba(142, 91, 255, 0.28), 0 8px 16px rgba(0, 0, 0, 0.35);
  background: #141826;
}

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

.streak-overview-timeline-marker.is-not-started .streak-overview-marker-avatar-wrap {
  opacity: 0.78;
  border-color: rgba(180, 188, 203, 0.72);
  box-shadow: 0 0 0 1px rgba(174, 182, 200, 0.24);
}

.streak-overview-marker-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  line-height: 1;
  color: #f7f0ff;
  background: linear-gradient(130deg, #7a39ff, #5f46d9);
  box-shadow: 0 0 0 1px rgba(207, 185, 255, 0.35), 0 8px 16px rgba(0, 0, 0, 0.3);
}

.streak-overview-timeline-marker.is-overlap.is-current {
  transform: translate(-50%, -20px);
}

.streak-overview-timeline-marker.is-overlap.is-longest {
  transform: translate(-50%, 12px);
}

.streak-overview-timeline-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -8px;
  color: #a5aec4;
  font-size: 0.68rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.streak-overview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.streak-overview-metric {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(245, 246, 251, 0.14);
  border-radius: 12px;
  background: rgba(15, 16, 19, 0.55);
  padding: 9px 8px;
}

.streak-overview-metric-label {
  color: #afb5c3;
  font-size: 0.72rem;
  line-height: 1.2;
}

.streak-overview-metric-value {
  color: #f1eaff;
  font-size: 1.02rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.streak-overview-target-meta {
  margin: 0;
  color: #cfb9ff;
  font-size: 0.84rem;
  line-height: 1.3;
}

.streak-overview-repair-meta {
  margin: 0;
  color: #c7ccd6;
  font-size: 0.8rem;
  line-height: 1.35;
}

.streak-overview-repair-btn {
  width: 100%;
  min-height: 40px;
}

.streak-overview-week {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.streak-overview-week h4 {
  margin: 0;
  color: #f1eaff;
  font-size: 0.86rem;
}

.streak-overview-week-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.streak-overview-week-day {
  display: grid;
  justify-items: center;
  gap: 4px;
  border: 1px solid rgba(245, 246, 251, 0.14);
  border-radius: 12px;
  background: rgba(15, 16, 19, 0.5);
  padding: 8px 4px;
}

.streak-overview-week-day.is-today {
  border-color: rgba(142, 91, 255, 0.6);
  box-shadow: inset 0 0 0 1px rgba(142, 91, 255, 0.24);
}

.streak-overview-weekday {
  color: #a7adba;
  font-size: 0.68rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.streak-overview-daynum {
  color: #f1f4fa;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.streak-overview-week-marker {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(245, 246, 251, 0.22);
}

.streak-overview-week-day.is-complete .streak-overview-week-marker,
.streak-overview-week-day.is-complete-today .streak-overview-week-marker {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(142, 91, 255, 0.3);
}

.streak-overview-week-day.is-gap .streak-overview-week-marker {
  background: #f36464;
  box-shadow: 0 0 0 3px rgba(243, 100, 100, 0.22);
}

.streak-overview-week-day.is-open .streak-overview-week-marker {
  background: #e3e6ee;
}

.streak-overview-week-day.is-idle {
  opacity: 0.7;
}

.account-trophy-path-section {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(245, 246, 251, 0.16);
}

.account-trophy-path-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-trophy-path-title {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 400;
}

.account-trophy-path-meta {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 400;
}

.account-trophy-path-scroller {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.account-trophy-path-scroller::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.account-trophy-path-canvas {
  position: relative;
  width: max-content;
  min-width: 100%;
  height: 250px;
  border-radius: 14px;
  border: 1px solid rgba(245, 246, 251, 0.26);
  background: #161616;
  box-shadow:
    inset 0 1px 0 rgba(245, 246, 251, 0.14),
    0 12px 26px rgba(28, 31, 42, 0.45);
  overflow: hidden;
  isolation: isolate;
}

.account-trophy-path-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 8% 12%, rgba(245, 246, 251, 0.84) 0 1px, transparent 1.3px),
    radial-gradient(circle at 19% 36%, rgba(215, 198, 255, 0.72) 0 1.1px, transparent 1.4px),
    radial-gradient(circle at 28% 14%, rgba(235, 245, 255, 0.82) 0 1.2px, transparent 1.5px),
    radial-gradient(circle at 42% 24%, rgba(245, 246, 251, 0.68) 0 1px, transparent 1.4px),
    radial-gradient(circle at 51% 44%, rgba(215, 198, 255, 0.74) 0 1.1px, transparent 1.5px),
    radial-gradient(circle at 58% 10%, rgba(245, 246, 251, 0.8) 0 1.2px, transparent 1.6px),
    radial-gradient(circle at 66% 52%, rgba(245, 246, 251, 0.66) 0 1px, transparent 1.4px),
    radial-gradient(circle at 74% 28%, rgba(215, 198, 255, 0.7) 0 1px, transparent 1.3px),
    radial-gradient(circle at 81% 62%, rgba(215, 198, 255, 0.78) 0 1.1px, transparent 1.5px),
    radial-gradient(circle at 88% 16%, rgba(245, 246, 251, 0.84) 0 1.2px, transparent 1.5px),
    radial-gradient(circle at 92% 42%, rgba(245, 246, 251, 0.66) 0 1.1px, transparent 1.4px),
    radial-gradient(circle at 12% 72%, rgba(238, 246, 255, 0.8) 0 1.2px, transparent 1.6px),
    radial-gradient(circle at 24% 86%, rgba(215, 198, 255, 0.68) 0 1px, transparent 1.3px),
    radial-gradient(circle at 36% 68%, rgba(215, 198, 255, 0.76) 0 1.1px, transparent 1.5px),
    radial-gradient(circle at 48% 90%, rgba(215, 198, 255, 0.66) 0 1px, transparent 1.4px),
    radial-gradient(circle at 62% 78%, rgba(243, 249, 255, 0.8) 0 1.2px, transparent 1.6px),
    radial-gradient(circle at 73% 92%, rgba(215, 198, 255, 0.68) 0 1px, transparent 1.4px),
    radial-gradient(circle at 86% 74%, rgba(228, 241, 255, 0.76) 0 1.1px, transparent 1.5px),
    radial-gradient(circle at 94% 88%, rgba(215, 198, 255, 0.66) 0 1px, transparent 1.4px);
  opacity: 0.95;
  pointer-events: none;
  z-index: 0;
}

.account-trophy-path-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 6% 18%, rgba(255, 255, 255, 0.98) 0 0.9px, transparent 1.6px),
    radial-gradient(circle at 15% 78%, rgba(215, 198, 255, 0.84) 0 1px, transparent 1.7px),
    radial-gradient(circle at 27% 56%, rgba(246, 251, 255, 0.88) 0 1px, transparent 1.7px),
    radial-gradient(circle at 38% 16%, rgba(245, 246, 251, 0.76) 0 0.95px, transparent 1.6px),
    radial-gradient(circle at 49% 82%, rgba(247, 251, 255, 0.86) 0 1px, transparent 1.7px),
    radial-gradient(circle at 61% 36%, rgba(215, 198, 255, 0.8) 0 1px, transparent 1.7px),
    radial-gradient(circle at 73% 60%, rgba(249, 252, 255, 0.86) 0 0.95px, transparent 1.6px),
    radial-gradient(circle at 84% 22%, rgba(224, 241, 255, 0.82) 0 1px, transparent 1.7px),
    radial-gradient(circle at 93% 72%, rgba(245, 246, 251, 0.9) 0 0.95px, transparent 1.6px);
  opacity: 0.46;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: trophySkyPulse 9.4s ease-in-out infinite;
  z-index: 0;
}

.account-trophy-path-canvas.is-static-effects::after {
  animation: none;
}

.account-trophy-star {
  position: absolute;
  z-index: 0;
  width: var(--star-size, 1.8px);
  height: var(--star-size, 1.8px);
  border-radius: 999px;
  background: rgba(240, 248, 255, 0.96);
  box-shadow:
    0 0 0 1px rgba(215, 198, 255, 0.18),
    0 0 8px rgba(215, 198, 255, 0.72);
  opacity: var(--star-opacity, 0.8);
  transform: translate(-50%, -50%) scale(0.86);
  animation: trophyStarTwinkle var(--twinkle-dur, 4.8s) ease-in-out var(--twinkle-delay, 0s) infinite;
  pointer-events: none;
  will-change: transform, opacity, filter;
}

.account-trophy-path-canvas.is-static-effects .account-trophy-star {
  animation: none;
  transform: translate(-50%, -50%);
  will-change: auto;
}

.account-trophy-star::before,
.account-trophy-star::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  pointer-events: none;
}

.account-trophy-star::before {
  width: calc(var(--star-size, 1.8px) * 3.2);
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(236, 247, 255, 0.9), rgba(255, 255, 255, 0));
}

.account-trophy-star::after {
  width: 1px;
  height: calc(var(--star-size, 1.8px) * 3.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(236, 247, 255, 0.9), rgba(255, 255, 255, 0));
}

.account-trophy-path-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.account-trophy-path-svg .trophy-path-travel-line {
  animation-name: trophyPathTravel;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.account-trophy-path-svg .trophy-path-travel-line.is-reverse {
  animation-name: trophyPathTravelReverse;
}

.account-trophy-path-canvas.is-static-effects .account-trophy-path-svg .trophy-path-travel-line {
  animation: none;
}

.account-trophy-path-flash {
  position: absolute;
  z-index: 2;
  width: 84px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(238, 250, 255, 0.96), rgba(255, 255, 255, 0));
  filter: blur(0.2px);
  opacity: 0;
  pointer-events: none;
}

.account-trophy-path-flash.flash-a {
  top: 50%;
  animation: trophyPathFlashA 6.2s linear infinite;
}

.account-trophy-path-flash.flash-b {
  top: 62%;
  animation: trophyPathFlashB 7.7s linear infinite;
}

@keyframes trophyStarTwinkle {
  0% {
    opacity: calc(var(--star-opacity, 0.8) * 0.48);
    transform: translate(-50%, -50%) scale(0.76);
    filter: brightness(0.84);
  }
  28% {
    opacity: calc(var(--star-opacity, 0.8) * 0.72);
    transform: translate(-50%, -50%) scale(0.92);
    filter: brightness(1.02);
  }
  52% {
    opacity: calc(var(--star-opacity, 0.8) * 1);
    transform: translate(-50%, -50%) scale(1.14);
    filter: brightness(1.28);
  }
  76% {
    opacity: calc(var(--star-opacity, 0.8) * 0.7);
    transform: translate(-50%, -50%) scale(0.9);
    filter: brightness(0.98);
  }
  100% {
    opacity: calc(var(--star-opacity, 0.8) * 0.48);
    transform: translate(-50%, -50%) scale(0.76);
    filter: brightness(0.84);
  }
}

@keyframes trophySkyPulse {
  0% {
    opacity: 0.34;
    filter: brightness(0.9) saturate(1);
  }
  33% {
    opacity: 0.52;
    filter: brightness(1.2) saturate(1.08);
  }
  68% {
    opacity: 0.6;
    filter: brightness(1.3) saturate(1.14);
  }
  100% {
    opacity: 0.38;
    filter: brightness(0.94) saturate(1.02);
  }
}

@keyframes trophyPathTravel {
  0% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -280;
  }
}

@keyframes trophyPathTravelReverse {
  0% {
    stroke-dashoffset: -280;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes trophyPathFlashA {
  0% {
    left: -90px;
    opacity: 0;
    transform: translateY(-6px);
  }
  14% {
    opacity: 0.86;
  }
  58% {
    opacity: 0.92;
  }
  100% {
    left: calc(100% + 90px);
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes trophyPathFlashB {
  0% {
    left: calc(100% + 90px);
    opacity: 0;
    transform: translateY(8px);
  }
  18% {
    opacity: 0.82;
  }
  64% {
    opacity: 0.9;
  }
  100% {
    left: -90px;
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-trophy-star {
    animation: none;
    transform: translate(-50%, -50%);
  }

  .account-trophy-path-canvas::after {
    animation: none;
  }

  .account-trophy-path-svg .trophy-path-travel-line {
    animation: none;
  }
}

.account-trophy-station {
  --station-width: 136px;
  position: absolute;
  z-index: 3;
  width: var(--station-width);
  margin-left: calc(var(--station-width) / -2);
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.account-trophy-station.is-milestone {
  --station-width: 280px;
}

.account-trophy-station.is-target {
  --station-width: 196px;
}

.account-trophy-badge {
  width: var(--station-badge-size, 74px);
  height: var(--station-badge-size, 74px);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(232, 245, 255, 0.5);
  background: linear-gradient(145deg, #4b4f60, #2b2f3d);
  box-shadow: 0 8px 16px rgba(20, 22, 31, 0.52);
  overflow: hidden;
}

.account-trophy-station.is-unlocked .account-trophy-badge {
  border-color: rgba(255, 236, 182, 0.88);
  background: linear-gradient(145deg, #8f73c8, #4a2b98);
  box-shadow:
    0 0 0 2px rgba(255, 225, 156, 0.28),
    0 12px 20px rgba(28, 31, 42, 0.56);
}

.account-trophy-station.is-current .account-trophy-badge {
  box-shadow:
    0 0 0 3px rgba(215, 198, 255, 0.36),
    0 14px 24px rgba(20, 22, 31, 0.56);
}

.account-trophy-station.is-locked {
  opacity: 0.52;
}

.account-trophy-station.is-locked .account-trophy-badge {
  filter: grayscale(1) blur(0.25px);
}

.account-trophy-station.is-next .account-trophy-badge {
  border-color: rgba(215, 198, 255, 0.8);
}

.account-trophy-station.is-milestone .account-trophy-badge {
  box-shadow:
    0 0 0 4px rgba(255, 223, 155, 0.32),
    0 18px 28px rgba(20, 22, 31, 0.58);
}

.account-trophy-station.is-target .account-trophy-badge {
  box-shadow:
    0 0 0 3px rgba(215, 198, 255, 0.28),
    0 14px 22px rgba(20, 22, 31, 0.56);
}

.account-trophy-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-trophy-badge svg {
  width: 56%;
  height: 56%;
  fill: rgba(34, 26, 10, 0.78);
}

.account-trophy-station-name {
  max-width: 124px;
  color: #e7edf5;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.16;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(28, 31, 42, 0.92);
}

.account-trophy-station.is-milestone .account-trophy-station-name {
  max-width: 238px;
  font-size: 0.9rem;
}

.account-trophy-station.is-target .account-trophy-station-name {
  max-width: 166px;
  font-size: 0.82rem;
}

.account-trophy-user-marker {
  position: absolute;
  z-index: 6;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 2px solid rgba(236, 247, 255, 0.92);
  box-shadow:
    0 0 0 2px rgba(132, 190, 255, 0.34),
    0 8px 16px rgba(15, 19, 31, 0.58);
  background: #151b2a;
  overflow: hidden;
  pointer-events: none;
}

.account-trophy-user-marker-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

@media (max-width: 640px) {
  .account-streak-metrics {
    gap: 6px;
  }

  .account-streak-metric {
    padding: 7px;
  }

  .account-streak-metric-value {
    font-size: 0.94rem;
  }

  .streak-overview-card {
    padding: 14px 12px 18px;
  }

  .streak-overview-hero {
    gap: 10px;
  }

  .streak-overview-progress-ring {
    width: 102px;
    height: 102px;
  }

  .streak-overview-current-value {
    font-size: 1.34rem;
  }

  .streak-overview-metrics {
    gap: 6px;
  }

  .streak-overview-metric {
    padding: 8px 6px;
  }

  .streak-overview-week-list {
    gap: 4px;
  }

  .streak-overview-week-day {
    padding: 7px 3px;
  }

  .streak-overview-weekday {
    font-size: 0.62rem;
  }

  .streak-overview-timeline {
    border-radius: 14px;
    padding: 10px 8px 9px;
  }

  .streak-overview-timeline-track {
    height: 102px;
  }

  .streak-overview-marker-avatar-wrap {
    width: 30px;
    height: 30px;
  }

  .streak-overview-marker-icon {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }

  .streak-overview-timeline-marker.is-current {
    bottom: 46px;
  }

  .streak-overview-timeline-marker.is-longest {
    bottom: 30px;
  }

  .account-trophy-path-canvas {
    height: 228px;
  }

  .account-trophy-station {
    --station-width: 120px;
    gap: 5px;
  }

  .account-trophy-station.is-milestone {
    --station-width: 212px;
  }

  .account-trophy-station.is-target {
    --station-width: 162px;
  }

  .account-trophy-badge {
    width: var(--station-badge-size, 64px);
    height: var(--station-badge-size, 64px);
  }

  .account-trophy-station-name {
    max-width: 112px;
    font-size: 0.72rem;
  }

  .account-trophy-station.is-milestone .account-trophy-station-name {
    max-width: 198px;
    font-size: 0.84rem;
  }

  .account-trophy-station.is-target .account-trophy-station-name {
    max-width: 148px;
    font-size: 0.78rem;
  }

  .account-trophy-user-marker {
    width: 24px;
    height: 24px;
    border-width: 1.5px;
  }
}

.account-badges-toggle {
  margin-top: 4px;
  width: 100%;
  border: 1px solid rgba(245, 246, 251, 0.24);
  border-radius: 10px;
  background: rgba(62, 34, 113, 0.72);
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.account-badges-toggle:focus-visible {
  outline: 2px solid rgba(142, 91, 255, 0.38);
  outline-offset: 2px;
}

.account-badges-panel {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(245, 246, 251, 0.16);
}

.account-badges-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.account-badge-item {
  display: grid;
  gap: 6px;
  justify-items: center;
  border: 1px solid rgba(245, 246, 251, 0.22);
  border-radius: 12px;
  background: rgba(62, 34, 113, 0.72);
  padding: 8px;
}

.account-badge-image {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(245, 246, 251, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.account-badge-description {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.account-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(31, 33, 43, 0.84);
  box-shadow: inset 0 1px 0 rgba(245, 246, 251, 0.08);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.account-tabs .tab-btn {
  min-height: 42px;
}

.account-tabs .tab-btn:not(.is-active) {
  background: #37363b;
}

.account-tab-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: #161616;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.account-color-card {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 10px;
  background: #161616;
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.account-settings-modal-card {
  width: min(100%, 620px);
  max-height: min(calc(var(--app-height) - 24px), 860px);
  display: flex;
  flex-direction: column;
}

.account-settings-body {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.account-settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-notification-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

.account-friends-launch {
  position: relative;
  display: inline-flex;
  width: 100%;
  overflow: visible;
}

.account-friends-launch .btn {
  width: 100%;
}

.account-friends-launch .chat-badge {
  top: -6px;
  right: -8px;
  transform: none;
  z-index: 30;
}

.account-head-tools .account-friends-launch {
  position: relative;
  width: auto;
  flex: 0 0 auto;
  overflow: visible;
}

.account-head-tools .account-friends-launch .group-icon-btn {
  position: relative;
}

.account-head-tools .account-friends-launch .chat-badge {
  top: -6px;
  right: -8px;
  transform: none;
  z-index: 70;
}

.account-llm-pane,
.account-llm-panel {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 10px;
  background: #161616;
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.account-llm-panel h4 {
  margin: 0;
  font-size: 0.95rem;
}

.account-llm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-admin-actions {
  display: grid;
  gap: 8px;
}

.account-admin-actions .btn {
  width: 100%;
}

.account-admin-mail-form {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 10px;
  background: #303030 !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.account-admin-mail-form .btn {
  width: 100%;
}

.guide-card {
  display: grid;
  gap: 10px;
}

.guide-greeting {
  margin: 0;
  line-height: 1.4;
}

.guide-pager-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.guide-page-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(122, 57, 255, 0.46);
  border-radius: 999px;
  background: rgba(31, 33, 43, 0.7);
  color: #aeb2c2;
  font-size: 0.78rem;
}

.guide-content {
  display: grid;
  gap: 10px;
}

.guide-block {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(31, 33, 43, 0.84);
  padding: 10px 12px;
}

.guide-block-title {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.guide-block-lead {
  margin: 0 0 8px;
  color: #aeb2c2;
  font-size: 0.84rem;
  line-height: 1.35;
}

.guide-visual {
  margin: 0 0 10px;
  border: 1px solid rgba(95, 55, 179, 0.62);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(28, 31, 42, 0.82);
}

.guide-visual-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: top center;
}

.guide-visual-caption {
  margin: 0;
  padding: 7px 10px;
  font-size: 0.76rem;
  line-height: 1.3;
  color: #aeb2c2;
  border-top: 1px solid rgba(95, 55, 179, 0.42);
  background: rgba(28, 31, 42, 0.92);
}

.guide-step-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  color: #e7edf5;
  font-size: 0.86rem;
  line-height: 1.35;
}

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

.account-chat-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--ink);
}

.account-chat-toggle > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-user-toggle-row {
  margin-top: 4px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  padding: 0;
  border: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(36, 39, 52, 0.9);
  border: 1px solid rgba(245, 246, 251, 0.42);
  transition: background 0.2s ease;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 999px;
  background: #e7edf5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.38);
  transition: transform 0.2s ease;
}

.switch input:checked + .switch-slider {
  background: #32dd87;
  border-color: #32dd87;
}

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

.account-stats {
  margin: 0;
}

.account-stats .stat-box {
  border: none;
  background: #303030;
  box-shadow: inset 0 1px 0 rgba(245, 246, 251, 0.08);
}

.account-stats .stat-box span {
  color: var(--muted);
}

.account-stats .stat-box strong {
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.account-logout-btn {
  justify-self: stretch;
}

.avatar-preview {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--user-color);
  background: rgba(24, 27, 36, 0.92);
  box-shadow:
    0 0 0 0 rgba(var(--user-color-rgb), 0.58),
    0 0 16px rgba(var(--user-color-rgb), 0.3);
  animation: avatarPulse 2.2s ease-in-out infinite;
}

@keyframes avatarPulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(var(--user-color-rgb), 0.6),
      0 0 12px rgba(var(--user-color-rgb), 0.28);
  }
  70% {
    box-shadow:
      0 0 0 10px rgba(var(--user-color-rgb), 0),
      0 0 18px rgba(var(--user-color-rgb), 0.38);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(var(--user-color-rgb), 0),
      0 0 12px rgba(var(--user-color-rgb), 0.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  .avatar-preview {
    animation: none;
  }
}

.account-avatar-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
}

#userAvatarInput {
  display: none;
}

.group-detail-toprow {
  display: block;
}

.group-detail-toprow-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.group-detail-actions-left,
.group-detail-actions-middle,
.group-detail-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.group-detail-actions-left,
.group-detail-actions-middle {
  justify-content: flex-start;
}

.group-detail-actions-right {
  justify-content: flex-end;
  margin-left: auto;
}

.group-detail-member-actions {
  margin-top: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.group-detail-toprow-actions::-webkit-scrollbar {
  display: none;
}

.group-detail-head-card {
  position: static;
  box-shadow: none;
  backdrop-filter: none;
  background: #242424;
}

.group-detail-actions-card {
  position: sticky;
  top: calc(var(--app-safe-top) + 6px);
  z-index: 20;
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: #242424;
  border: none;
  box-shadow: none;
}

/* Group detail action bar: hide moved actions (now in longpress menu) */
#viewGroupDetail #openGroupMembersModalBtn,
#viewGroupDetail #openGroupDetailChatBtn,
#viewGroupDetail #openGroupChallengeRankingModalBtn,
#viewGroupDetail #openGroupMemoryGalleryBtn,
#viewGroupDetail #groupLeaveBtn,
#viewGroupDetail #groupDetailCodeBtn {
  display: none !important;
}

#viewGroupDetail .group-detail-member-actions {
  display: none !important;
}

/* Group detail action bar: reduce remaining header buttons by 25% */
#viewGroupDetail .group-detail-actions-card .group-icon-btn,
#viewGroupDetail .group-detail-actions-card .group-plus-btn,
#viewGroupDetail .group-detail-actions-card .visit-edit-icon-btn,
#viewGroupDetail .group-detail-actions-card .group-detail-color-top {
  width: 41px;
  height: 41px;
  min-height: 41px;
}

#viewGroupDetail .group-detail-actions-card .group-icon-btn svg,
#viewGroupDetail .group-detail-actions-card .visit-edit-icon-btn svg {
  width: 20px;
  height: 20px;
}

.template-detail-actions-card {
  position: sticky;
  top: calc(var(--app-safe-top) + 6px);
  z-index: 20;
  display: grid;
  gap: 8px;
  margin-bottom: 0;
  padding: 12px 14px;
  background: #242424;
  border: none;
  box-shadow: none;
  border-radius: 24px;
}

.template-detail-actions-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-start;
  width: 100%;
}

.template-detail-actions-row .group-icon-btn,
.template-detail-actions-row .group-plus-btn {
  flex: 0 0 auto;
}

.template-detail-actions-row #templateGroupWorkflowBtn,
.template-detail-actions-row #chooseTemplateImagesBtn {
  order: 1;
}

.template-detail-actions-row #templateGroupSaveBtn {
  order: 2;
  margin-left: auto;
}

.template-detail-actions-row #templateGroupBackBtn {
  order: 3;
}

#viewGroupDetail {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: auto;
  min-height: calc(100% - 15px);
  overflow: visible;
  padding-bottom: 15px;
}

#viewTemplateGroupDetail {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: calc(100% - 15px);
  overflow: visible;
  padding-bottom: 15px;
  background: #161616;
}

.group-detail-places-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
  background: #242424;
}

.group-detail-challenge-card {
  margin-bottom: 0;
}

.challenge-winner-crown {
  margin-right: 2px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f7c948;
  filter: drop-shadow(0 1px 4px rgba(247, 201, 72, 0.35));
  flex: 0 0 auto;
}

.challenge-winner-crown svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

#groupDetailList {
  flex: 1;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.group-detail-search {
  margin-bottom: 8px;
}

.group-list-search {
  margin-bottom: 10px;
}

.impulse-filter-grid {
  margin-bottom: 0;
}

.impulse-filter-card {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 10px 12px;
  background: #161616 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  opacity: 1;
}

.impulse-filter-bar {
  display: grid;
  gap: 10px;
  position: relative;
}

.impulse-filter-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

#viewImpulse .impulse-filter-actions {
  grid-column: 1 / -1;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

#viewImpulse .impulse-filter-actions::-webkit-scrollbar {
  display: none;
}

#viewImpulse .impulse-filter-actions .group-icon-btn,
#viewImpulse .impulse-filter-actions .impulse-filter-toggle-btn,
#viewImpulse .impulse-filter-actions .impulse-sort-toggle-btn {
  flex: 0 0 auto;
}

.impulse-sort-toggle-btn {
  min-height: 33px;
  padding: 5px 9px;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
  font-size: 0.82rem;
}

.impulse-sort-toggle-btn.is-active {
  color: #ffffff;
  border-color: #32dd87;
  background: #32dd87;
}

.impulse-filter-toggle-btn {
  min-height: 33px;
  padding: 5px 9px;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
  font-size: 0.82rem;
}

.impulse-filter-toggle-btn.is-active {
  color: #ffffff;
  border-color: #8e5bff;
  background: linear-gradient(130deg, #5f46d9, #8e5bff);
}

#viewImpulse .impulse-filter-actions .group-search-open-btn {
  width: 33px;
  height: 33px;
}

#viewImpulse .impulse-filter-actions .group-search-open-btn svg {
  width: 16px;
  height: 16px;
}

.impulse-search-field {
  margin-bottom: 0;
}

.impulse-list-card {
  margin-top: 0;
}

.group-filter-card {
  position: sticky;
  top: 0;
  z-index: 40;
}

.card.impulse-filter-card.group-filter-card {
  background: #161616;
  box-shadow: none;
}

#viewTemplateGroups .card.impulse-filter-card.template-filter-card {
  background: #161616 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  opacity: 1;
}

.group-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

#viewGroups .group-filter-actions #offlineIndicator {
  margin-right: 0;
  margin-left: 2px;
}

.group-streak-open-btn {
  margin-right: 0;
}

#viewGroups .group-filter-card .group-gem-indicator {
  margin-right: auto;
}

.group-gem-indicator {
  width: auto;
  min-width: 58px;
  height: 36px;
  padding: 0 10px;
  gap: 6px;
  border: 1px solid rgba(248, 199, 90, 0.44);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 245, 212, 0.42), rgba(255, 245, 212, 0) 55%),
    linear-gradient(140deg, #4a3310, #7a551a 56%, #c0892a);
  color: #ffe5a8;
  box-shadow: 0 0 0 1px rgba(248, 199, 90, 0.14), 0 10px 20px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.group-gem-indicator:active {
  transform: scale(0.97);
}

.group-gem-indicator .group-gem-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.group-gem-indicator-value {
  font-size: 0.82rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.group-search-open-btn {
  flex: 0 0 auto;
}

.group-search-open-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.filter-search-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 8;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(245, 246, 251, 0.18);
  background: rgba(20, 20, 20, 0.96);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.filter-search-popup-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-search-popup-field {
  flex: 1 1 auto;
  margin-bottom: 0;
}

.filter-search-popup-close {
  flex: 0 0 auto;
}

.group-visibility-toggle-btn {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1;
}

.group-visibility-toggle-btn.is-active {
  color: #ffffff;
  border-color: #32dd87;
  background: #32dd87;
}

.group-list-card {
  margin-top: 0;
}

.template-filter-bar {
  gap: 10px;
}

.template-filter-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.template-search-field {
  flex: 1 1 260px;
  min-width: 180px;
}

.template-filter-toggle-btn {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 14px;
  white-space: nowrap;
  line-height: 1;
  background: #37363b;
  border: none;
  color: #eceff6;
}

.template-filter-toggle-btn.is-active {
  background: linear-gradient(130deg, #5f46d9, #8e5bff);
  color: #ffffff;
}

.template-list-card {
  margin-top: 0;
}

#viewGroups .group-list-card {
  background: #161616;
  margin-top: calc(var(--app-safe-top) + 71px);
}

#viewTemplateGroups .template-list-card,
#viewImpulse .impulse-list-card {
  background: #161616;
}

#viewGroups #groupList,
#viewTemplateGroups #templateGroupList,
#viewImpulse #impulseTemplateList {
  background: #161616;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.util-grid {
  margin-top: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.map-mode-segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: #37363b;
}

.map-mode-segmented .mode-btn {
  border: 0;
  border-right: 1px solid var(--card);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  min-height: 44px;
  padding: 9px 8px;
  font-size: clamp(0.9rem, 3.1vw, 1.08rem);
  white-space: nowrap;
}

.map-mode-segmented .mode-btn:last-child {
  border-right: 0;
}

.map-mode-segmented .mode-btn.is-active {
  border-right-color: var(--card);
  color: #fff;
  background: #7729ff;
}

.map-pick-btn {
  margin-top: 10px;
  min-height: 40px;
  width: 100%;
  border: none;
  border-radius: 14px;
  background: #37363b;
  color: #ffffff;
}

.map-pick-btn.is-active {
  color: #fff;
  border-color: transparent;
  background: #7729ff;
  box-shadow: none;
}

.mode-btn {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(62, 34, 113, 0.9);
  color: var(--ink);
  padding: 8px 6px;
  font-weight: 700;
  font-size: clamp(0.72rem, 2.5vw, 0.86rem);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-btn.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), #32dd87);
}

.mode-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 400;
}

.check-grid {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.map-bg-config {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-bg-config .color-row {
  flex: 1;
  margin: 0;
}

.color-row {
  justify-content: space-between;
}

.map-filter-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(122, 57, 255, 0.46);
  border-radius: 999px;
  background: rgba(24, 27, 36, 0.88);
  color: #e7edf5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.map-filter-toggle.is-active {
  border-color: #32dd87;
  color: #fff;
  background: #32dd87;
}

.check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.check input[type="color"] {
  width: 42px;
  height: 30px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid rgba(245, 246, 251, 0.42);
  background: rgba(24, 27, 36, 0.82);
  box-shadow: inset 0 1px 0 rgba(245, 246, 251, 0.12);
  cursor: pointer;
}

.check input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.check input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}

.check input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 8px;
}

.date-filter {
  margin: 10px 0 0;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 8px;
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-inline-size: 0;
  overflow-x: hidden;
}

.date-filter legend {
  padding: 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

#dateFilterPanel .date-range-row {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#dateFilterPanel .date-range-row > label {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 3px;
  overflow: hidden;
}

#dateFilterPanel .date-range-row input[type="date"] {
  display: block;
  margin: 0;
  box-sizing: border-box;
  inline-size: 100%;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-inline-size: 0;
  max-inline-size: 100%;
  height: 34px;
  padding: 4px 6px;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}

#dateFilterPanel .date-range-row input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  min-width: 0;
}

#dateFilterPanel .date-range-row input[type="date"]::-webkit-datetime-edit,
#dateFilterPanel .date-range-row input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

#dateFilterPanel .date-range-row input[type="date"]::-webkit-calendar-picker-indicator {
  margin: 0;
  padding: 0;
}

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

.visit-scope {
  margin: 0;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.visit-scope legend {
  padding: 0 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.map-card {
  position: relative;
  padding-bottom: 10px;
}

.card.map-controls {
  background: #242424;
}

#map {
  width: 100%;
  min-height: 44dvh;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  overflow: hidden;
}

#map.map-export-clean .leaflet-control-container,
#map.map-export-clean .leaflet-popup-pane {
  display: none !important;
}

body.map-fullscreen-active {
  overflow: hidden;
}

#mapWrap.is-fullscreen {
  position: fixed;
  z-index: 2200;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 860px);
  height: var(--app-height);
  margin: 0;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  border-radius: 0;
}

#mapWrap.is-fullscreen #map {
  min-height: calc(var(--app-height) - 80px);
  border-radius: 12px;
}

.map-export-tools {
  position: absolute;
  top: calc(14px + var(--app-safe-top));
  left: 14px;
  z-index: 2300;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(31, 33, 43, 0.2);
}

.map-export-tools label {
  font-size: 0.74rem;
  gap: 4px;
}

.map-export-tools #exportMapBtn {
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
  border: 1px solid transparent;
}

.map-export-tools #exportMapBtn:active {
  background: var(--primary-strong);
}

.map-fullscreen-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 800;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(31, 33, 43, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #1f212b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.12rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(31, 33, 43, 0.2);
}

.map-fullscreen-toggle:active {
  transform: scale(0.97);
}

.map-fullscreen-toggle.hidden {
  display: none !important;
}

.map-exit-fullscreen {
  position: absolute;
  top: calc(14px + var(--app-safe-top));
  right: 14px;
  z-index: 800;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(31, 33, 43, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #1f212b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(31, 33, 43, 0.2);
}

.map-exit-fullscreen:active {
  transform: scale(0.97);
}

#map .leaflet-popup-pane {
  z-index: 9000 !important;
}

#map .leaflet-popup {
  z-index: 9001 !important;
}

#map .leaflet-tile-pane {
  opacity: 1;
  transition: opacity 0.2s ease;
}

#map.map-basemap-hidden .leaflet-tile-pane {
  opacity: 0;
}

#map.map-pick-armed,
#map.map-pick-armed .leaflet-container {
  cursor: crosshair;
}

#templateMap.map-basemap-hidden .leaflet-tile-pane {
  opacity: 0;
}

.tap-target-marker {
  pointer-events: all;
}

.list {
  display: grid;
  gap: 8px;
}

.list-item {
  border: none;
  border-radius: 12px;
  background: #161616;
  padding: 10px;
  min-width: 0;
  margin-top: 5px;
}

.list-item.is-reorder-draggable {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.list-item.is-reorder-draggable:active {
  cursor: grabbing;
}

.list-item.is-reorder-dragging {
  opacity: 0.78;
  transform: scale(0.994);
  touch-action: none;
  box-shadow: 0 10px 22px rgba(79, 163, 255, 0.28);
}

.list-item.is-reorder-drop-before {
  box-shadow: inset 0 3px 0 rgba(114, 184, 255, 0.95);
}

.list-item.is-reorder-drop-after {
  box-shadow: inset 0 -3px 0 rgba(114, 184, 255, 0.95);
}

.list-item strong {
  display: block;
}

.challenge-winner-item {
  border-color: rgba(62, 205, 142, 0.58);
  background: linear-gradient(145deg, rgb(30, 30, 30), #5f46d9);
}

.challenge-winner-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.challenge-winner-head-team {
  align-items: flex-start;
}

.challenge-winner-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(245, 246, 251, 0.55);
  background: rgba(20, 22, 31, 0.86);
  flex: 0 0 auto;
}

.challenge-winner-avatar-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.challenge-winner-avatar-team {
  border: 2px solid rgba(28, 31, 42, 0.92);
  box-shadow: 0 4px 14px rgba(28, 31, 42, 0.35);
}

.challenge-winner-avatar-cluster.is-overlap {
  gap: 0;
}

.challenge-winner-avatar-cluster.is-overlap .challenge-winner-avatar-team {
  margin-left: -12px;
}

.challenge-winner-avatar-cluster.is-overlap .challenge-winner-avatar-team:first-child {
  margin-left: 0;
}

.challenge-ranking-modal-card {
  width: min(100%, 760px);
  height: auto;
  max-height: min(calc(var(--app-height) - 24px), 700px);
}

#groupChallengeRankingList {
  overflow-y: auto;
  max-height: min(52dvh, 460px);
}

.challenge-ranking-row {
  padding: 8px 10px;
}

.challenge-ranking-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.challenge-ranking-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(245, 246, 251, 0.45);
  background: rgba(20, 22, 31, 0.86);
  flex: 0 0 auto;
}

.challenge-ranking-title {
  margin: 0;
}

.bucket-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bucket-title-main {
  min-width: 0;
  flex: 1 1 auto;
}

.bucket-title-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.bucket-toggle-btn {
  border: 1px solid rgba(245, 246, 251, 0.42);
  background: #37363b;
  color: #e7edf5;
  border-radius: 999px;
  min-height: 24px;
  padding: 2px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  line-height: 1;
}

.bucket-toggle-btn:hover {
  background: rgba(62, 34, 113, 0.96);
}

.bucket-toggle-btn:focus-visible {
  outline: 2px solid rgba(142, 91, 255, 0.65);
  outline-offset: 1px;
}

.bucket-toggle-arrow {
  font-size: 0.86rem;
}

.bucket-visit-check {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #32dd87;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(31, 187, 107, 0.32);
  flex: 0 0 auto;
}

.list-item.bucket-origin-item {
  background: #161616;
}

.list-item.bucket-followup-item {
  padding-left: 22px;
  position: relative;
}

.list-item.bucket-followup-item::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 999px;
  background: rgba(142, 91, 255, 0.58);
}

.group-item {
  padding: 12px;
}

.group-item.is-challenge-started {
  --challenge-pulse-rgb: 186, 232, 255;
  --user-color-rgb: var(--challenge-pulse-rgb);
  border-width: 2px;
  border-color: rgba(186, 232, 255, 1);
  box-shadow:
    0 0 0 0 rgba(var(--user-color-rgb), 0.58),
    0 0 16px rgba(var(--user-color-rgb), 0.3);
  animation: avatarPulse 2.2s ease-in-out infinite;
}

.group-item.is-challenge-complete {
  border-width: 2px;
  border-color: rgba(50, 221, 135, 0.78);
  box-shadow: 0 0 0 1px rgba(50, 221, 135, 0.24), 0 10px 24px rgba(21, 134, 86, 0.2);
  background: rgba(31, 33, 43, 0.94);
}

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.group-title {
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.2;
  min-width: 0;
  overflow-wrap: anywhere;
}

.place-title {
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.32rem;
  line-height: 1.18;
  font-weight: 400;
}

.group-title-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.group-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: visible;
}

.icon-badge-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  overflow: visible;
  margin-right: 2px;
}

.icon-badge-wrap .chat-badge {
  top: -7px;
  right: -6px;
  z-index: 2;
  pointer-events: none;
}

.group-meta {
  margin-top: 8px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.group-desc {
  margin-top: 8px;
  color: #cfb9ff;
  line-height: 1.3;
  font-size: 0.88rem;
}

.group-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(122, 57, 255, 0.42);
  border-radius: 999px;
  background: rgba(36, 39, 52, 0.88);
  color: #e7edf5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.group-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.group-icon-btn:active {
  transform: scale(0.97);
}

.group-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.group-icon-btn.is-danger {
  color: #ff5a6e;
  border-color: rgba(161, 59, 49, 0.26);
  background: rgba(255, 90, 110, 0.08);
}

.group-icon-btn.is-owner-transfer {
  color: #cfb9ff;
  border-color: rgba(244, 210, 123, 0.42);
  background: rgba(126, 92, 26, 0.2);
}

.group-icon-btn.is-friend {
  color: #ffffff;
  border-color: #7a39ff;
  background: #7a39ff;
}

#viewGroups .group-item {
  position: relative;
  padding-bottom: 64px;
}

#viewGroups .group-item.is-pending-invite {
  padding-bottom: 12px;
  border-color: rgba(174, 126, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(174, 126, 255, 0.2), 0 8px 20px rgba(95, 55, 179, 0.22);
}

#viewGroups .group-item.is-pending-invite .group-tools {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
}

#viewGroups .group-item:not(.has-cover-image) {
  background: #242426;
}

#viewGroups .group-item:not(.has-cover-image):nth-child(6n + 1) {
  background: #242426;
}

#viewGroups .group-item:not(.has-cover-image):nth-child(6n + 2) {
  background: #242426;
}

#viewGroups .group-item:not(.has-cover-image):nth-child(6n + 3) {
  background: #242426;
}

#viewGroups .group-item:not(.has-cover-image):nth-child(6n + 4) {
  background: #242426;
}

#viewGroups .group-item:not(.has-cover-image):nth-child(6n + 5) {
  background: #242426;
}

#viewGroups .group-item:not(.has-cover-image):nth-child(6n + 6) {
  background: #242426;
}

#viewGroups .group-item.has-cover-image {
  padding: 0 0 64px;
  overflow: hidden;
}

#viewGroups .group-item.is-pending-invite.has-cover-image {
  padding: 0 0 12px;
}

#viewGroups .group-title {
  font-size: 1.32rem;
  line-height: 1.18;
}

#viewGroups .group-item.has-cover-image > .group-head {
  position: static;
  z-index: auto;
  margin-top: 0;
  padding-left: 12px;
  padding-right: 12px;
  padding-top: 12px;
}

#viewGroups .group-item.has-cover-image > .group-head .group-title {
  text-shadow: 0 2px 10px rgba(28, 31, 42, 0.72);
}

#viewGroups .group-item.has-cover-image > .template-season-row,
#viewGroups .group-item.has-cover-image > .template-badge-row,
#viewGroups .group-item.has-cover-image > .group-meta,
#viewGroups .group-item.has-cover-image > .group-desc {
  margin-left: 12px;
  margin-right: 12px;
}

#viewGroups .group-desc {
  color: #ffffff;
}

#viewGroups .group-tools {
  position: absolute;
  right: 15px;
  bottom: 15px;
  z-index: 2;
  gap: 8px;
  justify-content: flex-end;
}

#viewGroups .group-overview-item {
  --group-accent-color: #7a39ff;
  --group-accent-rgb: 122, 57, 255;
  padding: 10px 12px 12px;
  border-radius: 20px;
  border-color: transparent;
  position: relative;
  overflow: hidden;
}

#viewGroups .group-overview-item::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    rgba(var(--group-accent-rgb), 0.32),
    rgba(var(--group-accent-rgb), 0.95),
    rgba(var(--group-accent-rgb), 0.4)
  );
  pointer-events: none;
  z-index: 0;
}

#viewGroups .group-overview-item > * {
  position: relative;
  z-index: 1;
}

#viewGroups .group-overview-item:not(.has-cover-image),
#viewGroups .group-overview-item:not(.has-cover-image):nth-child(6n + 1),
#viewGroups .group-overview-item:not(.has-cover-image):nth-child(6n + 2),
#viewGroups .group-overview-item:not(.has-cover-image):nth-child(6n + 3),
#viewGroups .group-overview-item:not(.has-cover-image):nth-child(6n + 4),
#viewGroups .group-overview-item:not(.has-cover-image):nth-child(6n + 5),
#viewGroups .group-overview-item:not(.has-cover-image):nth-child(6n + 6) {
  background: #242426;
}

#viewGroups .group-overview-item.is-pending-invite {
  border-color: transparent;
  box-shadow: none;
}

#viewGroups .group-overview-item.is-challenge-started,
#viewGroups .group-overview-item.is-challenge-complete {
  border-width: 2px;
}

#viewGroups .group-overview-item.is-challenge-started {
  --challenge-pulse-rgb: 186, 232, 255;
  --user-color-rgb: var(--challenge-pulse-rgb);
  border-color: rgba(186, 232, 255, 1);
  box-shadow:
    0 0 0 0 rgba(var(--user-color-rgb), 0.58),
    0 0 16px rgba(var(--user-color-rgb), 0.3);
  animation: avatarPulse 2.2s ease-in-out infinite;
}

#viewGroups .group-overview-item.is-challenge-complete {
  border-color: rgba(50, 221, 135, 0.78);
  box-shadow: 0 0 0 1px rgba(50, 221, 135, 0.24), 0 10px 24px rgba(21, 134, 86, 0.2);
  background: #242426;
}

#viewGroups .group-overview-item.is-challenge-pro:not(.is-challenge-started):not(.is-challenge-complete) {
  border-width: 2px;
  border-color: rgba(215, 198, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(215, 198, 255, 0.24), 0 8px 20px rgba(95, 55, 179, 0.24);
}

#viewGroups .group-overview-item.is-clickable {
  cursor: pointer;
}

#viewGroups .group-overview-item.is-clickable:focus-visible {
  outline: 2px solid rgba(174, 126, 255, 0.45);
  outline-offset: 2px;
}

#viewGroups .group-overview-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  min-width: 0;
}

#viewGroups .group-overview-main {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

#viewGroups .group-overview-text {
  min-width: 0;
}

#viewGroups .group-overview-thumb {
  width: 80px;
  height: 80px;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(245, 246, 251, 0.2);
  box-shadow: none;
  background: rgba(174, 126, 255, 0.28);
  display: grid;
  place-items: center;
  color: #e7edf5;
  text-align: center;
  padding: 0;
}

#viewGroups .group-overview-thumb.is-placeholder {
  background: rgba(31, 33, 43, 0.88);
  border: 1px dashed rgba(245, 246, 251, 0.32);
  box-shadow: none;
  color: #cfb9ff;
}

#viewGroups .group-overview-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

#viewGroups .group-overview-thumb-placeholder {
  color: #aeb2c2;
  font-size: 0.72rem;
  line-height: 1.15;
  font-weight: 700;
}

#viewGroups .group-overview-thumb .group-overview-thumb-unread-badge {
  top: 6px;
  right: 6px;
  transform: none;
  z-index: 5;
}

#viewGroups .group-overview-thumb.is-active-group {
  border-color: var(--active-group-color, #7a39ff);
  box-shadow:
    0 0 0 0 rgba(var(--active-group-color-rgb, 122, 57, 255), 0.52),
    0 0 12px rgba(var(--active-group-color-rgb, 122, 57, 255), 0.24);
  animation: group-overview-thumb-pulse 1.6s ease-in-out infinite;
}

@keyframes group-overview-thumb-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(var(--active-group-color-rgb, 122, 57, 255), 0.56),
      0 0 12px rgba(var(--active-group-color-rgb, 122, 57, 255), 0.22);
  }
  50% {
    box-shadow:
      0 0 0 7px rgba(var(--active-group-color-rgb, 122, 57, 255), 0),
      0 0 18px rgba(var(--active-group-color-rgb, 122, 57, 255), 0.34);
  }
}

#viewGroups .group-overview-item .group-title {
  font-size: 1.26rem;
  line-height: 1.1;
  font-weight: 400;
  margin: 0;
}

#viewGroups .group-overview-item .group-meta {
  margin-top: 4px;
}

#viewGroups .group-overview-item .group-desc {
  margin-top: 15px;
  margin-left: 0;
  margin-bottom: 0;
  color: #ffffff;
}

#viewGroups .group-overview-points-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(var(--group-accent-rgb), 0.86);
  color: #e9f3ff;
  background: rgba(var(--group-accent-rgb), 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

#viewGroups .group-overview-side {
  display: inline-flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

#viewGroups .group-overview-play-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: #7729ff;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(119, 41, 255, 0.34);
}

#viewGroups .group-overview-play-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

#viewGroups .group-overview-play-btn:active {
  transform: scale(0.96);
}

#viewGroups .group-overview-invite-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(245, 246, 251, 0.22);
  color: #e7edf5;
  background: rgba(36, 39, 52, 0.88);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

#viewGroups .group-overview-invite-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#viewGroups .group-overview-text .group-overview-invite-actions {
  margin-top: 10px;
  flex-wrap: nowrap;
}

#viewGroups .group-overview-item.is-pending-invite .group-overview-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

#viewGroups .group-overview-item.is-pending-invite .group-overview-text {
  width: 100%;
}

#viewGroups .group-overview-invite-btn {
  border: 1px solid rgba(245, 246, 251, 0.22);
  border-radius: 999px;
  background: rgba(36, 39, 52, 0.88);
  color: #e7edf5;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  padding: 7px 10px;
  cursor: pointer;
}

#viewGroups .group-overview-invite-btn.is-accept {
  background: rgba(119, 41, 255, 0.92);
  border: none;
  color: #ffffff;
}

#viewGroups .group-overview-invite-btn.is-decline {
  background: rgba(66, 69, 84, 0.92);
  border: none;
  color: #f0f3f8;
}

#viewGroups .group-overview-invite-btn:active {
  transform: scale(0.97);
}

#viewGroups .group-overview-unread-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

#viewGroups .group-overview-unread-indicator {
  margin-right: 0;
}

#viewGroups .group-overview-unread-icon {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(245, 246, 251, 0.16);
  border-radius: 999px;
  background: rgba(31, 33, 43, 0.94);
  color: #e7edf5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#viewGroups .group-overview-unread-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

#viewTemplateGroups .group-item,
#viewImpulse .group-item {
  position: relative;
  padding-bottom: 64px;
}

#viewTemplateGroups .group-item {
  border: none;
}

#viewGroups #groupList {
  gap: 15px;
}

#viewTemplateGroups .group-item.has-cover-image,
#viewImpulse .group-item.has-cover-image {
  padding: 0 0 64px;
}

#viewTemplateGroups .group-item .template-group-tools,
#viewTemplateGroups .group-item .group-tools,
#viewImpulse .group-item .template-group-tools,
#viewImpulse .group-item .group-tools {
  position: absolute;
  left: auto;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  gap: 8px;
  justify-content: flex-end;
  margin-left: 0;
}

#viewTemplateGroups .group-head,
#viewImpulse .group-head {
  align-items: flex-start;
}

#viewGroupDetail #groupDetailList .list-item > strong,
#viewTemplateGroupDetail #templatePlaceList .list-item > strong {
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.32rem;
  line-height: 1.18;
  font-weight: 400;
}

#viewGroupDetail .group-detail-places-card .groups-head h3,
#viewTemplateGroupDetail .group-detail-places-card .groups-head h3 {
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.32rem;
  line-height: 1.18;
  font-weight: 400;
}

#viewImpulse .impulse-template-item {
  position: relative;
  padding-bottom: 64px;
}

#viewImpulse .impulse-template-item.has-cover-image {
  padding: 0 0 64px;
}

#viewImpulse .impulse-template-item .impulse-template-item-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  margin-top: 0;
  justify-content: flex-end;
  z-index: 2;
}

#viewImpulse .group-item .template-group-tools,
#viewImpulse .group-item .group-tools,
#viewImpulse .impulse-template-item .impulse-template-item-actions {
  right: 15px;
  bottom: 15px;
}

#viewImpulse #impulseTemplateList {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#viewImpulse #impulseTemplateList > .muted {
  grid-column: 1 / -1;
}

#viewImpulse .impulse-template-card {
  position: relative;
  min-height: 220px;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(106, 111, 131, 0.42);
  background: rgba(31, 33, 43, 0.92);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.46);
  isolation: isolate;
}

#viewImpulse .impulse-template-card:focus-visible {
  outline: 2px solid rgba(174, 126, 255, 0.86);
  outline-offset: 2px;
}

#viewImpulse .impulse-template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.54);
}

#viewImpulse .impulse-template-card-photo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 15%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(35deg, #4e56d9 0%, #8e5bff 45%, #cfb9ff 100%);
}

#viewImpulse .impulse-template-card-photo-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transform: scale(1.01);
  transition: transform 0.24s ease;
}

#viewImpulse .impulse-template-card:hover .impulse-template-card-photo-image {
  transform: scale(1.05);
}

#viewImpulse .impulse-template-card-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 10, 15, 0.06) 20%, rgba(9, 10, 15, 0.58) 70%, rgba(9, 10, 15, 0.92) 100%),
    radial-gradient(120% 100% at 20% -10%, rgba(174, 126, 255, 0.25), transparent 40%);
}

#viewImpulse .impulse-template-card:nth-child(6n + 1) .impulse-template-card-photo.is-fallback {
  background:
    radial-gradient(circle at 74% 18%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(36deg, #4e56d9 0%, #8e5bff 45%, #cfb9ff 100%);
}

#viewImpulse .impulse-template-card:nth-child(6n + 2) .impulse-template-card-photo.is-fallback {
  background:
    radial-gradient(circle at 76% 16%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(30deg, #4b3a6d 0%, #8e5bff 44%, #cfb9ff 100%);
}

#viewImpulse .impulse-template-card:nth-child(6n + 3) .impulse-template-card-photo.is-fallback {
  background:
    radial-gradient(circle at 74% 17%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(35deg, #2c3550 0%, #5f46d9 46%, #cfb9ff 100%);
}

#viewImpulse .impulse-template-card:nth-child(6n + 4) .impulse-template-card-photo.is-fallback {
  background:
    radial-gradient(circle at 78% 16%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(32deg, #52386e 0%, #8e5bff 45%, #cfb9ff 100%);
}

#viewImpulse .impulse-template-card:nth-child(6n + 5) .impulse-template-card-photo.is-fallback {
  background:
    radial-gradient(circle at 74% 18%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(28deg, #343849 0%, #6a6f83 44%, #cfb9ff 100%);
}

#viewImpulse .impulse-template-card:nth-child(6n + 6) .impulse-template-card-photo.is-fallback {
  background:
    radial-gradient(circle at 78% 14%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(34deg, #333a50 0%, #6a6f83 44%, #cfb9ff 100%);
}

#viewImpulse .impulse-template-card .impulse-template-card-photo.is-fallback {
  background: #2a1c4a !important;
}

#viewImpulse .impulse-template-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}

#viewImpulse .impulse-template-card-title {
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.36rem;
  line-height: 1.18;
  color: #e7edf5;
  text-shadow: 0 3px 10px rgba(28, 31, 42, 0.72);
  overflow-wrap: anywhere;
}

#viewImpulse .impulse-template-card-top-right {
  margin-left: auto;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 15px;
}

#viewImpulse .impulse-template-card-rating {
  margin-left: auto;
  align-self: flex-end;
  border: 1px solid rgba(245, 246, 251, 0.34);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(28, 31, 42, 0.58);
  color: #e7edf5;
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 600;
}

#viewImpulse .impulse-template-card-badge {
  margin-left: auto;
  max-width: 100%;
  border: 1px solid rgba(245, 246, 251, 0.42);
  border-radius: 999px;
  padding: 6px 10px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.42), transparent 38%),
    linear-gradient(145deg, rgba(142, 91, 255, 0.88), rgba(122, 57, 255, 0.88));
  color: #e7edf5;
  font-size: 0.74rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  box-shadow: 0 7px 16px rgba(28, 31, 42, 0.42);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes impulse-card-twinkle {
  from {
    transform: scale(0.9) rotate(-8deg);
    opacity: 0.55;
  }
  to {
    transform: scale(1.1) rotate(8deg);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  #viewImpulse .impulse-template-card,
  #viewImpulse .impulse-template-card-photo,
  #viewImpulse .impulse-template-card-photo-image,
  #viewImpulse .impulse-template-card::before {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

@media (max-width: 980px) {
  #viewImpulse #impulseTemplateList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #viewImpulse #impulseTemplateList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #viewImpulse .impulse-template-card {
    min-height: 172px;
  }

  #viewImpulse .impulse-template-card-title {
    font-size: 1.08rem;
  }

  #viewImpulse .impulse-template-card-badge {
    padding: 5px 8px;
    font-size: 0.66rem;
  }
}

.memory-list-btn.has-memory {
  border-width: 2px;
  border-color: rgba(142, 91, 255, 0.72);
}

.chat-badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(42%, -42%);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #7a39ff;
  color: #fff;
  border: none;
  font-size: 0.64rem;
  font-weight: 500;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-align: center;
  box-shadow: 0 3px 8px rgba(31, 33, 43, 0.24);
  z-index: 40;
  pointer-events: none;
}

.nav-with-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.nav-with-badge .chat-badge {
  transform: translate(34%, -34%);
  z-index: 60;
}

#navAccountBtn .chat-badge {
  transform: translate(28%, -28%);
}

.members-unread-btn {
  position: relative;
  overflow: visible;
  padding-right: 0;
}

.members-unread-btn .members-unread-badge {
  top: -7px;
  right: -6px;
  transform: none;
  z-index: 20;
}

.group-chat-unread-btn {
  position: relative;
  overflow: visible;
}

.group-chat-unread-btn .group-chat-unread-badge {
  top: -7px;
  right: -6px;
  transform: none;
  z-index: 20;
}

.group-color-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.template-images-block {
  margin-top: 10px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.template-status-panel {
  margin-top: 6px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.88);
}

.template-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-status-toast {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.template-status-toast.is-draft {
  background: rgba(21, 134, 86, 0.16);
  color: #32dd87;
  border-color: rgba(21, 134, 86, 0.28);
}

.template-status-toast.is-validation {
  background: rgba(224, 133, 30, 0.2);
  color: #cfb9ff;
  border-color: rgba(224, 133, 30, 0.34);
}

.template-status-toast.is-published {
  background: rgba(186, 52, 52, 0.16);
  color: #ff5a6e;
  border-color: rgba(186, 52, 52, 0.34);
}

.template-status-toast.is-archived {
  background: rgba(31, 33, 43, 0.12);
  color: #aeb2c2;
  border-color: rgba(31, 33, 43, 0.2);
}

.template-status-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.template-detail-head-actions .group-icon-btn,
.template-detail-actions-row .group-icon-btn {
  width: 36px;
  height: 36px;
}

.template-detail-meta-row > label {
  margin: 0;
}

.template-workflow-modal-card {
  width: min(100%, 560px);
}

.template-workflow-steps {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.template-workflow-step {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(31, 33, 43, 0.74);
}

.template-workflow-step p {
  margin: 4px 0 0;
}

.template-workflow-step.is-active {
  border-color: rgba(142, 91, 255, 0.58);
  box-shadow: inset 0 0 0 1px rgba(142, 91, 255, 0.2);
}

.template-workflow-step.is-done {
  border-color: rgba(174, 126, 255, 0.46);
}

.template-workflow-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#templateImagesInput {
  display: none;
}

.template-image-list {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.template-image-item {
  border: 1px solid rgba(31, 33, 43, 0.16);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
}

.template-image-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #e7edf5;
}

.template-image-remove {
  width: 100%;
  border: none;
  border-top: 1px solid rgba(31, 33, 43, 0.1);
  background: rgba(255, 90, 110, 0.08);
  color: #ff5a6e;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 6px;
  cursor: pointer;
}

.template-image-remove:active {
  background: rgba(255, 90, 110, 0.16);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

.copy-groups {
  margin: 0 0 10px;
  border: 1px solid #303030;
  border-radius: 12px;
  background: #242424;
  box-shadow: inset 0 1px 0 rgba(245, 246, 251, 0.08);
  padding: 10px;
}

#groupCreateModal #groupCopyOptions {
  margin-top: 15px;
}

.copy-groups-toggle {
  width: 100%;
  border: 1px solid #303030;
  border-radius: 10px;
  background: #37363b;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.copy-groups-toggle[aria-expanded="true"] {
  border-color: rgba(122, 57, 255, 0.68);
}

.copy-groups-body {
  margin-top: 10px;
}

.copy-groups-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.copy-group-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #303030;
  border-radius: 12px;
  background: #202020;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.copy-group-option:hover {
  border-color: rgba(122, 57, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(245, 246, 251, 0.12);
}

.copy-group-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.copy-group-name {
  min-width: 0;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-group-meta {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

#groupCopyOptions .muted {
  margin: 0;
  color: var(--muted);
}

.color-value {
  margin-top: -2px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Menlo", "Consolas", monospace;
  font-size: 0.78rem;
}

.color-value::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(31, 33, 43, 0.24);
  background: var(--swatch-color, #8e5bff);
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden-coordinates {
  display: none !important;
}

.place-autocomplete {
  position: relative;
}

.place-search-panel {
  border: 1px solid rgba(122, 57, 255, 0.42);
  border-radius: 12px;
  background: rgba(28, 31, 42, 0.84);
  padding: 8px;
  box-shadow: inset 0 1px 0 rgba(245, 246, 251, 0.08);
}

.has-geo-status {
  position: relative;
  overflow: visible;
}

.has-geo-status.is-ready::after {
  content: "";
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #32dd87;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.has-geo-status.is-ready::before {
  content: "";
  position: absolute;
  top: -3px;
  right: -1px;
  width: 6px;
  height: 11px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(42deg);
  z-index: 1;
  pointer-events: none;
}

.has-geo-status.is-error::after {
  content: "";
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ff5a6e;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.has-geo-status.is-error::before {
  content: "×";
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
  z-index: 1;
  pointer-events: none;
}

.place-suggest-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 3600;
  border: 1px solid rgba(245, 246, 251, 0.48);
  border-radius: 12px;
  background: rgba(24, 27, 36, 0.98);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}

.place-suggest-item {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(245, 246, 251, 0.26);
  background: transparent;
  color: #e7edf5;
  text-align: left;
  padding: 10px 11px;
  cursor: pointer;
}

.place-suggest-item:last-child {
  border-bottom: none;
}

.place-suggest-item:hover,
.place-suggest-item:focus-visible {
  background: rgba(122, 57, 255, 0.38);
  outline: none;
}

.place-suggest-title {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: #e7edf5;
  line-height: 1.25;
}

.place-suggest-sub {
  display: block;
  margin-top: 2px;
  color: #cfb9ff;
  font-size: 0.73rem;
  line-height: 1.2;
}

.place-suggest-empty {
  margin: 0;
  padding: 10px;
  color: #cfb9ff;
  font-size: 0.76rem;
}

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

.actions-capture .btn {
  width: 100%;
}

.bucket-radius-wrap input[type="number"] {
  max-width: 180px;
}

.quick-bucket-checkin {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px;
  background: #5f46d9 !important;
  box-shadow: inset 0 1px 0 rgba(245, 246, 251, 0.08);
  display: grid;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.quick-bucket-checkin::before,
.quick-bucket-checkin::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  display: none;
}

.quick-bucket-checkin::before {
  width: 140px;
  height: 140px;
  top: -68px;
  right: -54px;
  background: radial-gradient(circle, rgba(142, 91, 255, 0.26), rgba(142, 91, 255, 0));
}

.quick-bucket-checkin::after {
  width: 120px;
  height: 120px;
  left: -44px;
  bottom: -58px;
  background: radial-gradient(circle, rgba(174, 126, 255, 0.26), rgba(174, 126, 255, 0));
}

.quick-bucket-head {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

.quick-bucket-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(245, 246, 251, 0.42);
  background: rgba(36, 39, 52, 0.88);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.quick-bucket-badge::before {
  content: "✦";
  margin-right: 6px;
  color: #8ee9bb;
  line-height: 1;
}

.quick-bucket-question {
  margin: 0;
  font-weight: 400;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
  z-index: 1;
}

.quick-checkin-task {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: #5f46d9;
  box-shadow: inset 0 1px 0 rgba(215, 198, 255, 0.14);
  z-index: 1;
  display: grid;
  gap: 6px;
}

.quick-checkin-task-title {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8ee9bb;
}

.quick-checkin-task-text {
  margin: 0;
  color: #e7edf5;
  font-size: 0.92rem;
  line-height: 1.3;
}

.quick-checkin-task-text.is-muted {
  color: #aeb2c2;
}

.quick-checkin-task-text.is-error {
  color: #ff7f8d;
}

.quick-gps-status {
  margin: 0;
  color: var(--muted);
  z-index: 1;
}

.quick-gps-status.is-error {
  color: #ff7384;
}

.quick-gps-coords {
  display: none;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.86rem;
  color: #cfb9ff;
  border: 1px solid rgba(245, 246, 251, 0.36);
  border-radius: 10px;
  background: rgba(24, 27, 36, 0.72);
  padding: 8px 10px;
  z-index: 1;
}

.quick-capture-modal-card.bucket-mode .groups-head h3 {
  color: var(--ink);
}

.quick-capture-title-wrap {
  display: grid;
  gap: 4px;
}

.quick-capture-group-name {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.25;
  color: #d9d9de;
}

#quickCheckinImageInput {
  display: none;
}

.quick-capture-modal-card {
  position: relative;
  overflow: hidden;
}

#quickCaptureCard {
  background: linear-gradient(150deg, #5f46d9, rgba(28, 31, 42, 0.88)) !important;
  isolation: isolate;
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: calc(14px + var(--app-safe-top)) 14px calc(14px + var(--app-safe-bottom));
}

#quickCaptureModal {
  background: rgba(22, 22, 22, 0.9);
  padding: 0;
  align-items: stretch;
}

#quickCaptureModal .btn,
#quickCaptureModal .group-plus-btn,
#quickCaptureModal .group-icon-btn {
  background: #242424 !important;
}

#quickCaptureModal .btn {
  border: 1px solid var(--stroke);
}

#quickCaptureModal .group-plus-btn,
#quickCaptureModal .group-icon-btn {
  border-color: var(--stroke);
}

.quick-checkin-photo-btn {
  width: 52px;
  height: 52px;
  border-radius: 999px;
}

.quick-checkin-photo-btn svg {
  width: 22px;
  height: 22px;
}

#quickCaptureCard::before,
#quickCaptureCard::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

#quickCaptureCard::before {
  width: 140px;
  height: 140px;
  top: -68px;
  right: -54px;
  background: radial-gradient(circle, rgba(142, 91, 255, 0.26), rgba(142, 91, 255, 0));
  animation: quick-capture-orb-float-a 8.5s ease-in-out infinite alternate;
}

#quickCaptureCard::after {
  width: 120px;
  height: 120px;
  left: -44px;
  bottom: -58px;
  background: radial-gradient(circle, rgba(174, 126, 255, 0.24), rgba(174, 126, 255, 0));
  animation: quick-capture-orb-float-b 9.2s ease-in-out infinite alternate;
}

#quickCaptureCard > .groups-head,
#quickCaptureCard > #quickCaptureForm {
  position: relative;
  z-index: 1;
}

@keyframes quick-capture-orb-float-a {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(-8px, 8px, 0) scale(1.05);
  }
}

@keyframes quick-capture-orb-float-b {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(8px, -8px, 0) scale(1.04);
  }
}

.quick-checkin-ai-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    radial-gradient(circle at 22% 20%, rgba(50, 221, 135, 0.18), rgba(50, 221, 135, 0)),
    radial-gradient(circle at 80% 84%, rgba(122, 57, 255, 0.2), rgba(122, 57, 255, 0)),
    rgba(28, 31, 42, 0.82);
  backdrop-filter: blur(3px);
}

.quick-checkin-ai-panel {
  width: min(100%, 360px);
  border: 1px solid rgba(174, 126, 255, 0.44);
  border-radius: 16px;
  background: rgba(28, 31, 42, 0.92);
  box-shadow: 0 16px 42px rgba(28, 31, 42, 0.48), inset 0 1px 0 rgba(215, 198, 255, 0.14);
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  padding: 22px 18px;
}

.quick-checkin-ai-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #e7edf5;
}

.quick-checkin-ai-copy {
  margin: 0;
  color: #cfb9ff;
  font-size: 0.87rem;
  line-height: 1.3;
}

.quick-checkin-ai-spinner {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 6px solid rgba(122, 57, 255, 0.22);
  border-top-color: #8ee9bb;
  border-right-color: #cfb9ff;
  box-shadow: 0 0 26px rgba(50, 221, 135, 0.26);
  animation: quick-ai-spin 0.9s linear infinite;
}

.template-task-fields {
  display: grid;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 10px;
  background: #303030;
}

.template-deluxe-task-rows {
  display: grid;
  gap: 10px;
}

.template-deluxe-task-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(36, 36, 38, 0.55);
}

.template-deluxe-task-row.is-reorder-draggable {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.template-deluxe-task-row.is-reorder-draggable:active {
  cursor: grabbing;
}

.template-deluxe-task-row.is-reorder-dragging {
  opacity: 0.78;
  transform: scale(0.994);
  touch-action: none;
  box-shadow: 0 10px 22px rgba(79, 163, 255, 0.28);
}

.template-deluxe-task-row.is-reorder-drop-before {
  box-shadow: inset 0 3px 0 rgba(114, 184, 255, 0.95);
}

.template-deluxe-task-row.is-reorder-drop-after {
  box-shadow: inset 0 -3px 0 rgba(114, 184, 255, 0.95);
}

.template-deluxe-task-row-title {
  margin: 0;
}

.template-deluxe-task-drag-handle {
  font-size: 0.78rem;
  color: #9fb7d8;
  letter-spacing: 0.01em;
  user-select: none;
  -webkit-user-select: none;
}

.template-deluxe-task-remove-btn {
  margin-top: 15px;
  align-self: flex-end;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  line-height: 1;
}

#templatePlaceAddDeluxeTaskBtn {
  margin-bottom: 15px;
}

.list-item-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.list-item-actions .btn {
  flex: 1;
  min-width: 120px;
}

.group-place-actions {
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
}

.group-place-actions-left,
.group-place-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.group-place-actions-right {
  margin-left: auto;
}

.visit-edit-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(31, 33, 43, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #aeb2c2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.visit-edit-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 9602;
  width: min(calc(100% - 28px), 460px);
  max-width: calc(100% - 24px);
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(132, 95, 22, 0.42);
  background: #f7c948;
  color: #2b2412;
  box-shadow:
    0 20px 42px rgba(0, 0, 0, 0.48),
    0 0 26px rgba(243, 178, 89, 0.45);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  transform-origin: center;
  text-shadow: none;
}

.toast:not(.hidden) {
  animation: toast-zoom-pop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

body.modal-open .toast {
  top: 50%;
  bottom: auto;
}

@keyframes toast-zoom-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.82);
  }
  58% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.challenge-win-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9205;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at 14% 16%, rgba(119, 41, 255, 0.34), transparent 34%),
    radial-gradient(circle at 86% 20%, rgba(168, 121, 255, 0.28), transparent 32%),
    radial-gradient(circle at 50% 74%, rgba(92, 56, 182, 0.24), transparent 46%),
    rgba(16, 18, 26, 0.9);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.challenge-win-popup-backdrop.is-visible {
  opacity: 1;
}

.challenge-win-popup-card {
  width: min(100%, 420px);
  border: 1px solid rgba(174, 126, 255, 0.45);
  border-radius: 18px;
  background:
    radial-gradient(circle at 82% 10%, rgba(166, 116, 255, 0.28), transparent 34%),
    radial-gradient(circle at 16% 92%, rgba(109, 48, 220, 0.24), transparent 46%),
    linear-gradient(158deg, rgba(86, 42, 166, 0.97), rgba(26, 29, 40, 0.98));
  box-shadow: 0 24px 46px rgba(20, 16, 36, 0.72);
  padding: 22px 18px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: translateY(18px) scale(0.92);
  opacity: 0;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.challenge-win-popup-backdrop.is-visible .challenge-win-popup-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.challenge-win-popup-backdrop .challenge-win-popup-card {
  background:
    radial-gradient(circle at 82% 10%, rgba(166, 116, 255, 0.28), transparent 34%),
    radial-gradient(circle at 16% 92%, rgba(109, 48, 220, 0.24), transparent 46%),
    linear-gradient(158deg, rgba(86, 42, 166, 0.97), rgba(26, 29, 40, 0.98)) !important;
}

.challenge-win-popup-card > *,
.level-up-popup-card > * {
  position: relative;
  z-index: 1;
}

.challenge-win-popup-card::before,
.challenge-win-popup-card::after,
.level-up-popup-card::before,
.level-up-popup-card::after {
  content: "";
  position: absolute;
  inset: -6% -4%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

.challenge-win-popup-card::before,
.level-up-popup-card::before {
  background:
    radial-gradient(circle at 20% 24%, rgba(190, 134, 255, 0.88) 0 2px, transparent 2.8px),
    radial-gradient(circle at 15% 30%, rgba(171, 109, 255, 0.68) 0 2px, transparent 2.8px),
    radial-gradient(circle at 26% 18%, rgba(213, 174, 255, 0.82) 0 1.8px, transparent 2.6px),
    radial-gradient(circle at 76% 20%, rgba(155, 88, 255, 0.84) 0 2.1px, transparent 2.9px),
    radial-gradient(circle at 82% 28%, rgba(201, 155, 255, 0.72) 0 1.9px, transparent 2.7px),
    radial-gradient(circle at 70% 14%, rgba(130, 71, 255, 0.78) 0 1.9px, transparent 2.7px),
    radial-gradient(circle at 52% 8%, rgba(174, 126, 255, 0.52) 0 1.5px, transparent 2.2px);
  animation: popup-firework-burst-a 2.4s ease-in-out infinite;
}

.challenge-win-popup-card::after,
.level-up-popup-card::after {
  background:
    radial-gradient(circle at 30% 74%, rgba(182, 128, 255, 0.84) 0 2.2px, transparent 3px),
    radial-gradient(circle at 24% 66%, rgba(150, 86, 255, 0.7) 0 1.9px, transparent 2.8px),
    radial-gradient(circle at 36% 82%, rgba(213, 174, 255, 0.76) 0 1.9px, transparent 2.8px),
    radial-gradient(circle at 76% 70%, rgba(138, 75, 255, 0.86) 0 2.2px, transparent 3px),
    radial-gradient(circle at 70% 80%, rgba(196, 149, 255, 0.72) 0 1.9px, transparent 2.7px),
    radial-gradient(circle at 84% 62%, rgba(166, 112, 255, 0.68) 0 1.9px, transparent 2.7px),
    radial-gradient(circle at 50% 92%, rgba(139, 78, 255, 0.46) 0 1.5px, transparent 2.2px);
  animation: popup-firework-burst-b 2.7s ease-in-out infinite;
}

.challenge-win-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.challenge-win-star {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.05));
  box-shadow: 0 0 10px rgba(193, 143, 255, 0.86);
  animation: challenge-win-star-twinkle 1.8s ease-in-out infinite;
}

.challenge-win-star:nth-child(1) {
  top: 14px;
  left: 18%;
  animation-delay: 0.1s;
}

.challenge-win-star:nth-child(2) {
  top: 28px;
  right: 17%;
  width: 10px;
  height: 10px;
  animation-delay: 0.5s;
}

.challenge-win-star:nth-child(3) {
  top: 54px;
  left: 68%;
  width: 6px;
  height: 6px;
  animation-delay: 0.9s;
}

.challenge-win-crown-wrap {
  width: 98px;
  height: 98px;
  margin: 4px auto 8px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f7c948;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(247, 201, 72, 0.32);
  animation: challenge-win-crown-float 2.2s ease-in-out infinite;
}

.challenge-win-crown-wrap::after {
  content: "";
  position: absolute;
  top: -14px;
  left: -42px;
  width: 42px;
  height: 128px;
  transform: rotate(24deg);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.4),
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0)
  );
  filter: blur(0.4px);
  animation: challenge-win-crown-shine 1.9s ease-in-out infinite;
}

.challenge-win-crown-glow {
  position: absolute;
  inset: 14px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 225, 130, 0.55), rgba(255, 225, 130, 0.04));
  filter: blur(0.5px);
  animation: challenge-win-crown-glow-pulse 1.6s ease-in-out infinite;
}

.challenge-win-crown-wrap svg {
  width: 74px;
  height: 74px;
  fill: currentColor;
  filter: drop-shadow(0 0 10px rgba(255, 215, 107, 0.66));
}

.challenge-win-popup-card .popup-dialog-close-x {
  border: none;
  background: #37363b;
  color: #e7edf5;
}

.challenge-win-popup-card .popup-dialog-close-x:hover,
.challenge-win-popup-card .popup-dialog-close-x:focus-visible {
  background: #37363b;
  border: none;
}

.challenge-win-title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
  font-weight: 800;
  color: #e7edf5;
}

.challenge-win-subtitle {
  margin: 6px 0 0;
  color: rgba(215, 198, 255, 0.96);
  font-size: 0.98rem;
}

.challenge-win-group {
  margin: 6px 0 0;
  color: rgba(174, 178, 194, 0.9);
  font-size: 0.86rem;
}

.challenge-win-points {
  margin: 12px 0 14px;
  font-size: 1.12rem;
  font-weight: 800;
  color: #e2c7ff;
  text-shadow: 0 0 14px rgba(162, 102, 255, 0.52);
}

.popup-dialog-close-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(215, 198, 255, 0.42);
  background: rgba(62, 34, 113, 0.78);
  color: #e7edf5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  z-index: 2;
}

.popup-dialog-close-x:hover,
.popup-dialog-close-x:focus-visible {
  background: rgba(36, 39, 52, 0.92);
  border-color: rgba(215, 198, 255, 0.68);
}

@keyframes challenge-win-crown-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes challenge-win-crown-glow-pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

@keyframes challenge-win-crown-shine {
  0% {
    transform: translateX(-2px) rotate(24deg);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  70% {
    opacity: 0.92;
  }
  100% {
    transform: translateX(148px) rotate(24deg);
    opacity: 0;
  }
}

@keyframes challenge-win-star-twinkle {
  0%,
  100% {
    transform: scale(0.55);
    opacity: 0.45;
  }
  45% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.streak-start-popup-backdrop,
.streak-challenge-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9214;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at 18% 20%, rgba(22, 184, 137, 0.28), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(251, 191, 36, 0.18), transparent 34%),
    radial-gradient(circle at 50% 84%, rgba(30, 64, 175, 0.22), transparent 44%),
    rgba(9, 14, 25, 0.88);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.streak-start-popup-backdrop.is-visible,
.streak-challenge-popup-backdrop.is-visible {
  opacity: 1;
}

.streak-start-popup-card,
.streak-challenge-popup-card {
  width: min(100%, 430px);
  border-radius: 18px;
  border: 1px solid rgba(45, 212, 191, 0.44);
  background:
    radial-gradient(circle at 18% 14%, rgba(20, 184, 166, 0.22), transparent 34%),
    radial-gradient(circle at 86% 86%, rgba(59, 130, 246, 0.2), transparent 42%),
    linear-gradient(156deg, rgba(9, 28, 42, 0.98), rgba(15, 23, 42, 0.98));
  box-shadow: 0 24px 48px rgba(3, 9, 19, 0.72);
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: translateY(18px) scale(0.92);
  opacity: 0;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.streak-start-popup-card {
  padding: 22px 18px 18px;
}

.streak-challenge-popup-card {
  padding: 24px 18px 18px;
}

.streak-start-popup-backdrop.is-visible .streak-start-popup-card,
.streak-challenge-popup-backdrop.is-visible .streak-challenge-popup-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.streak-start-gem-wrap {
  width: 110px;
  height: 110px;
  margin: 2px auto 10px;
  position: relative;
  display: grid;
  place-items: center;
}

.streak-start-gem-core {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.02) 55%),
    linear-gradient(146deg, rgba(45, 212, 191, 0.98), rgba(14, 165, 233, 0.98));
  border: 1px solid rgba(153, 246, 228, 0.66);
  box-shadow:
    0 10px 28px rgba(45, 212, 191, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
  transform: rotate(45deg);
  animation: streak-gem-float 2.4s ease-in-out infinite;
}

.streak-start-gem-ring {
  position: absolute;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.45);
  opacity: 0.25;
  transform: scale(0.88);
}

.streak-start-gem-ring.ring-a {
  animation: streak-ring-pulse 1.6s ease-out infinite;
}

.streak-start-gem-ring.ring-b {
  animation: streak-ring-pulse 1.6s ease-out infinite 0.38s;
}

.streak-start-gem-ring.ring-c {
  animation: streak-ring-pulse 1.6s ease-out infinite 0.76s;
}

.streak-start-title,
.streak-challenge-title {
  margin: 0;
  color: #e6f8ff;
  font-size: 1.2rem;
  line-height: 1.3;
  font-weight: 800;
}

.streak-start-subtitle {
  margin: 8px 0 14px;
  color: rgba(163, 230, 255, 0.92);
  font-size: 0.95rem;
}

.streak-start-continue-btn {
  width: 100%;
}

.streak-challenge-question {
  margin: 10px 0 14px;
  color: rgba(191, 219, 254, 0.95);
  font-size: 1rem;
  line-height: 1.45;
}

.streak-challenge-actions {
  display: grid;
  gap: 10px;
}

@keyframes streak-gem-float {
  0%,
  100% {
    transform: rotate(45deg) translateY(0);
  }
  50% {
    transform: rotate(45deg) translateY(-5px);
  }
}

@keyframes streak-ring-pulse {
  0% {
    opacity: 0.44;
    transform: scale(0.82);
  }
  100% {
    opacity: 0;
    transform: scale(1.32);
  }
}

.level-up-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9212;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at 18% 18%, rgba(119, 41, 255, 0.32), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(178, 134, 255, 0.28), transparent 32%),
    radial-gradient(circle at 50% 82%, rgba(96, 55, 188, 0.22), transparent 44%),
    rgba(16, 18, 26, 0.9);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.level-up-popup-backdrop.is-visible {
  opacity: 1;
}

.level-up-popup-card {
  width: min(100%, 430px);
  border: 1px solid rgba(215, 198, 255, 0.5);
  border-radius: 18px;
  background:
    radial-gradient(circle at 14% 12%, rgba(164, 118, 255, 0.24), transparent 34%),
    radial-gradient(circle at 82% 88%, rgba(117, 58, 226, 0.24), transparent 40%),
    linear-gradient(160deg, rgba(81, 40, 160, 0.98), rgba(27, 30, 41, 0.98));
  box-shadow: 0 26px 48px rgba(20, 16, 36, 0.68);
  padding: 22px 16px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: translateY(18px) scale(0.92);
  opacity: 0;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.level-up-popup-backdrop.is-visible .level-up-popup-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.level-up-popup-backdrop .level-up-popup-card {
  background:
    radial-gradient(circle at 14% 12%, rgba(164, 118, 255, 0.24), transparent 34%),
    radial-gradient(circle at 82% 88%, rgba(117, 58, 226, 0.24), transparent 40%),
    linear-gradient(160deg, rgba(81, 40, 160, 0.98), rgba(27, 30, 41, 0.98)) !important;
}

.level-up-popup-title {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
}

.level-up-popup-subtitle {
  margin: 8px 0 14px;
  color: #cfb9ff;
  font-size: 0.98rem;
}

.level-up-popup-subtitle strong {
  color: #cfb9ff;
}

.level-up-popup-image-wrap {
  width: 184px;
  height: 184px;
  margin: 0 auto 12px;
  box-sizing: border-box;
  padding: 0;
  border-radius: 16px;
  border: 1px solid rgba(198, 157, 255, 0.62);
  background:
    radial-gradient(circle at 78% 16%, rgba(203, 163, 255, 0.22), transparent 40%),
    linear-gradient(145deg, rgba(108, 50, 216, 0.9), rgba(86, 42, 166, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(215, 198, 255, 0.24),
    0 14px 28px rgba(28, 31, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  animation: level-up-image-float 2.6s ease-in-out infinite;
}

.level-up-popup-image {
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  max-width: calc(100% - 40px);
  max-height: calc(100% - 40px);
  object-fit: contain;
  object-position: center;
  display: block;
  margin: auto;
  border-radius: 12px;
  filter: none;
}

.level-up-popup-image-gloss {
  position: absolute;
  top: -22%;
  left: -45%;
  width: 38%;
  height: 144%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.45),
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0)
  );
  transform: rotate(18deg);
  filter: blur(0.2px);
  animation: level-up-image-shine 1.95s ease-in-out infinite;
  pointer-events: none;
}

.level-up-popup-image-wrap.is-fallback svg {
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  fill: rgba(255, 229, 146, 0.96);
  filter: drop-shadow(0 0 12px rgba(255, 221, 125, 0.46));
}

.level-up-popup-points {
  margin: 0 0 14px;
  color: #e8ddff;
  font-size: 0.88rem;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(163, 104, 255, 0.32);
}

@keyframes popup-firework-burst-a {
  0% {
    opacity: 0.24;
    transform: scale(0.92) rotate(0deg);
  }
  50% {
    opacity: 0.84;
    transform: scale(1.1) rotate(8deg);
  }
  100% {
    opacity: 0.26;
    transform: scale(0.95) rotate(0deg);
  }
}

@keyframes popup-firework-burst-b {
  0% {
    opacity: 0.28;
    transform: scale(0.9) rotate(0deg);
  }
  50% {
    opacity: 0.78;
    transform: scale(1.08) rotate(-9deg);
  }
  100% {
    opacity: 0.3;
    transform: scale(0.94) rotate(0deg);
  }
}

@keyframes level-up-image-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes level-up-image-shine {
  0% {
    transform: translateX(-6px) rotate(18deg);
    opacity: 0;
  }
  26% {
    opacity: 1;
  }
  70% {
    opacity: 0.9;
  }
  100% {
    transform: translateX(238px) rotate(18deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .challenge-win-popup-backdrop,
  .challenge-win-popup-card,
  .streak-start-popup-backdrop,
  .streak-start-popup-card,
  .streak-challenge-popup-backdrop,
  .streak-challenge-popup-card,
  .level-up-popup-backdrop,
  .level-up-popup-card {
    transition: none;
  }

  .challenge-win-crown-wrap,
  .challenge-win-crown-wrap::after,
  .challenge-win-crown-glow,
  .challenge-win-star,
  .challenge-win-popup-card::before,
  .challenge-win-popup-card::after,
  .streak-start-gem-core,
  .streak-start-gem-ring,
  .level-up-popup-card::before,
  .level-up-popup-card::after,
  .level-up-popup-image-wrap,
  .level-up-popup-image-gloss,
  #groupTaskModal:not(.hidden) #groupTaskTitle,
  #groupTaskModal:not(.hidden) #groupTaskTitle::after {
    animation: none;
  }

  .toast:not(.hidden) {
    animation: none;
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(28, 31, 42, 0.62);
  padding: 16px;
  display: grid;
  align-items: center;
  overflow-y: auto;
}

#groupCreateModal,
#groupTaskModal,
#challengeDeluxeTasksModal,
#accountLlmModal,
#accountAdminMenuModal,
#groupMembersModal,
#friendsModal,
#chatModal,
#groupMemoryGalleryModal {
  background: rgba(22, 22, 22, 0.9);
}

#groupMembersModal,
#friendsModal,
#chatModal,
#groupChallengeRankingModal {
  padding-top: calc(12px + var(--app-safe-top));
  padding-bottom: calc(12px + var(--app-safe-bottom));
}

#groupMembersModal .modal-card,
#friendsModal .modal-card,
#chatModal .modal-card,
#groupChallengeRankingModal .modal-card {
  width: min(100%, var(--ranking-modal-max-width));
  height: min(
    calc(var(--app-height) - 24px - var(--app-safe-top) - var(--app-safe-bottom)),
    var(--ranking-modal-max-height)
  );
  max-height: min(
    calc(var(--app-height) - 24px - var(--app-safe-top) - var(--app-safe-bottom)),
    var(--ranking-modal-max-height)
  );
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#accountSettingsModal {
  background: rgba(22, 22, 22, 0.9);
}

.modal.app-dialog-chat-actions,
.modal.app-dialog-group-overview-actions {
  background: rgb(22 22 22 / 0.9);
}

.modal.modal-passive {
  pointer-events: none;
}

.modal-card {
  width: min(100%, 520px);
  margin: 0 auto;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: #242424;
  box-shadow: var(--shadow);
  padding: 14px;
}

.group-search-modal-card {
  width: min(100%, 560px);
}

.capture-modal-card {
  width: min(100%, 720px);
  max-height: min(calc(var(--app-height) - 24px), 920px);
  overflow-y: auto;
}

.modal-card h3 {
  margin: 0 0 10px;
}

.members-modal-card {
  width: min(100%, 900px);
  height: min(calc(var(--app-height) - 24px), 860px);
  display: flex;
  flex-direction: column;
}

.admin-users-modal-card {
  width: min(100%, 980px);
  height: min(calc(var(--app-height) - 24px), 900px);
}

.onboarding-coach {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-height) + 14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 16px), 680px);
  z-index: 3250;
  pointer-events: none;
}

.onboarding-coach-card {
  pointer-events: auto;
  border: 1px solid rgba(122, 57, 255, 0.52);
  border-radius: var(--radius);
  background: rgba(24, 27, 36, 0.96);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
  padding: 12px;
  display: grid;
  gap: 10px;
  max-height: min(58dvh, 560px);
  overflow-y: auto;
}

.onboarding-description {
  margin: 0;
  color: #aeb2c2;
  line-height: 1.35;
}

.onboarding-guidance {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(95, 55, 179, 0.5);
  border-radius: 12px;
  background: rgba(62, 34, 113, 0.82);
  padding: 8px 10px;
}

.onboarding-guidance-line {
  margin: 0;
  color: #e7edf5;
  font-size: 0.84rem;
  line-height: 1.3;
}

.onboarding-step-list {
  display: grid;
  gap: 8px;
  max-height: min(26dvh, 240px);
  overflow-y: auto;
  padding-right: 2px;
}

.onboarding-step-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(122, 57, 255, 0.42);
  border-radius: 12px;
  background: rgba(28, 31, 42, 0.84);
  padding: 8px 10px;
}

.onboarding-step-item::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(122, 57, 255, 0.5);
  margin-top: 2px;
}

.onboarding-step-item.is-done::before {
  background: linear-gradient(120deg, var(--accent), #32dd87);
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(62, 34, 113, 0.88);
}

.onboarding-step-item.is-current {
  border-color: rgba(142, 91, 255, 0.58);
  box-shadow: inset 0 0 0 1px rgba(142, 91, 255, 0.2);
}

.onboarding-step-title {
  margin: 0;
  color: #e7edf5;
}

.onboarding-step-meta {
  margin: 2px 0 0;
  color: #cfb9ff;
  font-size: 0.78rem;
  line-height: 1.3;
}

.onboarding-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.onboarding-skip-btn {
  justify-self: end;
}

.onboarding-highlight-target {
  position: relative;
  z-index: 3290 !important;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.96),
    0 0 0 6px rgba(142, 91, 255, 0.44),
    0 8px 22px rgba(0, 0, 0, 0.44) !important;
  animation: onboarding-target-pulse 1.15s ease-in-out infinite alternate;
}

@keyframes onboarding-target-pulse {
  from {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.88),
      0 0 0 6px rgba(142, 91, 255, 0.3),
      0 7px 18px rgba(0, 0, 0, 0.36);
  }
  to {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 1),
      0 0 0 8px rgba(142, 91, 255, 0.52),
      0 10px 28px rgba(0, 0, 0, 0.5);
  }
}

@media (max-width: 520px) {
  .onboarding-coach {
    width: calc(100% - 16px);
    bottom: calc(var(--bottom-nav-height) + 8px + env(safe-area-inset-bottom));
  }

  .onboarding-coach-card {
    max-height: min(56dvh, 540px);
  }

  .onboarding-actions {
    grid-template-columns: 1fr;
  }

  .onboarding-skip-btn {
    justify-self: start;
  }
}

.admin-user-create-form {
  margin-bottom: 10px;
}

#adminUsersList .member-list-item {
  height: auto;
  min-height: 152px;
  padding-top: 16px;
  padding-bottom: 16px;
  overflow: visible;
}

#adminUsersList .member-avatar {
  width: 88px;
  height: 88px;
}

#adminUsersList .member-row-meta {
  margin-left: 96px;
}

.activity-levels-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.activity-level-editor-modal-card {
  width: min(100%, 640px);
}

#activityLevelsList .activity-level-item,
#adminActivityPointsList .activity-level-item {
  display: grid;
  gap: 12px;
}

#activityLevelsList .activity-level-item {
  padding: 16px;
  min-height: 360px;
  grid-template-rows: auto auto;
  overflow: hidden;
}

#adminActivityPointsList .activity-level-item {
  padding: 18px 16px 20px;
  min-height: 128px;
  box-sizing: border-box;
}

#adminActivityPointsList .activity-level-head-main {
  gap: 10px;
}

.activity-level-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.activity-level-head-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.activity-level-title {
  font-size: 1.05rem;
  line-height: 1.2;
  margin: 0;
}

.activity-level-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-level-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.activity-level-actions .group-icon-btn {
  width: 36px;
  height: 36px;
}

.activity-level-range {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(31, 33, 43, 0.82);
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.activity-level-season {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(245, 246, 251, 0.24);
  background: rgba(62, 34, 113, 0.72);
  color: var(--muted);
  font-size: 0.75rem;
}

#activityLevelsList .activity-level-body {
  display: flex;
  align-items: flex-start;
  min-height: 190px;
  padding-bottom: 15px;
  box-sizing: border-box;
  overflow: visible;
}

#activityLevelsList .activity-level-media {
  width: min(200px, calc(100% - 2px));
  max-width: 100%;
  height: 150px;
  margin: 0;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background:
    radial-gradient(circle at 30% 24%, rgba(174, 126, 255, 0.18), rgba(174, 126, 255, 0) 60%),
    rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#activityLevelsList .activity-level-image {
  width: 100% !important;
  height: 100% !important;
  max-height: 100%;
  display: block;
  object-fit: contain !important;
  object-position: center;
  padding: 6px;
  background: rgba(28, 31, 42, 0.35);
  box-sizing: border-box;
}

#activityLevelsList .activity-level-image-placeholder {
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.2;
  padding: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-badge-editor-modal-card {
  width: min(100%, 640px);
}

#adminBadgesList .admin-badge-item {
  padding: 14px 14px 15px;
  min-height: 180px;
  display: grid;
  gap: 12px;
}

.admin-badge-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-badge-title {
  font-size: 1.05rem;
  line-height: 1.2;
  margin: 0;
}

.admin-badge-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.admin-badge-actions .group-icon-btn {
  width: 36px;
  height: 36px;
}

.admin-badge-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 96px;
  padding-bottom: 15px;
}

.admin-badge-media {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.admin-badge-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-badge-image-placeholder {
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  line-height: 1.2;
  padding: 6px;
}

.admin-badge-meta {
  margin: 0;
  align-self: center;
}

@media (max-width: 560px) {
  #activityLevelsList .activity-level-item {
    min-height: 330px;
  }
  #activityLevelsList .activity-level-body {
    align-items: flex-start;
  }
  #activityLevelsList .activity-level-media {
    width: min(178px, calc(100% - 2px));
    height: 134px;
  }
  .activity-level-actions .group-icon-btn {
    width: 36px;
    height: 36px;
  }
  .admin-badge-actions .group-icon-btn {
    width: 36px;
    height: 36px;
  }
}

.impulse-template-modal-card {
  width: min(100%, 980px);
  height: min(calc(var(--app-height) - 24px), 900px);
}

.impulse-template-content-card {
  background: #242424;
  border-radius: 25px;
  border-color: var(--stroke);
  box-shadow: none;
}

.impulse-template-head {
  margin-bottom: 12px;
  display: grid;
  gap: 6px;
}

.impulse-template-title {
  margin: 0;
}

.impulse-template-actions-card {
  position: sticky;
  top: calc(var(--app-safe-top) + 6px);
  z-index: 20;
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: #242424;
  border: none;
  box-shadow: none;
  border-radius: 24px;
}

.impulse-template-actions-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  width: 100%;
}

.impulse-template-actions-row .impulse-import-btn {
  flex: 0 0 auto;
}

.impulse-template-description {
  margin: 0;
  line-height: 1.35;
  color: #aeb2c2;
}

.impulse-template-rating-row {
  display: grid;
  gap: 4px;
}

.impulse-template-rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.impulse-template-rating-star {
  width: 30px;
  height: 30px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0;
  background: rgba(245, 246, 251, 0.08);
  color: #6f7589;
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms ease, color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.impulse-template-rating-star:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 224, 128, 0.7);
}

.impulse-template-rating-star:focus-visible {
  outline: 2px solid rgba(20, 165, 255, 0.9);
  outline-offset: 2px;
}

.impulse-template-rating-star.is-selected {
  color: #ffd65a;
  border-color: rgba(255, 214, 90, 0.8);
  background: rgba(255, 214, 90, 0.16);
}

.impulse-template-rating-star.is-average {
  color: #d4b25b;
  border-color: rgba(212, 178, 91, 0.52);
}

.impulse-template-rating-star:disabled {
  opacity: 0.65;
  cursor: default;
}

.impulse-template-rating-summary {
  margin: 0;
}

.impulse-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.impulse-carousel-image-btn {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(245, 250, 255, 0.88);
  padding: 0;
  width: 100%;
  min-height: 220px;
  max-height: 320px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.impulse-carousel-image-btn:disabled {
  cursor: default;
}

#impulseTemplateImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.impulse-image-counter {
  margin-top: 8px;
}

.impulse-template-actions {
  margin-top: 4px;
  margin-bottom: 10px;
}

.impulse-template-actions .btn {
  width: 100%;
}

.impulse-import-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  gap: 0;
}

.impulse-import-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.impulse-template-item .btn {
  margin-top: 8px;
}

.impulse-template-cover-wrap {
  position: relative;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  margin: 0;
}

.impulse-template-cover-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(9, 10, 15, 0) 18%, rgba(20, 22, 31, 0.66) 52%, rgba(31, 33, 43, 0.96) 82%, rgba(31, 33, 43, 1) 100%),
    radial-gradient(150% 92% at 50% 108%, rgba(31, 33, 43, 1) 0%, rgba(31, 33, 43, 0.16) 60%);
}

.impulse-template-cover {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: cover;
  border-radius: 0;
  margin: 0;
}

.impulse-template-item > strong {
  font-size: 1.36rem;
  line-height: 1.18;
  font-weight: 400;
}

.template-season-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.template-season-badge-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(245, 246, 251, 0.25);
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

#viewTemplateGroups .template-season-badge-thumb,
#viewGroups .template-season-badge-thumb,
#viewImpulse .template-season-badge-thumb {
  width: 76px;
  height: 76px;
  border-radius: 12px;
}

#viewTemplateGroups .template-badge-row .template-season-badge-thumb,
#viewImpulse .template-badge-row .template-season-badge-thumb {
  width: 96px;
  height: 96px;
  border-radius: 14px;
}

#viewTemplateGroups .group-item > .template-season-row + .template-status-toast,
#viewImpulse .group-item > .template-season-row + .template-status-toast {
  margin-top: 8px;
}

#viewTemplateGroups .group-item > .template-badge-row + .template-status-toast,
#viewImpulse .group-item > .template-badge-row + .template-status-toast {
  margin-top: 8px;
}

.impulse-template-item.has-cover-image > strong {
  position: relative;
  z-index: 1;
  margin-top: -18px;
}

.impulse-template-item.has-cover-image {
  padding: 0 0 15px;
  overflow: hidden;
}

.impulse-template-item {
  padding-bottom: 15px;
}

.impulse-template-item.has-cover-image > strong,
.impulse-template-item.has-cover-image > p,
.impulse-template-item.has-cover-image > .template-season-row,
.impulse-template-item.has-cover-image > .template-badge-row,
.impulse-template-item.has-cover-image > .impulse-template-item-actions {
  padding-left: 12px;
  padding-right: 12px;
}

.impulse-template-item-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.impulse-template-item-actions .btn {
  margin-top: 0;
  flex: 1;
}

#viewTemplateGroups .group-item.has-cover-image,
#viewImpulse .group-item.has-cover-image {
  padding: 0 0 64px;
  overflow: hidden;
}

#viewTemplateGroups .group-item.has-cover-image > .group-head,
#viewImpulse .group-item.has-cover-image > .group-head {
  position: relative;
  z-index: 1;
  margin-top: -18px;
  padding-left: 12px;
  padding-right: 12px;
}

#viewImpulse .group-item.has-cover-image > .group-head {
  position: static;
  z-index: auto;
}

#viewTemplateGroups .group-item.has-cover-image > .group-head .group-title,
#viewImpulse .group-item.has-cover-image > .group-head .group-title {
  font-size: 1.32rem;
  line-height: 1.18;
  text-shadow: 0 2px 10px rgba(28, 31, 42, 0.72);
}

#viewImpulse .group-item.has-cover-image > .group-head .group-title {
  position: relative;
  z-index: 2;
}

#viewTemplateGroups .group-item.has-cover-image > .template-status-toast,
#viewTemplateGroups .group-item.has-cover-image > .template-season-row,
#viewTemplateGroups .group-item.has-cover-image > .template-badge-row,
#viewTemplateGroups .group-item.has-cover-image > .group-meta,
#viewTemplateGroups .group-item.has-cover-image > .group-desc,
#viewImpulse .group-item.has-cover-image > .template-status-toast,
#viewImpulse .group-item.has-cover-image > .template-season-row,
#viewImpulse .group-item.has-cover-image > .template-badge-row,
#viewImpulse .group-item.has-cover-image > .group-meta,
#viewImpulse .group-item.has-cover-image > .group-desc {
  margin-left: 12px;
  margin-right: 12px;
}

.impulse-zoom-modal-card {
  width: min(100%, 920px);
}

.impulse-zoom-stage {
  margin-top: 4px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(245, 250, 255, 0.9);
  min-height: 48dvh;
  max-height: 66dvh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

#impulseZoomImage {
  max-width: 100%;
  max-height: 100%;
  transform-origin: center center;
  transition: transform 0.16s ease;
}

.impulse-zoom-controls {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.avatar-crop-modal-card {
  width: min(100%, 560px);
}

.avatar-crop-hint {
  margin: 0 0 10px;
}

.avatar-crop-stage {
  position: relative;
  margin: 0 auto;
  width: min(88vw, 330px);
  height: min(88vw, 330px);
  max-width: 330px;
  max-height: 330px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background:
    linear-gradient(45deg, rgba(36, 39, 52, 0.8) 25%, rgba(28, 31, 42, 0.8) 25% 50%, rgba(36, 39, 52, 0.8) 50% 75%, rgba(28, 31, 42, 0.8) 75%),
    rgba(28, 31, 42, 0.92);
  background-size: 20px 20px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.avatar-crop-stage.is-dragging {
  cursor: grabbing;
}

#avatarCropImage {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  max-height: none;
  transform-origin: 0 0;
  pointer-events: none;
  user-select: none;
}

.avatar-crop-stage-ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 2000px rgba(3, 6, 20, 0.48),
    inset 0 0 0 2px rgba(230, 242, 255, 0.7);
  border-radius: 999px;
}

.avatar-crop-zoom {
  margin-top: 12px;
}

.avatar-crop-zoom input[type="range"] {
  width: 100%;
}

.template-llm-modal-card {
  width: min(100%, 860px);
  height: min(calc(var(--app-height) - 24px), 860px);
  display: flex;
  flex-direction: column;
  position: relative;
}

.template-llm-modal-card .groups-head {
  margin-bottom: 8px;
}

.template-llm-modal-card .form {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.template-llm-modal-card textarea {
  resize: vertical;
}

.template-llm-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.template-llm-prompt-head span {
  font-size: 0.84rem;
  font-weight: 500;
}

.template-llm-msg {
  margin: 8px 0 2px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(95, 55, 179, 0.45);
  background: rgba(36, 39, 52, 0.6);
  color: #cfb9ff;
  font-size: 0.8rem;
  line-height: 1.35;
}

.template-llm-msg.is-error {
  border-color: rgba(215, 88, 88, 0.68);
  background: rgba(120, 26, 26, 0.34);
  color: #ffd6dc;
}

.template-llm-msg.is-success {
  border-color: rgba(50, 221, 135, 0.62);
  background: rgba(21, 134, 86, 0.32);
  color: #8ee9bb;
}

.template-llm-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

.template-llm-generate-btn {
  width: 34px;
  height: 34px;
}

.template-llm-generate-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.template-map-modal-card {
  width: min(100%, 860px);
  height: min(calc(var(--app-height) - 12px), 980px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.template-map-modal-card .groups-head {
  margin-bottom: 0;
  align-items: center;
}

.template-map-controls {
  display: grid;
  gap: 8px;
}

#templateMapModeButtons {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.template-map-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#templateMap {
  width: 100%;
  flex: 1;
  min-height: 40dvh;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  overflow: hidden;
  background: #1f212b;
}

#templateMapStats {
  margin: 0;
}

.template-map-modal-card .map-exit-fullscreen {
  position: static;
  margin-left: auto;
}

.llm-loading-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.llm-loading-dialog {
  min-width: 220px;
  max-width: min(100%, 360px);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  padding: 14px;
  display: grid;
  justify-items: center;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(31, 33, 43, 0.18);
}

.llm-loading-dialog p {
  margin: 0;
  font-size: 0.9rem;
  color: #aeb2c2;
  text-align: center;
}

.llm-loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(122, 57, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: llm-spin 0.9s linear infinite;
}

@keyframes llm-spin {
  to {
    transform: rotate(360deg);
  }
}

.members-modal-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.friends-modal-card {
  width: min(100%, 860px);
  max-height: min(calc(var(--app-height) - 24px), 900px);
  overflow: hidden;
}

.startscreen-discover-modal-card {
  position: relative;
  width: min(100%, 1180px);
  max-height: min(calc(var(--app-height) - 24px), 900px);
  display: grid;
  gap: 12px;
  overflow: auto;
  border: 1px solid rgba(142, 91, 255, 0.42);
  border-radius: 20px;
  background:
    radial-gradient(circle at 10% -6%, rgba(142, 91, 255, 0.22), transparent 30%),
    radial-gradient(circle at 108% 12%, rgba(95, 70, 217, 0.24), transparent 25%),
    rgba(22, 22, 22, 0.98);
  padding: 18px;
}

.startscreen-discover-modal-card::before {
  content: "";
  position: absolute;
  left: -64px;
  top: -64px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(142, 91, 255, 0.18), rgba(142, 91, 255, 0.01));
  pointer-events: none;
}

.startscreen-discover-head {
  margin-bottom: 0;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.startscreen-discover-head-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.startscreen-discover-head-copy h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
}

.startscreen-discover-intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.startscreen-discover-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  position: relative;
  z-index: 1;
}

.startscreen-discover-summary-card {
  border: 1px solid rgba(245, 246, 251, 0.12);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(36, 36, 36, 0.9);
  display: grid;
  gap: 4px;
}

.startscreen-discover-summary-chat {
  background: linear-gradient(140deg, rgba(122, 57, 255, 0.18), rgba(31, 33, 43, 0.92));
}

.startscreen-discover-summary-request {
  background: linear-gradient(140deg, rgba(255, 90, 110, 0.18), rgba(31, 33, 43, 0.92));
}

.startscreen-discover-summary-points {
  background: linear-gradient(140deg, rgba(95, 70, 217, 0.2), rgba(31, 33, 43, 0.92));
}

.startscreen-discover-summary-label {
  margin: 0;
  font-size: 0.78rem;
}

.startscreen-discover-summary-value {
  font-size: 0.98rem;
  line-height: 1.15;
}

.startscreen-discover-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  position: relative;
  z-index: 1;
}

.startscreen-discover-quick-actions .btn {
  margin: 0;
  min-height: 40px;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 700;
}

.startscreen-discover-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  position: relative;
  z-index: 1;
}

.startscreen-discover-panel {
  border: 1px solid rgba(245, 246, 251, 0.12);
  border-radius: 16px;
  background: rgba(36, 36, 36, 0.88);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.startscreen-discover-panel h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.startscreen-discover-ranking-section {
  min-height: 0;
  align-content: start;
}

.startscreen-discover-ranking-list {
  max-height: min(31dvh, 320px);
  overflow-y: auto;
  padding-right: 2px;
  display: grid;
  gap: 7px;
}

.startscreen-discover-ranking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(245, 246, 251, 0.08);
  background: rgba(22, 22, 22, 0.92);
}

.startscreen-discover-ranking-row.is-self {
  border-color: rgba(142, 91, 255, 0.56);
  background: rgba(95, 70, 217, 0.18);
}

.startscreen-discover-rank-badge {
  width: 30px;
  text-align: center;
  font-weight: 800;
  color: #d1b8ff;
  flex: 0 0 30px;
}

.startscreen-discover-ranking-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(142, 91, 255, 0.45);
  flex: 0 0 auto;
}

.startscreen-discover-ranking-text {
  min-width: 0;
  display: grid;
  gap: 2px;
  line-height: 1.2;
}

.startscreen-discover-ranking-text strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.97rem;
}

.startscreen-discover-ranking-text p {
  margin: 0;
  font-size: 0.84rem;
}

.startscreen-discover-request-list {
  max-height: min(31dvh, 320px);
  overflow-y: auto;
  display: grid;
  gap: 7px;
}

.startscreen-discover-request-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(245, 246, 251, 0.08);
  background: rgba(22, 22, 22, 0.92);
}

.startscreen-discover-request-text {
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.97rem;
}

.startscreen-discover-request-time {
  flex: 0 0 auto;
  font-weight: 700;
}

.startscreen-discover-pill {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.1;
  border: 1px solid rgba(142, 91, 255, 0.5);
}

.startscreen-discover-pill-request {
  color: #ffcad1;
  background: linear-gradient(135deg, rgba(255, 90, 110, 0.76), rgba(255, 90, 110, 0.6));
}

.startscreen-discover-pill-group {
  color: #d8c8ff;
  background: linear-gradient(135deg, rgba(122, 57, 255, 0.68), rgba(95, 70, 217, 0.62));
}

.startscreen-discover-activity-section {
  min-height: 220px;
  grid-column: 1 / -1;
}

.startscreen-discover-activity-list {
  max-height: min(34dvh, 340px);
  overflow-y: auto;
  display: grid;
  gap: 7px;
}

.startscreen-discover-activity-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(245, 246, 251, 0.08);
  background: rgba(22, 22, 22, 0.92);
}

.startscreen-discover-activity-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(122, 57, 255, 0.22);
}

.startscreen-discover-activity-body {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 6px;
}

.startscreen-discover-activity-text {
  min-width: 0;
  font-size: 0.93rem;
  line-height: 1.3;
}

.startscreen-discover-activity-time {
  flex: 0 0 auto;
  font-weight: 700;
  padding-top: 4px;
  white-space: nowrap;
  font-size: 0.82rem;
}

.startscreen-discover-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .startscreen-discover-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .startscreen-discover-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .startscreen-discover-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .startscreen-discover-activity-section {
    grid-column: auto;
  }
}

.friends-modal-list {
  display: grid;
  gap: 12px;
  align-content: start;
  padding-right: 4px;
}

.friends-self-header {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 14px;
  padding: 10px;
  background: #303030;
  box-shadow: 0 8px 18px rgba(28, 31, 42, 0.42);
}

.friends-self-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(174, 126, 255, 0.42);
  background: rgba(24, 27, 36, 0.82);
  flex: 0 0 auto;
}

.friends-self-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.friends-self-name {
  font-size: 1.02rem;
  line-height: 1.2;
}

.friends-self-points {
  margin: 0;
  color: #cfb9ff;
  font-size: 0.88rem;
  line-height: 1.2;
}

.friends-section {
  display: grid;
  gap: 8px;
  border: none;
  border-radius: 14px;
  background: #303030;
  padding: 10px;
}

.friends-section h4 {
  margin: 0;
  font-size: 0.9rem;
}

.friends-search-field {
  display: block;
}

.friends-search-field input {
  width: 100%;
}

.friend-row {
  display: grid;
  gap: 6px;
}

.friend-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.friend-row-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.friend-row-avatar-col {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 58px;
  flex: 0 0 58px;
}

.friend-row-avatar-col .member-avatar {
  width: 58px;
  height: 58px;
}

.friend-row.has-avatar-meta .friend-row-avatar-col {
  width: 98px;
  flex: 0 0 98px;
}

.friend-row.has-avatar-meta .friend-row-avatar-col .member-avatar {
  width: 84px;
  height: 84px;
}

.friend-row-avatar-meta {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.2;
  text-align: center;
}

.friend-row-main .member-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.2;
  margin-top: 2px;
}

.friend-row-avatar-clickable {
  cursor: zoom-in;
}

.friend-row-avatar-clickable:focus-visible {
  outline: 2px solid rgba(215, 198, 255, 0.75);
  outline-offset: 2px;
}

.friend-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.friend-row-actions-icon-only {
  flex-wrap: nowrap;
}

.friend-action-btn {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.friend-row-meta {
  margin: 0;
  font-size: 0.8rem;
}

.friend-row-subline {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.friend-row-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.friend-row-badge-image {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(174, 126, 255, 0.5);
  background: rgba(24, 27, 36, 0.82);
  flex: 0 0 auto;
}

.friend-row-divider {
  height: 1px;
  margin: 2px 15px 0;
  background: linear-gradient(
    90deg,
    rgba(142, 91, 255, 0),
    rgba(174, 126, 255, 0.58) 50%,
    rgba(142, 91, 255, 0)
  );
}

.friend-row-badge-name {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.2;
  color: #e7edf5;
  font-weight: 500;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .friend-row-has-icon-actions {
    position: relative;
    padding-bottom: 46px;
  }

  .friend-row-has-icon-actions .friend-row-top {
    justify-content: flex-start;
  }

  .friend-row-has-icon-actions .friend-row-actions-icon-only {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
}

.dialog-card {
  width: min(100%, 460px);
  padding: 16px;
  border-radius: 16px;
}

.dialog-message {
  margin: 4px 0 0;
  color: #aeb2c2;
  line-height: 1.35;
}

.dialog-message.dialog-message-white {
  color: #ffffff;
}

.dialog-actions {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.dialog-actions .btn {
  width: 100%;
}

.dialog-actions .btn.dialog-action-btn-with-badge {
  position: relative;
  display: block;
  text-align: center;
  overflow: visible;
  padding-right: 36px;
}

.dialog-actions .btn.dialog-action-btn-with-badge .dialog-action-label {
  display: block;
  width: 100%;
  text-align: center;
}

.dialog-actions .btn.dialog-action-btn-with-badge .chat-badge {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  flex: 0 0 auto;
}

.nav-target-modal-card {
  width: min(100%, 500px);
}

.nav-target-meta {
  margin-top: 2px;
  margin-bottom: 8px;
  line-height: 1.35;
}

.nav-target-actions {
  margin-top: 6px;
}

.memory-link-btn {
  border: none;
  background: transparent;
  color: #8e5bff;
  font-weight: 700;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.popup-memory-wrap {
  margin-top: 6px;
  border-top: 1px solid rgba(31, 33, 43, 0.12);
  padding-top: 6px;
}

.popup-memory-item {
  margin-bottom: 6px;
}

.popup-memory-meta {
  font-size: 0.72rem;
  color: #aeb2c2;
}

.popup-memory-text {
  font-size: 0.78rem;
  color: #aeb2c2;
  line-height: 1.25;
}

.popup-memory-more {
  border: none;
  background: transparent;
  color: #8e5bff;
  font-weight: 700;
  cursor: pointer;
  padding: 0 0 0 4px;
}

.popup-memory-actions {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popup-nav-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-start;
}

.popup-memory-add-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(122, 57, 255, 0.28);
  background: linear-gradient(135deg, rgba(122, 57, 255, 0.16), rgba(215, 198, 255, 0.3));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: #8e5bff;
  line-height: 1;
}

.popup-memory-add-btn:active {
  transform: scale(0.97);
}

.popup-memory-add-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.memory-image-picker {
  display: grid;
  gap: 8px;
}

#memoryImageInput {
  display: none;
}

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

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

.memory-entry-actions .btn {
  flex: 1;
  min-width: 140px;
}

.memory-image-preview {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(31, 33, 43, 0.18);
  background: #e7edf5;
}

.memory-list-item {
  padding: 12px;
}

.memory-item-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: stretch;
}

.memory-item-body {
  min-width: 0;
}

.memory-item-head {
  display: block;
}

.memory-item-date {
  margin: 2px 0 0;
}

.memory-item-text {
  margin: 6px 0 0;
  line-height: 1.32;
  word-break: break-word;
}

.memory-item-media {
  width: 92px;
  border: 1px solid rgba(31, 33, 43, 0.18);
  border-radius: 10px;
  background: #e7edf5;
  overflow: hidden;
}

.memory-item-media.is-clickable {
  padding: 0;
  cursor: pointer;
}

.memory-item-thumbnail {
  width: 100%;
  height: 100%;
  min-height: 86px;
  max-height: 120px;
  object-fit: cover;
  display: block;
}

.memory-item-thumbnail.is-fallback {
  object-fit: contain;
  background: #e7edf5;
}

.memory-item-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

#memoryImageModal {
  padding: max(6px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom));
}

.memory-image-modal-card {
  width: min(100%, calc(100vw - 12px));
  max-width: none;
  height: min(calc(var(--app-height) - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 100dvh);
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

#memoryImageModal .groups-head {
  margin-bottom: 0;
}

#avatarImageModal {
  padding: max(6px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom));
}

.avatar-image-modal-card {
  width: min(100%, calc(100vw - 12px));
  max-width: none;
  height: min(calc(var(--app-height) - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 100dvh);
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

#avatarImageModal .groups-head {
  margin-bottom: 0;
}

.avatar-image-stage {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(28, 31, 42, 0.9);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.avatar-image-large {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.chat-modal-card {
  width: min(100%, 920px);
}

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

.chat-entry-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  margin-left: 0;
  margin-right: 22px;
}

.chat-entry-item.is-own {
  margin-left: 22px;
  margin-right: 0;
}

.chat-entry-avatar {
  margin-top: 2px;
}

.chat-entry-main {
  min-width: 0;
  border-radius: 18px;
  background: #161616;
  border: 1px solid rgba(245, 246, 251, 0.14);
  padding: 10px;
}

.chat-entry-main.is-own {
  background: rgba(18, 134, 92, 0.32);
  border-color: rgba(92, 216, 166, 0.42);
}

.chat-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-item-head-text {
  min-width: 0;
}

.chat-item-head-text strong {
  font-size: 0.9rem;
}

.chat-item-head-text .muted {
  margin: 0;
  font-size: 0.74rem;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(245, 246, 251, 0.42);
  background: rgba(24, 27, 36, 0.92);
  flex: 0 0 auto;
}

.chat-item-text {
  margin: 8px 0 0;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-reply-preview {
  margin-top: 8px;
  border-left: 3px solid rgba(142, 91, 255, 0.72);
  background: rgba(36, 39, 52, 0.62);
  border-radius: 10px;
  padding: 7px 9px;
}

.chat-reply-preview-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-reply-preview-icon {
  color: #c7cad8;
  font-size: 0.78rem;
  line-height: 1;
}

.chat-reply-preview-name {
  display: block;
  font-size: 0.75rem;
  line-height: 1.2;
  color: #d8dbe7;
}

.chat-reply-preview-text {
  margin: 2px 0 0;
  font-size: 0.78rem;
  line-height: 1.25;
  color: #aeb2c2;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-reply-preview.is-clickable {
  cursor: pointer;
}

.chat-reply-preview.is-clickable:hover {
  background: rgba(52, 56, 74, 0.72);
}

.chat-reply-preview.is-clickable:focus-visible {
  outline: 2px solid rgba(142, 91, 255, 0.82);
  outline-offset: 1px;
}

.chat-reply-preview.is-missing {
  border-left-color: rgba(174, 178, 194, 0.7);
}

.chat-reaction-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-reaction-chip {
  border: 1px solid rgba(245, 246, 251, 0.38);
  border-radius: 999px;
  background: rgba(36, 39, 52, 0.84);
  color: #e7edf5;
  font-size: 0.8rem;
  line-height: 1.2;
  padding: 4px 9px;
  cursor: pointer;
}

.chat-reaction-chip.is-active {
  border-color: rgba(86, 198, 142, 0.72);
  background: rgba(86, 198, 142, 0.22);
}

.chat-reaction-chip:active {
  transform: scale(0.98);
}

.chat-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.chat-reply-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  border-left: 3px solid rgba(142, 91, 255, 0.72);
  border-radius: 10px;
  background: rgba(36, 39, 52, 0.7);
  padding: 7px 8px;
}

.chat-reply-composer-body {
  min-width: 0;
}

.chat-reply-composer-body strong {
  display: block;
  font-size: 0.78rem;
  line-height: 1.2;
}

.chat-reply-composer-body .muted {
  margin: 3px 0 0;
  font-size: 0.78rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-entry-item.is-reply-target-highlight .chat-entry-main {
  box-shadow: 0 0 0 2px rgba(142, 91, 255, 0.88);
}

@media (hover: none) and (pointer: coarse) {
  .chat-entry-item,
  .chat-entry-item *,
  .group-overview-item,
  .group-overview-item *,
  .chat-reply-preview,
  .chat-reply-preview * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

.memory-image-large {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(31, 33, 43, 0.18);
  background: #e7edf5;
}

#groupTaskImage {
  cursor: zoom-in;
}

.group-task-gallery {
  margin-top: 10px;
  display: grid;
  gap: 12px;
}

.group-task-list {
  margin-top: 8px;
  gap: 8px;
}

.group-task-add-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.group-task-add-form label {
  display: grid;
  gap: 6px;
}

.challenge-deluxe-place-task-item {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  border: none;
  background: #242426;
}

.challenge-deluxe-place-task-item.is-done {
  background: rgba(55, 54, 59, 0.9);
}

.challenge-deluxe-place-task-title {
  margin: 0;
  color: #ffffff;
  font-weight: 500;
  line-height: 1.35;
}

.challenge-deluxe-place-task-meta {
  margin: 0;
}

.challenge-deluxe-place-task-btn {
  justify-self: start;
}

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

.challenge-deluxe-place-task-joker-btn,
.challenge-deluxe-open-task-joker-btn {
  border-color: rgba(248, 199, 90, 0.5);
  color: #ffe5a8;
}

.challenge-deluxe-tasks-modal-card {
  max-width: 620px;
}

.group-memory-gallery-modal-card {
  width: min(100%, 960px);
  height: min(calc(var(--app-height) - 24px), 900px);
  max-width: 960px;
}

.group-memory-gallery-body {
  margin-top: 10px;
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
}

.challenge-deluxe-open-task-list {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.challenge-deluxe-open-task-item {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 9px;
  padding: 15px 15px 14px;
  border-radius: 20px;
  border: none;
  background: rgba(140, 90, 255, 0.5);
  box-shadow: none;
}

.challenge-deluxe-open-task-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.gem-shrine-modal-card {
  width: min(100%, 680px);
  max-height: min(calc(var(--app-height) - 24px), 820px);
  overflow-y: auto;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(45, 212, 191, 0.44);
  background:
    radial-gradient(circle at 18% 14%, rgba(20, 184, 166, 0.22), transparent 34%),
    radial-gradient(circle at 86% 86%, rgba(59, 130, 246, 0.2), transparent 42%),
    linear-gradient(156deg, rgba(9, 28, 42, 0.98), rgba(15, 23, 42, 0.98));
  box-shadow: 0 24px 48px rgba(3, 9, 19, 0.72);
}

#gemShrineModal {
  background: rgba(28, 31, 42, 0.62);
}

.gem-shrine-balance-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(248, 199, 90, 0.36);
  border-radius: 14px;
  padding: 12px;
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 245, 212, 0.24), rgba(255, 245, 212, 0) 56%),
    linear-gradient(140deg, rgba(74, 51, 16, 0.84), rgba(122, 85, 26, 0.8) 56%, rgba(192, 137, 42, 0.8));
}

.gem-shrine-balance-label {
  margin: 0;
}

.gem-shrine-balance-value {
  font-size: 1.25rem;
  line-height: 1.2;
  color: #ffe8b8;
}

.gem-shrine-next-reward-meta {
  margin: 0;
}

.gem-shrine-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.gem-shrine-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd25e, #ffe9a1);
  transition: width 0.24s ease;
}

.gem-shrine-usage-section,
.gem-shrine-earn-section {
  display: grid;
  gap: 10px;
}

.gem-shrine-usage-section h4,
.gem-shrine-earn-section h4 {
  margin: 0;
}

.gem-shrine-usage-item {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(245, 246, 251, 0.18);
  border-radius: 14px;
  padding: 10px;
  background: rgba(55, 54, 59, 0.66);
}

.gem-shrine-usage-copy {
  display: grid;
  gap: 4px;
}

.gem-shrine-usage-copy p {
  margin: 0;
}

.gem-shrine-usage-item .btn {
  justify-self: start;
}

.gem-shrine-earn-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.challenge-deluxe-open-task-item::before,
.challenge-deluxe-place-task-item::before {
  content: "";
  position: absolute;
  inset: -42% -28%;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.9) 0 1.5px, transparent 2.4px),
    radial-gradient(circle at 22% 40%, rgba(210, 240, 255, 0.88) 0 1.3px, transparent 2.1px),
    radial-gradient(circle at 31% 71%, rgba(255, 255, 255, 0.86) 0 1.4px, transparent 2.2px),
    radial-gradient(circle at 42% 27%, rgba(215, 244, 255, 0.9) 0 1.2px, transparent 2px),
    radial-gradient(circle at 48% 58%, rgba(255, 255, 255, 0.88) 0 1.3px, transparent 2px),
    radial-gradient(circle at 58% 15%, rgba(215, 242, 255, 0.86) 0 1.2px, transparent 2px),
    radial-gradient(circle at 63% 42%, rgba(255, 255, 255, 0.9) 0 1.5px, transparent 2.3px),
    radial-gradient(circle at 70% 64%, rgba(218, 245, 255, 0.86) 0 1.2px, transparent 2px),
    radial-gradient(circle at 77% 21%, rgba(255, 255, 255, 0.85) 0 1.4px, transparent 2.1px),
    radial-gradient(circle at 86% 37%, rgba(208, 238, 255, 0.84) 0 1.2px, transparent 2px),
    radial-gradient(circle at 91% 72%, rgba(255, 255, 255, 0.88) 0 1.4px, transparent 2.2px),
    radial-gradient(circle at 18% 82%, rgba(255, 255, 255, 0.82) 0 1.2px, transparent 2px),
    radial-gradient(circle at 27% 56%, rgba(202, 236, 255, 0.84) 0 1.15px, transparent 1.9px),
    radial-gradient(circle at 37% 9%, rgba(255, 255, 255, 0.84) 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 53% 82%, rgba(198, 234, 255, 0.82) 0 1.15px, transparent 1.9px),
    radial-gradient(circle at 67% 84%, rgba(255, 255, 255, 0.84) 0 1.2px, transparent 2px),
    radial-gradient(circle at 74% 49%, rgba(201, 235, 255, 0.82) 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 82% 8%, rgba(255, 255, 255, 0.8) 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 95% 24%, rgba(198, 234, 255, 0.8) 0 1.05px, transparent 1.8px);
  opacity: 0.82;
  animation:
    task-stars-drift 14s linear infinite,
    task-stars-flicker-a 6.8s linear infinite;
  animation-delay: -1.6s, -0.8s;
  z-index: 0;
}

.challenge-deluxe-open-task-item::after,
.challenge-deluxe-place-task-item::after {
  content: "";
  position: absolute;
  inset: -42% -28%;
  pointer-events: none;
  background:
    radial-gradient(circle at 9% 32%, rgba(255, 255, 255, 0.82) 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 16% 62%, rgba(196, 233, 255, 0.78) 0 1px, transparent 1.8px),
    radial-gradient(circle at 24% 12%, rgba(255, 255, 255, 0.76) 0 1px, transparent 1.8px),
    radial-gradient(circle at 35% 45%, rgba(199, 236, 255, 0.78) 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 46% 79%, rgba(255, 255, 255, 0.8) 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 57% 30%, rgba(202, 238, 255, 0.76) 0 1px, transparent 1.8px),
    radial-gradient(circle at 65% 53%, rgba(255, 255, 255, 0.8) 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 73% 12%, rgba(194, 231, 255, 0.76) 0 1px, transparent 1.8px),
    radial-gradient(circle at 81% 72%, rgba(255, 255, 255, 0.78) 0 1px, transparent 1.8px),
    radial-gradient(circle at 93% 48%, rgba(201, 236, 255, 0.78) 0 1.05px, transparent 1.85px);
  opacity: 0.58;
  animation:
    task-stars-drift-reverse 18.5s linear infinite,
    task-stars-flicker-b 5.2s linear infinite;
  animation-delay: -3.1s, -1.7s;
  z-index: 0;
}

.challenge-deluxe-open-task-item:nth-child(3n)::before,
.challenge-deluxe-place-task-item:nth-child(3n)::before {
  animation-delay: -5.4s, -2.9s;
}

.challenge-deluxe-open-task-item:nth-child(4n)::after,
.challenge-deluxe-place-task-item:nth-child(4n)::after {
  animation-delay: -7.2s, -0.9s;
}

.challenge-deluxe-place-task-item > *,
.challenge-deluxe-open-task-item > * {
  position: relative;
  z-index: 1;
}

@keyframes task-stars-drift {
  0% {
    transform: translate3d(-1%, -1.2%, 0);
  }
  50% {
    transform: translate3d(1.2%, 1%, 0);
  }
  100% {
    transform: translate3d(-1%, -1.2%, 0);
  }
}

@keyframes task-stars-drift-reverse {
  0% {
    transform: translate3d(1.2%, 1%, 0);
  }
  50% {
    transform: translate3d(-1%, -1.2%, 0);
  }
  100% {
    transform: translate3d(1.2%, 1%, 0);
  }
}

@keyframes task-stars-flicker-a {
  0% {
    opacity: 0.5;
  }
  8% {
    opacity: 0.82;
  }
  17% {
    opacity: 0.41;
  }
  26% {
    opacity: 0.9;
  }
  35% {
    opacity: 0.56;
  }
  47% {
    opacity: 0.86;
  }
  59% {
    opacity: 0.45;
  }
  72% {
    opacity: 0.92;
  }
  84% {
    opacity: 0.54;
  }
  100% {
    opacity: 0.5;
  }
}

@keyframes task-stars-flicker-b {
  0% {
    opacity: 0.34;
  }
  12% {
    opacity: 0.7;
  }
  21% {
    opacity: 0.28;
  }
  34% {
    opacity: 0.76;
  }
  46% {
    opacity: 0.36;
  }
  58% {
    opacity: 0.8;
  }
  69% {
    opacity: 0.3;
  }
  83% {
    opacity: 0.74;
  }
  93% {
    opacity: 0.4;
  }
  100% {
    opacity: 0.34;
  }
}

.challenge-deluxe-open-task-title {
  margin: 0;
  color: #ffffff;
  line-height: 1.35;
  font-weight: 500;
}

.challenge-deluxe-open-task-place {
  margin: 0;
  color: #c2c6d4;
  line-height: 1.3;
}

.challenge-deluxe-open-task-btn {
  justify-self: start;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  border: none;
  background: rgba(122, 57, 255, 0.24);
  color: #f2edff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.challenge-deluxe-open-task-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.challenge-deluxe-open-task-btn:hover,
.challenge-deluxe-open-task-btn:focus-visible {
  background: rgba(122, 57, 255, 0.42);
  color: #ffffff;
}

.group-task-carousel {
  display: grid;
  gap: 10px;
}

.group-memory-carousel-place-title {
  margin: 0;
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  line-height: 1.2;
  font-weight: 800;
  color: #f2edff;
}

.group-task-carousel-image-wrap {
  border-radius: 12px;
  overflow: hidden;
}

.group-task-carousel-image {
  cursor: pointer;
}

.group-task-carousel-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-task-carousel-meta .muted {
  margin: 0;
}

.group-task-carousel-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(106, 111, 131, 0.46);
  background: rgba(245, 246, 251, 0.96);
}

.group-task-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.group-task-carousel-index {
  font-size: 0.9rem;
  color: var(--muted);
  min-width: 62px;
  text-align: center;
}

#groupTaskTitle {
  font-weight: 400;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#groupTaskDescription {
  color: #e7edf5;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(106, 111, 131, 0.34);
  background: linear-gradient(
    146deg,
    rgba(62, 34, 113, 0.86) 0%,
    rgba(122, 57, 255, 0.52) 55%,
    rgba(142, 91, 255, 0.44) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(236, 242, 255, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

#groupTaskModal:not(.hidden) #groupTaskTitle {
  animation:
    group-task-title-pop 0.42s ease-out,
    group-task-title-float 1.45s ease-in-out 0.42s 3;
}

#groupTaskModal:not(.hidden) #groupTaskTitle::after {
  content: "✦";
  color: #8ee9bb;
  font-size: 0.84em;
  filter: drop-shadow(0 0 6px rgba(137, 246, 209, 0.45));
  animation: group-task-sparkle 0.9s ease-in-out 0.2s 4;
}

.import-table-wrap {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow: hidden;
  background: #161616;
}

.import-table {
  width: 100%;
  border-collapse: collapse;
}

.import-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(245, 250, 255, 0.98);
  border-bottom: 1px solid var(--stroke);
  padding: 8px 10px;
}

.import-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(31, 33, 43, 0.09);
  font-size: 0.84rem;
  vertical-align: middle;
}

.import-table tbody tr:last-child td {
  border-bottom: none;
}

.import-select-col {
  width: 70px;
}

.address-line {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.stats-grid {
  margin: 10px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-box {
  text-align: center;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.92);
  padding: 10px;
}

.stat-box span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
}

.stat-box strong {
  font-size: 1.3rem;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 8px;
  width: min(calc(100% - 16px), 860px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
  background: #161616;
  border: none;
  border-radius: 14px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  backdrop-filter: none;
  z-index: 1000;
}

.nav-btn {
  border: none;
  border-radius: 18px;
  background: transparent;
  color: #9096a8;
  width: 100%;
  height: 62px;
  min-width: 0;
  padding: 6px 4px;
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.nav-btn.nav-with-badge {
  overflow: visible;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.nav-label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.01em;
  line-height: 1;
}

.nav-btn.is-active {
  border-color: transparent;
  color: #ffffff;
  background: transparent;
}

.nav-btn:disabled,
.nav-btn.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.quick-add-nav-btn {
  width: min(46px, 100%);
  height: 46px;
  margin: 0 auto;
  border: none;
  border-radius: 999px;
  background: #7729ff;
  color: #ffffff;
  font-size: 1.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(122, 57, 255, 0.36);
  cursor: pointer;
}

.quick-add-nav-btn:active {
  transform: scale(0.96);
}

.app-msg {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--bottom-nav-height) + 6px);
  width: min(100%, 860px);
  margin: 0;
  padding: 0 12px;
  min-height: 1rem;
  font-size: 0.87rem;
  color: var(--muted);
  text-align: center;
  z-index: 990;
  pointer-events: none;
}

#captureModal .modal-card,
#groupDetailCaptureModal .modal-card {
  padding: 12px;
}

#captureModal #visitForm,
#groupDetailCaptureForm {
  gap: 8px;
}

#captureModal label,
#groupDetailCaptureForm label {
  gap: 4px;
  font-size: 0.8rem;
}

#captureModal input,
#captureModal textarea,
#captureModal select,
#groupDetailCaptureForm input,
#groupDetailCaptureForm textarea,
#groupDetailCaptureForm select {
  padding: 8px 10px;
  font-size: max(16px, 0.92rem);
  line-height: 1.2;
}

body.platform-ios #captureModal input,
body.platform-ios #captureModal textarea,
body.platform-ios #captureModal select,
body.platform-ios #groupDetailCaptureForm input,
body.platform-ios #groupDetailCaptureForm textarea,
body.platform-ios #groupDetailCaptureForm select,
body.platform-android #captureModal input,
body.platform-android #captureModal textarea,
body.platform-android #captureModal select,
body.platform-android #groupDetailCaptureForm input,
body.platform-android #groupDetailCaptureForm textarea,
body.platform-android #groupDetailCaptureForm select {
  font-size: 16px !important;
}

#noteInput,
#gdNoteInput {
  min-height: 60px;
}

#captureModal .visit-scope,
#groupDetailCaptureForm .visit-scope {
  padding: 6px;
  gap: 4px;
}

body.map-fullscreen-active .map-group-bar,
body.map-fullscreen-active .bottom-nav,
body.map-fullscreen-active .app-msg {
  display: none;
}

body.keyboard-open .bottom-nav,
body.keyboard-open .app-msg {
  opacity: 0;
  pointer-events: none;
}

body.keyboard-open .content {
  padding-bottom: 15px;
}

.hidden {
  display: none !important;
}

@keyframes geo-spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

@keyframes quick-ai-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes group-task-title-pop {
  0% {
    transform: translateY(8px) scale(0.94);
    opacity: 0.15;
  }
  65% {
    transform: translateY(-2px) scale(1.03);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes group-task-title-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes group-task-sparkle {
  0%,
  100% {
    transform: scale(0.9) rotate(0deg);
    opacity: 0.45;
  }
  40% {
    transform: scale(1.14) rotate(12deg);
    opacity: 1;
  }
  70% {
    transform: scale(0.96) rotate(-10deg);
    opacity: 0.72;
  }
}

@media (min-width: 920px) {
  .auth-screen,
  .mobile-app {
    padding: 20px;
  }

  .mobile-app {
    --app-side-padding: 20px;
    --app-top-padding: 20px;
  }

  .auth-screen {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }

  #map {
    min-height: 56dvh;
  }

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

@media (max-width: 430px) {
  .auth-screen,
  .mobile-app {
    padding: calc(var(--app-safe-top) + 15px) 8px calc(8px + var(--app-safe-bottom));
  }

  .mobile-app {
    --app-side-padding: 8px;
    --app-top-padding: calc(var(--app-safe-top) + 15px);
  }

  .card,
  .auth-card,
  .auth-hero {
    padding: 10px;
    border-radius: 14px;
  }

  .content {
    padding-bottom: calc(var(--bottom-nav-height) + 10px);
  }

  .form {
    gap: 7px;
  }

  label {
    gap: 4px;
    font-size: 0.78rem;
  }

  input,
  textarea,
  select {
    padding: 8px 9px;
    font-size: 0.9rem;
  }

  .split {
    gap: 6px;
  }

  .map-mode-segmented .mode-btn {
    min-height: 40px;
    padding: 8px 6px;
    font-size: 0.94rem;
  }

  .map-filter-toggle {
    width: 32px;
    height: 32px;
    font-size: 0.86rem;
  }

  #dateFilterPanel .date-range-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    width: 100%;
    margin-inline: 0;
    justify-items: stretch;
  }

  #dateFilterPanel .date-range-row input[type="date"] {
    height: 32px;
    padding: 4px 5px;
    font-size: 16px;
    line-height: 1.1;
  }

  #dateFilterPanel .date-range-row > label {
    font-size: 0.68rem;
  }

  .groups-head {
    gap: 8px;
    margin-bottom: 8px;
  }

  .group-head {
    align-items: flex-start;
  }

  .group-tools,
  .groups-head-actions,
  .group-place-actions-left,
  .group-place-actions-right {
    gap: 6px;
    flex-wrap: wrap;
  }

  .group-place-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .map-group-bar {
    padding: 8px;
  }

  .bottom-nav {
    gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }

  .nav-btn {
    height: 58px;
    padding: 5px 3px;
    gap: 3px;
  }

  .nav-icon {
    width: 20px;
    height: 20px;
  }

  .nav-label {
    font-size: 0.58rem;
  }

  .quick-add-nav-btn {
    width: min(41px, 100%);
    height: 41px;
    font-size: 1.62rem;
  }
}

@supports (-webkit-touch-callout: none) {
  input,
  textarea,
  select {
    font-size: 16px;
  }

  #dateFilterPanel .date-range-row {
    gap: 5px;
  }

  #dateFilterPanel .date-range-row input[type="date"] {
    height: 32px;
    padding: 4px 5px;
    font-size: 16px;
  }
}

@media (max-width: 430px) and (-webkit-min-device-pixel-ratio: 2) {
  #dateFilterPanel .date-range-row input[type="date"] {
    width: -webkit-fill-available !important;
    max-width: -webkit-fill-available !important;
  }
}

@media (max-height: 760px) {
  #captureModal .modal-card,
  #groupDetailCaptureModal .modal-card {
    padding: 10px;
  }

  #captureModal #visitForm,
  #groupDetailCaptureForm {
    gap: 7px;
  }

  #captureModal label,
  #groupDetailCaptureForm label {
    font-size: 0.76rem;
  }

  #captureModal input,
  #captureModal textarea,
  #captureModal select,
  #groupDetailCaptureForm input,
  #groupDetailCaptureForm textarea,
  #groupDetailCaptureForm select {
    padding: 7px 9px;
    font-size: max(16px, 0.88rem);
  }

  #noteInput,
  #gdNoteInput {
    min-height: 52px;
  }
}

/* Dark Palette Harmonization */
input::placeholder,
textarea::placeholder {
  color: #aeb2c2;
  opacity: 1;
}

select option {
  background: #202020;
  color: var(--ink);
}

select option[value=""] {
  color: #aeb2c2;
}

.auth-hero,
.auth-card,
.card,
.modal-card,
.list-item,
.group-plus-btn,
.group-icon-btn,
.visit-edit-icon-btn,
.tab-btn {
  color: var(--ink);
}

.visit-edit-icon-btn {
  border-color: rgba(245, 246, 251, 0.1);
  background: rgba(32, 35, 47, 0.94);
}

.member-list-item {
  background: #161616;
  border-color: var(--stroke);
}

.memory-list-item {
  background: #303030;
  border-color: var(--stroke);
}

.chat-entry-item {
  background: transparent;
  border-color: transparent;
}

.chat-entry-item .chat-entry-main {
  background: #161616;
  border-color: var(--stroke);
}

.impulse-template-item {
  background: rgba(31, 33, 43, 0.9);
  border-color: var(--stroke);
}

/* Buttons: always normal weight */
button,
.btn,
.tab-btn,
.mode-btn,
.nav-btn,
.auth-link-btn {
  font-weight: 400 !important;
}

.import-table,
.import-table thead,
.import-table tbody,
.import-table tbody tr,
.import-table thead th,
.import-table tbody td {
  background: #161616;
  color: var(--ink);
  border-color: var(--stroke);
}

.template-status-toast.is-draft {
  background: rgba(50, 221, 135, 0.15);
  color: #8ee9bb;
  border-color: rgba(50, 221, 135, 0.45);
}

.template-status-toast.is-validation {
  background: rgba(174, 126, 255, 0.2);
  color: #f5f6fb;
  border-color: rgba(174, 126, 255, 0.46);
}

.template-status-toast.is-published {
  background: rgba(142, 91, 255, 0.2);
  color: #f5f6fb;
  border-color: rgba(142, 91, 255, 0.44);
}

.template-status-toast.is-archived {
  background: rgba(122, 57, 255, 0.2);
  color: #f5f6fb;
  border-color: rgba(122, 57, 255, 0.42);
}

/* Popup windows */
.modal-card,
[class*="modal-card"],
.dialog-card,
.challenge-win-popup-card,
.level-up-popup-card,
.llm-loading-dialog {
  background: #242424 !important;
}

/* Dialog buttons */
.modal .btn,
.modal .tab-btn,
.modal .mode-btn,
.modal .auth-link-btn,
.modal .group-icon-btn,
.modal .group-plus-btn,
.modal .group-detail-code-btn,
.modal .badge-picker-trigger {
  background: #37363b;
  border: none;
}

.modal .btn,
.modal .tab-btn,
.modal .mode-btn,
.modal .auth-link-btn,
.modal .group-detail-code-btn,
.modal .badge-picker-trigger {
  border-radius: 14px;
}

.modal .group-icon-btn,
.modal .group-plus-btn {
  border-radius: 999px;
}

/* Group detail place overview + account view buttons */
#viewGroupDetail .btn,
#viewGroupDetail .tab-btn,
#viewGroupDetail .mode-btn,
#viewGroupDetail .auth-link-btn,
#viewGroupDetail .group-icon-btn,
#viewGroupDetail .group-plus-btn,
#viewGroupDetail .visit-edit-icon-btn,
#viewGroupDetail .group-detail-code-btn,
#viewAccount .btn,
#viewAccount .tab-btn,
#viewAccount .mode-btn,
#viewAccount .auth-link-btn,
#viewAccount .group-icon-btn,
#viewAccount .group-plus-btn,
#viewAccount .group-detail-code-btn,
#viewStreak .btn,
#viewStreak .group-icon-btn {
  background: #37363b;
  border: none;
}

#viewGroupDetail .btn,
#viewGroupDetail .tab-btn,
#viewGroupDetail .mode-btn,
#viewGroupDetail .auth-link-btn,
#viewGroupDetail .group-detail-code-btn,
#viewAccount .btn,
#viewAccount .tab-btn,
#viewAccount .mode-btn,
#viewAccount .auth-link-btn,
#viewAccount .group-detail-code-btn,
#viewStreak .btn {
  border-radius: 14px;
}

#viewGroupDetail .group-icon-btn,
#viewGroupDetail .group-plus-btn,
#viewGroupDetail .visit-edit-icon-btn,
#viewAccount .group-icon-btn,
#viewAccount .group-plus-btn,
#viewStreak .group-icon-btn {
  border-radius: 999px;
}

/* Group overview header buttons */
#viewGroups .group-filter-card .btn,
#viewGroups .group-filter-card .group-icon-btn,
#viewGroups .group-filter-card .group-plus-btn,
#viewGroups .group-filter-card .group-visibility-toggle-btn {
  background: #37363b;
  border: none;
}

/* Template "Neu" button aligned with other + buttons */
#viewTemplateGroups .template-filter-card #createTemplateGroupBtn {
  background: #37363b;
  border: none;
  border-radius: 999px;
}

#viewTemplateGroups .template-filter-card .template-filter-toggle-btn.is-active {
  background: linear-gradient(130deg, #5f46d9, #8e5bff);
  color: #ffffff;
}

#viewGroups .group-filter-card .btn,
#viewGroups .group-filter-card .group-visibility-toggle-btn {
  border-radius: 14px;
}

#viewGroups .group-filter-card .group-visibility-toggle-btn.is-active {
  background: #7729ff;
  color: #ffffff;
}

#viewGroups .group-filter-card .group-icon-btn,
#viewGroups .group-filter-card .group-plus-btn {
  border-radius: 999px;
}

#viewGroups .group-filter-card .group-streak-open-btn {
  border: 1px solid rgba(142, 91, 255, 0.48);
  background:
    radial-gradient(circle at 28% 18%, rgba(207, 185, 255, 0.45), rgba(207, 185, 255, 0) 56%),
    linear-gradient(140deg, #2d1a57, #5f46d9 56%, #8e5bff);
  box-shadow: 0 0 0 1px rgba(142, 91, 255, 0.16), 0 10px 20px rgba(0, 0, 0, 0.22);
  color: #ece0ff;
}

#viewGroups .group-filter-card .group-streak-open-btn svg {
  width: 17px;
  height: 17px;
}

#viewGroups .group-filter-card .group-gem-indicator {
  border: 1px solid rgba(248, 199, 90, 0.44);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 245, 212, 0.42), rgba(255, 245, 212, 0) 55%),
    linear-gradient(140deg, #4a3310, #7a551a 56%, #c0892a);
  box-shadow: 0 0 0 1px rgba(248, 199, 90, 0.14), 0 10px 20px rgba(0, 0, 0, 0.22);
  color: #ffe5a8;
}

/* Template group detail action buttons aligned with global round button style */
#viewTemplateGroupDetail .group-icon-btn,
#viewTemplateGroupDetail .group-plus-btn {
  background: #37363b;
  border: none;
  border-radius: 999px;
}

/* Template Group View Theme Alignment */
#viewTemplateGroups .list-item.group-item:not(.is-challenge-started),
#viewTemplateGroups .list-item.group-item.is-challenge-complete,
#viewTemplateGroups .list-item.group-item.is-challenge-pro:not(.is-challenge-started) {
  border: none !important;
  border-width: 0 !important;
  border-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  animation: none !important;
  background: rgba(31, 33, 43, 0.9);
}

#viewTemplateGroups .list-item.group-item:not(.is-challenge-started):not(.has-cover-image),
#viewTemplateGroups .list-item.group-item.is-challenge-complete:not(.has-cover-image),
#viewTemplateGroups .list-item.group-item.is-challenge-pro:not(.is-challenge-started):not(.has-cover-image) {
  background: #2a1c4a !important;
}

#viewTemplateGroups .template-filter-card,
#viewTemplateGroups .template-list-card,
#viewTemplateGroups #templateGroupList,
#viewTemplateGroups #templateGroupList > .list-item,
#viewImpulse #impulseTemplateList > .list-item,
#viewImpulse .impulse-template-card,
#viewTemplateGroups .template-status-toast,
#viewTemplateGroups .template-season-badge-thumb,
#viewTemplateGroups .template-badge-row .template-season-badge-thumb {
  border: none !important;
  border-width: 0 !important;
  border-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

#viewTemplateGroups .list-item.group-item::before,
#viewTemplateGroups .list-item.group-item::after {
  border: none !important;
  box-shadow: none !important;
}

#viewTemplateGroupDetail .group-detail-head-card {
  border-color: var(--stroke);
  background: #242424;
  margin-top: 0;
  border-radius: 25px;
}

#viewTemplateGroupDetail .group-detail-places-card {
  border-color: var(--stroke);
  background: #242424;
}

#viewTemplateGroupDetail .template-status-panel,
#viewTemplateGroupDetail .template-images-block {
  border-color: var(--stroke);
  background: #303030;
  background-image: none;
  box-shadow: none;
}

#viewTemplateGroupDetail .template-status-line .muted,
#viewTemplateGroupDetail #templateGroupPublishingDate {
  color: var(--muted);
}

#viewTemplateGroupDetail .template-image-item {
  border-color: var(--stroke);
  background: rgba(31, 33, 43, 0.92);
}

#viewTemplateGroupDetail .template-image-thumb {
  background: rgba(24, 27, 36, 0.94);
}

#viewTemplateGroupDetail .template-image-remove {
  border-top-color: rgba(245, 246, 251, 0.12);
  background: rgba(255, 90, 110, 0.14);
  color: #ffd6dc;
}

#viewTemplateGroupDetail .template-image-remove:active {
  background: rgba(255, 90, 110, 0.24);
}

/* No shadows in group and template overviews */
#viewGroups .group-item:not(.is-challenge-started),
#viewGroups .group-item.is-pending-invite,
#viewGroups .group-overview-item:not(.is-challenge-started),
#viewGroups .group-overview-item.is-pending-invite,
#viewGroups .group-overview-item.is-challenge-complete,
#viewGroups .group-overview-item.is-challenge-pro:not(.is-challenge-started):not(.is-challenge-complete),
#viewGroups .group-overview-play-btn,
#viewTemplateGroups .group-item:not(.is-challenge-started),
#viewTemplateGroups .group-item.is-challenge-complete,
#viewTemplateGroups .group-item.is-challenge-pro:not(.is-challenge-started),
#viewImpulse .group-item:not(.is-challenge-started),
#viewImpulse .group-item.is-challenge-complete,
#viewImpulse .group-item.is-challenge-pro:not(.is-challenge-started),
#viewImpulse .impulse-template-card,
#viewImpulse .impulse-template-card:hover,
#viewImpulse .impulse-template-card-badge {
  box-shadow: none !important;
}

#viewGroups .group-item.is-challenge-started,
#viewGroups .group-overview-item.is-challenge-started,
#viewTemplateGroups .group-item.is-challenge-started,
#viewImpulse .group-item.is-challenge-started {
  --active-group-color: #bae8ff;
  --active-group-color-rgb: 186, 232, 255;
  --user-color-rgb: var(--active-group-color-rgb);
  border-width: 3px;
  border-color: rgba(var(--user-color-rgb), 1) !important;
  box-shadow:
    0 0 0 0 rgba(var(--user-color-rgb), 0.58),
    0 0 16px rgba(var(--user-color-rgb), 0.3);
  animation: avatarPulse 2.2s ease-in-out infinite !important;
}

#viewGroups .group-item.is-challenge-started.is-challenge-pro,
#viewGroups .group-item.is-challenge-started.is-challenge-deluxe,
#viewGroups .group-overview-item.is-challenge-started.is-challenge-pro,
#viewGroups .group-overview-item.is-challenge-started.is-challenge-deluxe,
#viewTemplateGroups .group-item.is-challenge-started.is-challenge-pro,
#viewTemplateGroups .group-item.is-challenge-started.is-challenge-deluxe,
#viewImpulse .group-item.is-challenge-started.is-challenge-pro,
#viewImpulse .group-item.is-challenge-started.is-challenge-deluxe {
  --user-color-rgb: var(--active-group-color-rgb);
  border-color: rgba(var(--user-color-rgb), 1) !important;
  box-shadow:
    0 0 0 0 rgba(var(--user-color-rgb), 0.58),
    0 0 16px rgba(var(--user-color-rgb), 0.3);
  animation: avatarPulse 2.2s ease-in-out infinite !important;
}

#viewGroups .group-item.has-cover-image > .group-head .group-title,
#viewTemplateGroups .group-item.has-cover-image > .group-head .group-title,
#viewImpulse .group-item.has-cover-image > .group-head .group-title,
#viewImpulse .impulse-template-card-title {
  text-shadow: none !important;
}

/* Uniform input borders */
input,
textarea,
select {
  border-color: #303030 !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: transparent !important;
}

/* Impulse detail modal: visible separation + exact modal backdrop */
#impulseTemplateModal {
  background: rgba(22, 22, 22, 0.9) !important;
}

#impulseTemplateModal .impulse-template-modal-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

#impulseTemplateModal .impulse-template-actions-card {
  margin-bottom: 20px !important;
  border: 1px solid var(--stroke) !important;
}

#impulseTemplateModal .impulse-template-content-card {
  background: #242424 !important;
  border: 1px solid var(--stroke) !important;
  border-radius: 25px !important;
}

/* Frosted glass effect (WhatsApp-like) */
.card.impulse-filter-card.group-filter-card {
  background: rgba(30, 30, 30, 0.6) !important;
  border: 1px solid rgba(245, 246, 251, 0.13) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24) !important;
  backdrop-filter: blur(16px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(135%) !important;
}

.bottom-nav {
  background: rgba(30, 30, 30, 0.6) !important;
  border: 1px solid rgba(245, 246, 251, 0.13) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(18px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
}

.impulse-filter-card,
#viewTemplateGroups .card.impulse-filter-card.template-filter-card,
#viewTemplateGroups .template-filter-card,
.map-group-bar {
  background: rgba(30, 30, 30, 0.6) !important;
  border: 1px solid rgba(245, 246, 251, 0.13) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24) !important;
  backdrop-filter: blur(16px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(135%) !important;
}

/* Full-width bottom nav + full-bleed sticky group filter */
.mobile-app {
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.content {
  padding-top: 0 !important;
  padding-left: var(--app-side-padding, 12px);
  padding-right: var(--app-side-padding, 12px);
}

.card.impulse-filter-card {
  width: calc(100% + (var(--app-side-padding, 12px) * 2)) !important;
  min-width: calc(100% + (var(--app-side-padding, 12px) * 2)) !important;
  max-width: none !important;
  margin-left: calc(-1 * var(--app-side-padding, 12px)) !important;
  margin-right: calc(-1 * var(--app-side-padding, 12px)) !important;
  background: rgb(50 50 50 / 50%) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
}

.card.impulse-filter-card.template-filter-card {
  width: calc(100% + (var(--app-side-padding, 12px) * 2)) !important;
  min-width: calc(100% + (var(--app-side-padding, 12px) * 2)) !important;
  max-width: none !important;
  margin-left: calc(-1 * var(--app-side-padding, 12px)) !important;
  margin-right: calc(-1 * var(--app-side-padding, 12px)) !important;
  background: rgb(50 50 50 / 50%) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
}

.map-group-bar {
  top: calc(var(--app-safe-top)) !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: none !important;
  background: rgb(50 50 50 / 50%) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding-left: calc(12px + env(safe-area-inset-left)) !important;
  padding-right: calc(12px + env(safe-area-inset-right)) !important;
}

.bottom-nav {
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  transform: none !important;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: none !important;
  background: rgb(50 50 50 / 50%) !important;
  border: none !important;
  border-radius: 0 !important;
  padding:
    8px calc(10px + env(safe-area-inset-right))
    calc(8px + env(safe-area-inset-bottom))
    calc(10px + env(safe-area-inset-left)) !important;
}

#viewGroups .card.impulse-filter-card.group-filter-card {
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 45;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: none !important;
  margin: 0 !important;
  background: rgb(50 50 50 / 50%) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  padding:
    calc(10px + var(--app-safe-top))
    calc(12px + env(safe-area-inset-right))
    10px
    calc(12px + env(safe-area-inset-left)) !important;
}

#viewImpulse .card.impulse-filter-card {
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 45;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: none !important;
  margin: 0 !important;
  background: rgb(50 50 50 / 50%) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  padding:
    calc(10px + var(--app-safe-top))
    calc(12px + env(safe-area-inset-right))
    10px
    calc(12px + env(safe-area-inset-left)) !important;
}

#viewMap .card.impulse-filter-card.map-filter-card {
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 45;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: none !important;
  margin: 0 !important;
  transform: none !important;
  background: rgb(50 50 50 / 50%) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  padding:
    calc(10px + var(--app-safe-top))
    calc(12px + env(safe-area-inset-right))
    10px
    calc(12px + env(safe-area-inset-left)) !important;
}

#viewAccount .card.impulse-filter-card.account-filter-card {
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 45;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: none !important;
  margin: 0 !important;
  background: rgb(50 50 50 / 50%) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  padding:
    calc(15px + var(--app-safe-top))
    calc(12px + env(safe-area-inset-right))
    10px
    calc(12px + env(safe-area-inset-left)) !important;
}

.card.group-detail-actions-card,
.card.group-detail-actions-card.impulse-template-actions-card {
  position: sticky;
  top: calc(var(--app-safe-top) + 15px) !important;
  z-index: 45;
  width: calc(100% + (var(--app-side-padding, 12px) * 2)) !important;
  min-width: calc(100% + (var(--app-side-padding, 12px) * 2)) !important;
  max-width: none !important;
  margin-top: 0 !important;
  margin-left: calc(-1 * var(--app-side-padding, 12px)) !important;
  margin-right: calc(-1 * var(--app-side-padding, 12px)) !important;
  background: rgb(50 50 50 / 50%) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  padding:
    10px
    calc(12px + env(safe-area-inset-right))
    10px
    calc(12px + env(safe-area-inset-left)) !important;
}

#viewGroupDetail .card.impulse-filter-card.group-detail-filter-card,
#viewTemplateGroupDetail .card.impulse-filter-card.template-detail-filter-card {
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 45;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: none !important;
  margin: 0 !important;
  background: rgb(50 50 50 / 50%) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  padding:
    calc(10px + var(--app-safe-top))
    calc(12px + env(safe-area-inset-right))
    10px
    calc(12px + env(safe-area-inset-left)) !important;
}

@media (min-width: 920px) {
  .card.impulse-filter-card.group-filter-card {
    margin-top: calc(-1 * var(--app-top-padding, 20px) - 1px) !important;
    padding-top: calc(10px + var(--app-safe-top)) !important;
  }

  .card.group-detail-actions-card,
  .card.group-detail-actions-card.impulse-template-actions-card {
    margin-top: 0 !important;
    padding-top: 10px !important;
  }
}

/* Place edit modals */
#captureModal {
  background: rgb(22 22 22 / 90%) !important;
}

#groupDetailCaptureModal {
  background: rgba(22, 22, 22, 0.9) !important;
}

#memoryEntryModal,
#memoryListModal,
#memoryTextModal,
#memoryImageModal {
  background: rgb(22 22 22 / 90%) !important;
}

#importPlacesModal {
  background: rgb(22 22 22 / 90%) !important;
  padding: max(16px, var(--app-safe-top)) 16px max(16px, var(--app-safe-bottom)) !important;
}

#importPlacesModal .modal-card {
  width: min(100%, 720px) !important;
  height: auto !important;
  max-height: min(calc(var(--app-height) - 48px), 760px) !important;
  margin: 0 auto !important;
  display: flex;
  flex-direction: column;
}

#importPlacesModal #importPlacesList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

#captureModal .groups-head,
#groupDetailCaptureModal .groups-head {
  justify-content: flex-end !important;
}

#captureCloseBtn,
#groupDetailCaptureCloseBtn {
  margin-left: auto !important;
}

.place-search-panel {
  background: #303030 !important;
  border: none !important;
}

.place-suggest-list {
  background: #303030 !important;
  border: 1px solid #404040 !important;
}

#impulseTemplateModal .card.impulse-filter-card.impulse-template-filter-card {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: none !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: rgb(50 50 50 / 50%) !important;
  z-index: 3405 !important;
  padding:
    calc(10px + var(--app-safe-top))
    calc(12px + env(safe-area-inset-right))
    10px
    calc(12px + env(safe-area-inset-left)) !important;
}

#impulseTemplateModal {
  padding-top: 0 !important;
}

/* Bottom nav: icons + labels 20% larger */
.bottom-nav .nav-icon {
  width: 26.4px !important;
  height: 26.4px !important;
}

.bottom-nav .nav-label {
  font-size: 0.744rem !important;
}

.bottom-nav .quick-add-nav-btn {
  font-size: 2.34rem !important;
}

@media (max-width: 430px) {
  .bottom-nav .nav-icon {
    width: 24px !important;
    height: 24px !important;
  }

  .bottom-nav .nav-label {
    font-size: 0.696rem !important;
  }

  .bottom-nav .quick-add-nav-btn {
    font-size: 1.944rem !important;
  }
}
