/* ===== poem.php — extracted inline <style> → poem.css ===== */
/* Base Page & Background (Transparent to preserve site background.png) */
.diwan-page-wrapper {
    background: transparent;
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
    direction: rtl;
    text-align: right;
    padding: 1.5rem 0 3.5rem;
    min-height: 85vh;
    box-sizing: border-box;
}

.diwan-container {
    width: 94%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* =========================================================
   TOP BREADCRUMB BANNER (EDITORIAL DARK BROWN)
   ========================================================= */
.diwan-top-banner {
    width: 100%;
    box-sizing: border-box;
    background: #0f172a;
    border-radius: 12px;
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    color: #f8fafc;
    font-family: 'Amiri', 'Cairo', serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.diwan-top-banner a {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s, color 0.2s;
}

.diwan-top-banner a:hover {
    color: #fed7aa;
}

.diwan-banner-sep {
    color: #64748b;
    font-size: 1.15rem;
    margin: 0 0.15rem;
}

.diwan-banner-current {
    color: #ffffff;
}

/* =========================================================
   2-COLUMN GRID LAYOUT
   ========================================================= */
.diwan-grid-layout {
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas: "main side";
    gap: 1.75rem;
    align-items: start;
}

.diwan-sidebar {
    grid-area: side;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    position: sticky;
    top: 2rem;
    box-sizing: border-box;
}

.diwan-main-area {
    grid-area: main;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-sizing: border-box;
}

/* =========================================================
   CARDS BASE STYLING (ARTICLE.PHP DESIGN TOKENS)
   ========================================================= */
.diwan-card {
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
}

.diwan-card-divider {
    border: 0;
    border-top: 1px solid #f1f5f9;
    margin: 1.15rem 0;
}

/* =========================================================
   1. POET PROFILE CARD (SIDEBAR)
   ========================================================= */
.diwan-poet-profile-card {
    padding: 1.75rem 1.35rem;
    text-align: center;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.diwan-poet-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 0.85rem;
}

.diwan-poet-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    border: 3px solid #fed7aa;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.18);
}

.diwan-poet-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.diwan-poet-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}

.diwan-poet-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.diwan-poet-name-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.diwan-poet-name-link:hover {
    color: #f97316;
}

.diwan-verified-badge {
    color: #f97316;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
}

.diwan-poet-country {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.diwan-poet-handle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.95rem;
}

/* Poet follow actions wrapper */
.diwan-poet-action {
    text-align: center;
    margin-top: 0.35rem;
}

.diwan-follow-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 0.35rem 1.85rem;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: inherit;
}

.diwan-follow-btn:hover {
    border-color: #f97316;
    color: #ea580c;
    background: #fff7ed;
}

.diwan-follow-btn.is-active {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.diwan-poet-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 0.5rem;
}

.diwan-stat-col {
    text-align: center;
}

.diwan-stat-number {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.diwan-stat-label {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.2rem;
}

.diwan-poet-more {
    text-align: center;
}

.diwan-more-link {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s;
}

.diwan-more-link:hover {
    color: #f97316;
}

/* =========================================================
   2. SUGGESTIONS CARD (SIDEBAR)
   ========================================================= */
.diwan-suggestions-card {
    padding: 1.35rem 1.25rem;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.diwan-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.15rem;
}

.diwan-quote-icon {
    font-size: 1.15rem;
    font-weight: 900;
    color: #f97316;
    line-height: 1;
}

.diwan-feather-ico {
    font-size: 1.1rem;
    color: #f97316;
}

.diwan-card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.diwan-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.diwan-suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
}

.diwan-suggest-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.diwan-suggest-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.diwan-suggest-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1rem;
    flex-shrink: 0;
}

.diwan-suggest-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.diwan-suggest-name-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.diwan-suggest-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.diwan-suggest-check {
    color: #f97316;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.diwan-suggest-handle {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.diwan-mini-follow-form {
    display: inline-flex;
    flex-shrink: 0;
}

.diwan-mini-follow-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 0.25rem 0.95rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    flex-shrink: 0;
}

