* {
    box-sizing: border-box;
}

body {
    font-family: "Cairo", Arial, sans-serif;
    background: #030303;
    margin: 0;
    color: #f3f4f6;
}

.sol-page {
    min-height: 100vh;
    padding: 1.4rem 1rem;
    position: relative;
    overflow: hidden;
}

.glow {
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 999px;
    filter: blur(70px);
    opacity: 0.22;
    pointer-events: none;
}

.glow-left {
    background: #7c3aed;
    top: -140px;
    left: -90px;
}

.glow-right {
    background: #0ea5e9;
    right: -130px;
    bottom: -120px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    padding: 1.25rem;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
}

.row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

input, button {
    font-size: 1rem;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
}

input {
    flex: 1;
    min-width: 260px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.35);
    color: #f9fafb;
}

input::placeholder {
    color: #9ca3af;
}

button {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button:hover {
    background: rgba(255, 255, 255, 0.16);
}

button:disabled {
    opacity: 0.8;
    cursor: wait;
}

h1 {
    margin-top: 0;
    font-size: clamp(1.5rem, 4vw, 2.15rem);
}

.muted {
    color: #d1d5db;
}

.average-formula {
    margin: 0.35rem 0 0.75rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(229, 231, 235, 0.82);
}

/* Bottom of /info: back link + global page view counter */
.sol-page-footer {
    margin-top: 1.5rem;
    margin-bottom: 0.35rem;
}

.sol-footer-solution-nav {
    margin: 0 0 0.2rem;
    text-align: center;
}

.sol-info-page-views {
    margin: 0.25rem 0 0;
    text-align: center;
    font-size: 0.62rem;
    font-weight: 500;
    line-height: 1.35;
    color: rgba(148, 163, 184, 0.88);
}

.sol-footer-solution-link {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.35;
    color: rgba(196, 181, 253, 0.72);
    text-decoration: none;
    transition:
        color 0.15s ease,
        text-decoration-color 0.15s ease;
}

.sol-footer-solution-link:hover {
    color: #e9d5ff;
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

.sol-footer-solution-link:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.9);
    outline-offset: 3px;
    border-radius: 4px;
}

.blessing {
    text-align: center;
    font-family: "Aref Ruqaa Ink", serif;
    font-size: 2rem;
    line-height: 1.5;
    color: #f5f3ff;
    margin: 0 0 0.7rem 0;
}

.date-bar {
    margin-bottom: 0.8rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.95rem;
    color: #e5e7eb;
    text-align: center;
}

.card {
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.28);
}
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    min-width: 560px;
}
th, td {
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.6rem;
    text-align: center;
}
th {
    background: rgba(255, 255, 255, 0.1);
}
.error {
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px solid rgba(248, 113, 113, 0.55);
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}
.error-list {
    margin: 0;
    padding-inline-start: 1.25rem;
}
.success {
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px solid rgba(52, 211, 153, 0.55);
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.18);
    color: #bbf7d0;
}
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}
.is-loading .spinner {
    display: inline-block;
}
.btn-text-loading {
    display: none;
}
.is-loading .btn-text-default {
    display: none;
}
.is-loading .btn-text-loading {
    display: inline;
}
.celebration-banner {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fde68a;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.25), rgba(236, 72, 153, 0.2), rgba(14, 165, 233, 0.25));
    border: 1px solid rgba(245, 158, 11, 0.55);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    animation: pop 1.2s ease-in-out infinite alternate;
}
.balloons {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}
.balloon {
    position: absolute;
    top: -40px;
    font-size: 2rem;
    opacity: 0;
    animation: balloonFall 2500ms ease-in forwards;
}
.balloon.b1 { left: 6%; animation-delay: 0ms; }
.balloon.b2 { left: 16%; animation-delay: 120ms; }
.balloon.b3 { left: 26%; animation-delay: 220ms; }
.balloon.b4 { left: 36%; animation-delay: 80ms; }
.balloon.b5 { left: 46%; animation-delay: 260ms; }
.balloon.b6 { left: 56%; animation-delay: 180ms; }
.balloon.b7 { left: 66%; animation-delay: 100ms; }
.balloon.b8 { left: 76%; animation-delay: 300ms; }
.balloon.b9 { left: 86%; animation-delay: 150ms; }
.balloon.b10 { left: 94%; animation-delay: 340ms; }
.confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}
.confetti span {
    position: absolute;
    width: 8px;
    height: 14px;
    top: -20px;
    opacity: 0;
    animation: confettiBurst 2800ms ease-out forwards;
}
.confetti.landed {
    inset: auto 0 0 0;
    height: 96px;
    overflow: visible;
}
.confetti.landed span {
    animation: none !important;
    top: auto !important;
    bottom: 10px !important;
    height: 14px;
    opacity: 0.95;
    transform: rotate(0deg);
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pop {
    from { transform: scale(1); }
    to { transform: scale(1.02); }
}
@keyframes balloonFall {
    0% { opacity: 0; transform: translateY(-20px) scale(0.9); }
    10% { opacity: 0.95; }
    85% { opacity: 0.95; }
    100% { opacity: 0; transform: translateY(104vh) scale(0.95); }
}
@keyframes confettiBurst {
    0% { opacity: 0; transform: translateY(-20px) rotate(0deg); }
    10% { opacity: 0.95; }
    100% { opacity: 0.9; transform: translateY(104vh) rotate(260deg); }
}

/* Teacher remark block (aligned with solution “explanation” styling) */
.student-remark-section {
    margin-top: 1rem;
    padding-top: 0.35rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.22);
}

