.problem-solving-page {
    width: 100%;
    padding: 28px 26px 40px;
    box-sizing: border-box;
}

.problem-solving-page h2 {
    color: white;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.problem-solving-page h3 {
    color: white;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.problem-solving-start-section {
    margin-bottom: 24px;
}

.problem-solving-hero {
    display: block;
    margin-bottom: 24px;
}

.problem-solving-hero-copy,
.problem-solving-hero-card,
.problem-solving-section-card,
.problem-solving-info-card,
.problem-solving-faq-item,
.problem-solving-step,
.problem-solving-chat-panel {
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(18, 21, 46, 0.96), rgba(9, 11, 28, 0.96));
    box-shadow: 0 24px 60px rgba(4, 7, 24, 0.34);
}

.problem-solving-hero-copy {
    padding: 30px;
}

.problem-solving-badge,
.problem-solving-chat-kicker,
.problem-solving-card-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #c9ffd0;
    background: rgba(126, 231, 135, 0.12);
    border: 1px solid rgba(126, 231, 135, 0.25);
    font-size: 1rem;
    letter-spacing: 0.06em;
}

.problem-solving-hero-copy h1 {
    margin-top: 18px;
    margin-bottom: 16px;
    text-align: left;
    font-size: clamp(1.5rem, 2vw, 2.25rem);
    line-height: 1.1;
    color: white;
    letter-spacing: -0.03em;
}

.problem-solving-lead {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.08rem;
    line-height: 1.75;
}

.problem-solving-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
}

.problem-solving-point {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.problem-solving-point strong {
    display: block;
    color: white;
    font-size: 1rem;
    margin-bottom: 8px;
}

.problem-solving-point span {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.96rem;
    line-height: 1.55;
}

.problem-solving-hero-card {
    padding: 26px 24px;
}

.problem-solving-start-card {
    width: 100%;
    padding: 30px;
    box-sizing: border-box;
}

.problem-solving-hero-card h2,
.problem-solving-section-card h2,
.problem-solving-info-card h2,
.problem-solving-steps h2,
.problem-solving-faq h2 {
    text-align: left;
    margin-top: 14px;
    margin-bottom: 14px;
}

.problem-solving-start-copy {
    margin-top: 18px;
}

.problem-solving-card-note {
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.66);
    line-height: 1.6;
}

.problem-solving-form {
    margin-top: 22px;
}

.problem-solving-label {
    display: block;
    margin-bottom: 10px;
    color: white;
    font-size: 1rem;
}

.problem-solving-form textarea {
    width: 100%;
    min-height: 150px;
    resize: vertical;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(126, 231, 135, 0.24);
    background: rgba(7, 10, 25, 0.86);
    color: white;
    font-size: 1rem;
    line-height: 1.6;
    box-sizing: border-box;
}

.problem-solving-form textarea:focus {
    box-shadow: 0 0 0 1px rgba(126, 231, 135, 0.42), 0 0 18px rgba(126, 231, 135, 0.18);
}

.problem-solving-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.problem-solving-form--entry textarea {
    min-height: 200px;
}

.problem-solving-photo-field {
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.problem-solving-photo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.problem-solving-photo-title {
    display: block;
    color: white;
    font-weight: 700;
}

.problem-solving-photo-note {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.55;
    font-size: 0.94rem;
}

.problem-solving-photo-button,
.problem-solving-photo-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: white;
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.problem-solving-photo-button:hover,
.problem-solving-photo-remove:hover {
    background: rgba(82, 195, 255, 0.1);
    border-color: rgba(82, 195, 255, 0.28);
}

.problem-solving-photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.problem-solving-photo-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(7, 10, 25, 0.62);
}

.problem-solving-photo-preview[hidden] {
    display: none;
}

.problem-solving-photo-preview img {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.problem-solving-photo-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 6px;
}

.problem-solving-photo-name {
    color: white;
    font-weight: 600;
    line-height: 1.45;
    word-break: break-word;
}

.problem-solving-photo-status {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.92rem;
}

.problem-solving-photo-remove {
    margin-left: auto;
    flex-shrink: 0;
}

.problem-solving-photo-error {
    margin: 12px 0 0;
    color: #ff9b9b;
    line-height: 1.5;
    font-size: 0.94rem;
}

.problem-solving-form-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-top: 16px;
}

.problem-solving-form-meta {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
}

.problem-solving-form-hint {
    margin: 0;
    color: rgba(255, 255, 255, 0.64);
    line-height: 1.65;
    font-size: 0.96rem;
    max-width: 820px;
}

