:root {
    --primary-dark: #0a1633;
    --primary: #112552;
    --primary-light: #1a3a6b;
    --accent-gold: #ffd54f;
    --accent-gold-hover: #ffca28;
    --accent-blue: #1565c0;
    --accent-blue-hover: #0d47a1;
    --bg-page: #f0f2f5;
    --bg-surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --site-header-height: 105px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-color: #94a3b8 transparent;
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8 !important;
    border-radius: 9999px;
    transition: background 200ms ease;
}

::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active {
    background: #64748b !important;
}

@font-face {
    font-family: 'Jameel Noori Nastaleeq';
    src: local('Jameel Noori Nastaleeq'),
         local('JameelNooriNastaleeq'),
         local('Jameel Noori Nastaleeq Regular'),
         url('../assets/fonts/jameel-noori-nastaleeq.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', 'Urdu Typesetting', Tahoma, Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    direction: rtl;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ==========================================
   HEADER & NAVIGATION
   ========================================== */
.site-header {
    background: linear-gradient(135deg, #09142f 0%, #112552 50%, #173b7a 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}

.header-top .logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-top .logo-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    transition: transform var(--transition-fast);
}

.header-top .logo:hover .logo-icon {
    transform: scale(1.05);
}

.logo-text-group {
    display: flex;
    flex-direction: column;
}

.header-top .logo h1 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #ffffff;
    line-height: 1.3;
}

.logo-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-top .login-btn {
    color: #fff;
    text-decoration: none;
    padding: 8px 22px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition-fast);
    backdrop-filter: blur(6px);
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.header-top .login-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Mobile Toggle */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 9px 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.mobile-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-nav-toggle span {
    width: 100%;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.mobile-nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Navigation Menu */
.main-nav {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-nav ul li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.main-nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--accent-gold);
    border-radius: 3px 3px 0 0;
    transition: width var(--transition-fast);
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.main-nav ul li a:hover::after,
.main-nav ul li a.active::after {
    width: 44px;
}

.nav-auth-mobile {
    display: none;
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero {
    background: linear-gradient(135deg, #09142f 0%, #112552 45%, #18428a 100%);
    color: #fff;
    padding: 22px 20px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 40% 40%, rgba(255,255,255,0.04) 0%, transparent 60%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, transparent, var(--bg-page));
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 30px;
    font-size: 11.5px;
    color: var(--accent-gold);
    margin-bottom: 8px;
    backdrop-filter: blur(4px);
}

.hero h2 {
    font-size: 23px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.35;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.65;
    max-width: 580px;
    margin: 0 auto;
}

.hero-btns {
    display: none;
}

/* ==========================================
   STATS SECTION (Index page)
   ========================================== */
.stats-section {
    max-width: 1140px;
    margin: -14px auto 0;
    padding: 0 24px;
    position: relative;
    z-index: 10;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 14px;
    transition: transform var(--transition-fast);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-card:nth-child(1) .stat-icon { background: linear-gradient(135deg, #ede9fe, #ddd6fe); }
.stat-card:nth-child(2) .stat-icon { background: linear-gradient(135deg, #dcfce7, #bbf7d0); }
.stat-card:nth-child(3) .stat-icon { background: linear-gradient(135deg, #fef3c7, #fde68a); }

.stat-number {
    font-size: 34px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================
   ABOUT SECTION (Index page)
   ========================================== */
.about-section {
    max-width: 1140px;
    margin: 50px auto 30px;
    padding: 0 24px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 36px;
    align-items: center;
}

.about-text h3 {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 14px;
    line-height: 1.4;
}

.about-text p {
    color: #475569;
    line-height: 1.9;
    font-size: 15px;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 22px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.feature-item:hover {
    transform: translateX(-4px);
}

.feature-item .fi-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #112552, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.feature-item .fi-text {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

.about-visual {
    display: flex;
    justify-content: center;
}

.visual-card {
    background: linear-gradient(135deg, #0a1633, #173b7a);
    border-radius: var(--radius-lg);
    padding: 44px 34px;
    color: #fff;
    text-align: center;
    width: 100%;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.1);
}

.visual-card .vc-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.visual-card h4 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.visual-card p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
}

/* ==========================================
   MAIN CONTENT & FILTER BAR
   ========================================== */
.main-content {
    flex: 1;
    max-width: 1140px;
    margin: 0 auto;
    padding: 30px 24px 60px;
    width: 100%;
}

.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--bg-surface);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.filter-bar select,
.filter-bar input {
    padding: 10px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}

.filter-bar input {
    flex: 1;
    min-width: 260px;
}

.filter-bar select {
    min-width: 180px;
    cursor: pointer;
}

/* ==========================================
   TABLE & DATA CARDS
   ========================================== */
.table-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.data-table th {
    background: #f8fafc;
    padding: 14px 18px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.2px;
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: var(--text-main);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.badge-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-case { background: #e0f2fe; color: #0369a1; }
.badge-report { background: #dcfce7; color: #15803d; }
.badge-note { background: #fef3c7; color: #b45309; }
.badge-other { background: #f1f5f9; color: #475569; }

.empty-msg {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 15px;
}

.empty-msg .empty-icon {
    font-size: 44px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.8;
}

/* Buttons */
.btn-view {
    padding: 7px 18px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-view:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(21, 101, 192, 0.3);
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-download:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}

/* ==========================================
   MODAL
   ========================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: var(--bg-surface);
    width: 90%;
    max-width: 680px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transform: translateY(12px);
    transition: transform var(--transition-fast);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

.modal-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal-close {
    background: none;
    border: 1px solid var(--border-color);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.btn-print {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    color: #334155;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-print:hover {
    background: #f1f5f9;
}

.modal-body {
    padding: 24px;
}

.modal-body pre {
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 2.1;
    direction: rtl;
    font-size: 14.5px;
    color: #334155;
    background: #f8fafc;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
    background: #09142f;
    color: rgba(255, 255, 255, 0.65);
    padding: 36px 24px;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-inner {
    max-width: 1140px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 26px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 13.5px;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-gold);
}

.footer-copy {
    font-size: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
    color: rgba(255, 255, 255, 0.5);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-top {
        padding: 12px 18px;
    }

    .header-top .header-actions .login-btn {
        display: none !important;
    }

    .mobile-nav-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        background: #0d1b3e;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        padding: 8px 16px 4px;
    }

    .main-nav ul li a {
        padding: 12px 14px;
        font-size: 14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .main-nav ul li a::after {
        display: none;
    }

    .nav-auth-mobile {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px 16px 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 4px;
    }

    .nav-auth-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px 14px;
        border-radius: var(--radius-sm);
        text-decoration: none;
        font-size: 13.5px;
        font-weight: 600;
        transition: all var(--transition-fast);
        text-align: center;
    }

    .nav-btn-register {
        background: rgba(16, 185, 129, 0.22);
        border: 1px solid rgba(52, 211, 153, 0.45);
        color: #6ee7b7;
    }

    .nav-btn-register:hover,
    .nav-btn-register:active {
        background: rgba(16, 185, 129, 0.35);
        border-color: rgba(52, 211, 153, 0.7);
        color: #fff;
    }

    .nav-btn-login {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.28);
        color: #ffffff;
    }

    .nav-btn-login:hover,
    .nav-btn-login:active {
        background: rgba(255, 255, 255, 0.22);
        border-color: rgba(255, 255, 255, 0.6);
    }

    @media (max-width: 380px) {
        .nav-auth-mobile {
            grid-template-columns: 1fr;
        }
    }

    .hero {
        padding: 15px 12px 18px;
    }

    .hero-badge {
        font-size: 10.5px;
        padding: 2px 10px;
        margin-bottom: 6px;
    }

    .hero h2 {
        font-size: 19px;
        margin-bottom: 5px;
    }

    .hero p {
        font-size: 12px;
        margin-bottom: 0;
        line-height: 1.5;
    }

    .stats-section {
        margin-top: -10px;
        padding: 0 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .stat-card {
        padding: 20px 16px;
    }

    .stat-number {
        font-size: 28px;
    }

    .main-content {
        padding: 20px 16px 40px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
    }

    .filter-bar input,
    .filter-bar select {
        width: 100%;
        min-width: 0;
    }

    .data-table th,
    .data-table td {
        padding: 12px 14px;
        font-size: 13px;
    }

    .footer-links {
        gap: 16px;
    }
}

/* ==========================================
   INCIDENT PLACE SKETCH BUILDER
   ========================================== */
.builder-page-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    min-height: 595px;
    background: #eef2f6;
    position: relative;
}

.builder-subnav {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.builder-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.builder-title-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #09142f 0%, #1565c0 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 3px 8px rgba(21, 101, 192, 0.25);
}

.builder-title-text h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
}

.builder-title-text span {
    font-size: 11.5px;
    color: var(--text-muted);
}

.builder-actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.builder-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    transition: all var(--transition-fast);
    line-height: 1.4;
}

.builder-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px);
}

.builder-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.builder-btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border-color: #059669;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.builder-btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #047857;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.builder-btn-dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border-color: #0f172a;
}

.builder-btn-dark:hover {
    background: #000;
    color: #ffffff;
}

.builder-btn-danger {
    color: #b91c1c;
    border-color: #fca5a5;
    background: #fff5f5;
}

.builder-btn-danger:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

/* ==========================================================================
   MS Office Style Ribbon Toolbar for Incident Place Builder
   ========================================================================== */

.office-ribbon {
    background: #ffffff;
    border-bottom: 1.5px solid #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    position: sticky;
    top: var(--site-header-height, 105px);
    z-index: 500;
    user-select: none;
}

body.builder-fullscreen .office-ribbon {
    top: 0 !important;
}

/* 1. Quick Access Bar / App Title */
.ribbon-quick-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0b1a3d 0%, #112552 100%);
    color: #ffffff;
    padding: 6px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-wrap: wrap;
    gap: 10px;
}

.ribbon-app-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ribbon-app-icon {
    font-size: 20px;
    background: rgba(255, 255, 255, 0.12);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ribbon-app-text h2 {
    font-size: 14.5px;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ribbon-app-badge {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    letter-spacing: 0.3px;
}

.ribbon-app-desc {
    font-size: 11px;
    color: #94a3b8;
    display: block;
}

.ribbon-quick-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ribbon-qa-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.ribbon-qa-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    transform: translateY(-1px);
}

.ribbon-qa-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ribbon-qa-primary {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}

.ribbon-qa-primary:hover {
    background: #047857 !important;
}

.ribbon-qa-dark {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

.ribbon-qa-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 2px;
}

.ribbon-toggle-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
}

.ribbon-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 2. Ribbon Tabs Bar */
.ribbon-tabs-bar {
    display: flex;
    align-items: flex-end;
    background: #f1f5f9;
    padding: 0 16px;
    border-bottom: 1px solid #cbd5e1;
    overflow-x: auto;
    gap: 4px;
}

.ribbon-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 18px;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    color: #475569;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    top: 1px;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: inherit;
}

.ribbon-tab-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ribbon-tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    border-bottom-color: #ffffff;
    font-weight: 700;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.04);
}

.ribbon-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2.5px;
    background: #0284c7;
    border-radius: 2px 2px 0 0;
}

/* 3. Ribbon Body & Panels */
.ribbon-body {
    background: #ffffff;
    border-bottom: 1px solid #cbd5e1;
    overflow-x: auto;
    overflow-y: hidden;
    transition: all 0.25s ease;
}

.office-ribbon.collapsed .ribbon-body {
    display: none !important;
}

.ribbon-pane {
    display: none;
    padding: 8px 16px;
    gap: 12px;
    align-items: stretch;
    min-height: 94px;
}

.ribbon-pane.active {
    display: flex;
}

/* 4. Ribbon Groups */
.ribbon-group {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0 12px;
    border-left: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.ribbon-group:last-child {
    border-left: none;
}

.ribbon-group-content {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.ribbon-group-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-align: center;
    margin-top: 4px;
    padding-top: 3px;
    border-top: 1px solid #f8fafc;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* 5. Ribbon Buttons (Large & Small) */
.ribbon-btn-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 62px;
    padding: 4px 8px;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    color: #1e293b;
    font-family: inherit;
}

.ribbon-btn-large:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.ribbon-btn-large.active {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0369a1;
    box-shadow: inset 0 0 0 1px #0284c7, 0 2px 6px rgba(2, 132, 199, 0.2);
}

.ribbon-icon-large {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ribbon-text-large {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.ribbon-btn-large small {
    font-size: 9px;
    color: #64748b;
    font-weight: 500;
}

.ribbon-btn-large.active small {
    color: #0284c7;
}

/* Special markers */
.ribbon-btn-incident {
    border-color: #fecaca;
    background: #fef2f2;
}

.ribbon-btn-incident:hover {
    background: #fee2e2;
    border-color: #f87171;
}

.ribbon-btn-incident.active {
    background: #fee2e2;
    border-color: #dc2626;
    box-shadow: 0 0 0 1.5px #dc2626;
}

.ribbon-btn-danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.ribbon-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ribbon-btn-small {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    height: 25px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    font-family: inherit;
}

.ribbon-btn-small:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.ribbon-btn-small.active {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0369a1;
    box-shadow: 0 0 0 1px #0284c7;
}

.ribbon-icon-small {
    font-size: 13px;
    width: 16px;
    text-align: center;
    display: inline-block;
    flex-shrink: 0;
}

/* Form controls in ribbon */
.ribbon-form-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ribbon-form-item label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    margin: 0;
}

.ribbon-input, .ribbon-select {
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 11.5px;
    background: #ffffff;
    color: #1e293b;
    font-family: inherit;
}

.ribbon-input:focus, .ribbon-select:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.ribbon-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #334155;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
}

.ribbon-checkbox input {
    accent-color: #0284c7;
    width: 15px;
    height: 15px;
}

/* ==========================================================================
   Main Workspace: Expansive Center Canvas + Single Properties Sidebar
   ========================================================================== */

/* Prevent multiple nested scrollbars across browser window on Incident Builder */
html.builder-lock-scroll,
body.builder-lock-scroll {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.builder-lock-scroll .site-header {
    flex-shrink: 0 !important;
    transition: margin-top 0.25s ease, opacity 0.2s ease;
}

body.builder-lock-scroll .builder-page-wrapper {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

body.builder-lock-scroll .office-ribbon {
    flex-shrink: 0 !important;
}

body.builder-lock-scroll .builder-status-bar {
    flex-shrink: 0 !important;
}

.builder-workspace {
    display: flex;
    flex-direction: row;
    flex: 1 1 0%;
    min-height: 0;
    height: auto;
    background: #cbd5e1;
    overflow: hidden;
    position: relative;
}

.builder-sidebar {
    background: #ffffff;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Tools Sidebar (Right side in RTL) - Single clean scrollbar inside sidebar */
.builder-sidebar-tools {
    width: 255px;
    flex-shrink: 0;
    background: #ffffff;
    border-left: 1.5px solid #cbd5e1;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 35;
}

/* Properties Sidebar (Left side in RTL) - Slim 285px to prevent squashing canvas */
.builder-sidebar-properties {
    display: none;
    width: 285px;
    max-width: 285px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1.5px solid #cbd5e1;
    box-shadow: -3px 0 14px rgba(15, 23, 42, 0.08);
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    flex-direction: column;
    gap: 10px;
    z-index: 40;
    transition: all 0.2s ease;
}

.builder-sidebar-properties.open {
    display: flex !important;
}

.builder-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
}

.builder-card-tools {
    padding: 10px;
    margin-bottom: 0;
}

.builder-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    border-bottom: 1.5px solid #e2e8f0;
    padding-bottom: 5px;
}

.builder-toolgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.builder-tool-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    color: #1e293b;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: right;
    transition: all 0.15s ease;
    min-height: 40px;
    font-family: inherit;
}

.builder-tool-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.builder-tool-btn.active {
    background: linear-gradient(135deg, #112552 0%, #1a3a6b 100%);
    color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 3px 8px rgba(17, 37, 82, 0.25);
}

.builder-tool-icon {
    font-size: 14px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 4px;
    flex-shrink: 0;
}

.builder-tool-btn.active .builder-tool-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffd54f;
}

.builder-tool-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.builder-tool-name {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.builder-tool-sub {
    font-size: 9px;
    color: #64748b;
    font-weight: 400;
}

.builder-tool-btn.active .builder-tool-sub {
    color: rgba(255, 255, 255, 0.7);
}

.builder-hint {
    font-size: 11px;
    color: #64748b;
    margin-top: 8px;
    line-height: 1.5;
    background: #f1f5f9;
    padding: 8px 10px;
    border-radius: 6px;
    border-right: 3px solid #1565c0;
}

/* Stage Container: Holds stage and keeps zoom controls pinned without overlapping sidebars */
.builder-stage-container {
    flex: 1 1 0%;
    min-width: 0;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    background: #cbd5e1;
}

/* Stage & Canvas: Safe centering so overflowing paper never gets clipped or overlaps sidebar */
.builder-stage {
    flex: 1 1 0%;
    min-width: 0;
    height: 100%;
    background: #cbd5e1;
    overflow: auto;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: safe center;
    position: relative;
    background-image: 
        radial-gradient(#94a3b8 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Google Maps Style Stacked Zoom Controls (Pinned to corner of stage viewport) */
.gmap-zoom-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 45;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.gmap-zoom-btn {
    width: 36px;
    height: 36px;
    background: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #3c4043;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
    font-family: Arial, sans-serif;
    user-select: none;
}

.gmap-zoom-btn:hover {
    background: #f1f3f4;
    color: #1a73e8;
}

.gmap-zoom-btn:active {
    background: #e8eaed;
}

.gmap-zoom-divider {
    height: 1px;
    width: 24px;
    background: #e0e0e0;
    margin: 0 auto;
}

.gmap-zoom-btn-reset {
    font-size: 11px;
    font-weight: 700;
    color: #5f6368;
    height: 28px;
    border-top: 1px solid #e0e0e0;
}

.gmap-zoom-btn-fit {
    font-size: 11px;
    font-weight: 700;
    color: #0284c7;
    height: 28px;
    border-top: 1px solid #e0e0e0;
    background: #f8fafc;
    border-radius: 0 0 5px 5px;
    cursor: pointer;
    border-left: none;
    border-right: none;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gmap-zoom-btn-fit:hover {
    background: #e0f2fe;
    color: #0369a1;
}

/* Rotation Presets & Sliders */
.rot-presets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 6px;
}

.rot-steps-row {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.rot-preset-btn, .rot-step-btn {
    padding: 5px 3px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    font-family: inherit;
}

.rot-preset-btn:hover, .rot-step-btn:hover {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0369a1;
}

.rot-preset-btn:active, .rot-step-btn:active {
    background: #bae6fd;
}

.builder-range {
    accent-color: #0284c7;
    cursor: pointer;
}

.builder-paper {
    margin: auto;
    flex-shrink: 0;
    position: relative;
    background: #ffffff;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 2px;
    transition: transform 0.2s ease;
    transform-origin: center center;
}

#map {
    display: block;
    background: #ffffff;
    touch-action: none;
    cursor: crosshair;
}

#map text, .compass text {
    font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', 'Urdu Typesetting', Tahoma, Arial, sans-serif !important;
}

/* Forms in Builder */
.builder-form-group {
    margin-bottom: 10px;
}

.builder-label {
    display: block;
    font-size: 11.5px;
    color: #475569;
    font-weight: 600;
    margin-bottom: 4px;
}

.builder-input, .builder-select {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    color: #1e293b;
    transition: border-color var(--transition-fast);
}

.builder-input:focus, .builder-select:focus {
    border-color: #1565c0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}

.builder-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.builder-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #334155;
    cursor: pointer;
    margin-top: 6px;
}

.builder-checkbox-label input {
    width: 16px;
    height: 16px;
    accent-color: #112552;
}

.builder-selection-empty {
    background: #f1f5f9;
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-size: 12px;
}

.builder-status-bar {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 7px 20px;
    font-size: 11.5px;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.builder-status-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1e293b;
}

/* Responsive Builder */
@media(max-width: 900px) {
    .builder-workspace {
        flex-direction: column;
        height: auto;
    }
    .builder-sidebar-tools, .builder-sidebar-properties {
        width: 100%;
        border-right: none;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    .builder-stage {
        min-height: 500px;
        padding: 12px;
    }
}

/* Full Page View / Fullscreen Mode */
body.builder-fullscreen .site-header {
    display: none !important;
}

.ribbon-qa-fullscreen {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transition: all 0.2s ease;
}

.ribbon-qa-fullscreen:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffd54f;
    border-color: rgba(255, 255, 255, 0.4);
}

body.builder-fullscreen .ribbon-qa-fullscreen,
.ribbon-qa-fullscreen.active {
    background: #0284c7 !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.4) !important;
}

@media print {
    .site-header, .site-footer, .builder-subnav, .builder-sidebar, .builder-sidebar-tools, .builder-sidebar-properties, .builder-status-bar, .gmap-zoom-container, .tool-guide-wrapper, .guide-scroll-hint {
        display: none !important;
    }
    body, .builder-page-wrapper, .builder-stage {
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }
    .builder-workspace {
        display: block !important;
        height: auto !important;
        background: transparent !important;
    }
    .builder-paper {
        box-shadow: none !important;
        margin: 0 auto !important;
        transform: none !important;
    }
}

/* ==========================================================================
   Comprehensive Tool Editorial Guides & Knowledge Base (AdSense Compliant)
   ========================================================================== */
.tool-guide-wrapper {
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    padding: 50px 20px 60px;
    direction: rtl;
    color: #1e293b;
}

.tool-guide-container {
    max-width: 1140px;
    margin: 0 auto;
}

.tool-guide-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.tool-guide-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 14px;
    border: 1px solid #bae6fd;
}

.tool-guide-title {
    font-size: 27px;
    font-weight: 800;
    color: #09142f;
    line-height: 1.5;
    margin-bottom: 10px;
}

.tool-guide-subtitle {
    font-size: 15px;
    color: #64748b;
    max-width: 820px;
    margin: 0 auto;
    line-height: 1.8;
}

.tool-guide-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.tool-guide-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tool-guide-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-guide-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    transform: translateY(-2px);
}

.tool-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.tool-card-title {
    font-size: 19px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    line-height: 1.4;
}

.tool-card-body {
    font-size: 14.5px;
    color: #334155;
    line-height: 1.9;
}

.tool-card-body p {
    margin-bottom: 12px;
}

.tool-card-body p:last-child {
    margin-bottom: 0;
}

.tool-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 20px 0 30px;
}

.tool-step-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
}

.tool-step-num {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #09142f;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
}

.tool-step-text {
    flex: 1;
}

.tool-step-text strong {
    display: block;
    font-size: 16px;
    color: #0f172a;
    margin-bottom: 4px;
}

.tool-step-text p {
    margin: 0;
    font-size: 14px;
    color: #475569;
    line-height: 1.7;
}

.tool-guide-table-wrap {
    overflow-x: auto;
    margin: 20px 0 30px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.tool-guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: right;
}

.tool-guide-table th {
    background: #09142f;
    color: #ffffff;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 14px;
}

.tool-guide-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    line-height: 1.7;
}

.tool-guide-table tr:hover td {
    background: #f8fafc;
}

.tool-faq-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

.tool-faq-section h3 {
    font-size: 22px;
    font-weight: 700;
    color: #09142f;
    margin-bottom: 20px;
    text-align: center;
}

.tool-faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
}

.tool-faq-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tool-faq-item[open] {
    border-color: #0284c7;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
}

.tool-faq-summary {
    padding: 14px 20px;
    font-weight: 700;
    font-size: 16px;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    user-select: none;
}

.tool-faq-summary::-webkit-details-marker {
    display: none;
}

.tool-faq-summary::after {
    content: "＋";
    font-size: 18px;
    color: #0284c7;
    transition: transform 0.2s ease;
}

.tool-faq-item[open] .tool-faq-summary::after {
    content: "−";
}

.tool-faq-content {
    padding: 0 20px 18px;
    font-size: 14.5px;
    color: #475569;
    line-height: 1.9;
    border-top: 1px dashed #f1f5f9;
    padding-top: 14px;
}

.guide-scroll-hint {
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #cbd5e1;
    padding: 9px 16px;
    text-align: center;
    font-size: 13.5px;
    font-weight: 600;
    color: #0369a1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.guide-scroll-hint:hover {
    background: #e0f2fe;
    color: #0284c7;
}
