:root {
  color-scheme: dark;
  --bg: #020203;
  --bg-soft: #0a0a10;
  --panel: rgba(14, 14, 22, 0.28);
  --panel-solid: #0e0e16;
  --panel-soft: rgba(16, 16, 28, 0.24);
  --panel-soft-2: rgba(20, 20, 36, 0.18);
  --accent: #b03ed0;
  --accent-soft: color-mix(in srgb, var(--accent) 20%, transparent);
  --accent-soft-2: color-mix(in srgb, var(--accent) 12%, transparent);
  --text: #f0f0f5;
  --muted: #8a8a9a;
  --muted-soft: rgba(138, 138, 154, 0.7);
  --divider: rgba(255, 255, 255, 0.08);
  --field-bg: rgba(255, 255, 255, 0.04);
  --field-border: rgba(255, 255, 255, 0.10);
  --danger: #cf6f80;
  --star: #d9d9d9;
  --radius: 14px;
  --field-radius: 10px;
  --glass-blur: blur(40px) saturate(1.8);
  --glass-border: 1px solid rgba(255, 255, 255, 0.10);
  --glass-shine: inset 0 1px 0 rgba(200, 99, 99, 0.08), inset 0 0 20px rgba(255, 255, 255, 0.01);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --glow: 0 0 18px color-mix(in srgb, var(--accent) 22%, transparent);
  --glass-bg-1: rgba(176, 62, 208, 0.07);
  --glass-bg-2: rgba(62, 95, 208, 0.06);
  --glass-bg-3: rgba(119, 78, 208, 0.04);
  --toolbar-size: 60px;
  --toolbar-top: 16px;
  --toolbar-right: 16px;
  --drawer-width: 290px;
  --sidebar-width: 220px;
  --days-pill-x: 50%;
  --font: "SF Pro Display", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.light-theme {
  color-scheme: light;
  --bg: #f2f2f7;
  --bg-soft: #e8e8ed;
  --panel: rgba(255, 255, 255, 0.55);
  --panel-solid: #f5f5f5;
  --panel-soft: rgba(255, 255, 255, 0.65);
  --panel-soft-2: rgba(255, 255, 255, 0.35);
  --text: #1a1a1a;
  --muted: #6B6B6B;
  --muted-soft: rgba(107, 107, 107, 0.6);
  --divider: rgba(0, 0, 0, 0.08);
  --field-bg: rgba(0, 0, 0, 0.03);
  --field-border: rgba(0, 0, 0, 0.1);
  --glass-border: 1px solid rgba(255, 255, 255, 0.5);
  --glass-shine: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

*:focus {
  outline: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  overflow: hidden;
  font-size: 13.5px;
}

body::before,
body::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  pointer-events: none;
  z-index: -1;
  background-attachment: fixed;
}

body::before {
  background-image:
    radial-gradient(circle at 20% 30%, var(--glass-bg-1) 0%, transparent 40vw),
    radial-gradient(circle at 80% 20%, var(--glass-bg-2) 0%, transparent 40vw),
    radial-gradient(circle at 50% 80%, var(--glass-bg-3) 0%, transparent 50vw);
  animation: bg-drift 24s ease-in-out infinite alternate;
}

.node-color-picker-strip {
  display: flex;
  gap: 8px;
  padding: 0 24px 16px;
  justify-content: center;
}

.node-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  padding: 0;
}

.node-color-swatch:hover {
  transform: scale(1.15);
}

.node-color-swatch.active {
  border-color: var(--text);
  transform: scale(1.1);
}

body::after {
  background-image:
    radial-gradient(circle at 70% 60%, var(--glass-bg-2) 0%, transparent 40vw),
    radial-gradient(circle at 30% 70%, var(--glass-bg-1) 0%, transparent 50vw);
  animation: bg-drift-reverse 32s ease-in-out infinite alternate;
  opacity: 0.8;
}

@keyframes bg-drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-3%, 2%) scale(1.05); }
  100% { transform: translate(2%, -3%) scale(0.95); }
}

@keyframes bg-drift-reverse {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(3%, -2%) scale(0.95); }
  100% { transform: translate(-2%, 3%) scale(1.05); }
}

@keyframes tipSlideIn {
  0% { opacity: 0; transform: translateY(-8px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tipSlideOut {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-6px) scale(0.95); }
}

#googleTip.tip-hiding {
  animation: tipSlideOut 0.25s ease forwards;
  pointer-events: none;
}

/* Hide Scrollbar Completely */
::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

* {
  -ms-overflow-style: none !important;  /* IE and Edge */
  scrollbar-width: none !important;  /* Firefox */
}

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

a {
  color: var(--muted);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  overflow: hidden;
  z-index: 10;
}

.screen.active {
  display: block;
}

.start-screen.active,
.auth-screen.active {
  display: grid;
  place-items: center;
  z-index: 1000;
  background: transparent;
}

/* ─── Start Hero (Unified Centered Panel) ─── */
.start-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 440px;
  width: 100%;
  padding: 0 24px;
}

.start-hero__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.start-hero__logo .network-star {
  width: 64px;
  height: 64px;
}

.start-hero__title {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  color: var(--star);
  letter-spacing: -0.02em;
}

.start-hero__tagline {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

/* Goal Input */
.start-hero__input-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goal-input-wrap {
  position: relative;
}

.goal-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.goal-input::placeholder {
  color: var(--muted-soft);
}

.goal-input:focus {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent), 0 0 20px color-mix(in srgb, var(--accent) 8%, transparent);
  background: rgba(255,255,255,0.06);
}

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

.goal-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  padding: 11px 14px;
}

/* AI Loading */
.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0;
}

.ai-loading span {
  font-size: 13px;
  color: var(--muted);
  animation: ai-text-pulse 1.8s ease-in-out infinite;
}

@keyframes ai-text-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.loading-star {
  width: 48px;
  height: 48px;
  color: var(--star);
  animation: ai-spin 2.2s linear infinite;
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--accent) 50%, transparent));
}

.loading-star svg {
  width: 100%;
  height: 100%;
}

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

/* Auth Block */
.start-hero__auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.85;
  position: relative;
}

