/* NoScript fallback */
.noscript-wrap {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(145deg, #eff6ff 0%, #f8fafc 45%, #eef2ff 100%);
}

.noscript-card {
    width: min(560px, 92vw);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #bfdbfe;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(30, 64, 175, 0.16);
}

.noscript-head {
    background: linear-gradient(90deg, #1d4ed8, #2563eb);
    color: #ffffff;
    padding: 18px 20px;
}

.noscript-head h1 {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
}

.noscript-head p {
    margin: 4px 0 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #dbeafe;
    font-weight: 600;
}

.noscript-body {
    padding: 22px 20px 24px;
    text-align: center;
}

.noscript-icon {
    width: 110px;
    height: 110px;
    margin: 0 auto 12px;
}

.noscript-icon svg {
    width: 100%;
    height: 100%;
}

.noscript-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 800;
    color: #1d4ed8;
}

.noscript-text {
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

/* Full screen startup loader */
.startup-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #eff6ff 0%, #f8fafc 45%, #eef2ff 100%);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.startup-loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.startup-loader-card {
    width: min(560px, 92vw);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #bfdbfe;
    box-shadow: 0 20px 50px rgba(30, 64, 175, 0.16);
    background: #ffffff;
}

.startup-loader-head {
    padding: 18px 20px;
    background: linear-gradient(90deg, #1d4ed8, #2563eb);
    color: #ffffff;
}

.startup-loader-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.startup-loader-head p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #dbeafe;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.startup-loader-body {
    min-height: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
}

.startup-loader-text {
    margin: 0;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Startup dot loader */
.startup-dot-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 26px;
}

.startup-dot-loader span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
    transform: translateY(0);
    animation: startupDotBounce 0.9s ease-in-out infinite;
}

.startup-dot-loader span:nth-child(2) {
    animation-delay: 0.12s;
    background: #60a5fa;
}

.startup-dot-loader span:nth-child(3) {
    animation-delay: 0.24s;
    background: #1d4ed8;
}