.student-remark-section__heading {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    color: #e5e7eb;
}

.student-remark-inner .solution-author-meta {
    margin-top: 0.5rem;
}

.student-remark-explanation-row {
    margin-top: 0.75rem;
}

.student-remark-section .solution-explanation.content,
.student-remark-section .solution-explanation.student-remark-text {
    line-height: 1.9;
    white-space: normal;
}

.student-remark-text {
    margin-top: 0;
}

.student-remark-text.content {
    text-align: start;
}

.student-remark-replies-block {
    margin-top: 1.35rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.22);
}

.student-remark-reply-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.student-remark-reply {
    margin: 0;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(14, 165, 233, 0.28);
    background: rgba(14, 165, 233, 0.08);
}

.student-remark-reply--own {
    border-color: rgba(94, 234, 212, 0.38);
    background: rgba(13, 148, 136, 0.1);
}

.thread-root {
    border-width: 1px;
}

.student-remark-reply--teacher {
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.07);
    margin-top: 0.5rem;
}

.student-remark-reply__teacher-head {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.student-remark-reply__teacher-site {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.65rem;
    flex-shrink: 0;
    max-width: 100%;
    color: inherit;
    text-decoration: none;
}

.student-remark-reply__teacher-site:hover .student-remark-reply__name,
.student-remark-reply__teacher-site:focus-visible .student-remark-reply__name {
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.student-remark-reply__teacher-site:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.9);
    outline-offset: 3px;
    border-radius: 10px;
}

.student-remark-reply__teacher-avatar-wrap {
    flex-shrink: 0;
}

.student-remark-teacher-avatar {
    width: 40px;
    height: 40px;
    border-width: 2px;
}

.student-remark-teacher-avatar-placeholder {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
}

.student-remark-reply__teacher-head-text {
    flex: 1;
    min-width: 0;
}

.student-remark-reply--teacher .student-remark-reply__body {
    margin-top: 0.5rem;
}

.student-remark-reply--teacher .student-remark-reply__body:empty {
    display: none;
}

.student-remark-reply--teacher .student-remark-reply__image-gallery {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: flex-start;
}

.student-remark-reply--teacher .student-remark-reply__body + .student-remark-reply__image-gallery {
    margin-top: 0.4rem;
}

.student-remark-reply__gallery-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    max-width: min(420px, 100%);
}

.student-remark-reply__gallery-download {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding: 0.2rem 0.55rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.student-remark-reply__gallery-download:hover {
    background: rgba(245, 158, 11, 0.22);
    color: #ffedd5;
}

.student-remark-reply__gallery-download:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.9);
    outline-offset: 2px;
}

.student-remark-reply__gallery-thumb {
    display: block;
    width: auto;
    max-width: 100%;
    padding: 0;
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(251, 191, 36, 0.28);
    background: rgba(0, 0, 0, 0.35);
    cursor: zoom-in;
    font: inherit;
    color: inherit;
}

.student-remark-reply__gallery-thumb:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.85);
    outline-offset: 3px;
}

.student-remark-reply__gallery-thumb:hover .student-remark-reply__gallery-img {
    opacity: 0.93;
}