.google-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  transition: all 0.2s ease;
}

.google-auth-btn:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.04);
}

.start-hero__footnote {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

/* Google Tip */
.google-tip {
  position: absolute;
  top: 106%;
  left: 69%;
  margin-top: -55px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: auto;
  pointer-events: none;
}

.google-tip__bubble {
  position: relative;
  z-index: 20;
  pointer-events: auto;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 12px;
  padding: 12px 28px 12px 14px;
  width: 270px;
  backdrop-filter: blur(20px) saturate(1.8);
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
  animation: tipFadeUp 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

#mapTipNeuron .google-tip__bubble,
#mapTipCore .google-tip__bubble {
  background: color-mix(in srgb, #000 40%, color-mix(in srgb, var(--panel-solid) 80%, transparent));
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
}


.google-tip__icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 0; }
.google-tip__heading { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.google-tip__body { font-size: 12px; color: rgba(255,255,255,0.85); line-height: 1.5; }
.google-tip__body strong { color: var(--accent); font-weight: 600; }
.google-tip__close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none; border: none; color: rgba(255,255,255,0.4);
  font-size: 12px; cursor: pointer; padding: 4px; line-height: 1; flex-shrink: 0;
  transition: color 0.2s;
}
.google-tip__close:hover { color: rgba(255,255,255,0.9); }

.google-tip__arrow {
  margin-left: 12px;
  margin-bottom: -15px;
  opacity: 0.95;
  filter: drop-shadow(0 0 4px var(--accent));
  animation: tipFadeUp 0.5s 0.15s cubic-bezier(0.34,1.56,0.64,1) both;
}

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

.workspace-screen.active {
  display: block;
}

.star-launch {
  border: 0;
  background: transparent;
  color: var(--star);
  display: grid;
  justify-items: center;
  gap: 16px;
  cursor: pointer;
  transition: transform 180ms ease;
}

.star-launch:hover {
  transform: translateY(-2px);
}

.star-launch span {
  pointer-events: none;
}

.star-launch span:last-child {
  font-size: 24px;
  font-weight: 600;
  color: #D9D9D9;
}

.network-star {
  width: 120px;
  height: 120px;
  display: inline-grid;
  place-items: center;
  transition: transform 888ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 200ms ease;
  animation: star-enter 888ms cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.network-star.spinning {
  animation: ai-spin 2s linear infinite !important;
  filter: drop-shadow(0 0 24px color-mix(in srgb, var(--accent) 60%, transparent)) !important;
}

.network-star svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.network-star.small {
  width: 32px;
  height: 32px;
}

.star-launch:hover .network-star {
  filter: drop-shadow(0 0 16px rgba(217, 217, 217, 0.25));
}

.floating-star:hover .network-star {
  filter: drop-shadow(0 0 16px rgba(217, 217, 217, 0.25));
}

.star-launch.compact .network-star {
  width: 60px;
  height: 60px;
}

@keyframes star-enter {
  0% {
    opacity: 0;
    transform: scale(0.6) rotate(-360deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.auth-screen {
  background: transparent;
}

.auth-card,
.challenge-drawer,
.modal-shell,
.avatar-preview,
.profile-overlay-sheet,
.avatar-preview,
.profile-overlay-sheet {
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shine), var(--shadow);
}

.auth-card {
  width: min(30vw, 450px);
  min-width: 360px;
  padding: 30px;
}

.auth-card h1,
.sidebar-header h2,
.challenge-drawer__head h3,
.card-head h3,
#nodeDrawerTitle {
  margin: 0;
  font-weight: 500;
  font-size: 1.25rem;
}

#nodeDrawerTitle {
  outline: none;
  padding: 2px 4px;
  margin-left: -4px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  cursor: text;
}

#nodeDrawerTitle:focus {
  background: rgba(255, 255, 255, 0.05);
}

.auth-card h1 {
  margin-bottom: 24px;
}

.field,
.choice-card {
  display: grid;
  gap: 10px;
}

.field+.field {
  margin-top: 18px;
}

.spaced-field span {
  margin-bottom: 8px;
  display: block;
}

.field span,
.auth-footnote span,
.goal-strip__content p,
.progress-meta span,
.choice-card__label,
.card-head p,
.meta-row span {
  color: var(--muted);
}

.field input,
.field textarea,
.choice-card input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--field-radius);
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  font-size: 13px;
}

.field select,
.choice-card select {
  display: none;
  /* Removed native selects, but leave rule just in case */
}

/* Combo Field (Duration + Unit) */
.combo-field {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  border-radius: var(--field-radius);
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.combo-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

.combo-divider {
  width: 1px;
  height: 100%;
  background: var(--field-border);
}

.combo-stepper {
  display: flex;
  align-items: center;
  flex: 1;
  height: 100%;
}

.combo-stepper input.combo-input {
  flex: 1;
  width: 100%;
  text-align: center;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  border-radius: 0;
  padding: 0;
  min-width: 0;
}

.combo-select-wrapper {
  flex: 1;
  height: 100%;
  background: transparent;
}

.combo-select-wrapper .custom-select {
  border: 0;
  background: transparent;
}

/* Custom Select */
.custom-select {
  position: relative;
  width: 100%;
  height: 44px;
  border-radius: var(--field-radius);
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  user-select: none;
  cursor: pointer;
}

.custom-select.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

.custom-select__value {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 40px 0 14px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

body.light-theme .custom-select__value {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='rgba(0,0,0,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.custom-select__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: var(--panel-solid);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 6px;
  z-index: 100;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 200px;
  overflow-y: auto;
}

body.light-theme .custom-select__menu {
  background: #333333;
  /* Forcing dark background per user requirement */
  color: #ffffff;
  border-color: #222222;
}

.custom-select__option {
  padding: 10px 12px;
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
  transition: background-color 150ms ease, color 150ms ease;
}

body.light-theme .custom-select__option {
  color: #ffffff;
}

.custom-select__option:hover {
  background-color: var(--accent);
  color: #ffffff;
}


.field input:focus,
.field textarea:focus,
.field select:focus,
.choice-card input:focus,
.choice-card select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

.field textarea {
  resize: none;
}

.field-large textarea {
  min-height: 182px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 74px;
}

.link-button,
.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.challenge-item,
.profile-chip,
.floating-star,
.sidebar-toggle,
.drawer-tab,
.modal-nav__item,
.toolbar-button,
.switch span,
.color-swatch {
  transition:
    transform 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    opacity 150ms ease,
    box-shadow 150ms ease;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  cursor: pointer;
}

.password-field .link-button {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
}

.primary-button,
.ghost-button,
.danger-button {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.primary-button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 80%, #6a1b9a));
  color: #fff;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

button:disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
  filter: saturate(0.5);
  box-shadow: none !important;
}

.primary-button--small {
  min-width: 126px;
  padding: 11px 16px;
}

.ghost-button {
  border: var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
}

.danger-button {
  border: 1px solid rgba(207, 111, 128, 0.25);
  background: rgba(207, 111, 128, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--danger);
}

#clearAllUserObjectsButton {
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--accent);
  transition: background 0.2s, box-shadow 0.2s;
}