@keyframes startupDotBounce {
    0%, 100% { transform: translateY(0); opacity: 0.65; }
    50% { transform: translateY(-8px); opacity: 1; }
}

 /* Custom Scrollbar for Palette */
        .custom-scroll::-webkit-scrollbar {
            width: 6px;
        }
        .custom-scroll::-webkit-scrollbar-track {
            background: #f1f1f1;
        }
        .custom-scroll::-webkit-scrollbar-thumb {
            background: #888;
            border-radius: 3px;
        }

        /* Video/Image Container Aspect Ratio */
        .media-container {
            position: relative;
            padding-bottom: 56.25%; /* 16:9 */
            height: 0;
            overflow: hidden;
            background: #000;
            border-radius: 8px;
        }
        .media-content {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        /* CBT option list styling (new UI) */
        .cbt-options-wrap {
            max-width: 860px;
            margin: 0 auto;
        }

        .cbt-options-header {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 12px;
            margin: 0 0 10px;
            padding: 10px 12px;
            background: #f9fafb;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
        }

        .cbt-options-title {
            font-size: 13px;
            font-weight: 800;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: #111827;
        }

        .cbt-options-subtitle {
            font-size: 12px;
            color: #6b7280;
            font-weight: 600;
        }

        .cbt-options-list {
            display: grid;
            grid-template-columns: 1fr;
            gap: 10px;
        }

        .cbt-option {
            position: relative;
            display: grid;
            grid-template-columns: 44px 1fr 22px;
            align-items: center;
            gap: 12px;
            padding: 12px 12px;
            border-radius: 12px;
            border: 2px solid #e5e7eb;
            background: #ffffff;
            cursor: pointer;
            transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
            user-select: none;
        }

        .cbt-option:active {
            transform: translateY(1px);
        }

        .cbt-option-input {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }

        .cbt-option-letter {
            width: 40px;
            height: 40px;
            display: grid;
            place-items: center;
            border-radius: 10px;
            font-weight: 900;
            color: #1f2937;
            background: #f3f4f6;
            border: 1px solid #e5e7eb;
        }

        .cbt-option-text {
            font-size: 15px;
            line-height: 1.35;
            color: #111827;
            font-weight: 600;
            word-break: break-word;
        }

        .cbt-option-indicator {
            width: 18px;
            height: 18px;
            border-radius: 999px;
            border: 2px solid #cbd5e1;
            background: #ffffff;
            box-shadow: inset 0 0 0 4px #ffffff;
            justify-self: end;
        }

        .cbt-option:hover {
            border-color: #93c5fd;
            background: #f8fbff;
        }

        .cbt-option:has(.cbt-option-input:focus-visible) {
            outline: 3px solid rgba(37, 99, 235, 0.18);
            outline-offset: 2px;
        }

        .cbt-option:has(.cbt-option-input:checked) {
            border-color: #2563eb;
            background: #eff6ff;
        }

        .cbt-option:has(.cbt-option-input:checked) .cbt-option-letter {
            background: #2563eb;
            border-color: #1d4ed8;
            color: #ffffff;
        }

        .cbt-option:has(.cbt-option-input:checked) .cbt-option-indicator {
            border-color: #2563eb;
            background: #2563eb;
            box-shadow: inset 0 0 0 4px #bfdbfe;
        }
        
        /* Review Mode Styling (new option states) */
        .cbt-option-correct {
            border-color: #16a34a !important;
            background: #dcfce7 !important;
        }

        .cbt-option-correct .cbt-option-letter {
            background: #16a34a;
            border-color: #15803d;
            color: #ffffff;
        }

        .cbt-option-correct .cbt-option-indicator {
            border-color: #16a34a;
            background: #16a34a;
            box-shadow: inset 0 0 0 4px #bbf7d0;
        }

        .cbt-option-wrong {
            border-color: #dc2626 !important;
            background: #fee2e2 !important;
        }

        .cbt-option-wrong .cbt-option-letter {
            background: #dc2626;
            border-color: #b91c1c;
            color: #ffffff;
        }

        .cbt-option-wrong .cbt-option-indicator {
            border-color: #dc2626;
            background: #dc2626;
            box-shadow: inset 0 0 0 4px #fecaca;
        }

        .cbt-option-muted {
            opacity: 0.62;
        }

        @media (min-width: 900px) {
            .cbt-options-list {
                grid-template-columns: 1fr 1fr;
                gap: 12px;
            }
        }

        @media (max-width: 420px) {
            .cbt-option {
                grid-template-columns: 40px 1fr 20px;
                padding: 10px;
                border-radius: 10px;
            }

            .cbt-option-letter {
                width: 36px;
                height: 36px;
                border-radius: 9px;
            }

            .cbt-option-text {
                font-size: 14px;
            }
        }

        /* Mobile Sidebar Animation */
        @media (max-width: 768px) {
            .sidebar {
                position: fixed;
                right: -100%;
                top: 0;
                height: 100%;
                z-index: 50;
                transition: right 0.3s ease;
            }
            .sidebar.active {
                right: 0;
            }
        }
        .report-btn {
  font-size: 12px;
  color: #dc2626;
  background: transparent;
  border: none;
  cursor: pointer;
  margin-bottom: 8px;
}

.report-btn:hover {
  text-decoration: underline;
}
.report-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Desktop popup */
.report-sheet {
  background: #fff;
  width: 600px;
  height: 100vh;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Mobile bottom sheet */
@media (max-width: 768px) {
  .report-modal {
    align-items: flex-end;
  }

  .report-sheet {
    width: 100%;
    height: 98vh;
    border-radius: 16px 16px 0 0;
  }
}

.report-header {
  padding: 10px 14px;
  background: #f9fafb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.report-header button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

#report-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.hidden {
  display: none;
}

/* Issue Selector Tiles */
.issue-grid {
    display: grid;
    grid-template-columns: repeat(2, 1x); /* 1 column on mobile */
    gap: 12px;
}

@media (min-width: 480px) {
    .issue-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on desktop */
    }
}

.issue-tile {
    cursor: pointer;
    position: relative;
    border: 2px solid #f3f4f6;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    background: #fff;
}

.issue-tile:hover {
    border-color: #dbeafe;
    background: #f8faff;
}

/* Hidden Radio Button Logic */
.issue-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.issue-radio:checked + .issue-tile {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}

.issue-tile i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
}

