.isti-app {
    max-width: 760px;
    margin: 24px auto;
    font-family: "Noto Naskh Arabic", "Amiri", Tahoma, sans-serif;
    line-height: 1.9;
}

.isti-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    padding: 24px 26px;
    margin-bottom: 20px;
}

.isti-title {
    font-size: 1.5rem;
    color: #0f5132;
    margin: 0 0 18px;
    text-align: center;
}

.isti-form .isti-field {
    margin-bottom: 16px;
}

.isti-label {
    display: block;
    font-weight: 700;
    color: #34495e;
    margin-bottom: 6px;
}

.isti-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.98rem;
    background: #f8fafc;
    box-sizing: border-box;
}

.isti-input:focus {
    outline: none;
    border-color: #0f5132;
    background: #fff;
}

.isti-modes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.isti-mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.isti-mode:has(input:checked) {
    background: #e6f4ea;
    border-color: #0f5132;
}

.isti-hint {
    color: #64748b;
    font-size: 0.85rem;
}

.isti-login-note {
    background: #fff7ed;
    border: 1px dashed #fbbf24;
    border-radius: 8px;
    padding: 10px 14px;
    color: #92400e;
    font-size: 0.92rem;
}

.isti-btn {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background: #0f5132;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.isti-btn:hover {
    background: #093a24;
}

.isti-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ---- Result ---- */

.isti-result-card {
    animation: isti-fade 0.35s ease;
}

@keyframes isti-fade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.isti-result-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.isti-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.98rem;
}

.isti-badge-good { background: #d1fae5; color: #065f46; }
.isti-badge-bad  { background: #fee2e2; color: #991b1b; }
.isti-badge-warn { background: #fef3c7; color: #92400e; }

.isti-page-info {
    color: #475569;
    font-weight: 700;
}

.isti-result-body {
    background: #f8fafc;
    border-right: 4px solid #0f5132;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.isti-cat-tag {
    display: inline-block;
    background: #0f5132;
    color: #fff;
    font-size: 0.8rem;
    border-radius: 50px;
    padding: 2px 12px;
    margin-bottom: 8px;
}

.isti-result-text {
    margin: 0;
    color: #1e293b;
    white-space: pre-line;
}

.isti-verses-title {
    color: #334155;
    font-size: 1.05rem;
    margin: 0 0 12px;
}

.isti-sura-group {
    margin-bottom: 18px;
}

.isti-sura-name {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f5132;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}

.isti-verse {
    margin: 0 0 12px;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
}

.isti-verse:last-child { border-bottom: none; }

.isti-arabic {
    font-family: "Amiri", "Scheherazade New", "AlQuran", serif;
    font-size: 1.55rem;
    line-height: 2.2;
    color: #0b1622;
    direction: rtl;
    text-align: justify;
}

.isti-aya-ref {
    color: #64748b;
    font-size: 0.9rem;
    margin-right: 6px;
}

.isti-translation {
    color: #475569;
    font-size: 0.95rem;
    border-right: 3px solid #cbd5e1;
    padding-right: 12px;
    margin-top: 6px;
}

.isti-empty {
    color: #64748b;
    text-align: center;
    padding: 12px;
}

/* ---- History ---- */

.isti-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.isti-history-row {
    display: grid;
    grid-template-columns: 2.2fr 1fr 0.7fr 1.2fr auto;
    gap: 10px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.92rem;
}

.isti-history-head {
    display: grid;
    grid-template-columns: 2.2fr 1fr 0.7fr 1.2fr auto;
    gap: 10px;
    font-weight: 800;
    color: #475569;
    padding: 0 14px;
    font-size: 0.85rem;
}

.isti-h-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.isti-link {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.82rem;
    cursor: pointer;
}

.isti-link:hover { background: #e0e7ff; }

.isti-danger { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.isti-danger:hover { background: #fecaca; }

.isti-title-edit {
    width: 100%;
    padding: 4px 8px;
}

.isti-btn-tg {
    margin-top: 14px;
    background: #229ed9;
    text-align: center;
}

.isti-btn-tg:hover {
    background: #1c85b6;
}

.isti-bot-card {
    margin-top: 20px;
}

.isti-bot-title {
    font-size: 1.15rem;
    margin-bottom: 10px;
}

.isti-bot-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.isti-bot-btn {
    margin-top: 0;
    flex: 1 1 180px;
}

.isti-error {
    color: #991b1b;
}

.isti-btn-bl {
    margin-top: 14px;
    background: #00a859;
    text-align: center;
}

.isti-btn-bl:hover {
    background: #008f4c;
}

@media (max-width: 600px) {
    .isti-history-row,
    .isti-history-head {
        grid-template-columns: 1fr 1fr;
    }
    .isti-history-head span:nth-child(3),
    .isti-history-head span:nth-child(5) { display: none; }
}