#clearAllUserObjectsButton:hover {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 20%, transparent);
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.icon-button:hover,
.challenge-item:hover,
.profile-chip:hover,
.floating-star:hover,
.sidebar-toggle:hover,
.drawer-tab:hover,
.modal-nav__item:hover,
.toolbar-button:hover,
.color-swatch:hover {
  transform: translateY(-1px);
}

.auth-button {
  width: 100%;
  margin-top: 28px;
}

.auth-footnote {
  margin: 18px 0 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.glass-popover {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  z-index: 1000;
  background: rgba(15, 15, 25, 0.45);
  backdrop-filter: blur(45px) saturate(2);
  -webkit-backdrop-filter: blur(45px) saturate(2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  padding: 16px;
  transform-origin: top right;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glass-popover.hidden {
  opacity: 0;
  transform: translateY(-10px) scale(0.92);
  pointer-events: none;
  display: block !important;
  /* Allow transition */
}

.color-picker-content {
  display: flex;
  gap: 16px;
}

.color-picker-main {
  width: 210px;
}

.color-picker-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-left: 14px;
  border-left: 1px solid var(--divider);
  gap: 20px;
}

.side-setting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.side-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.switch--mini {
  width: 30px;
  height: 18px;
}

.switch--mini .slider::after {
  width: 14px;
  height: 14px;
  top: 2px;
  left: 2px;
}

.switch--mini input:checked + .slider::after {
  transform: translateX(12px);
}

.color-picker-area {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  cursor: crosshair;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#colorPickerCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.color-picker-cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.hue-slider-container {
  margin-bottom: 16px;
}

.hue-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
  outline: none;
  cursor: pointer;
}

.hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.color-picker-footer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-preview {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hex-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  outline: none;
  transition: all 0.2s ease;
}

.hex-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.12);
}

.workspace-views {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.workspace-view {
  position: absolute;
  inset: 0;
  transition: transform 300ms ease, opacity 300ms ease;
}

.workspace-view--map {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}

.workspace-view--profile {
  pointer-events: none;
  opacity: 0;
  transform: translateX(8%);
}

.workspace-screen.profile-open .workspace-view--map {
  opacity: 0;
  transform: translateX(-6%);
}

.workspace-screen.profile-open .workspace-view--profile {
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0);
}

.toolbar-group-container {
  position: fixed;
  top: var(--toolbar-top);
  right: var(--toolbar-right);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.top-toolbar-wrapper {
  position: relative;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  background: rgba(10, 10, 18, 0.18);
  backdrop-filter: blur(50px) saturate(1.8);
  -webkit-backdrop-filter: blur(50px) saturate(1.8);
  border: var(--glass-border);
  border-radius: 999px;
  padding: 8px;
  box-shadow: var(--glass-shine), var(--shadow);
}

.top-toolbar-wrapper.hidden {
  display: none !important;
}

.top-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

#togglePhysicsButton {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  min-width: 48px;
  margin-right: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: width 500ms cubic-bezier(0.32, 1.25, 0.32, 1), margin 500ms cubic-bezier(0.32, 1.25, 0.32, 1), transform 500ms cubic-bezier(0.32, 1.25, 0.32, 1), opacity 400ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

#togglePhysicsButton.active {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent);
}

.workspace-screen.profile-open #togglePhysicsButton,
.workspace-screen.swiping-to-map #togglePhysicsButton {
  width: 0;
  min-width: 0;
  margin-right: 0;
  padding: 0;
  opacity: 0;
  transform: scale(0.5) translateX(20px);
  pointer-events: none;
}

.toolbar-button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

.toolbar-thumb {
  position: absolute;
  left: 0;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 32%, transparent), var(--glow);
  transition: transform 400ms cubic-bezier(0.32, 1.25, 0.32, 1);
  z-index: 0;
}

.workspace-screen.profile-open .toolbar-thumb {
  transform: translateX(56px);
}



.toolbar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.toolbar-icon--map {
  width: 32px;
  height: 32px;
}

#togglePhysicsButton .toolbar-icon {
  width: 22px;
  height: 22px;
}

.toolbar-icon svg {
  width: 100%;
  height: 100%;
}

.toolbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  box-shadow: var(--glow);
  background-size: cover;
  background-position: center;
}

.sidebar-toggle {
  position: fixed;
  top: 24px;
  left: 18px;
  z-index: 80;
  width: 30px;
  height: 24px;
  border: var(--glass-border);
  border-radius: 10px;
  background: var(--panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  cursor: pointer;
  box-shadow: var(--glass-shine), var(--shadow);
}

.sidebar-toggle span,
.sidebar-toggle span::before,
.sidebar-toggle span::after {
  content: "";
  position: absolute;
  left: 7px;
  width: 14px;
  height: 1px;
  background: var(--text);
}

.sidebar-toggle span {
  top: 11px;
}

.sidebar-toggle span::before {
  top: -4px;
  left: 0;
}

.sidebar-toggle span::after {
  top: 4px;
  left: 0;
}

.sidebar {
  position: relative;
  z-index: 40;
  width: var(--sidebar-width);
  flex-shrink: 0;
  height: 100vh;
  background: rgba(8, 8, 16, 0.18);
  backdrop-filter: blur(60px) saturate(1.9);
  -webkit-backdrop-filter: blur(60px) saturate(1.9);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 76px 14px 18px;
  overflow: auto;
  transition: width 250ms ease, padding 250ms ease, border-color 250ms ease, transform 250ms ease;
}

.sidebar.collapsed {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  overflow: hidden;
}

.sidebar-header {
  margin-bottom: 18px;
}

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

.sidebar-section-header {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 16px 12px 4px;
  opacity: 0.8;
}

.challenge-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  padding: 10px 12px 8px;
}