.student-remark-reply__gallery-thumb .student-remark-reply__gallery-img {
    display: block;
    max-height: 220px;
    width: auto;
    max-width: min(420px, 100%);
}

body.remark-reply-lightbox-open {
    overflow: hidden;
}

/* Backdrop clicks close; surface uses vertical margin:auto so short content is centred and tall images scroll. */
.remark-reply-lightbox {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    z-index: 9999;
    margin: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-block: calc(clamp(0.75rem, 3vw, 1.75rem) + env(safe-area-inset-top, 0px))
        calc(clamp(0.75rem, 3vw, 1.75rem) + env(safe-area-inset-bottom, 0px));
    padding-inline: calc(clamp(0.75rem, 3vw, 1.75rem) + env(safe-area-inset-left, 0px))
        calc(clamp(0.75rem, 3vw, 1.75rem) + env(safe-area-inset-right, 0px));
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(4px);
    cursor: zoom-out;
}

.remark-reply-lightbox[hidden] {
    display: none;
}

.remark-reply-lightbox:not([hidden]) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Viewport-relative height so vertical spacing is predictable (fixes odd % chaining). */
    min-block-size: 100vh;
    min-block-size: 100dvh;
}

.remark-reply-lightbox__surface {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    flex: 0 0 auto;
    margin-inline: auto;
    /* Bias upward from dead-centre — comfortable below the notch / close control. */
    margin-block-start: clamp(2.5rem, 9vmin, 4.75rem);
    margin-block-end: auto;
    max-width: min(1120px, 100%);
    width: max-content;
    min-width: 0;
    padding: 0;
    cursor: default;
}

.remark-reply-lightbox__frame {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
}

.remark-reply-lightbox__close {
    position: absolute;
    top: -0.25rem;
    inset-inline-end: -0.25rem;
    z-index: 2;
    margin: 0;
    padding: 0;
    border: none;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    font-size: 1.85rem;
    line-height: 1;
    color: #f9fafb;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.remark-reply-lightbox__close:hover {
    background: rgba(245, 158, 11, 0.35);
    border-color: rgba(251, 191, 36, 0.55);
}

.remark-reply-lightbox__close:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 3px;
}

.remark-reply-lightbox__download {
    flex-shrink: 0;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1.1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    appearance: none;
    text-decoration: none;
    color: #ffedd5;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.45);
    cursor: pointer;
}

.remark-reply-lightbox__download:hover {
    background: rgba(245, 158, 11, 0.32);
}

.remark-reply-lightbox__download:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.9);
    outline-offset: 3px;
}

.remark-reply-lightbox__download[hidden] {
    display: none;
}

.remark-reply-lightbox__img {
    display: block;
    margin: 0;
    box-sizing: border-box;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 72vh;
    max-height: min(72vh, 72dvh, calc(100svh - 9.5rem));
    border-radius: 10px;
    object-fit: contain;
    cursor: zoom-out;
}

.student-remark-reply__teacher-thread {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0 0 0 0.75rem;
    border-inline-start: 2px solid rgba(251, 191, 36, 0.35);
}

.student-remark-reply__like-row--public {
    margin-top: 0.55rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
}

.student-remark-reply__like-row-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.remark-reply-like-readonly {
    display: inline-flex;
    align-items: center;
    color: #9ca3af;
}

.remark-reply-like-readonly--on {
    color: #f43f5e;
}

.remark-reply-like-readonly--on .explanation-like-btn__path {
    fill: currentColor;
    stroke: none;
}

.student-remark-reply__teacher-bar {
    margin-top: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
}

.student-remark-reply__like-row {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.remark-reply-like-btn {
    padding: 0.2rem;
    border-radius: 999px;
}

.student-remark-reply__teacher-toggle {
    font-size: 0.86rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.45);
    color: #ffedd5;
}

.student-remark-reply__teacher-compose {
    margin-top: 0.55rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.student-remark-reply__teacher-label {
    display: block;
    font-size: 0.86rem;
    margin-bottom: 0.35rem;
    color: #e5e7eb;
}

.student-remark-reply__teacher-textarea {
    width: 100%;
    min-height: 4rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.35);
    color: #f9fafb;
    font: inherit;
    font-size: 0.92rem;
    resize: vertical;
}

.student-remark-reply__teacher-files-label {
    display: block;
    margin-top: 0.55rem;
    font-size: 0.82rem;
}