.issue-tile span {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* Specific colors for icons */
.icon-red { background: #fee2e2; color: #dc2626; }
.icon-blue { background: #dbeafe; color: #2563eb; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-purple { background: #f3e8ff; color: #9333ea; }
.icon-green { background: #dcfce7; color: #16a34a; }
.icon-gray { background: #f3f4f6; color: #4b5563; }

/* Modern Textarea Styling */
.feedback-container {
    position: relative;
    background: #f9fafb;
    border: 2px solid #f3f4f6;
    border-radius: 12px;
    transition: all 0.2s ease;
    padding: 2px; /* Small inner padding for the focus ring effect */
}

.feedback-container:focus-within {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.05);
}

.feedback-textarea {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #374151;
    min-height: 100px;
    resize: none; /* Keeps the professional look fixed */
}

.feedback-footer {
    display: flex;
    justify-content: flex-end;
    padding: 8px 12px;
    border-top: 1px solid #f3f4f6;
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Multi-column Input Row */
.input-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap; /* Allows stacking on very small screens */
}

.input-group {
    flex: 1; /* Makes both fields take equal width */
    min-width: 200px; /* Minimum width before stacking */
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    font-size: 14px;
}

.input-field {
    width: 100%;
    padding: 10px 12px 10px 36px; /* Extra padding on left for the icon */
    background-color: #f9fafb;
    border: 2px solid #f3f4f6;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: #2563eb;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.05);
}

/* CBT question meta row: Q number + Time on Q */
.cbt-q-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cbt-q-time-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #0f172a;
    color: #e5e7eb;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.35);
}

.cbt-q-time-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cbt-q-time-label i {
    color: #fbbf24;
}

.cbt-q-time-value {
    font-size: 14px;
    font-weight: 800;
    color: #f9fafb;
}

@media (max-width: 640px) {
    .cbt-q-time-pill {
        padding: 5px 10px;
    }

    .cbt-q-time-label {
        font-size: 10px;
    }

    .cbt-q-time-value {
        font-size: 14px;
    }
}

.cbt-q-number {
    min-width: 40px;
    height: 32px;
    padding: 5px 9px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-weight: 800;
    font-size: 14px;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cbt-q-number span {
    margin-left: 2px;
}

.cbt-q-text {
    font-size: 15px;
}

.cbt-q-topic-label {
    margin-top: 2px;
    margin-bottom: 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    font-weight: 600;
}

/* Solution panel redesign */
.cbt-solution-panel {
    border-top: 1px solid #e5e7eb;
}

.cbt-solution-title {
    font-weight: 800;
    color: #111827;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cbt-solution-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.cbt-sol-tab-btn {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #4b5563;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.cbt-sol-tab-btn:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #eff6ff;
}

.cbt-sol-tab-btn.active {
    border-color: #2563eb;
    color: #ffffff;
    background: #2563eb;
}

.cbt-solution-content {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 12px;
    color: #374151;
}

.cbt-sol-text p {
    line-height: 1.7;
    font-size: 15px;
}

.cbt-sol-image-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cbt-sol-image {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 6px;
}

.cbt-sol-enlarge-btn {
    align-self: flex-end;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1f2937;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 10px;
    transition: all 0.2s ease;
}

.cbt-sol-enlarge-btn:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #eff6ff;
}

.cbt-sol-video-wrap {
    border-radius: 10px;
    overflow: hidden;
}

.cbt-sol-video-player {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 28%),
        linear-gradient(160deg, #020617 0%, #0f172a 48%, #111827 100%);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.cbt-sol-video-player:fullscreen,
.cbt-sol-video-player.is-solution-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: 0;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.22), transparent 24%),
        linear-gradient(160deg, #020617 0%, #020617 100%);
}

.cbt-sol-video-player:fullscreen .cbt-sol-video-stage,
.cbt-sol-video-player.is-solution-fullscreen .cbt-sol-video-stage {
    height: calc(100vh - 118px);
    display: flex;
}

.cbt-sol-video-player:fullscreen .media-container,
.cbt-sol-video-player.is-solution-fullscreen .media-container {
    width: 100%;
    height: 100%;
    padding-bottom: 0;
}

.cbt-sol-video-player:fullscreen .cbt-sol-player-controls,
.cbt-sol-video-player.is-solution-fullscreen .cbt-sol-player-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin-top: 0;
    padding: 18px 18px 22px;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.88) 62%, rgba(2, 6, 23, 0.25) 100%);
}

.cbt-sol-video-player:fullscreen .cbt-sol-player-topbar,
.cbt-sol-video-player.is-solution-fullscreen .cbt-sol-player-topbar {
    top: 16px;
    left: 16px;
    right: 16px;
}