.problem-solving-limit-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.problem-solving-limit-title {
    display: block;
    width: 100%;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.problem-solving-limit-row {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.92rem;
    line-height: 1.4;
}

.problem-solving-limit-row[hidden] {
    display: none !important;
}

.problem-solving-limit-row--count {
    border-color: rgba(126, 231, 135, 0.24);
    background: linear-gradient(180deg, rgba(126, 231, 135, 0.1), rgba(126, 231, 135, 0.04));
}

.problem-solving-limit-row--reset {
    border-color: rgba(188, 140, 255, 0.18);
    background: linear-gradient(180deg, rgba(188, 140, 255, 0.08), rgba(188, 140, 255, 0.03));
}

.problem-solving-limit-label {
    color: rgba(255, 255, 255, 0.56);
}

.problem-solving-limit-value {
    color: white;
    font-weight: 700;
    white-space: nowrap;
}

.problem-solving-limit-row--count .problem-solving-limit-value {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(126, 231, 135, 0.16);
    color: #d8ffdd;
}

.problem-solving-limit-row--reset .problem-solving-limit-value {
    color: #f2e7ff;
    font-weight: 700;
}

.problem-solving-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    padding: 14px 22px;
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(90deg, #3672ff, #45c4ff);
    box-shadow: 0 16px 30px rgba(54, 114, 255, 0.28);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.problem-solving-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(54, 114, 255, 0.38);
}

.problem-solving-submit[disabled] {
    opacity: 0.7;
    cursor: wait;
}

.problem-solving-form--entry .problem-solving-submit {
    position: relative;
    justify-content: space-between;
    gap: 14px;
    min-height: 60px;
    padding: 8px 8px 8px 22px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 36px rgba(5, 14, 31, 0.24);
    overflow: hidden;
}

.problem-solving-form--entry .problem-solving-submit::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background:
        radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.1), transparent 30%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.problem-solving-form--entry .problem-solving-submit > span {
    position: relative;
    z-index: 1;
}

.problem-solving-form--entry .problem-solving-submit .btn-text {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    line-height: 1.2;
}

.problem-solving-submit-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    flex-shrink: 0;
}

.problem-solving-submit-icon::before {
    content: "";
    width: 9px;
    height: 9px;
    border-top: 2px solid #041120;
    border-right: 2px solid #041120;
    transform: translateX(-2px) rotate(45deg);
}

.problem-solving-submit-icon::after {
    content: "";
    position: absolute;
    width: 13px;
    height: 2px;
    border-radius: 999px;
    background: #041120;
    transform: translateX(-2px);
}

.problem-solving-form--entry .problem-solving-submit:focus-visible {
    outline: none;
    transform: translateY(-1px);
}

.problem-solving-form--entry .problem-solving-submit:active {
    transform: translateY(0);
}

.problem-solving-submit .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: problem-solving-spin 0.8s linear infinite;
}

.problem-solving-section-card,
.problem-solving-steps,
.problem-solving-faq {
    margin-top: 38px;
    color: white;
}

.problem-solving-section-card {
    padding: 28px;
}

.problem-solving-section-card p,
.problem-solving-info-card p {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.7;
}

.problem-solving-step-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 18px;
}

.problem-solving-step {
    padding: 16px 16px 20px;
}

.problem-solving-step-number,
.problem-solving-info-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(126, 231, 135, 0.14);
    color: #d8ffdd;
    font-weight: 700;
}

.problem-solving-step h3,
.problem-solving-faq-item h3 {
    margin-top: 18px;
    margin-bottom: 10px;
}

.problem-solving-step p,
.problem-solving-faq-item p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.65;
}

.problem-solving-faq-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.problem-solving-faq-item {
    padding: 24px;
}

.problem-solving-chat-body footer {
    display: none;
}

.problem-solving-chat-page {
    width: 100%;
    min-height: calc(100vh - 90px);
}

.problem-solving-chat-shell {
    min-height: calc(100vh - 90px);
    padding: 18px 16px;
    box-sizing: border-box;
}

.problem-solving-chat-panel {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 126px);
    overflow: hidden;
}

.problem-solving-chat-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    padding: 26px 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.problem-solving-chat-head h1 {
    margin: 14px 0 0;
    text-align: left;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.15;
    color: white;
}

.problem-solving-chat-description {
    margin: 12px 0 0;
    max-width: 760px;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.65;
}

.problem-solving-chat-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.problem-solving-chat-history {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    row-gap: 18px;
    padding: 20px 18px 24px;
    background:
        radial-gradient(circle at top right, rgba(82, 195, 255, 0.08), transparent 24%),
        linear-gradient(180deg, rgba(18, 21, 46, 0.97), rgba(9, 11, 28, 0.97));
}

.problem-solving-chat-history .similar-header {
    text-align: left;
}

.problem-solving-history-head {
    display: flex;
    flex-direction: column;
}

.problem-solving-history-description {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.6;
}