.student-remark-reply__teacher-files {
    display: block;
    margin-top: 0.35rem;
    width: 100%;
    font-size: 0.82rem;
    color: #e5e7eb;
}

.student-remark-reply__teacher-files-hint {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    line-height: 1.45;
}

.student-remark-reply__teacher-toolbar {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.btn-teacher-send {
    padding: 0.4rem 0.9rem;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.45);
    color: #dcfce7;
    font-weight: 600;
    font-size: 0.88rem;
}

.muted-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 0.86rem;
    text-decoration: underline;
    cursor: pointer;
}

.student-remark-reply__teacher-feedback {
    margin: 0.45rem 0 0;
    font-size: 0.84rem;
    color: #fecaca;
}

.student-remark-reply__teacher-feedback.is-success {
    color: #bbf7d0;
}

.student-remark-reply__meta {
    margin: 0 0 0.35rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0.35rem 0.75rem;
    font-size: 0.88rem;
}

.student-remark-reply__edited-flag {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(253, 230, 138, 0.95);
    letter-spacing: 0.02em;
}

.student-remark-reply__name {
    font-weight: 700;
    color: #e0f2fe;
}

.student-remark-reply__time {
    font-size: 0.82rem;
    margin-inline-start: auto;
}

.student-remark-reply__body {
    margin: 0;
    line-height: 1.75;
    color: #f3f4f6;
    font-size: 0.94rem;
    text-align: start;
}

.student-remark-reply__actions {
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-start;
}

.student-remark-reply__edit-btn {
    padding: 0.28rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.1);
    color: #fef3c7;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.student-remark-reply__edit-btn:hover {
    background: rgba(251, 191, 36, 0.2);
}

.student-remark-reply__edit-btn:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.9);
    outline-offset: 2px;
}

.student-remark-reply__editor {
    margin: 0 0 0.5rem;
}

.student-remark-reply-editor__error {
    margin: 0 0 0.45rem;
    font-size: 0.84rem;
    color: #fecaca;
}

.student-remark-reply-editor__textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 5.5rem;
    margin-bottom: 0.55rem;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(0, 0, 0, 0.45);
    color: #f9fafb;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.65;
    resize: vertical;
}

.student-remark-reply-editor__textarea:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.student-remark-reply-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-start;
}

.student-remark-reply-editor__btn {
    padding: 0.45rem 0.85rem;
    min-height: 40px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.07);
    color: #e5e7eb;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.student-remark-reply-editor__btn--primary {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.15);
    color: #ecfeff;
}

.student-remark-reply-editor__btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.student-remark-reply-form {
    margin-top: 0.85rem;
    padding: 1rem 1.05rem 1.1rem;
    border-radius: 14px;
    border: 1px solid rgba(56, 189, 248, 0.22);
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.55), rgba(0, 0, 0, 0.32));
}

.student-remark-reply-form[dir="rtl"] {
    direction: rtl;
    text-align: start;
}

.student-remark-reply-form__title {
    margin: 0 0 0.5rem;
    font-size: 0.94rem;
    font-weight: 600;
    color: #bae6fd;
}

.student-remark-reply-form__feedback {
    margin: 0 0 0.6rem;
    padding: 0.55rem 0.72rem;
    border-radius: 10px;
    font-size: 0.87rem;
    line-height: 1.45;
    text-align: start;
}

.student-remark-reply-form__feedback.is-success {
    border: 1px solid rgba(52, 211, 153, 0.45);
    background: rgba(16, 185, 129, 0.18);
    color: #bbf7d0;
}

.student-remark-reply-form__feedback.is-error {
    border: 1px solid rgba(248, 113, 113, 0.5);
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
}

.student-remark-reply-form__label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.89rem;
    font-weight: 600;
    color: #dbeafe;
}

.student-remark-reply-form__textarea {
    width: 100%;
    margin-bottom: 0.85rem;
    box-sizing: border-box;
    min-height: 6.8rem;
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.68;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.45);
    color: #f9fafb;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.student-remark-reply-form__textarea:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.65);
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.35),
        0 0 22px rgba(14, 165, 233, 0.12);
}

.student-remark-reply-form__textarea:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.3);
}

.student-remark-reply-form__textarea::placeholder {
    color: rgba(156, 163, 175, 0.9);
}

.student-remark-reply-form__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.student-remark-reply-form__hint {
    flex: 1 1 9rem;
    font-size: 0.82rem;
    color: rgba(203, 213, 225, 0.75);
    text-align: start;
}