.diwan-mini-follow-btn:hover {
    border-color: #f97316;
    color: #ea580c;
    background: #fff7ed;
}

/* =========================================================
   3. READ ALSO CARD (SIDEBAR)
   ========================================================= */
.diwan-readalso-card {
    padding: 1.35rem 1.25rem;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.diwan-readalso-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.diwan-readalso-item {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s;
    line-height: 1.45;
}

.diwan-readalso-item:last-child {
    border-bottom: 0;
}

.diwan-readalso-item:hover {
    color: #f97316;
}

/* =========================================================
   MAIN POEM CARD (ARTICLE.PHP ARTICLE CARD STYLING)
   ========================================================= */
.diwan-poem-main-card {
    padding: 2.25rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #edf2f7;
}

/* Top Action Toolbar */
.diwan-poem-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 2.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.diwan-tools-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #64748b;
    font-size: 0.9rem;
}

.diwan-tb-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    transition: all 0.2s;
    font-family: inherit;
}

.diwan-tb-btn:hover {
    color: #f97316;
    border-color: #fed7aa;
    background: #fff7ed;
}

.diwan-tb-btn.is-favorited {
    color: #ef4444;
    border-color: #fca5a5;
    background: #fee2e2;
}

.diwan-tb-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.88rem;
    color: #64748b;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    background: #f8fafc;
    border-radius: 9999px;
    border: 1px solid #f1f5f9;
}

.diwan-tools-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.diwan-tb-action-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
    padding: 0.4rem 0.95rem;
    border-radius: 9999px;
    transition: all 0.2s;
}

.diwan-tb-action-btn:hover {
    border-color: #fed7aa;
    color: #ea580c;
    background: #fff7ed;
}

.diwan-verse-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
    padding: 0.35rem 0.85rem;
    background: #f1f5f9;
    border-radius: 9999px;
}

/* =========================================================
   POEM VERSES (TWO-HEMISTICH CLASSICAL LAYOUT)
   ========================================================= */
.diwan-verses-wrapper {
    padding: 1rem 0 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.diwan-bayt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.55rem;
    line-height: 2.35;
    color: #0f172a;
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    transition: background 0.2s;
    box-sizing: border-box;
}

.diwan-bayt-row:hover {
    background: #f8fafc;
}

.diwan-bayt-first {
    flex: 1;
    text-align: right;
    padding-left: 1.5rem;
}

.diwan-bayt-gap {
    width: 60px;
    flex-shrink: 0;
}

.diwan-bayt-second {
    flex: 1;
    text-align: left;
    padding-right: 1.5rem;
}

/* Empty verses placeholder inside the poem card */
.diwan-empty-body {
    text-align: center;
    color: #94a3b8;
    font-size: 0.95rem;
    padding: 1.5rem 1rem;
    margin: 0;
}

.diwan-line {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.55rem;
    line-height: 2.35;
    color: #0f172a;
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    text-align: center;
    box-sizing: border-box;
}

.diwan-line:hover {
    background: #f8fafc;
}

.diwan-poem-main-card.is-night-mode .diwan-line {
    color: #f1f5f9;
}

.diwan-poem-main-card.is-night-mode .diwan-line:hover {
    background: #334155;
}

.is-wide-mode .diwan-bayt-gap {
    width: 140px;
}

/* Night mode for the poem card */
.diwan-poem-main-card.is-night-mode {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

.diwan-poem-main-card.is-night-mode .diwan-bayt-row {
    color: #f1f5f9;
}

.diwan-poem-main-card.is-night-mode .diwan-bayt-row:hover {
    background: #334155;
}

.diwan-poem-main-card.is-night-mode .diwan-tb-btn,
.diwan-poem-main-card.is-night-mode .diwan-tb-action-btn,
.diwan-poem-main-card.is-night-mode .diwan-tb-stat,
.diwan-poem-main-card.is-night-mode .diwan-verse-count-badge {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

.diwan-poem-main-card.is-night-mode .diwan-poem-toolbar {
    border-bottom-color: #334155;
}

/* =========================================================
   TAGS / CLASSIFICATION BADGES (ARTICLE.PHP TAGS CHIPS)
   ========================================================= */
.diwan-tags-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding-top: 0.5rem;
}

.diwan-badge-pill {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 1.35rem;
    border-radius: 9999px;
    transition: all 0.2s;
    cursor: default;
}

.diwan-badge-pill:hover {
    background: #f97316;
    color: #ffffff;
}

/* =========================================================
   PREVIOUS POEM NAVIGATION CARD (ARTICLE.PHP PREV/NEXT)
   ========================================================= */
.diwan-prev-card-wrap {
    display: flex;
    justify-content: flex-start;
}

.diwan-prev-poem-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.35rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    min-width: 210px;
    transition: all 0.2s;
}