.challenge-item.active {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: var(--glass-shine);
}

.challenge-item__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.challenge-item__title {
  flex: 1;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
  font-size: 17px;
}

.edit-challenge-btn {
  opacity: 0;
  transition: opacity 0.2s ease;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
  display: inline-block;
  transform: scaleX(-1);
}

.edit-challenge-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.challenge-item:hover .edit-challenge-btn {
  opacity: 1;
}

.challenge-item__goal {
  margin-top: 10px;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 15px;
}

.challenge-item.empty {
  cursor: default;
  color: var(--muted);
}

.canvas-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: var(--bg);
}

.canvas-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.147);
  pointer-events: none;
  z-index: 3;
}

.canvas-stage::before {
  display: none;
}

/* Floating ambient cloud gradients */
.canvas-cloud {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
  filter: blur(60px);
}

.canvas-cloud--1 {
  width: 80%;
  height: 80%;
  top: -20%;
  left: -15%;
  background: radial-gradient(circle, var(--cloud-1, rgba(176, 62, 208, 0.09)) 0%, transparent 60%);
  animation: cloud-float-1 32s ease-in-out infinite;
}

.canvas-cloud--2 {
  width: 75%;
  height: 75%;
  bottom: -25%;
  right: -10%;
  background: radial-gradient(circle, var(--cloud-2, rgba(62, 95, 208, 0.07)) 0%, transparent 60%);
  animation: cloud-float-2 28s ease-in-out infinite;
}

.canvas-cloud--3 {
  width: 70%;
  height: 70%;
  top: 20%;
  left: 15%;
  background: radial-gradient(circle, var(--cloud-3, rgba(119, 78, 208, 0.06)) 0%, transparent 60%);
  animation: cloud-float-3 38s ease-in-out infinite;
}

.canvas-cloud--4 {
  width: 90%;
  height: 65%;
  top: -5%;
  right: -20%;
  background: radial-gradient(circle, var(--cloud-2, rgba(62, 95, 208, 0.07)) 0%, transparent 60%);
  animation: cloud-float-4 24s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes cloud-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.75; }
  15% { transform: translate(35%, -15%) scale(1.2); opacity: 1; }
  35% { transform: translate(10%, 40%) scale(0.85); opacity: 0.6; }
  55% { transform: translate(-30%, 20%) scale(1.15); opacity: 0.9; }
  75% { transform: translate(-15%, -25%) scale(0.9); opacity: 0.7; }
  90% { transform: translate(20%, -5%) scale(1.05); opacity: 0.85; }
}

@keyframes cloud-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1.05); opacity: 0.65; }
  20% { transform: translate(-35%, 20%) scale(0.85); opacity: 0.9; }
  40% { transform: translate(-10%, -30%) scale(1.2); opacity: 1; }
  60% { transform: translate(30%, -15%) scale(0.9); opacity: 0.7; }
  80% { transform: translate(15%, 35%) scale(1.1); opacity: 0.85; }
}

@keyframes cloud-float-3 {
  0%, 100% { transform: translate(0, 0) scale(0.9); opacity: 0.5; }
  25% { transform: translate(25%, 30%) scale(1.18); opacity: 0.85; }
  45% { transform: translate(-20%, -20%) scale(1.05); opacity: 0.7; }
  65% { transform: translate(-35%, 15%) scale(1.15); opacity: 0.95; }
  85% { transform: translate(15%, -25%) scale(0.88); opacity: 0.6; }
}

@keyframes cloud-float-4 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  18% { transform: translate(-25%, -30%) scale(1.25); opacity: 0.85; }
  35% { transform: translate(20%, 15%) scale(0.82); opacity: 0.55; }
  52% { transform: translate(40%, -20%) scale(1.1); opacity: 0.8; }
  70% { transform: translate(-10%, 30%) scale(1.18); opacity: 0.9; }
  88% { transform: translate(-30%, -10%) scale(0.92); opacity: 0.6; }
}

#graphCanvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  display: block;
  cursor: grab;
}

#graphCanvas.dragging {
  cursor: grabbing;
}

.canvas-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.34;
  background-image:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.11) 0 1px, transparent 1px),
    radial-gradient(circle at 34% 41%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px),
    radial-gradient(circle at 68% 27%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 64%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px),
    radial-gradient(circle at 52% 82%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px);
}

.workspace-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 15;
}

.floating-star {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 26;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: var(--glass-border);
  background: rgba(8, 8, 16, 0.16);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  color: var(--star);
  box-shadow: var(--glass-shine), var(--shadow), var(--glow);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.days-pill {
  position: relative;
  z-index: 95;
  padding: 8px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, rgba(12, 12, 20, 0.22));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, rgba(255, 255, 255, 0.06));
  box-shadow: var(--glass-shine), var(--shadow), var(--glow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 400ms cubic-bezier(0.32, 1.25, 0.32, 1);
  transform-origin: top center;
}

.days-pill span {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
}

.workspace-screen.profile-open #daysPill,
.workspace-screen.swiping-to-map #daysPill {
  opacity: 0;
  transform: translateY(-56px) scaleY(0.5);
  pointer-events: none;
}

.challenge-drawer {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 50;
  width: var(--drawer-width, 290px);
  height: calc(100vh - 48px);
  max-height: 680px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 16px;
  background: rgba(4, 4, 8, 0.28);
  backdrop-filter: blur(10px) saturate(1.8);
  -webkit-backdrop-filter: blur(10px) saturate(1.8);
  animation: drawer-in 200ms ease;
  user-select: none;
  overflow: hidden;
}