.student-remark-reply-form__submit {
    flex-shrink: 0;
    padding: 0.6rem 1.35rem;
    min-height: 44px;
    border-radius: 11px;
    border: 1px solid rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.15);
    color: #ecfeff;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition:
        background 0.15s ease,
        transform 0.12s ease;
}

.student-remark-reply-form__submit:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.28);
}

.student-remark-reply-form__submit:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.9);
    outline-offset: 3px;
}

.student-remark-reply-form__submit:active:not(:disabled) {
    transform: scale(0.98);
}

.student-remark-reply-form__submit:disabled {
    opacity: 0.72;
    cursor: wait;
}

@media (max-width: 480px) {
    .student-remark-reply-form__submit {
        width: 100%;
    }

    .student-remark-reply-form__hint {
        flex-basis: 100%;
        order: 2;
        text-align: center;
    }
}

.solution-page-views-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    color: #c4b5fd;
}

.solution-page-views-stat__icon {
    display: block;
    flex-shrink: 0;
}

.solution-page-views-stat__value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.95rem;
    color: #ddd6fe;
}

.meta {
    margin: 0.45rem 0 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.meta-author .author-row {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

a.author-row--link {
    color: inherit;
    text-decoration: none;
}

a.author-row--link:hover .author-name,
a.author-row--link:focus-visible .author-name {
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

a.author-row--link:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.9);
    outline-offset: 3px;
    border-radius: 10px;
}

.solution-author-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.solution-author-placeholder {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fbbf24;
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.38), rgba(14, 165, 233, 0.22));
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.solution-author-placeholder--unknown {
    color: #94a3b8;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
}

.author-name {
    line-height: 1.45;
}

.solution-explanation {
    margin-top: 0;
    margin-bottom: 0;
}

.solution-explanation-block {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 0.65rem;
}

.solution-explanation-block > .solution-explanation.content {
    flex: 1;
    min-width: 0;
    margin-top: 0;
}

.solution-explanation-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

.solution-explanation-toolbar .solution-page-views-stat {
    margin-inline-end: 0.15rem;
}

.explanation-like-btn {
    display: inline-grid;
    place-items: center;
    margin: 0;
    padding: 0.25rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #fda4af;
    cursor: pointer;
    font: inherit;
    line-height: 0;
    transition: color 0.15s ease, transform 0.15s ease;
}

.explanation-like-btn:hover:not(:disabled) {
    color: #fb7185;
    transform: scale(1.06);
}

.explanation-like-btn:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.9);
    outline-offset: 3px;
}

.explanation-like-btn:disabled {
    cursor: default;
    transform: none;
}

.explanation-like-btn--liked {
    color: #f43f5e;
}

.explanation-like-btn__svg {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.explanation-like-btn__path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: fill 0.15s ease, stroke-width 0.15s ease;
}

.explanation-like-btn--liked .explanation-like-btn__path {
    fill: currentColor;
    stroke: none;
}

.explanation-like-count {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fecdd3;
}

@media (max-width: 520px) {
    .student-remark-section .solution-explanation-block {
        flex-direction: column;
        align-items: stretch;
    }

    .student-remark-section .solution-explanation-toolbar {
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .sol-page {
        padding: 1rem 0.6rem;
    }
    .container {
        padding: 1rem;
        border-radius: 16px;
    }
    h1 {
        font-size: 1.35rem;
    }
    .muted {
        font-size: 0.95rem;
    }
    .date-bar {
        font-size: 0.88rem;
    }
    .blessing {
        font-size: 1.55rem;
        margin-bottom: 0.6rem;
    }
    .row {
        flex-direction: column;
    }
    input, button {
        width: 100%;
        box-sizing: border-box;
    }
    input {
        min-width: 0;
    }
    button {
        min-height: 44px;
    }
    .card {
        padding: 0.85rem;
    }
    .celebration-banner {
        font-size: 1.1rem;
        padding: 0.8rem;
    }
    .balloon {
        font-size: 1.8rem;
    }
    th, td {
        padding: 0.5rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
}
@media (max-width: 420px) {
    h1 {
        font-size: 1.2rem;
    }
    .muted {
        font-size: 0.9rem;
    }
    .celebration-banner {
        font-size: 1rem;
    }
    .blessing {
        font-size: 1.35rem;
    }
}