.cbt-sol-video-stage {
    position: relative;
    background: #000000;
}

.cbt-sol-video-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.8) 0%, rgba(2, 6, 23, 0) 46%);
}

.cbt-sol-player-frame,
.cbt-sol-player-frame iframe {
    width: 100%;
    height: 100%;
}

.cbt-sol-player-topbar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cbt-sol-player-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.72);
    color: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cbt-sol-player-status {
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
}

.cbt-sol-player-controls {
    position: relative;
    z-index: 3;
    margin-top: -2px;
    padding: 14px 14px 16px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.92));
}

.cbt-sol-progress-area {
    position: relative;
    width: 100%;
    height: 7px;
    background: rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    cursor: pointer;
    overflow: hidden;
}

.cbt-sol-progress-buffered {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: rgba(255, 255, 255, 0.18);
}

.cbt-sol-progress-filled {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: linear-gradient(90deg, #38bdf8, #3b82f6);
}

.cbt-sol-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #ffffff;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
}

.cbt-sol-controls-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.cbt-sol-controls-left,
.cbt-sol-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cbt-sol-control-btn {
    min-width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.cbt-sol-control-btn:hover {
    background: rgba(59, 130, 246, 0.24);
    transform: translateY(-1px);
}

.cbt-sol-control-btn.primary {
    background: #2563eb;
}

.cbt-sol-control-btn.primary:hover {
    background: #1d4ed8;
}

.cbt-sol-time-display {
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 700;
    min-width: 108px;
}

.cbt-sol-helper-text {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
}

/* CBT-style question image panel */
.cbt-question-image-wrap {
    width: 100%;
    max-width: 860px;
    margin: 0 0 1rem;
}

.cbt-question-image-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    min-height: 220px;
    max-height: 420px;
    background: #f8fafc;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    padding: 10px;
    box-shadow: inset 0 0 0 1px #eef2f7;
    overflow: hidden;
}

.cbt-question-image {
    width: 100%;
    height: 100%;
    max-height: 390px;
    object-fit: contain;
    object-position: left;
    border-radius: 8px;
    background: #ffffff;
}

.cbt-question-image:hover {
    opacity: 0.96;
}

.cbt-question-image-hint {
    margin-top: 8px;
    text-align: left;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Question/Solution image loader (theme matched) */
.image-loader-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(248, 250, 252, 0.92);
    border-radius: 12px;
    z-index: 2;
}

/* Ensure JS-added Tailwind hidden class actually hides loader */
.image-loader-wrap.hidden {
    display: none !important;
}