.node-drawer {
  position: absolute;
  top: 114px;
  right: 24px;
  z-index: 50;
  width: 290px;
  height: calc(100vh - 210px);
  max-height: 580px;
  display: flex;
  flex-direction: column;
  background: rgba(4, 4, 8, 0.28);
  backdrop-filter: blur(10px) saturate(1.8);
  -webkit-backdrop-filter: blur(10px) saturate(1.8);
  border-radius: var(--radius);
  border: var(--glass-border);
  gap: 0;
  padding: 16px;
  box-shadow: var(--glass-shine), var(--shadow);
  animation: node-drawer-in 200ms ease;
  user-select: none;
  overflow: hidden;
}

@keyframes node-drawer-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.drawer-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 60;
  transition: background-color 0.2s;
}

.drawer-resizer:hover,
.drawer-resizer.active {
  background-color: color-mix(in srgb, var(--accent) 18%, transparent);
}

.drawer-resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1px;
  height: 48px;
  background-color: var(--divider);
  opacity: 0;
  transition: opacity 0.2s;
}

.drawer-resizer:hover::after,
.drawer-resizer.active::after {
  opacity: 1;
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.challenge-drawer__head,
.progress-meta,
.drawer-footer,
.meta-row,
.toggle-row,
.profile-topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

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

.editable-title {
  outline: none;
  border-radius: 4px;
  transition: color 0.3s ease;
}

.editable-title.is-default {
  color: var(--muted);
}

.edit-drawer-title-btn {
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
  margin-right: auto;
  display: inline-block;
  transform: scaleX(-1);
}

.challenge-drawer__head:hover .edit-drawer-title-btn {
  opacity: 1;
}

.edit-drawer-title-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.progress-meta {
  margin-bottom: 14px;
}

.progress-meta span {
  font-weight: 400;
  color: var(--muted-soft);
}

.drawer-tabs {
  display: flex;
  position: relative;
  gap: 4px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  width: 100%;
}

.tabs-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  background: color-mix(in srgb, var(--accent) 16%, rgba(255, 255, 255, 0.04));
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), var(--glow);
  transition: all 0.15s ease;
  pointer-events: none;
  z-index: 0;
}

.drawer-tab {
  flex: 1;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.drawer-tab.active {
  color: var(--text);
}

.drawer-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-panel {
  display: none;
  flex: 1;
  height: 100%;
  flex-direction: column;
  min-height: 0;
}

.drawer-panel.active {
  display: flex;
}

.goal-strip {
  flex: 1;
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
  min-height: 0;
}

.goal-strip__line {
  border-radius: 999px;
  background: var(--accent);
  box-shadow: var(--glow);
}

.goal-strip__content {
  padding: 16px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(60px) saturate(2);
  -webkit-backdrop-filter: blur(60px) saturate(2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-height: 0;
  cursor: text;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.goal-strip--notes .goal-strip__content {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
}

.goal-strip__content.saved-success {
  animation: save-pulse 0.4s ease-out;
}

@keyframes save-pulse {
  0% {
    border-color: var(--accent);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent);
  }

  50% {
    border-color: var(--accent);
    box-shadow: 0 0 0 10px transparent;
  }

  100% {
    border-color: color-mix(in srgb, var(--accent) 20%, transparent);
    box-shadow: 0 0 0 0 transparent;
  }
}

.goal-strip__content p {
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 17px;
  line-height: 1.6;
}

#goalBlockText:empty:before {
  content: attr(data-placeholder);
  color: var(--muted);
  opacity: 0.6;
  pointer-events: none;
  font-size: 1.05rem;
}

.progress-track {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--divider);
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: var(--glow);
  transition: width 300ms ease;
}

.editor-shell {
  flex: 1;
  min-height: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px;
  overflow: auto;
}

.rich-editor {
  min-height: 180px;
  outline: none;
  color: var(--text);
  line-height: 1.6;
}

.rich-editor ul,
.rich-editor ol {
  padding-left: 20px;
}

.secondary-actions,
.paged-panel__header {
  margin-bottom: 12px;
}

.todo-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: grid;
  gap: 10px;
  padding-right: 4px;
  align-content: start;
}

.todo-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.todo-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.todo-item__checkbox {
  position: relative;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.todo-item__checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.todo-item__checkbox span {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background: transparent;
  border: 1px solid var(--divider);
  border-radius: 4px;
}

.todo-item__checkbox input:checked~span {
  background: var(--accent);
  border-color: var(--accent);
}

.todo-item__checkbox span::after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.todo-item__checkbox input:checked~span::after {
  display: block;
}

.todo-item__text {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.todo-item input[type="checkbox"]:checked+.todo-item__text {
  color: var(--muted);
  text-decoration: line-through;
}

.todo-item__delete {
  opacity: 0;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 12px;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.todo-item:hover .todo-item__delete {
  opacity: 1;
}

.todo-item__delete:hover {
  color: var(--danger);
}

#addTodoButton {
  margin-top: 18px;
}

.direction-card {
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.direction-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.direction-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.direction-card__header input[type="text"] {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  outline: none;
  padding: 0;
}

.direction-card__pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.direction-members-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--divider);
}

.direction-member-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.direction-member-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.direction-member-name {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
}

.direction-member-stat {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.direction-member-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  overflow: hidden;
}

.direction-member-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 6px currentColor;
}

.direction-no-data {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
  text-align: center;
}

.direction-card__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.direction-card__actions button {
  flex: 1;
  padding: 6px;
  font-size: 12px;
  border-radius: 6px;
}


.directions-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.active-members-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.active-member-card {
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.active-member-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.active-member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--divider);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background-size: cover;
  background-position: center;
}

.active-member-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.active-member-role {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.active-member-stat {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.active-member-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}

.active-member-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 6px currentColor;
}

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

.node-attachment {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--panel-solid);
  border: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.node-attachment:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}

.node-attachment:hover .attachment-remove-overlay {
  opacity: 1;
}

.node-attachment img, .node-attachment video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.node-attachment .file-icon {
  font-size: 24px;
  color: var(--muted);
}