.problem-solving-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.problem-solving-history-item {
    display: block;
    padding: 14px 15px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    transition: 0.2s ease;
}

.problem-solving-history-item:hover {
    border-color: rgba(82, 195, 255, 0.26);
    background: rgba(82, 195, 255, 0.08);
}

.problem-solving-history-item.is-active {
    border-color: rgba(82, 195, 255, 0.36);
    background: rgba(82, 195, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(82, 195, 255, 0.12);
}

.problem-solving-history-item-title {
    display: -webkit-box;
    overflow: hidden;
    color: white;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.problem-solving-history-item-meta {
    display: block;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.9rem;
}

.problem-solving-history-empty {
    padding: 18px 16px;
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.03);
}

.problem-solving-history-empty h3 {
    margin: 0 0 10px;
    text-align: left;
}

.problem-solving-history-empty p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.problem-solving-chat-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    text-decoration: none;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.problem-solving-chat-status {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.95rem;
}

.problem-solving-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.problem-solving-empty-state {
    display: flex;
    min-height: 240px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 30px;
    text-align: center;
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(180deg, rgba(126, 231, 135, 0.06), transparent 42%),
        rgba(255, 255, 255, 0.02);
}

.problem-solving-empty-state h3 {
    margin: 0 0 12px;
    color: white;
    font-size: 1.5rem;
}

.problem-solving-empty-state p {
    max-width: 720px;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.7;
}

.problem-solving-message {
    max-width: 86%;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.problem-solving-message--user {
    align-self: flex-end;
    background: linear-gradient(180deg, rgba(50, 73, 143, 0.95), rgba(34, 47, 108, 0.95));
}

.problem-solving-message--assistant {
    align-self: flex-start;
    background: linear-gradient(180deg, rgba(18, 43, 46, 0.96), rgba(12, 26, 28, 0.96));
}

.problem-solving-message-role {
    display: block;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.problem-solving-message-text {
    color: white;
    white-space: pre-wrap;
    line-height: 1.7;
    font-size: 1rem;
}

.problem-solving-message-text strong {
    color: white;
    font-weight: 700;
}

.problem-solving-message-text .katex {
    font-size: 1.04em;
}

.problem-solving-message-text .katex-display {
    margin: 0.9em 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.1em 0;
}

.problem-solving-message--loading .problem-solving-message-text {
    display: flex;
    align-items: center;
}

.problem-solving-typing {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.problem-solving-typing span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    animation: problem-solving-typing 1.1s infinite ease-in-out;
}

.problem-solving-typing span:nth-child(2) {
    animation-delay: 0.14s;
}

.problem-solving-typing span:nth-child(3) {
    animation-delay: 0.28s;
}

.problem-solving-form--chat {
    margin-top: 0;
    padding: 18px 30px 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(6, 8, 21, 0.72);
}

.problem-solving-form--chat textarea {
    min-height: 100px;
    max-height: 220px;
    margin-top: 12px;
}

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

@keyframes problem-solving-typing {
    0%,
    80%,
    100% {
        transform: scale(0.7);
        opacity: 0.35;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@media screen and (max-width: 1180px) {
    .problem-solving-points,
    .problem-solving-step-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 1024px) {
    .problem-solving-page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .problem-solving-faq-grid {
        grid-template-columns: 1fr;
    }

    .problem-solving-chat-head {
        flex-direction: column;
        align-items: stretch;
    }

    .problem-solving-chat-actions {
        justify-content: space-between;
    }

    .problem-solving-chat-history {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: 100%;
        row-gap: 18px;
        padding-top: 20px;
        padding-bottom: 24px;
    }
}

@media screen and (max-width: 700px) {
    .problem-solving-page {
        padding-top: 18px;
        padding-bottom: 28px;
    }

    .problem-solving-hero-copy,
    .problem-solving-hero-card,
    .problem-solving-section-card,
    .problem-solving-step,
    .problem-solving-faq-item {
        padding: 20px 16px;
        border-radius: 20px;
    }

    .problem-solving-start-card {
        padding: 20px 16px;
    }

    .problem-solving-chat-shell {
        padding: 0;
    }

    .problem-solving-chat-panel {
        min-height: calc(100vh - 90px);
        border-radius: 0;
    }

    .problem-solving-chat-head,
    .problem-solving-messages,
    .problem-solving-form--chat {
        padding-left: 16px;
        padding-right: 16px;
    }

    .problem-solving-chat-head,
    .problem-solving-form-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .problem-solving-photo-preview {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .problem-solving-photo-remove {
        margin-left: 0;
    }

    .problem-solving-chat-actions {
        width: 100%;
        justify-content: space-between;
    }

    .problem-solving-message {
        max-width: 100%;
    }

    .problem-solving-submit {
        width: 100%;
        min-width: 0;
    }
}