.diwan-prev-poem-card:hover {
    background: #ffffff;
    border-color: #f97316;
}

.diwan-prev-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #f97316;
}

.diwan-prev-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
}

.diwan-prev-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    font-family: monospace;
}

/* =========================================================
   COMMENTS SECTION CARD (ARTICLE.PHP COMMENTS STYLING)
   ========================================================= */
.diwan-comments-card {
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.diwan-comments-header {
    margin-bottom: 1.25rem;
}

.diwan-comments-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.diwan-comments-empty {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.diwan-comments-empty p {
    margin: 0;
}

/* Scrollable list of posted comments */
.diwan-comments-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
}

.diwan-single-comment {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.diwan-comment-user-ico {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.2);
}

.diwan-comment-content strong {
    font-size: 0.92rem;
    color: #0f172a;
    font-weight: 700;
}

.diwan-comment-content p {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.6;
}

.diwan-comment-action-row {
    margin-top: 1.25rem;
}

.diwan-login-comment-link {
    color: #f97316;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s;
}

.diwan-login-comment-link:hover {
    color: #ea580c;
    text-decoration: underline;
}

.diwan-comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Wrapper around the comment textarea */
.diwan-comment-input-wrap {
    width: 100%;
    min-width: 0;
}

.diwan-comment-textarea {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.diwan-comment-textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.diwan-comment-submit-btn {
    align-self: flex-start;
    background: #f97316;
    color: #ffffff;
    border: none;
    padding: 0.55rem 1.65rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}

.diwan-comment-submit-btn:hover {
    background: #ea580c;
}

/* Alerts */
.diwan-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.diwan-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Toast */
.diwan-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #0f172a;
    color: #ffffff;
    padding: 0.65rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99999;
    pointer-events: none;
}

.diwan-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* =========================================================
   RESPONSIVE (MOBILE & TABLET)
   ========================================================= */
@media (max-width: 900px) {
    .diwan-grid-layout {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "main"
            "side";
    }

    .diwan-top-banner {
        font-size: 1.1rem;
        padding: 1rem;
        display: block;
        text-align: center;
        line-height: 1.8;
    }
    
    .diwan-top-banner > * {
        display: inline;
    }

    .diwan-verses-wrapper {
        padding: 0.5rem 0 1.5rem;
        gap: 0.75rem;
    }

    .diwan-bayt-row {
        flex-direction: column;
        gap: 0.3rem;
        font-size: 1.35rem;
        line-height: 1.85;
        text-align: center;
        padding: 0.45rem 0.75rem;
    }

    .diwan-bayt-first,
    .diwan-bayt-second {
        text-align: center;
        padding: 0;
    }

    .diwan-bayt-gap {
        display: none;
    }

    .diwan-line {
        font-size: 1.35rem;
        line-height: 1.85;
        padding: 0.45rem 0.75rem;
    }

    .diwan-poem-main-card {
        padding: 1.5rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .diwan-verses-wrapper {
        padding: 0.25rem 0 1rem;
        gap: 0.5rem;
    }

    .diwan-bayt-row {
        font-size: 1.2rem;
        line-height: 1.8;
        padding: 0.4rem 0.6rem;
    }

    .diwan-line {
        font-size: 1.2rem;
        line-height: 1.8;
        padding: 0.4rem 0.6rem;
    }

    .diwan-poem-main-card {
        padding: 1.25rem 0.25rem;
    }
}

/* Empty / Not Found State */
.diwan-empty-state {
    text-align: center;
    padding: 3.5rem 2rem;
    background: #ffffff;
    border: 2px dashed #e2e8f0;
    border-radius: 20px;
    margin: 1rem 0 2rem;
}

.diwan-empty-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.diwan-empty-state h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
}

.diwan-empty-state p {
    color: #64748b;
    margin: 0 0 1.25rem 0;
    font-size: 1rem;
}

.diwan-btn-back {
    display: inline-block;
    background: #f97316;
    color: #ffffff;
    padding: 0.6rem 1.6rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.diwan-btn-back:hover {
    background: #ea580c;
}

/* Breadcrumb: natural inline text wrapping on mobile */
@media (max-width: 640px) {
    .diwan-top-banner {
        display: block;
        text-align: center;
        padding: 1rem 0.75rem;
        font-size: 1.1rem;
        line-height: 1.8;
    }
    .diwan-top-banner > * {
        display: inline;
    }
}

/* Toolbar: mobile two-row layout */
@media (max-width: 768px) {
    .diwan-container {
        width: 100%;
        padding: 0 2px;
    }
    .diwan-poem-toolbar {
        padding-bottom: 0.75rem;
        margin-bottom: 1.25rem;
    }
    .diwan-tools-right {
        width: 100%;
        max-width: none;
        padding-inline: 0;
        margin-inline: 0;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.35rem;
    }
    .diwan-verse-count-badge {
        width: max-content;
        margin: 0 auto 0.2rem;
        font-size: 0.75rem;
        padding: 0.25rem 0.65rem;
    }
    .diwan-tools-right .diwan-verse-count-badge {
        margin-inline: 0;
    }
    .diwan-tools-right .diwan-tb-action-btn {
        flex: 0 0 auto;
        font-size: 0.78rem;
        padding: 0.3rem 0.7rem;
        white-space: nowrap;
    }
    .diwan-tools-left {
        width: 100%;
        max-width: none;
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .diwan-tb-btn {
        width: 40px;
        height: 40px;
        padding: 0 0.35rem;
        gap: 0.3rem;
    }
    .diwan-tb-btn i {
        font-size: 1.1rem;
        line-height: 1;
    }
    .diwan-tb-stat {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
    .diwan-tb-stat i {
        font-size: 1.1em;
        line-height: 1;
    }
    .diwan-verse-count-badge > i,
    .diwan-tb-action-btn > i {
        font-size: 0.6em;
        line-height: 1;
    }
}
/* =========================================================
   MOBILE VERSES — moved from style.css mobile fixes so ALL
   diwan responsive rules live in poem.css
   ========================================================= */
@media (max-width: 768px) {
    .diwan-poem-main-card {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .diwan-verses-wrapper > .diwan-bayt-row,
    .diwan-verses-wrapper .diwan-line {
        font-size: 1.8rem;
        line-height: 2.1;
        padding: 0.5rem 0.15rem;
    }

    .diwan-poem-main-card .diwan-verses-wrapper {
        gap: 2rem;
    }

    .diwan-verses-wrapper > .diwan-bayt-row {
        align-items: stretch;
        width: 100%;
    }
    .diwan-verses-wrapper > .diwan-bayt-row > .diwan-bayt-first {
        width: calc(100% - 2.5rem);
        margin-left: auto;
        margin-right: 0;
        text-align: right;
    }
    .diwan-verses-wrapper > .diwan-bayt-row > .diwan-bayt-second {
        width: calc(100% - 2.5rem);
        margin-left: 0;
        margin-right: auto;
        text-align: left;
    }

    .diwan-verses-wrapper > .diwan-line:nth-child(odd) {
        margin-top: 0;
    }

    .diwan-verses-wrapper:has(> .diwan-mobile-bayt) {
        gap: 0;
    }
    .diwan-mobile-bayt {
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
        margin-bottom: 1.6rem;
    }
    .diwan-mobile-bayt:last-child {
        margin-bottom: 0;
    }
}

/* Line-mode structural wrapper: transparent on desktop so layout stays byte-identical */
@media (min-width: 769px) {
    .diwan-mobile-bayt {
        display: contents;
    }
}