.attachment-remove-overlay {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(255, 59, 48, 0.9);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.attachment-remove-overlay:hover {
  background: #ff3b30;
  transform: scale(1.1);
}

.paged-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.drawer-footer {
  margin-top: 18px;
  justify-content: flex-start;
}

.drawer-footer .primary-button {
  margin-left: auto;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: var(--glass-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.danger-icon {
  color: var(--danger);
  border-color: rgba(207, 111, 128, 0.32);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px) saturate(1.4);
  -webkit-backdrop-filter: blur(6px) saturate(1.4);
  animation: overlay-in 200ms ease;
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-shell {
  position: relative;
  width: min(1160px, 100%);
  max-height: min(88vh, 920px);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: modal-in 200ms ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.985);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 8;
  background: var(--panel);
}

.create-modal {
  display: block;
}

.create-grid {
  display: grid;
  gap: 24px;
  padding: 34px 34px 28px;
  min-height: 100%;
}

.create-grid--two {
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: stretch;
}

.column-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100%;
}

.compact-stack {
  gap: 16px;
}

.create-card {
  position: relative;
  z-index: 1;
  padding: 20px;
  border-radius: var(--radius);
  border: var(--glass-border);
  background: var(--panel-soft);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--glass-shine);
}

.create-card:has(.custom-select.active) {
  z-index: 100;
}

.main-column .create-card {
  min-height: 100%;
}

.create-modal .create-card {
  background: color-mix(in srgb, var(--panel-solid) 45%, transparent);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
}

.card-head {
  margin-bottom: 18px;
}

.duration-stepper {
  display: flex;
  align-items: stretch;
  background: color-mix(in srgb, var(--panel-soft) 80%, var(--divider));
  border-radius: 8px;
  overflow: hidden;
  height: 44px;
}

.duration-stepper input {
  flex: 1;
  min-width: 0;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.duration-stepper input::-webkit-outer-spin-button,
.duration-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.duration-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.stepper-btn {
  width: 44px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.2s, background 0.2s;
}

.stepper-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

input[type="time"],
input[type="datetime-local"] {
  color-scheme: dark;
}

.create-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  padding-right: 6px;
}

.profile-overlay-sheet {
  position: absolute;
  inset: 28px;
  z-index: 70;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 26px;
  padding: 28px;
  box-shadow: var(--shadow);
  animation: profile-slide 300ms ease;
}

@keyframes profile-slide {
  from {
    opacity: 0;
    transform: translateX(28px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.profile-topbar {
  justify-content: flex-start;
  padding-right: 44px;
}

.profile-topbar__meta h2 {
  margin: 0;
  font-size: 34px;
  font-weight: 500;
}

.profile-topbar__meta p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.profile-avatar-large {
  width: 90px;
  height: 90px;
  border: var(--glass-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--glass-shine), var(--glow);
  background-size: cover;
  background-position: center;
}

.profile-avatar-large span,
.avatar-preview__surface span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.profile-shell {
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--glass-border);
}

.modal-sidebar {
  background: var(--panel-soft);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 20px 14px;
}

.modal-nav {
  display: grid;
  gap: 6px;
}

.modal-nav__item {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
}

.modal-nav__item.active {
  background: color-mix(in srgb, var(--accent) 16%, rgba(255, 255, 255, 0.04));
  color: var(--text);
  box-shadow: var(--glow), var(--glass-shine);
}

.modal-content {
  overflow: auto;
}

.profile-content {
  padding: 22px 26px 26px;
}

.profile-panel {
  display: none;
}

.profile-panel.active {
  display: block;
}

.profile-panel .create-card {
  width: fit-content;
  min-width: min(100%, 500px);
  max-width: 100%;
}

.section-save {
  margin-top: 28px;
}

.toggle-row--spaced {
  margin-top: 18px;
}

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

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: block;
  padding: 10px 14px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.segmented input:checked+span {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
  box-shadow: var(--glow);
}

.design-settings-group {
  display: grid;
  gap: 16px;
}

.drawing-area {
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}



.icon-button--mini {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 10px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.navigation-modes {
  display: flex;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 10px;
  padding: 2px;
  flex-shrink: 0;
}

.mode-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-btn:hover {
  color: var(--text);
}

.mode-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 12px color-mix(in srgb, var(--accent) 30%, transparent);
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.setting-desc {
  font-size: 12px;
  color: var(--muted);
}

.color-palette {
  display: flex;
  gap: 16px;
  margin-top: 22px;
  align-items: center;
  flex-wrap: nowrap;
  padding-right: 12px;
}

.palette-divider {
  width: 1px;
  height: 24px;
  background: var(--divider);
  margin: 0 4px;
  flex-shrink: 0;
}

.palette-setting {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.palette-intensity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.intensity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

.intensity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}

.intensity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.palette-label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.switch--palette {
  width: 36px;
  height: 20px;
}

.switch--palette .slider::after {
  width: 14px;
  height: 14px;
  top: 3px;
  left: 3px;
}

.switch--palette input:checked + .slider::after {
  transform: translateX(16px);
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  flex-shrink: 0;
}

.color-swatch[data-color="#B03ED0"] {
  background: #b03ed0;
}

.color-swatch[data-color="#D25562"] {
  background: #d25562;
}

.color-swatch[data-color="#D97A2B"] {
  background: #d97a2b;
}

.color-swatch[data-color="#C9A227"] {
  background: #c9a227;
}

.color-swatch[data-color="#3EAF72"] {
  background: #3eaf72;
}

.color-swatch[data-color="#3A7BFF"] {
  background: #3a7bff;
}

.color-swatch[data-color="#FF5E8E"] {
  background: #FF5E8E;
}

.color-swatch[data-color="#6366F1"] {
  background: #6366F1;
}

.color-swatch[data-color="#06B6D4"] {
  background: #06B6D4;
}

.color-swatch[data-color="#84CC16"] {
  background: #84CC16;
}

.color-swatch[data-color="#F97316"] {
  background: #F97316;
}

.color-swatch[data-color="#64748B"] {
  background: #64748B;
}

.color-swatch[data-color="#FFFFFF"] {
  background: #FFFFFF;
}

.color-swatch.active {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 42%, transparent), var(--glow);
  transform: scale(1.06);
}

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

.switch input {
  position: absolute;
  opacity: 0;
}

.switch .slider {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--divider);
  transition: background-color 150ms ease;
  cursor: pointer;
}

.switch .slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch input:checked + .slider {
  background: var(--accent);
}

.switch input:checked + .slider::after {
  transform: translateX(18px);
}

.stacked-list {
  display: grid;
  gap: 12px;
}

.meta-row {
  padding: 10px 0 4px;
}

.disabled-field {
  opacity: 0.55;
}

.avatar-preview {
  position: relative;
  width: min(360px, 100%);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.avatar-preview__close {
  justify-self: end;
}

.avatar-preview__surface {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  background: var(--panel-soft-2);
  display: grid;
  place-items: center;
  font-size: 84px;
  background-size: cover;
  background-position: center;
}

.avatar-edit-button {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}

.avatar-edit-button:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.05);
}

