 *,
 *::before,
 *::after {
     box-sizing: border-box;
 }

 body {
     margin: 0;
     background: #1d1d23;
     overflow: hidden;
     font-family: "Work Sans", sans-serif;
 }

 #disclaimer-popup {
     position: fixed;
     bottom: 24px;
     left: 24px;
     z-index: 99999;
     background: #1d1d23;
     border: 1px solid rgba(255, 255, 255, 0.1);
     border-radius: 14px;
     padding: 16px 18px;
     max-width: 420px;
     width: calc(100% - 48px);
     box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
     display: flex;
     gap: 12px;
     align-items: flex-start;
     animation: disclaimerFadeIn 0.4s ease forwards;
 }

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

 #disclaimer-popup.hidden {
     display: none;
 }

 #disclaimer-icon {
     color: rgba(255, 255, 255, 0.55);
     font-size: 14px;
     margin-top: 2px;
     flex-shrink: 0;
 }

 #disclaimer-body {
     flex: 1;
     min-width: 0;
 }

 #disclaimer-title {
     font-size: 13px;
     font-weight: 700;
     color: rgba(255, 255, 255, 0.9);
     margin: 0 0 5px 0;
 }

 #disclaimer-text {
     font-size: 11.5px;
     font-weight: 400;
     color: rgba(255, 255, 255, 0.5);
     line-height: 1.6;
     margin: 0;
 }

 #disclaimer-close {
     background: none;
     border: none;
     cursor: pointer;
     color: rgba(255, 255, 255, 0.35);
     font-size: 18px;
     padding: 0;
     flex-shrink: 0;
     line-height: 1;
     margin-top: 2px;
     transition: color 0.2s;
     -webkit-tap-highlight-color: transparent;
     touch-action: manipulation;
 }

 #disclaimer-close:hover {
     color: rgba(255, 255, 255, 0.7);
 }

 #loading-screen {
     position: fixed;
     inset: 0;
     background: #1d1d23;
     z-index: 9999;
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     gap: 20px;
     transition: opacity 0.4s ease;
 }

 #loading-screen.hidden {
     opacity: 0;
     pointer-events: none;
 }

 .loading-spinner {
     width: 44px;
     height: 44px;
     border: 3px solid rgba(255, 255, 255, 0.1);
     border-top-color: rgba(255, 255, 255, 0.6);
     border-radius: 50%;
     animation: spin 0.8s linear infinite;
 }

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

 .loading-label {
     font-size: 14px;
     font-weight: 500;
     color: rgba(255, 255, 255, 0.45);
     letter-spacing: 0.03em;
 }

 .this-layer-badge {
     font-size: 10px;
     font-weight: 600;
     color: #7c9cff;
     background: rgba(124, 156, 255, 0.12);
     border: 1px solid rgba(124, 156, 255, 0.25);
     border-radius: 7px;
     padding: 2px 8px;
     flex-shrink: 0;
     white-space: nowrap;
 }

 #blocked-overlay {
     position: absolute;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
     display: none;
     justify-content: center;
     align-items: center;
     backdrop-filter: blur(14px);
     -webkit-backdrop-filter: blur(14px);
     background: rgba(0, 0, 0, 0.45);
     z-index: 900;
     opacity: 0;
     transition: opacity 0.45s ease;
 }

 #blocked-overlay .overlay-content {
     position: relative;
     background: #1d1d23;
     border: 1px solid rgba(255, 255, 255, 0.09);
     border-radius: 24px;
     padding: 36px 32px 28px;
     width: 440px;
     max-width: calc(100vw - 40px);
     text-align: center;
     color: white;
     box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
     display: flex;
     flex-direction: column;
     align-items: center;
 }

 #overlay-back-btn {
     display: none;
 }

 .overlay-steps-badge {
     display: inline-flex;
     align-items: center;
     gap: 8px;
     background: rgba(255, 255, 255, 0.07);
     border: 1px solid rgba(255, 255, 255, 0.1);
     border-radius: 50px;
     padding: 7px 16px;
     font-size: 13px;
     font-weight: 500;
     color: rgba(255, 255, 255, 0.85);
     margin-bottom: 20px;
 }

 .overlay-steps-badge i {
     font-size: 11px;
     color: rgba(255, 255, 255, 0.5);
 }

 .overlay-progress-wrap {
     width: 100%;
     margin-bottom: 28px;
 }

 .overlay-progress-bar {
     width: 100%;
     height: 5px;
     background: rgba(255, 255, 255, 0.08);
     border-radius: 3px;
     overflow: hidden;
 }

 .overlay-progress-fill {
     height: 100%;
     background: #ECCC18;
     border-radius: 3px;
     transition: width 0.6s cubic-bezier(0.34, 1.1, 0.64, 1);
     width: 0%;
 }

 #blocked-overlay h2 {
     font-size: 30px;
     font-weight: 800;
     margin: 0 0 12px 0;
     line-height: 1.2;
     color: #fff;
     letter-spacing: -0.01em;
 }

 .overlay-subtitle {
     font-size: 15px;
     color: rgba(255, 255, 255, 0.5);
     margin: 0 0 26px 0;
     line-height: 1.55;
 }

 #blocked-overlay a {
     text-decoration: none;
     width: 100%;
 }

 #unlock-button {
     width: 100%;
     padding: 15px 24px;
     font-size: 17px;
     font-family: "Work Sans", sans-serif;
     font-weight: 700;
     border: none;
     border-radius: 48px;
     background: #ECCC18;
     color: #111;
     cursor: pointer;
     transition: background 0.2s, transform 0.12s;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 8px;
     margin-bottom: 12px;
     box-shadow: 0 4px 16px rgba(236, 204, 24, 0.2);
 }

 #unlock-button:hover {
     background: #d4b712;
 }

 #unlock-button:active {
     transform: scale(0.97);
 }

 #overlay-pricing {
     font-size: 13px;
     color: rgba(255, 255, 255, 0.35);
     margin: 0 0 20px 0;
     line-height: 1;
 }

 .overlay-divider {
     width: 100%;
     height: 1px;
     background: rgba(255, 255, 255, 0.07);
     margin-bottom: 18px;
 }

 #blocked-overlay #presence-counter {
     font-size: 13.5px;
     font-weight: 500;
     color: rgba(255, 255, 255, 0.7);
 }

 #small-cta {
     position: fixed;
     bottom: 90px;
     left: 50%;
     transform: translateX(-50%);
     text-align: center;
     align-items: center;
     display: none;
     z-index: 1000;
     flex-direction: column;
     gap: 10px;
     pointer-events: auto;
 }

 #small-cta button {
     padding: 8px 18px;
     font-size: 22px;
     font-weight: 600;
     border: none;
     border-radius: 30px;
     background: #ECCC18;
     color: black;
     cursor: pointer;
     transition: 0.2s;
 }

 #small-cta button:hover {
     background: #C5AA11;
 }

 #small-cta p {
     font-size: 20px;
     color: white;
     margin-top: 0;
 }

 #presence-counter {
     display: none;
     align-items: center;
     justify-content: center;
     gap: 8px;
     border-radius: 50px;
     font-size: 13px;
     font-weight: 500;
     white-space: nowrap;
     pointer-events: none;
     will-change: transform;
 }

 .presence-dot {
     width: 7px;
     height: 7px;
     border-radius: 50%;
     background: #4ade80;
     flex-shrink: 0;
     animation: presencePulse 2s ease-in-out infinite;
 }

 @keyframes presencePulse {
     0%,
     100% {
         opacity: 1;
         transform: scale(1);
     }
     50% {
         opacity: 0.55;
         transform: scale(0.8);
     }
 }

 #presence-count-text {
     font-size: 16px;
     font-weight: 500;
     color: #fff;
     line-height: 1;
 }

 #small-cta p2 {
     font-size: 24px;
     font-weight: 600;
     color: white;
     margin: 0;
     text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
 }

 #ml-img {
     width: 55px;
     height: 55px;
 }

 #tutorial-overlay {
     display: none;
     position: fixed;
     inset: 0;
     background: rgba(0, 0, 0, 0.72);
     z-index: 2000;
     align-items: center;
     justify-content: center;
     opacity: 0;
     animation: tutorialFadeIn 0.4s ease 0.3s forwards;
     transition: background 0.4s ease;
 }

 #tutorial-overlay.visible {
     display: flex;
 }

 /* When reopened manually (no delay) */

 #tutorial-overlay.visible-instant {
     display: flex;
     animation: tutorialFadeIn 0.25s ease 0s forwards;
 }

 #tutorial-overlay.hidden {
     display: none !important;
 }

 @keyframes tutorialFadeIn {
     to {
         opacity: 1;
     }
 }

 #tutorial-card {
     background: #1d1d23;
     border: 1px solid rgba(255, 255, 255, 0.08);
     border-radius: 24px;
     width: 360px;
     max-width: calc(100vw - 40px);
     padding: 32px 28px 24px;
     box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
     display: flex;
     flex-direction: column;
     gap: 24px;
     position: relative;
 }

 #tutorial-progress-dots {
     display: flex;
     justify-content: center;
     gap: 6px;
 }

 .tutorial-dot {
     width: 6px;
     height: 6px;
     border-radius: 50%;
     background: rgba(255, 255, 255, 0.15);
     transition: background 0.25s, width 0.25s;
 }

 .tutorial-dot.active {
     background: var(--md-accent);
     width: 18px;
     border-radius: 3px;
 }

 #tutorial-slides {
     min-height: 180px;
     position: relative;
 }

 .tutorial-slide {
     display: none;
     flex-direction: column;
     align-items: center;
     text-align: center;
     gap: 14px;
     animation: slideIn 0.28s ease;
 }

 .tutorial-slide.active {
     display: flex;
 }

 @keyframes slideIn {
     from {
         opacity: 0;
         transform: translateX(16px);
     }
     to {
         opacity: 1;
         transform: translateX(0);
     }
 }

 .tutorial-icon {
     width: 64px;
     height: 64px;
     border-radius: 18px;
     background: var(--md-accent-dim);
     border: 1px solid rgba(124, 156, 255, 0.2);
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 24px;
     color: var(--md-accent);
 }

 .tutorial-title {
     color: #fff;
     font-size: 16px;
     font-weight: 700;
     line-height: 1.3;
 }

 .tutorial-desc {
     color: rgba(255, 255, 255, 0.5);
     font-size: 13.5px;
     line-height: 1.6;
 }

 .tutorial-desc b {
     color: rgba(255, 255, 255, 0.85);
     font-weight: 600;
 }

 #tutorial-footer {
     display: flex;
     align-items: center;
     justify-content: space-between;
 }

 #tutorial-skip {
     background: transparent;
     border: none;
     color: rgba(255, 255, 255, 0.28);
     font-size: 13px;
     cursor: pointer;
     padding: 6px 0;
     transition: color 0.2s;
 }

 #tutorial-skip:hover {
     color: rgba(255, 255, 255, 0.55);
 }

 #tutorial-nav {
     display: flex;
     align-items: center;
     gap: 8px;
 }

 #tutorial-prev,
 #tutorial-next {
     background: var(--md-surface);
     border: 1px solid rgba(255, 255, 255, 0.08);
     border-radius: 12px;
     color: #fff;
     font-size: 13px;
     font-weight: 600;
     padding: 9px 18px;
     cursor: pointer;
     display: flex;
     align-items: center;
     gap: 7px;
     transition: background 0.2s, border-color 0.2s;
 }

 #tutorial-prev {
     padding: 9px 14px;
     color: rgba(255, 255, 255, 0.45);
 }

 #tutorial-prev:hover {
     background: var(--md-surface-hover);
     color: #fff;
 }

 #tutorial-next {
     background: var(--md-accent);
     border-color: transparent;
     color: #fff;
 }

 #tutorial-next:hover {
     background: #a0b8ff;
 }

 #tutorial-prev:disabled {
     opacity: 0;
     pointer-events: none;
 }

 .tutorial-kbd {
     display: inline-block;
     background: rgba(255, 255, 255, 0.08);
     border: 1px solid rgba(255, 255, 255, 0.18);
     border-radius: 5px;
     padding: 0 7px;
     font-size: 11px;
     font-family: monospace;
     color: rgba(255, 255, 255, 0.65);
     vertical-align: middle;
     line-height: 1.8;
 }

 .tutorial-live {
     display: inline-flex;
     align-items: center;
     gap: 5px;
     background: rgba(52, 211, 153, 0.1);
     border: 1px solid rgba(52, 211, 153, 0.25);
     border-radius: 20px;
     padding: 2px 9px 2px 7px;
     font-size: 10px;
     font-weight: 700;
     color: #34d399;
     letter-spacing: 0.06em;
     vertical-align: middle;
 }

 .tutorial-live::before {
     content: '';
     width: 5px;
     height: 5px;
     border-radius: 50%;
     background: #34d399;
     animation: tLivePulse 1.4s ease-in-out infinite;
     flex-shrink: 0;
 }

 @keyframes tLivePulse {
     0%,
     100% {
         opacity: 1;
         transform: scale(1);
     }
     50% {
         opacity: 0.4;
         transform: scale(0.7);
     }
 }

 .tutorial-icon--bounce {
     animation: tIconBounce 0.5s cubic-bezier(0.34, 1.6, 0.64, 1) both;
 }

 @keyframes tIconBounce {
     from {
         transform: scale(0.55);
         opacity: 0;
     }
     to {
         transform: scale(1);
         opacity: 1;
     }
 }

 #tutorial-overlay.tutorial-ruler-mode {
     background: rgba(0, 0, 0, 0.0);
     align-items: flex-end;
     padding-bottom: 28px;
 }

 .tutorial-mat-preview {
     width: 100%;
     background: rgba(255, 255, 255, 0.03);
     border: 1px solid rgba(255, 255, 255, 0.07);
     border-radius: 14px;
     overflow: hidden;
     margin-bottom: 4px;
 }

 .tutorial-mat-preview .material-item {
     border-radius: 0;
     border-bottom: 1px solid rgba(255, 255, 255, 0.05);
 }

 .tutorial-mat-preview .material-item:last-child {
     border-bottom: none;
 }

 #container {
     position: absolute;
     inset: 0;
     width: 100vw;
     height: 100vh;
     background: #1d1d23;
 }

 input[type=number]::-webkit-inner-spin-button,
 input[type=number]::-webkit-outer-spin-button {
     -webkit-appearance: none;
     margin: 0;
 }

 input[type=number] {
     -moz-appearance: textfield;
 }

 :root {
     --guide-bg: #1d1d23;
     --md-surface: #25262f;
     --md-surface-2: #2c2e37;
     --md-surface-3: #31333d;
     --md-surface-hover: #353843;
     --md-surface-active: #3d404c;
     --md-on-surface: #e6e8ec;
     --md-on-surface-dim: rgba(230, 232, 236, 0.45);
     --md-accent: #7c9cff;
     --md-accent-dim: rgba(124, 156, 255, 0.18);
     --md-elevation-1: 0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.3);
     --md-elevation-2: 0 3px 10px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.25);
     --md-elevation-3: 0 6px 20px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
     --md-radius-fab: 16px;
     --md-radius-pill: 50px;
     --md-radius-card: 18px;
 }

 .md-btn {
     position: relative;
     overflow: hidden;
     -webkit-tap-highlight-color: transparent;
     cursor: pointer;
     border: none;
     outline: none;
     user-select: none;
     transition: background 0.22s ease, box-shadow 0.22s ease, transform 0.12s ease;
 }

 .md-btn::after {
     content: '';
     position: absolute;
     inset: 0;
     border-radius: inherit;
     background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
     opacity: 0;
     transform: scale(0);
     transition: opacity 0.4s ease, transform 0.4s ease;
     pointer-events: none;
 }

 .md-btn:active::after {
     opacity: 1;
     transform: scale(2.5);
     transition: none;
 }

 .md-btn:active {
     transform: scale(0.94);
 }

 .md-fab {
     width: 56px;
     height: 56px;
     border-radius: var(--md-radius-fab);
     background: var(--md-surface);
     color: var(--md-on-surface);
     font-size: 22px;
     display: flex;
     align-items: center;
     justify-content: center;
     box-shadow: var(--md-elevation-2);
     border: 1px solid rgba(255, 255, 255, 0.06);
 }

 .md-fab:hover {
     background: var(--md-surface-hover);
     box-shadow: var(--md-elevation-3);
 }

 .md-fab:active {
     background: var(--md-surface-active);
     box-shadow: var(--md-elevation-1);
 }

 .md-fab--accent:hover {
     background: var(--md-accent-dim);
     border-color: rgba(124, 156, 255, 0.22);
     color: var(--md-accent);
 }

 .md-fab.active-toggle {
     background: rgba(64, 72, 80, 0.95);
 }

 .md-fab-extended {
     height: 52px;
     padding: 0 20px 0 16px;
     border-radius: var(--md-radius-pill);
     background: var(--md-surface);
     color: var(--md-on-surface);
     font-size: 14px;
     font-weight: 600;
     letter-spacing: 0.03em;
     display: flex;
     align-items: center;
     gap: 10px;
     box-shadow: var(--md-elevation-3);
     border: 1px solid rgba(255, 255, 255, 0.06);
     white-space: nowrap;
 }

 .md-fab-extended .fab-icon {
     width: 32px;
     height: 32px;
     border-radius: 10px;
     background: rgba(255, 255, 255, 0.06);
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 15px;
     transition: background 0.2s;
     flex-shrink: 0;
 }

 .md-fab-extended:hover {
     background: var(--md-surface-hover);
     box-shadow: var(--md-elevation-3);
 }

 .md-fab-extended:hover .fab-icon {
     background: rgba(255, 255, 255, 0.1);
 }

 .md-fab-extended:active {
     background: var(--md-surface-active);
 }

 .nav-arrow {
     position: absolute;
     top: 50%;
     width: 52px;
     height: 52px;
     margin-top: -26px;
     border-radius: var(--md-radius-fab);
     background: var(--md-surface);
     color: var(--md-on-surface);
     font-size: 20px;
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     box-shadow: var(--md-elevation-2);
     border: 1px solid rgba(255, 255, 255, 0.06);
     z-index: 999;
     user-select: none;
     -webkit-tap-highlight-color: transparent;
     transition: background 0.22s ease, box-shadow 0.22s ease, transform 0.12s ease;
     overflow: hidden;
 }

 .nav-arrow::after {
     content: '';
     position: absolute;
     inset: 0;
     border-radius: inherit;
     background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
     opacity: 0;
     transform: scale(0);
     transition: opacity 0.4s ease, transform 0.4s ease;
     pointer-events: none;
 }

 .nav-arrow:hover {
     background: var(--md-surface-hover);
     box-shadow: var(--md-elevation-3);
 }

 .nav-arrow:active::after {
     opacity: 1;
     transform: scale(2.5);
     transition: none;
 }

 .nav-arrow:active {
     transform: scale(0.94);
     background: var(--md-surface-active);
 }

 #arrow-left {
     left: 28px;
 }

 #arrow-right {
     right: 28px;
 }

 #bottom-nav-bar {
     position: fixed;
     bottom: 28px;
     left: 50%;
     transform: translateX(-50%);
     display: flex;
     align-items: stretch;
     z-index: 999;
     background: var(--md-surface);
     border: 1px solid rgba(255, 255, 255, 0.08);
     border-radius: 14px;
     box-shadow: var(--md-elevation-2);
     overflow: hidden;
 }

 .block-arrow,
 .row-arrow {
     width: 44px;
     height: 44px;
     background: transparent;
     font-size: 14px;
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     border: none;
     border-left: 1px solid rgba(255, 255, 255, 0.06);
     user-select: none;
     -webkit-tap-highlight-color: transparent;
     transition: background 0.18s ease;
     flex-shrink: 0;
     position: relative;
 }

 .block-arrow:first-child,
 .row-arrow:first-child {
     border-left: none;
 }

 .block-arrow {
     color: var(--md-accent);
 }

 .row-arrow {
     color: #7fffc4;
 }

 .block-arrow:hover,
 .row-arrow:hover {
     background: rgba(255, 255, 255, 0.06);
 }

 .block-arrow:active,
 .row-arrow:active {
     background: rgba(255, 255, 255, 0.12);
 }

 .block-arrow.block-nav-active {
     background: rgba(124, 156, 255, 0.15);
 }

 .row-arrow.row-nav-active {
     background: rgba(127, 255, 196, 0.1);
 }

 #block-scroll-center {
     width: 170px;
     height: 44px;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 7px;
     padding: 0 10px;
     border-left: 1px solid rgba(255, 255, 255, 0.06);
     border-right: 1px solid rgba(255, 255, 255, 0.06);
     cursor: pointer;
     user-select: none;
     -webkit-tap-highlight-color: transparent;
     transition: background 0.18s ease;
     flex-shrink: 0;
 }

 #block-scroll-center:hover {
     background: rgba(255, 255, 255, 0.06);
 }

 #block-scroll-center:active {
     background: rgba(255, 255, 255, 0.1);
 }

 #block-scroll-img {
     width: 26px;
     height: 26px;
     object-fit: contain;
     image-rendering: pixelated;
     border-radius: 3px;
     display: none;
     pointer-events: none;
     flex-shrink: 0;
 }

 #block-scroll-info {
     display: flex;
     flex-direction: column;
     align-items: flex-start;
     pointer-events: none;
 }

 #block-scroll-name {
     font-size: 10px;
     font-weight: 600;
     color: rgba(255, 255, 255, 0.85);
     max-width: 120px;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
     line-height: 1.2;
     display: none;
 }

 #block-scroll-label {
     font-size: 11px;
     font-weight: 600;
     color: rgba(255, 255, 255, 0.3);
     letter-spacing: 0.03em;
     transition: color 0.2s ease;
     pointer-events: none;
     line-height: 1.2;
 }

 #block-scroll-center.block-nav-active #block-scroll-label {
     color: var(--md-accent);
 }

 #build-indicator {
     position: absolute;
     top: 16px;
     left: 50%;
     transform: translateX(-50%);
     color: var(--md-on-surface);
     background: var(--md-surface);
     padding: 10px 28px;
     border-radius: var(--md-radius-pill);
     font-size: 1.15em;
     font-weight: 600;
     letter-spacing: 0.02em;
     z-index: 10;
     border: 1px solid rgba(255, 255, 255, 0.06);
     box-shadow: var(--md-elevation-2);
 }

 #b-top {
     position: absolute;
     top: 16px;
     right: 16px;
     display: flex;
     flex-direction: row;
     gap: 10px;
     align-items: flex-start;
     z-index: 15;
 }

 #b-main {
     display: flex;
     flex-direction: column;
     gap: 8px;
 }

 #settings-panel {
     display: flex;
     flex-direction: column;
     gap: 8px;
     transform: translateX(100%);
     opacity: 0;
     pointer-events: none;
     transition: transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.25s ease;
 }

 #settings-panel.active {
     transform: translateX(0);
     opacity: 1;
     pointer-events: auto;
 }

 #b-bottom {
     position: absolute;
     top: 16px;
     left: 16px;
     display: flex;
     gap: 12px;
     z-index: 15;
 }

 #help-button {
     position: absolute;
     bottom: 32px;
     right: 16px;
     z-index: 15;
     width: 44px;
     height: 44px;
     border-radius: 50%;
     background: var(--md-surface);
     color: rgba(255, 255, 255, 0.45);
     font-size: 17px;
     font-weight: 700;
     display: flex;
     align-items: center;
     justify-content: center;
     box-shadow: var(--md-elevation-2);
     border: 1px solid rgba(255, 255, 255, 0.06);
     cursor: pointer;
     transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, transform 0.12s ease;
     -webkit-tap-highlight-color: transparent;
     user-select: none;
 }

 #help-button:hover {
     background: var(--md-accent-dim);
     border-color: rgba(124, 156, 255, 0.25);
     color: var(--md-accent);
     box-shadow: var(--md-elevation-3);
 }

 #help-button:active {
     transform: scale(0.92);
     box-shadow: var(--md-elevation-1);
 }

 #home-button {
     position: absolute;
     bottom: 32px;
     left: 16px;
     z-index: 15;
     width: 44px;
     height: 44px;
     border-radius: 50%;
     background: var(--md-surface);
     color: rgba(255, 255, 255, 0.45);
     font-size: 17px;
     font-weight: 700;
     display: flex;
     align-items: center;
     justify-content: center;
     box-shadow: var(--md-elevation-2);
     border: 1px solid rgba(255, 255, 255, 0.06);
     cursor: pointer;
     transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, transform 0.12s ease;
     -webkit-tap-highlight-color: transparent;
     user-select: none;
 }

 #home-button:hover {
     background: var(--md-accent-dim);
     border-color: rgba(124, 156, 255, 0.25);
     color: var(--md-accent);
     box-shadow: var(--md-elevation-3);
 }

 #home-button:active {
     transform: scale(0.92);
     box-shadow: var(--md-elevation-1);
 }

 .bg-color-wrapper {
     position: relative;
     display: inline-block;
 }

 #bg-color-options {
     position: absolute;
     top: 50%;
     right: 66px;
     transform: translateY(-50%) translateX(20px);
     display: flex;
     gap: 8px;
     opacity: 0;
     pointer-events: none;
     transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
 }

 #bg-color-options.active {
     opacity: 1;
     transform: translateY(-50%) translateX(0);
     pointer-events: auto;
 }

 .color-btn {
     width: 40px;
     height: 40px;
     border-radius: 50%;
     border: 2px solid rgba(0, 0, 0, 0.3);
     cursor: pointer;
     box-shadow: var(--md-elevation-1);
     transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
 }

 .color-btn:hover {
     transform: scale(1.12);
     border-color: rgba(255, 255, 255, 0.6);
     box-shadow: var(--md-elevation-2);
 }

 #hud {
     position: absolute;
     top: 16px;
     left: 16px;
     padding: 8px 18px;
     font-size: 15px;
     font-weight: 600;
     background: rgba(14, 16, 26, 0.9);
     color: #e8edff;
     border-radius: 30px;
     border: 1px solid rgba(124, 156, 255, 0.38);
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(124, 156, 255, 0.08);
     display: none;
     z-index: 999;
     text-align: center;
     backdrop-filter: blur(10px);
     letter-spacing: 0.01em;
 }

 #popup-overlay {
     position: fixed;
     inset: 0;
     display: flex;
     justify-content: flex-end;
     align-items: flex-end;
     z-index: 1000;
     pointer-events: none;
     opacity: 0;
     transition: opacity 0.35s ease;
 }

 #popup-overlay.show {
     opacity: 1;
     pointer-events: auto;
 }

 #popup-overlay::before {
     content: '';
     position: absolute;
     inset: 0;
     background: rgba(0, 0, 0, 0.5);
     opacity: 0;
     transition: opacity 0.35s ease;
     pointer-events: none;
 }

 #popup-overlay.show::before {
     opacity: 1;
     pointer-events: auto;
 }

 .popup-content {
     position: relative;
     width: 420px;
     max-width: calc(100vw - 32px);
     max-height: 72vh;
     background: var(--guide-bg);
     border: 1px solid rgba(255, 255, 255, 0.07);
     border-radius: 22px 22px 0 0;
     display: flex;
     flex-direction: column;
     overflow: hidden;
     transform: translateY(60px);
     opacity: 0;
     transition: transform 0.38s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.3s ease;
     box-shadow: 0 -8px 60px rgba(0, 0, 0, 0.55), 0 -2px 0 rgba(255, 255, 255, 0.04) inset;
     z-index: 1;
     margin-right: 24px;
 }

 @media (min-width: 769px) {
     #popup-overlay {
         justify-content: center;
         align-items: center;
     }
     .popup-content {
         border-radius: 22px;
         max-height: 78vh;
         margin: 0;
         transform: translateY(24px) scale(0.97);
         transition: transform 0.38s cubic-bezier(0.34, 1.25, 0.64, 1), opacity 0.28s ease;
     }
     .popup-handle {
         display: none;
     }
 }

 #popup-overlay.show .popup-content {
     transform: translateY(0) scale(1);
     opacity: 1;
 }

 .popup-handle {
     width: 36px;
     height: 4px;
     border-radius: 2px;
     background: rgba(255, 255, 255, 0.15);
     margin: 12px auto 0;
     flex-shrink: 0;
 }

 .popup-header {
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 18px 22px 14px;
     flex-shrink: 0;
     border-bottom: 1px solid rgba(255, 255, 255, 0.06);
 }

 .popup-header-left {
     display: flex;
     flex-direction: column;
     gap: 2px;
 }

 .popup-title {
     color: #fff;
     font-weight: 700;
     font-size: 1.15em;
     letter-spacing: 0.01em;
     line-height: 1.2;
 }

 .popup-subtitle {
     color: rgba(255, 255, 255, 0.35);
     font-size: 0.75em;
     font-weight: 400;
     letter-spacing: 0.02em;
 }

 .popup-view-tabs {
     display: flex;
     gap: 6px;
     padding: 10px 14px;
     flex-shrink: 0;
 }

 .view-tab {
     flex: 1;
     padding: 8px 12px;
     background: rgba(255, 255, 255, 0.04);
     border: 1px solid rgba(255, 255, 255, 0.07);
     border-radius: 12px;
     color: rgba(255, 255, 255, 0.38);
     font-size: 12px;
     font-weight: 500;
     cursor: pointer;
     transition: all 0.22s ease;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 6px;
     position: relative;
     overflow: hidden;
 }

 .view-tab:hover {
     background: rgba(255, 255, 255, 0.07);
     color: rgba(255, 255, 255, 0.65);
     border-color: rgba(255, 255, 255, 0.12);
 }

 .view-tab.active {
     background: rgba(124, 156, 255, 0.12);
     border-color: rgba(124, 156, 255, 0.28);
     color: var(--md-accent);
     font-weight: 600;
 }

 .close-btn {
     width: 34px;
     height: 34px;
     border-radius: 50%;
     background: rgba(255, 255, 255, 0.07);
     border: 1px solid rgba(255, 255, 255, 0.07);
     color: rgba(255, 255, 255, 0.65);
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     font-size: 14px;
     transition: background 0.2s, color 0.2s, border-color 0.2s;
     flex-shrink: 0;
 }

 .close-btn:hover {
     background: rgba(255, 255, 255, 0.13);
     color: #fff;
     border-color: rgba(255, 255, 255, 0.16);
 }

 .popup-progress-bar {
     height: 5px;
     background: rgba(255, 255, 255, 0.06);
     flex-shrink: 0;
     overflow: hidden;
 }

 .popup-progress-fill {
     height: 100%;
     background: linear-gradient(90deg, var(--md-accent), #a78bfa);
     width: 0%;
     transition: width 0.5s cubic-bezier(0.34, 1.1, 0.64, 1);
     border-radius: 0 3px 3px 0;
 }

 .popup-search-wrap {
     padding: 12px 14px 4px;
     flex-shrink: 0;
     position: relative;
 }

 .popup-search {
     width: 100%;
     background: rgba(255, 255, 255, 0.06);
     border: 1px solid rgba(255, 255, 255, 0.08);
     border-radius: 12px;
     color: #fff;
     font-size: 13px;
     padding: 9px 14px 9px 38px;
     outline: none;
     box-sizing: border-box;
     transition: border-color 0.2s, background 0.2s;
 }

 .popup-search:focus {
     border-color: rgba(124, 156, 255, 0.35);
     background: rgba(255, 255, 255, 0.09);
 }

 .popup-search::placeholder {
     color: rgba(255, 255, 255, 0.22);
 }

 .popup-search-icon {
     position: absolute;
     left: 26px;
     top: 50%;
     transform: translateY(-50%);
     color: rgba(255, 255, 255, 0.28);
     font-size: 12px;
     pointer-events: none;
 }

 .table-scroll {
     flex: 1;
     overflow-y: auto;
     overscroll-behavior: contain;
     padding: 0 8px 16px;
 }

 .table-scroll::-webkit-scrollbar {
     width: 4px;
 }

 .table-scroll::-webkit-scrollbar-track {
     background: transparent;
 }

 .table-scroll::-webkit-scrollbar-thumb {
     background: rgba(255, 255, 255, 0.1);
     border-radius: 4px;
 }

 .table-scroll::-webkit-scrollbar-thumb:hover {
     background: rgba(255, 255, 255, 0.2);
 }

 .table-scroll {
     scrollbar-width: thin;
     scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
 }

 .material-list {
     list-style: none;
     margin: 0;
     padding: 0;
     display: flex;
     flex-direction: column;
     gap: 2px;
 }

 .material-item {
     display: flex;
     align-items: center;
     gap: 12px;
     padding: 10px 12px;
     border-radius: 12px;
     cursor: pointer;
     transition: background 0.18s ease;
     user-select: none;
     -webkit-tap-highlight-color: transparent;
 }

 .material-item:hover {
     background: rgba(255, 255, 255, 0.06);
 }

 .material-item:active {
     background: rgba(255, 255, 255, 0.09);
 }

 .material-item.done .material-name {
     text-decoration: line-through;
     color: rgba(255, 255, 255, 0.28);
 }

 .material-item.done .material-qty {
     color: rgba(255, 255, 255, 0.18);
 }

 .material-item.done .material-img-wrap {
     opacity: 0.3;
 }

 .material-img-wrap {
     width: 44px;
     height: 44px;
     border-radius: 10px;
     background: rgba(255, 255, 255, 0.05);
     display: flex;
     align-items: center;
     justify-content: center;
     flex-shrink: 0;
     overflow: hidden;
     transition: opacity 0.2s;
 }

 .material-img-wrap img {
     width: 36px;
     height: 36px;
     image-rendering: pixelated;
     object-fit: contain;
 }

 .material-info {
     flex: 1;
     min-width: 0;
 }

 .material-name {
     color: #fff;
     font-size: 13.5px;
     font-weight: 500;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
     transition: color 0.2s;
     line-height: 1.25;
 }

 .material-qty {
     color: rgba(255, 255, 255, 0.38);
     font-size: 11.5px;
     font-weight: 400;
     margin-top: 2px;
     transition: color 0.2s;
 }

 .material-check {
     width: 22px;
     height: 22px;
     border-radius: 6px;
     border: 1.5px solid rgba(255, 255, 255, 0.16);
     background: transparent;
     display: flex;
     align-items: center;
     justify-content: center;
     flex-shrink: 0;
     transition: border-color 0.2s, background 0.2s;
 }

 .material-item.done .material-check {
     background: var(--md-accent);
     border-color: var(--md-accent);
 }

 .material-check-icon {
     opacity: 0;
     color: #fff;
     font-size: 11px;
     transform: scale(0.5);
     transition: opacity 0.18s ease, transform 0.18s ease;
 }

 .material-item.done .material-check-icon {
     opacity: 1;
     transform: scale(1);
 }

 .group-container {
     margin-bottom: 6px;
     border-radius: 14px;
     overflow: hidden;
     border: 1px solid rgba(255, 255, 255, 0.05);
 }

 .group-header {
     display: flex;
     align-items: center;
     gap: 12px;
     padding: 11px 12px;
     cursor: pointer;
     background: rgba(255, 255, 255, 0.035);
     user-select: none;
     -webkit-tap-highlight-color: transparent;
     transition: background 0.18s;
     position: relative;
 }

 .group-header:hover {
     background: rgba(255, 255, 255, 0.065);
 }

 .group-header.done .material-name {
     text-decoration: line-through;
     color: rgba(255, 255, 255, 0.28);
 }

 .group-header.done .material-qty {
     color: rgba(255, 255, 255, 0.18);
 }

 .group-header.done .material-img-wrap {
     opacity: 0.3;
 }

 .group-header.done .material-check {
     background: var(--md-accent);
     border-color: var(--md-accent);
 }

 .group-header.done .material-check-icon {
     opacity: 1;
     transform: scale(1);
 }

 .group-chevron {
     font-size: 11px;
     color: rgba(255, 255, 255, 0.35);
     transition: transform 0.22s ease, color 0.2s;
     flex-shrink: 0;
     width: 16px;
     text-align: center;
 }

 .group-header.expanded .group-chevron {
     transform: rotate(90deg);
     color: rgba(255, 255, 255, 0.6);
 }

 .group-children {
     overflow: hidden;
     max-height: 0;
     transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
     background: rgba(0, 0, 0, 0.15);
 }

 .group-children.open {
     max-height: 800px;
 }

 .child-item {
     display: flex;
     align-items: center;
     gap: 12px;
     padding: 9px 12px 9px 16px;
     cursor: pointer;
     user-select: none;
     -webkit-tap-highlight-color: transparent;
     transition: background 0.18s;
     position: relative;
 }

 .child-item::before {
     content: '';
     position: absolute;
     left: 20px;
     top: 0;
     bottom: 0;
     width: 2px;
     background: rgba(255, 255, 255, 0.08);
 }

 .child-item:last-child::before {
     height: 50%;
     bottom: auto;
 }

 .child-item:hover {
     background: rgba(255, 255, 255, 0.05);
 }

 .child-item:active {
     background: rgba(255, 255, 255, 0.08);
 }

 .child-item.done .material-name {
     text-decoration: line-through;
     color: rgba(255, 255, 255, 0.28);
 }

 .child-item.done .material-qty {
     color: rgba(255, 255, 255, 0.18);
 }

 .child-item.done .material-img-wrap {
     opacity: 0.3;
 }

 .child-item.done .material-check {
     background: var(--md-accent);
     border-color: var(--md-accent);
 }

 .child-item.done .material-check-icon {
     opacity: 1;
     transform: scale(1);
 }

 .child-item .material-img-wrap {
     width: 36px;
     height: 36px;
     border-radius: 8px;
     margin-left: 14px;
 }

 .child-item .material-img-wrap img {
     width: 28px;
     height: 28px;
 }

 .child-item .material-name {
     font-size: 12.5px;
 }

 .child-item .material-qty {
     font-size: 11px;
 }

 .craft-note {
     font-size: 10px;
     color: rgba(255, 255, 255, 0.28);
     background: rgba(255, 255, 255, 0.06);
     border-radius: 6px;
     padding: 2px 7px;
     white-space: nowrap;
     flex-shrink: 0;
     font-weight: 500;
     letter-spacing: 0.02em;
 }

 .extra-logs-badge {
     font-size: 10px;
     font-weight: 600;
     color: #ffd97a;
     background: rgba(255, 200, 60, 0.12);
     border: 1px solid rgba(255, 200, 60, 0.2);
     border-radius: 7px;
     padding: 2px 8px;
     flex-shrink: 0;
     white-space: nowrap;
 }

 .standalone-item {
     display: flex;
     align-items: center;
     gap: 12px;
     padding: 10px 12px;
     border-radius: 12px;
     cursor: pointer;
     transition: background 0.18s ease;
     user-select: none;
     -webkit-tap-highlight-color: transparent;
 }

 .standalone-item:hover {
     background: rgba(255, 255, 255, 0.06);
 }

 .standalone-item:active {
     background: rgba(255, 255, 255, 0.09);
 }

 .standalone-item.done .material-name {
     text-decoration: line-through;
     color: rgba(255, 255, 255, 0.28);
 }

 .standalone-item.done .material-qty {
     color: rgba(255, 255, 255, 0.18);
 }

 .standalone-item.done .material-img-wrap {
     opacity: 0.3;
 }

 .standalone-item.done .material-check {
     background: var(--md-accent);
     border-color: var(--md-accent);
 }

 .standalone-item.done .material-check-icon {
     opacity: 1;
     transform: scale(1);
 }

 .group-synthetic {
     border-color: rgba(255, 200, 60, 0.12);
 }

 .group-header-synth {
     background: rgba(255, 200, 60, 0.04);
 }

 .group-header-synth:hover {
     background: rgba(255, 200, 60, 0.08) !important;
 }

 .synth-badge {
     background: rgba(255, 160, 30, 0.14) !important;
     border-color: rgba(255, 160, 30, 0.28) !important;
     color: #ffb347 !important;
 }

 .section-label {
     font-size: 10px;
     font-weight: 600;
     letter-spacing: 0.08em;
     text-transform: uppercase;
     color: rgba(255, 255, 255, 0.2);
     padding: 12px 12px 6px;
 }

 .empty-state {
     display: none;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     padding: 40px 20px;
     color: rgba(255, 255, 255, 0.25);
     font-size: 13px;
     gap: 8px;
 }

 .empty-state i {
     font-size: 28px;
     opacity: 0.4;
 }

 .popup-footer {
     flex-shrink: 0;
     border-top: 1px solid rgba(255, 255, 255, 0.06);
     padding: 12px 18px;
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 8px;
 }

 .popup-footer-count {
     color: rgba(255, 255, 255, 0.3);
     font-size: 12px;
 }

 .popup-footer-count span {
     color: rgba(255, 255, 255, 0.65);
     font-weight: 600;
 }

 .popup-reset-btn {
     background: transparent;
     border: 1px solid rgba(255, 255, 255, 0.1);
     color: rgba(255, 255, 255, 0.42);
     font-size: 12px;
     font-weight: 500;
     padding: 6px 16px;
     border-radius: 20px;
     cursor: pointer;
     letter-spacing: 0.02em;
     transition: border-color 0.2s, color 0.2s, background 0.2s;
     position: relative;
     overflow: hidden;
 }

 .popup-reset-btn:hover {
     border-color: rgba(255, 255, 255, 0.22);
     color: rgba(255, 255, 255, 0.75);
     background: rgba(255, 255, 255, 0.05);
 }

 .popup-content table {
     display: none;
 }

 #btn-img {
     width: 28px;
 }

 #block-tooltip {
     position: fixed;
     z-index: 500;
     pointer-events: none;
     display: flex;
     align-items: center;
     gap: 10px;
     background: var(--md-surface);
     border: 1px solid rgba(255, 255, 255, 0.1);
     border-radius: 14px;
     padding: 8px 14px 8px 10px;
     box-shadow: var(--md-elevation-3);
     opacity: 0;
     transform: translateY(6px) scale(0.97);
     transition: opacity 0.18s ease, transform 0.18s ease;
     max-width: 280px;
 }

 #block-tooltip.visible {
     opacity: 1;
     transform: translateY(0) scale(1);
 }

 #block-tooltip-img {
     width: 40px;
     height: 40px;
     border-radius: 8px;
     image-rendering: pixelated;
     flex-shrink: 0;
     background: rgba(255, 255, 255, 0.05);
 }

 #block-tooltip-text {
     display: flex;
     flex-direction: column;
     gap: 2px;
 }

 #block-tooltip-name {
     color: #fff;
     font-size: 14px;
     font-weight: 600;
     line-height: 1.2;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
     max-width: 180px;
 }

 #fov-slider-container {
     position: absolute;
     top: 50%;
     right: 66px;
     transform: translateY(-50%) translateX(20px);
     background: var(--md-surface);
     border: 1px solid rgba(255, 255, 255, 0.06);
     padding: 14px 18px;
     border-radius: 14px;
     display: flex;
     flex-direction: column;
     gap: 12px;
     opacity: 0;
     pointer-events: none;
     transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
     box-shadow: var(--md-elevation-3);
     min-width: 200px;
 }

 #fov-slider-container.active {
     opacity: 1;
     transform: translateY(-50%) translateX(0);
     pointer-events: auto;
 }

 #fov-slider-container label {
     color: var(--md-on-surface);
     font-size: 0.9em;
     text-align: center;
 }

 #fov-slider {
     width: 100%;
     height: 6px;
     -webkit-appearance: none;
     appearance: none;
     background: rgba(255, 255, 255, 0.14);
     border-radius: 3px;
     outline: none;
     cursor: pointer;
 }

 #fov-slider::-webkit-slider-thumb {
     -webkit-appearance: none;
     appearance: none;
     width: 18px;
     height: 18px;
     background: var(--md-accent);
     border-radius: 50%;
     cursor: pointer;
     box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.2);
     transition: background 0.2s, box-shadow 0.2s;
 }

 #fov-slider::-webkit-slider-thumb:hover {
     background: #a0b8ff;
     box-shadow: 0 0 0 5px rgba(124, 156, 255, 0.25);
 }

 #fov-slider::-moz-range-thumb {
     width: 18px;
     height: 18px;
     background: var(--md-accent);
     border-radius: 50%;
     cursor: pointer;
     border: none;
 }

 #change-mode {
     display: none;
 }

 @media (max-width: 768px) {
     #b-top {
         top: 6px;
         right: 6px;
         gap: 6px;
     }
     #b-main {
         gap: 6px;
     }
     #settings-panel {
         gap: 6px;
     }
     #fov-slider-container {
         right: 46px;
         min-width: 150px;
         padding: 10px 14px;
     }
     #b-bottom {
         top: 6px;
         left: 6px;
         gap: 12px;
     }
     .nav-arrow {
         width: 44px;
         height: 44px;
         font-size: 17px;
     }
     #arrow-left {
         left: 12px;
     }
     #arrow-right {
         right: 12px;
     }
     #bottom-nav-bar {
         bottom: 16px;
     }
     .block-arrow,
     .row-arrow {
         width: 36px;
         height: 36px;
         font-size: 12px;
     }
     #block-scroll-center {
         width: 110px;
         height: 36px;
         gap: 5px;
         padding: 0 8px;
     }
     #block-scroll-img {
         width: 20px;
         height: 20px;
     }
     #block-scroll-name {
         font-size: 9px;
         max-width: 80px;
     }
     #block-scroll-label {
         font-size: 10px;
     }
     .md-fab {
         width: 44px;
         height: 44px;
         font-size: 18px;
     }
     .md-fab-extended {
         height: 44px;
         font-size: 13px;
         padding: 0 16px 0 12px;
     }
     #material-button {
         width: 44px;
         height: 44px;
         align-items: center;
         justify-content: center;
         padding: 0;
         border-radius: var(--md-radius-fab);
         font-size: 0;
         gap: 0;
     }
     #material-button .fab-icon {
         width: auto;
         height: auto;
         background: none;
         border-radius: 0;
         font-size: 18px;
     }
     #build-indicator {
         font-size: 0.95em;
         padding: 7px 18px;
     }
     #hud {
         font-size: 13px;
         padding: 7px 14px;
     }
     #btn-img {
         width: 22px;
     }
     .color-btn {
         width: 32px;
         height: 32px;
     }
     #bg-color-options {
         right: 52px;
         gap: 6px;
     }
     .popup-content {
         width: 100%;
         max-width: 100%;
         border-radius: 20px 20px 0 0;
         margin: 0;
         max-height: 80vh;
     }
     #popup-overlay {
         justify-content: center;
         align-items: flex-end;
     }
     #block-tooltip {
         padding: 6px 10px 6px 8px;
         gap: 8px;
         border-radius: 10px;
     }
     #block-tooltip-img {
         width: 32px;
         height: 32px;
     }
     #block-tooltip-name {
         font-size: 12px;
     }
     #change-mode {
         display: none;
     }
     #blocked-overlay h2 {
         font-size: 22px;
     }
     #blocked-overlay .overlay-content {
         padding: 28px 20px 22px;
     }
     .overlay-subtitle {
         font-size: 13.5px;
     }
     body.overlay-open #arrow-left,
     body.overlay-open #arrow-right {
         display: none;
     }
     #overlay-back-btn {
         display: flex;
         position: absolute;
         top: 16px;
         left: 16px;
         width: 36px;
         height: 36px;
         border-radius: 10px;
         background: rgba(255, 255, 255, 0.08);
         border: 1px solid rgba(255, 255, 255, 0.1);
         color: rgba(255, 255, 255, 0.7);
         font-size: 14px;
         cursor: pointer;
         align-items: center;
         justify-content: center;
         transition: background 0.18s;
         -webkit-tap-highlight-color: transparent;
     }
     #overlay-back-btn:active {
         background: rgba(255, 255, 255, 0.15);
     }
     #small-cta {
         gap: 5px;
         bottom: 70px;
     }
     #small-cta button {
         padding: 6px 12px;
         font-size: 16px;
     }
     #small-cta p {
         font-size: 14px;
         width: 250px;
         margin-top: 0;
     }
     #small-cta p2 {
         font-size: 18px;
     }
     #help-button {
         bottom: 56px;
         right: 8px;
         width: 32px;
         height: 32px;
         font-size: 13px;
     }
     #home-button {
         bottom: 56px;
         left: 8px;
         width: 32px;
         height: 32px;
         font-size: 13px;
     }
     #explode-slider-container {
         right: 46px;
         min-width: 150px;
         padding: 10px 14px;
     }
     #mat-progress-badge {
         display: none !important;
     }
 }

 #explode-slider-container {
     position: absolute;
     top: 50%;
     right: 66px;
     transform: translateY(-50%) translateX(20px);
     background: var(--md-surface);
     border: 1px solid rgba(255, 255, 255, 0.06);
     padding: 14px 18px;
     border-radius: 14px;
     display: flex;
     flex-direction: column;
     gap: 12px;
     opacity: 0;
     pointer-events: none;
     transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
     box-shadow: var(--md-elevation-3);
     min-width: 200px;
 }

 #explode-slider-container.active {
     opacity: 1;
     transform: translateY(-50%) translateX(0);
     pointer-events: auto;
 }

 #explode-mode-toggle {
     display: flex;
     background: rgba(255, 255, 255, 0.05);
     border-radius: 8px;
     padding: 2px;
     gap: 2px;
 }

 .explode-mode-btn {
     flex: 1;
     padding: 5px 0;
     border: none;
     border-radius: 6px;
     background: transparent;
     color: rgba(255, 255, 255, 0.35);
     font-size: 11px;
     font-weight: 600;
     cursor: pointer;
     transition: background 0.18s, color 0.18s;
     white-space: nowrap;
 }

 .explode-mode-btn.active {
     background: var(--md-accent-dim);
     color: var(--md-accent);
 }

 #explode-slider-container label {
     color: var(--md-on-surface);
     font-size: 0.9em;
     text-align: center;
 }

 #explode-slider {
     width: 100%;
     height: 6px;
     -webkit-appearance: none;
     appearance: none;
     background: rgba(255, 255, 255, 0.14);
     border-radius: 3px;
     outline: none;
     cursor: pointer;
 }

 #explode-slider::-webkit-slider-thumb {
     -webkit-appearance: none;
     appearance: none;
     width: 18px;
     height: 18px;
     background: var(--md-accent);
     border-radius: 50%;
     cursor: pointer;
     box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.2);
     transition: background 0.2s, box-shadow 0.2s;
 }

 #explode-slider::-webkit-slider-thumb:hover {
     background: #a0b8ff;
     box-shadow: 0 0 0 5px rgba(124, 156, 255, 0.25);
 }

 #explode-slider::-moz-range-thumb {
     width: 18px;
     height: 18px;
     background: var(--md-accent);
     border-radius: 50%;
     cursor: pointer;
     border: none;
 }

 /* === UX / Dopamine improvements === */

 @keyframes checkBounce {
     0% {
         transform: scale(0.4) rotate(-8deg);
     }
     55% {
         transform: scale(1.3) rotate(3deg);
     }
     78% {
         transform: scale(0.93);
     }
     100% {
         transform: scale(1) rotate(0deg);
     }
 }

 .material-check.bounce {
     animation: checkBounce 0.38s cubic-bezier(0.34, 1.5, 0.64, 1) both;
 }

 #mat-progress-badge {
     font-size: 10px;
     font-weight: 700;
     color: rgba(255, 255, 255, 0.38);
     background: rgba(255, 255, 255, 0.07);
     border: 1px solid rgba(255, 255, 255, 0.09);
     border-radius: 20px;
     padding: 1px 8px;
     line-height: 1.7;
     transition: color 0.3s, background 0.3s, border-color 0.3s;
     display: none;
     flex-shrink: 0;
 }

 #mat-progress-badge.visible {
     display: inline-block;
 }

 #mat-progress-badge.complete {
     color: #34d399;
     background: rgba(52, 211, 153, 0.15);
     border-color: rgba(52, 211, 153, 0.28);
 }

 @keyframes toastSlideIn {
     from {
         opacity: 0;
         transform: translateX(-50%) translateY(-10px) scale(0.95);
     }
     to {
         opacity: 1;
         transform: translateX(-50%) translateY(0) scale(1);
     }
 }

 @keyframes toastSlideOut {
     to {
         opacity: 0;
         transform: translateX(-50%) translateY(-8px) scale(0.97);
     }
 }

 @keyframes confettiRise {
     0% {
         opacity: 1;
         transform: translateY(0) rotate(0deg) scale(1);
     }
     100% {
         opacity: 0;
         transform: translateY(-90vh) rotate(540deg) scale(0.3);
     }
 }

 @media (max-width: 480px) {
     #disclaimer-popup {
         bottom: 0;
         left: 0;
         right: 0;
         width: 100%;
         max-width: 100%;
         border-radius: 16px 16px 0 0;
         padding: 14px 16px;
         gap: 10px;
     }
     #disclaimer-title {
         font-size: 12.5px;
     }
     #disclaimer-text {
         font-size: 11px;
     }
 }