.image-loader-wrap p {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.image-loader-rings {
    width: 52px;
    height: 52px;
    position: relative;
}

.image-loader-rings span {
    position: absolute;
    border: 3px solid transparent;
    border-top-color: #2563eb;
    border-right-color: #60a5fa;
    border-radius: 999px;
    animation: imageRingSpin 1.2s linear infinite;
}

.image-loader-rings span:nth-child(1) {
    inset: 0;
}

.image-loader-rings span:nth-child(2) {
    inset: 8px;
    animation-duration: 1.45s;
    animation-direction: reverse;
}

.image-loader-rings span:nth-child(3) {
    inset: 16px;
    animation-duration: 1.75s;
}

@keyframes imageRingSpin {
    to { transform: rotate(360deg); }
}

.cbt-sol-image-wrap {
    position: relative;
}

@media (max-width: 1024px) {
    .cbt-question-image-shell {
        min-height: 200px;
        max-height: 360px;
        padding: 8px;
    }

    .cbt-question-image {
        max-height: 332px;
    }
}

@media (max-width: 768px) {
    .cbt-question-image-wrap {
        margin-bottom: 0.75rem;
    }

    .cbt-question-image-shell {
        min-height: 170px;
        max-height: 300px;
        border-radius: 10px;
    }

    .cbt-question-image {
        max-height: 274px;
        border-radius: 6px;
    }

    .cbt-question-image-hint {
        font-size: 11px;
    }
}

@media (max-width: 420px) {
    .cbt-question-image-shell {
        min-height: 150px;
        max-height: 240px;
        padding: 6px;
    }

    .cbt-question-image {
        max-height: 220px;
    }
}

/* Rate modal star design */
.rate-sheet {
    border: 1px solid #dbeafe;
    max-width: 640px;
    background:
        radial-gradient(circle at top right, rgba(250, 204, 21, 0.18), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.rate-header {
    background: linear-gradient(90deg, #1d4ed8, #2563eb);
    color: #ffffff;
}

.rate-header-copy {
    margin: 3px 0 0;
    font-size: 12px;
    color: rgba(219, 234, 254, 0.92);
    font-weight: 500;
}

.rate-hero-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff7d6 0%, #ffffff 55%, #eef6ff 100%);
    border: 1px solid #fde68a;
}

.rate-kicker {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #b45309;
}

.rate-hero-panel h4 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 800;
}

.rate-mood-copy {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 13px;
}

.rate-score-badge {
    min-width: 88px;
    height: 88px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #ffffff;
    font-size: 28px;
    font-weight: 900;
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.22);
}

.rate-stars {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.rate-star-btn {
    width: 54px;
    height: 54px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    color: #d1d5db;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
}

.rate-star-btn:hover {
    border-color: #f59e0b;
    color: #fbbf24;
    transform: translateY(-1px);
}

.rate-star-btn.active {
    border-color: #f59e0b;
    color: #f59e0b;
    background: #fffbeb;
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.24);
}

.rate-tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rate-tag-btn {
    border: 1px solid #dbeafe;
    background: #ffffff;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.rate-tag-btn:hover,
.rate-tag-btn.active {
    background: #eff6ff;
    border-color: #60a5fa;
    color: #1d4ed8;
}

.rate-snapshot-card {
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    border: 1px solid #dbeafe;
    border-radius: 18px;
    padding: 14px;
    color: #1e3a8a;
    display: grid;
    gap: 12px;
}

.rate-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.rate-snapshot-item {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dbeafe;
    padding: 10px;
}

.rate-snapshot-item span {
    display: block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6b7280;
}

.rate-snapshot-item strong {
    display: block;
    margin-top: 6px;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 800;
}

@media (max-width: 640px) {
    .rate-hero-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .rate-score-badge {
        width: 72px;
        height: 72px;
        min-width: 72px;
        border-radius: 18px;
        font-size: 22px;
    }

    .rate-snapshot-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cbt-sol-controls-main {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Result page review button redesign */
.review-sol-btn {
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    min-width: 290px;
    background: linear-gradient(120deg, #0f172a 0%, #1e293b 55%, #334155 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.review-sol-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.35);
    filter: brightness(1.03);
}

.review-sol-btn:active {
    transform: translateY(0);
}

.review-sol-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.review-sol-title {
    display: block;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.review-sol-sub {
    display: block;
    margin-top: 1px;
    font-size: 11px;
    color: #cbd5e1;
    font-weight: 600;
}

/* Result header restart button redesign */
.res-restart-btn {
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.14));
    color: #ffffff;
    border-radius: 12px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 22px rgba(30, 58, 138, 0.2);
    backdrop-filter: blur(3px);
    transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.res-restart-btn i {
    font-size: 12px;
}

.res-restart-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.33), rgba(255, 255, 255, 0.2));
}

/* Right-side floating support button */
#support-bot-btn {
    position: fixed;
    right: 16px;
    bottom: 18px;
    z-index: 170;
    width: 54px;
    height: 54px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    color: #ffffff;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
    transition: transform 0.2s ease, filter 0.2s ease;
}

#support-bot-btn.dev-btn-visible {
    display: inline-flex;
}

#support-bot-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

#support-bot-btn svg {
    width: 24px;
    height: 24px;
}

/* New Startup Loader Animations */
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-10px); } }
@keyframes pencilMove { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-5px, 10px); } 50% { transform: translate(5px, 20px); } 75% { transform: translate(-10px, 15px); } }
@keyframes progressFlow { 0% { width: 0%; transform: translateX(-100%); } 50% { width: 100%; transform: translateX(0%); } 100% { width: 100%; transform: translateX(100%); } }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pencil-move { animation: pencilMove 4s ease-in-out infinite; }
.animate-progress-flow { animation: progressFlow 2s ease-in-out infinite; }

/* Scanner Loader Animations */
@keyframes paperUp { 0% { transform: translateY(50px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-150px); opacity: 0; } }
@keyframes laserScan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.animate-paper-up { animation: paperUp 3s linear infinite; }
.animate-laser-scan { animation: laserScan 1.5s ease-in-out infinite; }