@media (max-width: 1220px) {
  .create-grid--three {
    grid-template-columns: 1fr 1fr;
  }

  .main-column {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1120px) {
  body {
    overflow: auto;
  }

  .workspace-view--map {
    grid-template-columns: 1fr;
  }

  .sidebar:not(.collapsed) {
    position: fixed;
    top: 0;
    left: 0;
  }

  .challenge-drawer {
    width: min(420px, calc(100% - 32px));
    left: 16px;
  }

  .profile-overlay-sheet {
    inset: 12px;
  }

  .profile-shell {
    grid-template-columns: 1fr;
  }

  .modal-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--divider);
  }
}

@media (max-width: 780px) {
  .auth-card {
    min-width: 0;
    width: calc(100% - 32px);
  }

  .create-grid--three {
    grid-template-columns: 1fr;
  }

  .create-grid {
    padding: 28px 20px 22px;
  }

  .challenge-drawer {
    width: calc(100% - 24px);
    left: 12px;
    top: 64px;
    height: calc(100vh - 76px);
  }

  .top-toolbar-wrapper {
    right: 12px;
    top: 12px;
  }
}

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


.member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.member-tool {
  font-size: 11px;
  opacity: 0.5;
  margin-left: 6px;
  vertical-align: baseline;
  display: inline-block;
  transform: translateY(-1px);
}


.member-item.top-worker {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.member-item.top-worker .member-name {
  font-weight: 600;
  color: #fff;
}

.member-item.observer {
  opacity: 0.6;
  filter: grayscale(0.8);
}

.member-icon {
  font-size: 18px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
}

.member-icon.has-avatar {
  color: transparent;
}


.member-name {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

.member-color-input {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  overflow: hidden;
}

.member-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.member-color-input::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.member-badge {
  font-size: 10px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--muted);
}

/* ── Premium Dark Glass Confirm Dialog ── */
.confirm-dialog {
  background: rgba(12, 12, 16, 0.82);
  backdrop-filter: blur(80px) saturate(1.6) brightness(0.95);
  -webkit-backdrop-filter: blur(80px) saturate(1.6) brightness(0.95);
  padding: 48px 88px 44px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 48px 120px rgba(0, 0, 0, 0.70),
    0 16px 48px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  max-width: 816px;
  width: 100%;
  text-align: center;
  animation: dialog-enter 400ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

/* Dynamic glow canvas — sits behind all content */
.confirm-glow-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.confirm-dialog h3 {
  margin: 0 0 38px;
  font-size: 31px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.92);
  position: relative;
  z-index: 1;
}

.premium-warning-title {
  background: linear-gradient(135deg, #e85454 0%, #c8001e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  filter: none;
}

.premium-info-title {
  background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  filter: none;
}

.confirm-actions {
  display: flex;
  gap: 18px;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.confirm-actions button {
  min-width: 204px;
  padding: 19px 41px;
  font-size: 26px;
  font-weight: 500;
  border-radius: 20px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
}

.confirm-actions button.ghost-button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: none;
}

.confirm-actions button.ghost-button:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  transform: none;
  box-shadow: none;
}

.confirm-actions button.ghost-button:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.08);
}

.confirm-actions button.keyboard-selected {
  background: rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  transform: none;
  box-shadow: none;
}

/* Warning "OK" button — premium dark glass with bright red (#FF0000) glow */
.confirm-actions button.warning-confirm {
  background: rgba(255, 0, 0, 0.12) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(255, 0, 0, 0.35) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(255, 0, 0, 0.15) !important;
  font-weight: 600;
  letter-spacing: -0.01em;
  transform: none;
  min-width: 160px !important;
  padding: 12px 32px !important;
  border-radius: 16px !important;
  margin-top: 16px !important;
}

.confirm-actions button.warning-confirm:hover {
  background: rgba(255, 0, 0, 0.22) !important;
  border-color: rgba(255, 0, 0, 0.70) !important;
  color: #ffffff !important;
  box-shadow: 
    0 8px 32px rgba(255, 0, 0, 0.28),
    0 0 20px rgba(255, 0, 0, 0.18) !important;
  transform: translateY(-2px) !important;
}

.confirm-actions button.warning-confirm:active {
  transform: translateY(0) scale(0.96) !important;
  background: rgba(255, 0, 0, 0.16) !important;
  box-shadow: 0 4px 16px rgba(255, 0, 0, 0.15) !important;
}

/* Info "OK" button — premium dark glass with white glow */
.confirm-actions button.info-confirm {
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(255, 255, 255, 0.08) !important;
  font-weight: 600;
  letter-spacing: -0.01em;
  transform: none;
  min-width: 160px !important;
  padding: 12px 32px !important;
  border-radius: 16px !important;
  margin-top: 16px !important;
}

.confirm-actions button.info-confirm:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.40) !important;
  color: #ffffff !important;
  box-shadow: 
    0 8px 32px rgba(255, 255, 255, 0.15),
    0 0 20px rgba(255, 255, 255, 0.10) !important;
  transform: translateY(-2px) !important;
}

.confirm-actions button.info-confirm:active {
  transform: translateY(0) scale(0.96) !important;
  background: rgba(255, 255, 255, 0.10) !important;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.08) !important;
}

