
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 25px 15px;

    font-family:
        "Segoe UI",
        Arial,
        sans-serif;

    background: #f4f7fb;

    color: #1f2937;
}


.container {
    width: 100%;
    max-width: 900px;

    margin: auto;
}


.card {
    background: #ffffff;

    border-radius: 18px;

    padding: 28px;

    box-shadow:
        0 8px 30px
        rgba(0, 0, 0, 0.08);
}


/* HEADER */

.header {
    margin-bottom: 25px;
}

.header h1 {
    margin: 0 0 7px;

    font-size: 26px;

    color: #111827;
}

.header p {
    margin: 0;

    color: #6b7280;

    font-size: 14px;
}


/* FORM */

.form-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 16px;
}

.form-group {
    margin-bottom: 3px;
}

.form-group.full {
    grid-column: 1 / -1;
}

label {
    display: block;

    margin-bottom: 7px;

    font-size: 14px;

    font-weight: 600;

    color: #374151;
}


input,
textarea {
    width: 100%;

    border:
        1px solid #d1d5db;

    border-radius: 9px;

    padding:
        12px 13px;

    background: #ffffff;

    color: #111827;

    font-family: inherit;

    font-size: 14px;

    outline: none;

    transition: .2s;
}


input:focus,
textarea:focus {
    border-color: #4f46e5;

    box-shadow:
        0 0 0 3px
        rgba(79, 70, 229, .10);
}


textarea {
    min-height: 100px;

    resize: vertical;
}


/* API KEY */

.key-wrapper {
    position: relative;
}

.key-wrapper input {
    padding-right: 100px;
}


.btn-show {
    position: absolute;

    right: 7px;
    top: 7px;

    border: 0;

    border-radius: 6px;

    padding:
        7px 10px;

    background: #f3f4f6;

    color: #374151;

    font-size: 12px;

    cursor: pointer;
}


/* BUTTON */

.button-group {
    display: flex;

    gap: 10px;

    margin-top: 20px;

    flex-wrap: wrap;
}


.btn {
    border: 0;

    border-radius: 9px;

    padding:
        11px 18px;

    font-family: inherit;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition: .2s;
}


.btn:disabled {
    opacity: .55;

    cursor: not-allowed;
}


.btn-primary {
    background: #4f46e5;

    color: #ffffff;
}

.btn-primary:hover {
    background: #4338ca;
}


.btn-secondary {
    background: #eef2f7;

    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}


.btn-danger {
    background: #fee2e2;

    color: #991b1b;
}

.btn-danger:hover {
    background: #fecaca;
}


/* STATUS */

.status {
    margin-top: 20px;

    padding: 13px 15px;

    border-radius: 9px;

    border: 1px solid #e5e7eb;

    background: #f9fafb;

    font-size: 13px;
}


.status-idle {
    color: #4b5563;
}


.status-loading {
    background: #fffbeb;

    border-color: #fde68a;

    color: #92400e;
}


.status-success {
    background: #ecfdf5;

    border-color: #a7f3d0;

    color: #065f46;
}


.status-error {
    background: #fef2f2;

    border-color: #fecaca;

    color: #991b1b;
}


/* RESULT */

.result-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 12px;

    margin-top: 15px;
}


.result-card {
    background: #f9fafb;

    border:
        1px solid #e5e7eb;

    border-radius: 10px;

    padding: 13px;
}


.result-card span {
    display: block;

    font-size: 10px;

    color: #6b7280;

    margin-bottom: 5px;

    font-weight: 600;
}


.result-card strong {
    display: block;

    font-size: 14px;

    color: #111827;

    word-break: break-word;
}


/* SECTION */

.section-title {
    margin-top: 22px;

    margin-bottom: 8px;

    font-size: 14px;

    font-weight: 700;
}


/* ANSWER */

.answer-container {
    margin-top: 5px;
}


.answer {
    padding: 15px;

    border-radius: 10px;

    background: #eef2ff;

    border:
        1px solid #c7d2fe;

    color: #312e81;

    font-size: 14px;

    line-height: 1.7;

    white-space: pre-wrap;
}


/* RAW RESPONSE */

.raw-response {
    margin: 0;

    min-height: 150px;

    max-height: 450px;

    overflow: auto;

    padding: 15px;

    border-radius: 10px;

    background: #111827;

    color: #e5e7eb;

    font-family:
        Consolas,
        Monaco,
        monospace;

    font-size: 12px;

    line-height: 1.6;

    white-space: pre-wrap;

    word-break: break-word;
}


/* TEMPORARY */

.temporary {
    margin-top: 5px;

    border-top:
        1px solid #e5e7eb;

    padding-top: 5px;
}


.temporary-list {
    display: flex;

    flex-direction: column;

    gap: 9px;
}


.empty {
    padding: 14px;

    text-align: center;

    color: #9ca3af;

    font-size: 13px;

    border:
        1px dashed #d1d5db;

    border-radius: 9px;
}


.temporary-item {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding: 13px;

    border:
        1px solid #e5e7eb;

    border-radius: 10px;

    background: #ffffff;
}


.temporary-info {
    min-width: 0;
}


.model {
    font-weight: 700;

    font-size: 14px;

    margin-bottom: 3px;
}


.url {
    font-size: 12px;

    color: #6b7280;

    word-break: break-all;

    margin-bottom: 3px;
}


.key {
    font-family: Consolas, monospace;

    font-size: 11px;

    color: #9ca3af;
}


.temporary-actions {
    display: flex;

    gap: 6px;

    flex-shrink: 0;
}


.btn-use,
.btn-delete {
    border: 0;

    border-radius: 7px;

    padding:
        7px 11px;

    font-size: 12px;

    font-weight: 600;

    cursor: pointer;
}


.btn-use {
    background: #eef2ff;

    color: #3730a3;
}


.btn-delete {
    background: #fee2e2;

    color: #991b1b;
}


/* NOTICE */

.notice {
    margin-top: 20px;

    padding: 13px 15px;

    border-radius: 9px;

    background: #fff7ed;

    border:
        1px solid #fed7aa;

    color: #9a3412;

    font-size: 12px;

    line-height: 1.6;
}


/* RESPONSIVE */

@media (max-width: 650px) {

    body {
        padding: 12px;
    }


    .card {
        padding: 19px;
    }


    .form-grid {
        grid-template-columns: 1fr;
    }


    .form-group.full {
        grid-column: auto;
    }


    .result-grid {
        grid-template-columns: 1fr;
    }


    .button-group {
        flex-direction: column;
    }


    .btn {
        width: 100%;
    }


    .temporary-item {
        align-items: stretch;

        flex-direction: column;
    }


    .temporary-actions {
        width: 100%;
    }


    .btn-use,
    .btn-delete {
        flex: 1;
    }

}