.member-item.is-me {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, var(--panel-soft));
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 30%, transparent);
}

.member-popover {
  position: absolute;
  top: 100px;
  left: calc(24px + var(--drawer-width) + 12px);
  width: 280px;
  background: rgba(10, 10, 18, 0.18);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 20px;
  border: var(--glass-border);
  box-shadow: var(--glass-shine), 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popover-in 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popover-in {
  from {
    opacity: 0;
    transform: scale(0.2) translateX(-60px);
    filter: blur(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateX(0);
    filter: blur(0);
  }
}


.member-popover.closing {
  animation: popover-out 280ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: none;
}

.popover-close-corner {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0.5;
  transition: opacity 0.2s;
  z-index: 10;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text-main);
}

.popover-close-corner:hover {
  opacity: 1;
}


@keyframes popover-out {
  from {
    opacity: 1;
    transform: scale(1) translateX(0);
    filter: blur(0);
  }

  to {
    opacity: 0;
    transform: scale(0.2) translateX(-60px);
    filter: blur(10px);
  }
}

.popover-head {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--divider);
}

.popover-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 18px;
  background-size: cover;
  background-position: center;
}

.popover-avatar.has-avatar {
  color: transparent;
}


.popover-title {
  flex: 1;
}

.popover-title h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.popover-title span {
  font-size: 11px;
  color: var(--success);
  opacity: 0.8;
}

.popover-body {
  padding: 16px;
}

.popover-section h5 {
  margin: 0 0 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

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

.role-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.role-btn.active {
  background: color-mix(in srgb, var(--accent) 15%, rgba(255, 255, 255, 0.04));
  border-color: var(--accent);
  box-shadow: var(--glow);
}

.role-icon {
  font-size: 18px;
}

.role-text {
  font-size: 11px;
  font-weight: 500;
}

.popover-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
}


.member-item.is-me .member-name {
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
}


#goalBlockText[contenteditable="true"],
#nodeEditor[contenteditable="true"] {
  outline: none;
  cursor: text;
  min-height: 1.2em;
  background: transparent;
  box-shadow: none;
}


.primary-button.danger {
  background: var(--danger);
  border-color: rgba(207, 111, 128, 0.32);
}

.primary-button.danger:hover {
  background: #bd3e52;
  box-shadow: 0 0 16px rgba(207, 111, 128, 0.25);
}

.invite-popover {
  position: fixed;
  bottom: 32px;
  left: calc(24px + var(--drawer-width) + 160px);
  width: 360px;
  background: rgba(12, 12, 20, 0.22);
  backdrop-filter: blur(40px) saturate(1.8);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.02),
    inset 0 0 20px rgba(255, 255, 255, 0.01);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: invite-in 450ms cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom left;
}

.invite-popover .popover-head {
  padding: 24px 24px 16px;
  border-bottom: none;
}

.invite-popover .popover-head h4 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  width: 100%;
}

.invite-option .ghost-button.success-state {
  background: #4caf50 !important;
  color: #fff !important;
  border-color: #4caf50 !important;
}

.invite-popover .popover-body {
  padding: 0 20px 24px;
}

.invite-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invite-option {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  cursor: pointer;
}

.invite-option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.invite-option .option-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  transition: transform 0.3s ease;
}

.invite-option:hover .option-icon {
  transform: scale(1.1) rotate(-5deg);
  background: rgba(255, 255, 255, 0.08);
}

.invite-option .option-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.invite-option .option-text strong {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.invite-option .option-text span {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.invite-option .ghost-button {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-color: transparent;
}

.invite-option .ghost-button:hover {
  background: var(--accent);
  color: #fff;
}

@keyframes invite-in {
  from {
    opacity: 0;
    transform: scale(0.3) translateY(40px);
    filter: blur(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

.invite-popover.closing {
  animation: invite-out 280ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes invite-out {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  to {
    opacity: 0;
    transform: scale(0.3) translateY(40px);
  }
}

.todo-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.todo-item__attach {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.todo-item__attach:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.todo-item__attachments {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 4px 34px;
}

.attachment-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  background: var(--panel-soft-2);
  border: 1px solid var(--divider);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}

.attachment-chip:hover {
  background: var(--panel-soft);
  color: var(--text);
  border-color: var(--accent);
}

.attachment-remove {
  font-size: 10px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.attachment-remove:hover {
  opacity: 1;
  color: var(--danger);
}

#lightboxModal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  background: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(16px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.4) !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#lightboxImage {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: lightbox-fade 0.3s ease-out;
}

@keyframes lightbox-fade {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-caption {
  color: #fff;
  font-size: 14px;
  opacity: 0.7;
}

.lightbox-close {
  position: absolute;
  top: 40px;
  right: 40px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  z-index: 10;
  padding: 10px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.05);
  border: 0;
  color: #fff;
  font-size: 48px;
  width: 60px;
  height: 100px;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-50%) scale(1.05);
}

.lightbox-prev {
  left: 40px;
}

.lightbox-next {
  right: 40px;
}

.lightbox-nav.hidden {
  display: none;
}

/* Authentication Screen Adjustments */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: var(--muted-soft);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--divider);
}

.auth-divider span {
  padding: 0 10px;
}

.google-auth-button {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--divider);
  font-size: 14px;
  padding: 12px;
}

.google-auth-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.google-icon {
  width: 18px;
  height: 18px;
}

/* ── Confirm Overlay ── */
#confirmModal {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px) saturate(0.7);
  -webkit-backdrop-filter: blur(6px) saturate(0.7);
}

#confirmModal .confirm-dialog {
  background: rgba(12, 12, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    0 48px 120px rgba(0, 0, 0, 0.70),
    0 16px 48px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
}

.confirm-subtext {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0;
  margin-bottom: 40px;
  line-height: 1.55;
  text-align: center;
  font-weight: 400;
  letter-spacing: 0;
  position: relative;
  z-index: 1;
}

.confirm-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: none !important;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 2;
}

.confirm-close svg {
  display: block;
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.confirm-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: scale(1.05);
}

.confirm-close:hover svg {
  transform: rotate(90deg);
}

.confirm-close:active {
  transform: scale(0.95);
}