/* IMS Species Guide — scoped for SiteLayout */
/* Hull Biofouling ID Guide - Styles */
/* Franmarine Underwater Services */

.ims-tool {
    --primary: var(--ocean-ink, #0a1721);
    --primary-light: var(--brand-orange, #ff6600);
    --accent-copper: var(--brand-orange, #ff6600);
    --accent-copper-light: var(--brand-orange-light, #ff8533);
    --danger: #c53d3d;
    --danger-light: #d95555;
    --success: #2f9e6a;
    --warning: var(--brand-orange, #ff6600);
    --niche: var(--teal, #139fa3);
    --gray-100: var(--steel-100, #eef2f4);
    --gray-200: #e4e9ed;
    --gray-300: #d0d7dd;
    --gray-600: var(--steel-500, #616971);
    --gray-800: var(--ink, #0b1520);
    --wa-color: var(--ocean-ink, #0a1721);
    --nsw-color: var(--ocean-deep, #16465f);
}

.ims-tool, .ims-tool * { box-sizing: border-box; }

.ims-tool {
    font-family: var(--font-body, "Inter", -apple-system, BlinkMacSystemFont, sans-serif);
    line-height: 1.65;
    color: var(--text-secondary, #2c3742);
    background: var(--white, #ffffff);
}

/* =============================================
   Region Modal (First Visit)
   ============================================= */

.region-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.region-modal.active {
    opacity: 1;
    visibility: visible;
}

.region-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 23, 33, 0.88);
    backdrop-filter: blur(8px);
}

.region-modal-content {
    position: relative;
    background: linear-gradient(120deg, var(--ocean-ink, #0a1721) 0%, var(--ocean-deep, #16465f) 130%);
    border-radius: var(--radius, 0.75rem);
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 80px rgba(10, 23, 33, 0.45);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

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

.region-modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.region-modal-header h2 {
    color: white;
    font-family: var(--font-display, "Space Grotesk", "Inter", sans-serif);
    font-size: 1.6rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.region-modal-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

.region-modal-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.region-modal-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 1.1rem 1.25rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius, 0.75rem);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    text-align: left;
    font-family: inherit;
}

.region-modal-btn:hover {
    background: rgba(60, 180, 224, 0.12);
    border-color: var(--cyan, #3cb4e0);
    transform: translateX(4px);
}

.region-modal-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.4rem;
    background: rgba(60, 180, 224, 0.16);
    border: 1px solid rgba(60, 180, 224, 0.4);
    color: var(--cyan, #3cb4e0);
    font-family: var(--font-display, "Space Grotesk", "Inter", sans-serif);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.region-modal-name {
    display: block;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.region-modal-desc {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-top: 2px;
}

.region-modal-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.region-modal-close:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.region-modal-skip {
    display: block;
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.6rem 0.5rem;
    background: none;
    border: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    text-decoration: underline;
    text-underline-offset: 0.18em;
    cursor: pointer;
    transition: color 0.2s ease;
}

.region-modal-skip:hover {
    color: #fff;
}

/* =============================================
   Region Dropdown (Header)
   ============================================= */

.region-dropdown {
    position: relative;
    margin-left: 16px;
}

.region-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    cursor: pointer;
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.region-dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.region-dropdown-icon {
    flex-shrink: 0;
    opacity: 0.8;
}

.region-dropdown-arrow {
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.region-dropdown.open .region-dropdown-arrow {
    transform: rotate(180deg);
}

.region-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: var(--radius, 0.75rem);
    border: 1px solid var(--line, rgba(11, 21, 32, 0.12));
    box-shadow: var(--shadow-md, 0 6px 18px rgba(10, 23, 33, 0.1));
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
    z-index: 1000;
}

.region-dropdown.open .region-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.region-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    color: #333;
    transition: background 0.15s ease;
    text-align: left;
}

.region-dropdown-item:hover {
    background: #f5f5f5;
}

.region-dropdown-item.active {
    background: var(--ocean-ink, #0a1721);
    color: white;
}

/* Region badge in actions strip */
.region-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--off-white, #eef2f4);
    color: var(--ink, #0b1520);
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius, 0.75rem);
    border: 1px solid var(--line, rgba(11, 21, 32, 0.12));
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    animation: fadeInUp 0.5s ease;
}

.region-badge-icon {
    font-size: 1.1rem;
}

.region-badge-text {
    font-size: 0.95rem;
}

/* Pulse animation for region badge */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Region content visibility */
/* WA region */
body[data-region="wa"] .wa-content { display: block !important; }
body[data-region="wa"] .nsw-content { display: none !important; }
body[data-region="wa"] .vic-content { display: none !important; }
body[data-region="wa"] .tas-content { display: none !important; }
body[data-region="wa"] .qld-content { display: none !important; }
body[data-region="wa"] .sa-content { display: none !important; }
body[data-region="wa"] .nt-content { display: none !important; }

/* NSW region */
body[data-region="nsw"] .wa-content { display: none !important; }
body[data-region="nsw"] .nsw-content { display: block !important; }
body[data-region="nsw"] .vic-content { display: none !important; }
body[data-region="nsw"] .tas-content { display: none !important; }
body[data-region="nsw"] .qld-content { display: none !important; }
body[data-region="nsw"] .sa-content { display: none !important; }
body[data-region="nsw"] .nt-content { display: none !important; }

/* VIC region */
body[data-region="vic"] .wa-content { display: none !important; }
body[data-region="vic"] .nsw-content { display: none !important; }
body[data-region="vic"] .vic-content { display: block !important; }
body[data-region="vic"] .tas-content { display: none !important; }
body[data-region="vic"] .qld-content { display: none !important; }
body[data-region="vic"] .sa-content { display: none !important; }
body[data-region="vic"] .nt-content { display: none !important; }

/* TAS region */
body[data-region="tas"] .wa-content { display: none !important; }
body[data-region="tas"] .nsw-content { display: none !important; }
body[data-region="tas"] .vic-content { display: none !important; }
body[data-region="tas"] .tas-content { display: block !important; }
body[data-region="tas"] .qld-content { display: none !important; }
body[data-region="tas"] .sa-content { display: none !important; }
body[data-region="tas"] .nt-content { display: none !important; }

/* QLD region */
body[data-region="qld"] .wa-content { display: none !important; }
body[data-region="qld"] .nsw-content { display: none !important; }
body[data-region="qld"] .vic-content { display: none !important; }
body[data-region="qld"] .tas-content { display: none !important; }
body[data-region="qld"] .qld-content { display: block !important; }
body[data-region="qld"] .sa-content { display: none !important; }
body[data-region="qld"] .nt-content { display: none !important; }

/* SA region */
body[data-region="sa"] .wa-content { display: none !important; }
body[data-region="sa"] .nsw-content { display: none !important; }
body[data-region="sa"] .vic-content { display: none !important; }
body[data-region="sa"] .tas-content { display: none !important; }
body[data-region="sa"] .qld-content { display: none !important; }
body[data-region="sa"] .sa-content { display: block !important; }
body[data-region="sa"] .nt-content { display: none !important; }

/* NT region */
body[data-region="nt"] .wa-content { display: none !important; }
body[data-region="nt"] .nsw-content { display: none !important; }
body[data-region="nt"] .vic-content { display: none !important; }
body[data-region="nt"] .tas-content { display: none !important; }
body[data-region="nt"] .qld-content { display: none !important; }
body[data-region="nt"] .sa-content { display: none !important; }
body[data-region="nt"] .nt-content { display: block !important; }
body[data-region="nt"] .sl-content { display: none !important; }

/* Sri Lanka — IMO–Norad TEST Biofouling Project.
   No Australian legal classes apply, so we show any Sri Lanka-specific blocks
   (.sl-content) and fall back to the default .wa-content for shared ID info.
   Where a Sri Lanka override exists, the matching .wa-content block is marked
   .has-sl-override so it is hidden to avoid duplication. */
body[data-region="sl"] .nsw-content,
body[data-region="sl"] .vic-content,
body[data-region="sl"] .tas-content,
body[data-region="sl"] .qld-content,
body[data-region="sl"] .sa-content,
body[data-region="sl"] .nt-content { display: none !important; }
body[data-region="sl"] .wa-content { display: block !important; }
body[data-region="sl"] .sl-content { display: block !important; }
body[data-region="sl"] .wa-content.has-sl-override { display: none !important; }

/* Hide Sri Lanka-only content while an Australian region is active */
body[data-region="wa"] .sl-content,
body[data-region="nsw"] .sl-content,
body[data-region="vic"] .sl-content,
body[data-region="tas"] .sl-content,
body[data-region="qld"] .sl-content,
body[data-region="sa"] .sl-content { display: none !important; }

/* Elements that only apply to the Australian editions are hidden for Sri Lanka */
body[data-region="sl"] .aus-only { display: none !important; }

/* Sri Lankan flag accent for the region badge/dropdown */
body[data-region="sl"] .region-badge { border-color: #8D153A; }

/* Responsive region modal */
@media (max-width: 600px) {
    .region-modal-content {
        padding: 1.5rem 1.1rem;
        max-height: min(92vh, 100%);
        overflow-y: auto;
        width: min(94vw, 500px);
    }

    .region-modal-header {
        margin-bottom: 1.25rem;
    }
    
    .region-modal-header h2 {
        font-size: 1.25rem;
    }

    .region-modal-btn {
        gap: 0.85rem;
        padding: 0.9rem 1rem;
    }

    .region-modal-icon {
        min-width: 2.6rem;
        font-size: 0.75rem;
    }
    
    /* Keep the short region code visible so users know the active region */
    .region-dropdown-text {
        font-size: 0.78rem;
    }
}

/* Header styles replaced by .ims-toolbar block at end of file */

/* Actions strip under PageHero (region + print downloads) */
.ims-actions,
.hero {
    background: var(--off-white, #eef2f4);
    color: var(--ink, #0b1520);
    padding: var(--space-lg, 3rem) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line, rgba(11, 21, 32, 0.12));
}

.ims-actions::before,
.hero::before {
    display: none;
}

.ims-actions .container,
.hero .container {
    position: relative;
    z-index: 1;
}

.ims-actions h1,
.hero h1 {
    display: none;
}

.ims-actions__lead {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--muted, #616971);
}

.ims-actions .hero-badge,
.hero-badge {
    display: none;
}

/* Print Links */
.print-links {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.print-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--brand-orange, #ff6600);
    border: 1.5px solid var(--brand-orange, #ff6600);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius, 0.75rem);
    color: white;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    min-width: 140px;
    font-family: var(--font-display, "Space Grotesk", "Inter", sans-serif);
}

.print-btn:hover {
    background: var(--brand-orange-dark, #e05a00);
    border-color: var(--brand-orange-dark, #e05a00);
    color: white;
    transform: translateY(-2px);
}

.print-icon {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.print-text {
    font-weight: 600;
    font-size: 1rem;
}

.print-desc {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 2px;
}

/* Main Content — do not pad SiteLayout <main>; that created a white gap under the header */

.section-title {
    font-family: var(--font-display, "Space Grotesk", "Inter", sans-serif);
    font-size: clamp(1.5rem, 2.6vw, 2.2rem);
    color: var(--ink, #0b1520);
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--brand-orange, #ff6600);
}

.section-title.danger { color: var(--danger); border-color: var(--danger); }
.section-title.success { color: var(--success); border-color: var(--success); }
.section-title.niche { color: var(--niche); border-color: var(--niche); }

/* Info Cards */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 24px;
    margin-bottom: 50px;
    /* Let each card size to its content instead of stretching to the tallest */
    align-items: start;
}

.info-card {
    background: white;
    border-radius: var(--radius, 0.75rem);
    border: 1px solid var(--line, rgba(11, 21, 32, 0.12));
    padding: 28px;
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(10, 23, 33, 0.05));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.info-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.info-card:hover::after {
    opacity: 1;
}

.info-card h3 {
    color: var(--primary);
    margin-bottom: 16px;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card ul { padding-left: 20px; }
.info-card li { 
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Priority Badges */
.priority {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.priority.high { 
    background: var(--danger);
    color: white;
    box-shadow: none;
}
.priority.medium { 
    background: var(--brand-orange, #ff6600);
    color: white;
    box-shadow: none;
}
.priority.low { 
    background: var(--success);
    color: white;
    box-shadow: none;
}

/* Species Cards */
.species-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
    gap: 24px;
    margin-bottom: 50px;
}

.species-card {
    background: white;
    border-radius: var(--radius, 0.75rem);
    border: 1px solid var(--line, rgba(11, 21, 32, 0.12));
    overflow: hidden;
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(10, 23, 33, 0.05));
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    cursor: pointer;
    position: relative;
}

.species-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    transition: width 0.25s ease;
}

.species-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.species-card:hover::before {
    width: 8px;
}

.species-card.invasive::before { background: linear-gradient(180deg, var(--danger-light), var(--danger)); }
.species-card.native::before { background: linear-gradient(180deg, #228B22, var(--success)); }
.species-card.niche-species::before { background: linear-gradient(180deg, var(--cyan, #3cb4e0), var(--niche)); }

.species-image {
    height: 180px;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-style: italic;
    overflow: hidden;
}

.species-content { padding: 20px; }

.species-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.species-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gray-800);
}

.species-scientific {
    font-style: italic;
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.species-group {
    display: inline-block;
    background: var(--gray-200);
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.species-description {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 15px;
    line-height: 1.5;
}

.species-features {
    background: var(--gray-100);
    padding: 12px;
    border-radius: 8px;
}

.species-features h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.species-features ul {
    list-style: none;
    font-size: 0.85rem;
}

.species-features li {
    padding: 3px 0;
    padding-left: 15px;
    position: relative;
}

.species-features li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Alert Box */
.alert {
    background: linear-gradient(135deg, #fef3f3 0%, #fff8f8 100%);
    border: 1px solid rgba(204, 0, 0, 0.15);
    border-left: 5px solid var(--danger-light);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at top right, rgba(204, 0, 0, 0.05), transparent 70%);
    pointer-events: none;
}

.alert h4 {
    color: var(--danger-light);
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert ul {
    padding-left: 20px;
    margin: 0;
}

.alert li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Quick Reference Table */
.table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

th.invasive-header { 
    background: linear-gradient(135deg, #8B0000, #CC0000); 
}
th.native-header { 
    background: linear-gradient(135deg, #006400, #228B22); 
}
th.niche-header {
    /* Darker amber keeps white header text at readable contrast */
    background: linear-gradient(135deg, #a34e00, #c96400);
}

td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.95rem;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover { 
    background: linear-gradient(90deg, rgba(0, 51, 102, 0.03), transparent);
}

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

.scientific { font-style: italic; }

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.contact-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.contact-card h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.contact-card p { margin-bottom: 10px; }
.contact-card strong { color: var(--gray-800); }

.hotline {
    display: inline-block;
    background: var(--danger-light);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Filter Buttons */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--gray-300);
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.filter-btn.invasive.active { background: var(--danger); border-color: var(--danger); }
.filter-btn.native.active { background: var(--success); border-color: var(--success); }

/* Footer */










/* Developer Contact Section */
.dev-contact {
    width: 100%;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dev-contact-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 30px;
    background: var(--navy-mid, #102636);
    border-radius: var(--radius, 0.75rem);
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex-wrap: wrap;
}

.dev-contact-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.dev-contact-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dev-contact-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
}

.dev-contact-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.dev-contact-links {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.dev-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: var(--cyan, #3cb4e0);
    text-decoration: none;
    transition: all 0.25s ease;
}

.dev-link:hover {
    background: rgba(60, 180, 224, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(60, 180, 224, 0.3);
    color: #fff;
}

.dev-link svg {
    transition: transform 0.25s ease;
}

.dev-link:hover svg {
    transform: scale(1.1);
}

@media (max-width: 600px) {
    .dev-contact-inner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .dev-contact-links {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Search */
.search-box {
    width: 100%;
    max-width: 400px;
    padding: 14px 24px 14px 48px;
    border: 2px solid var(--gray-300);
    border-radius: 30px;
    font-size: 1rem;
    margin-bottom: 30px;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 16px center no-repeat;
    transition: all 0.2s ease;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.search-box::placeholder {
    color: var(--gray-600);
}

/* Quick Reference Styles */
.ref-note {
    margin-bottom: 20px;
    color: var(--gray-600);
    font-size: 0.9em;
    padding: 12px 16px;
    background: var(--gray-100);
    border-radius: 8px;
}

.ref-note a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.ref-note a:hover {
    text-decoration: underline;
}

.ref-section-title {
    margin: 30px 0 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ref-section-title.noxious {
    color: var(--danger);
}

.ref-section-title.watch {
    color: var(--warning);
}

/* Priority List in Info Card */
.priority-list {
    padding-left: 0;
    list-style: none;
}

.priority-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Responsive — phone / tablet */
@media (max-width: 768px) {
    .ims-actions,
    .hero {
        padding: 1.5rem 0;
    }

    .ims-actions__lead {
        font-size: 0.95rem;
        padding-inline: 0.25rem;
    }

    .print-links {
        gap: 0.65rem;
    }

    .print-btn {
        min-width: 0;
        flex: 1 1 calc(50% - 0.65rem);
        max-width: 12rem;
        padding: 0.75rem 0.85rem;
    }

    .print-icon {
        font-size: 1.4rem;
    }

    .print-text {
        font-size: 0.9rem;
    }

    .ims-toolbar nav ul {
        gap: 0.65rem 0.85rem;
    }

    .ims-toolbar nav a {
        font-size: 0.72rem;
    }

    .species-grid,
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-card {
        padding: 1.25rem;
    }

    .section-title {
        font-size: 1.4rem;
        margin-bottom: 1.25rem;
    }

    .ims-tool main {
        padding: 1.75rem 0;
    }

    .search-box {
        border-radius: var(--radius, 0.75rem);
        max-width: none;
    }
}

@media (max-width: 420px) {
    .print-btn {
        flex: 1 1 100%;
        max-width: none;
    }

    .priority-list li {
        flex-wrap: wrap;
    }
}

/* Print Styles */
@media print {
    header, .filter-bar, .search-box, nav { display: none; }
    .species-card { break-inside: avoid; page-break-inside: avoid; }
}

/* Image handling */
.species-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.species-image img.error {
    display: none;
}

.species-image .placeholder {
    display: none;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e5ec 0%, #c5ccd6 100%);
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    color: var(--gray-600);
    font-size: 0.85rem;
}

.species-image img.error + .placeholder {
    display: flex;
}

.placeholder-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Gallery Modal */
.gallery-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gallery-overlay.active {
    opacity: 1;
    visibility: visible;
}

.gallery-container {
    width: 100%;
    max-width: 900px;
    max-height: calc(100vh - 40px);
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.gallery-overlay.active .gallery-container {
    transform: translateY(0);
    opacity: 1;
}

.gallery-header {
    padding: 16px 20px;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.gallery-header.high-priority {
    background: var(--danger);
}

.gallery-header.medium-priority {
    background: var(--warning);
}

.gallery-header.native {
    background: var(--success);
}

.gallery-header.niche {
    background: var(--niche);
}

.gallery-header-text {
    min-width: 0;
}

.gallery-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.gallery-scientific {
    font-style: italic;
    opacity: 0.8;
    font-size: 0.9rem;
    margin-top: 2px;
}

.gallery-close {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.gallery-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.gallery-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.gallery-image-container {
    position: relative;
    background: var(--gray-100);
    border-radius: 8px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main-image {
    width: 100%;
    max-height: 50vh;
    object-fit: contain;
    border-radius: 8px;
    background: var(--gray-100);
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    border: 3px solid transparent;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.gallery-thumb:hover {
    opacity: 1;
    transform: scale(1.05);
}

.gallery-thumb.active {
    border-color: var(--primary);
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 82, 147, 0.3);
}

.gallery-info {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.gallery-info h4 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.gallery-info p {
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.6;
}

.gallery-features {
    margin-top: 12px;
}

.gallery-features ul {
    padding-left: 18px;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.gallery-features li {
    margin-bottom: 4px;
}

.gallery-lookalike {
    margin-top: 16px;
    background: #fff8e1;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 12px;
}

.gallery-lookalike strong {
    color: #e65100;
}

/* Mobile Modal */
@media (max-width: 640px) {
    .gallery-overlay {
        padding: 0;
    }
    
    .gallery-container {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    
    .gallery-header {
        padding: 12px 16px;
    }
    
    .gallery-title {
        font-size: 1.05rem;
    }
    
    .gallery-body {
        padding: 12px;
    }
    
    .gallery-main-image {
        max-height: 35vh;
    }
}

/* Lookalike comparison */
.lookalike-box {
    background: #fbf3e6;
    border: 1px solid #e7c98b;
    border-left: 4px solid var(--brand-orange, #ff6600);
    border-radius: var(--radius, 0.75rem);
    padding: 12px;
    margin-top: 10px;
    font-size: 0.85rem;
}

.lookalike-box strong {
    color: var(--brand-orange-dark, #e05a00);
}

/* IMS toolbar (replaces standalone tool header under SiteLayout) */
.ims-toolbar {
  background: var(--ocean-ink, #0a1721);
  color: #fff;
  padding: 0.75rem 0;
  position: sticky;
  top: var(--header-h, 4.25rem);
  z-index: 40;
  box-shadow: 0 2px 10px rgba(10, 23, 33, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ims-toolbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: var(--max, 68rem);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.ims-toolbar nav ul {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.ims-toolbar nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ims-toolbar nav a:hover {
  color: var(--brand-orange, #ff6600);
}

.ims-tool .container {
  max-width: var(--max, 68rem);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.ims-tool .page-hero .container.narrow,
.ims-tool .container.narrow {
  max-width: var(--narrow, 42rem);
}

.ims-tool .section-title {
  font-family: var(--font-display, "Space Grotesk", "Inter", sans-serif);
}

.ims-tool .region-dropdown-trigger {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius, 0.75rem);
  color: #fff;
}

.ims-tool .region-dropdown-trigger:hover {
  border-color: var(--cyan, #3cb4e0);
  color: var(--cyan, #3cb4e0);
}

.ims-tool .print-btn,
.ims-tool .btn {
  background: var(--brand-orange, #ff6600);
  border-color: var(--brand-orange, #ff6600);
  color: #fff;
}

.ims-tool .print-btn:hover,
.ims-tool .btn:hover {
  background: var(--brand-orange-dark, #e05a00);
  border-color: var(--brand-orange-dark, #e05a00);
  color: #fff;
}

/* Left stripe mirrors the priority coding: red invasive, amber watch, green native */
.ims-tool .species-card::before {
  background: linear-gradient(180deg, var(--brand-orange, #ff6600), var(--brand-orange-dark, #e05a00));
}

.ims-tool .species-card.invasive::before {
  background: linear-gradient(180deg, var(--danger, #c53d3d), #8b0000);
}

.ims-tool .species-card.niche::before {
  background: linear-gradient(180deg, #c96400, #a34e00);
}

.ims-tool .species-card.native::before {
  background: linear-gradient(180deg, var(--success, #2f9e6a), #1f7a50);
}

.ims-tool .contact-section,
.ims-tool #contact {
  background: var(--ocean-ink, #0a1721);
}

/* Section title sits on the dark reporting band — keep it readable */
.ims-tool #contact .section-title,
.ims-tool .contact-section .section-title {
  color: var(--white, #ffffff);
}

.ims-tool .contact-section a,
.ims-tool #contact a {
  color: var(--brand-orange, #ff6600);
}

.ims-tool main {
  padding: var(--space-lg, 3rem) 0;
  background: var(--white, #ffffff);
}

@media (max-width: 800px) {
  /* Single-row toolbar: nav scrolls horizontally instead of wrapping to 3 lines */
  .ims-toolbar__inner {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  .ims-toolbar nav {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .ims-toolbar nav::-webkit-scrollbar {
    display: none;
  }

  .ims-toolbar nav ul {
    flex-wrap: nowrap;
    gap: 1rem;
    padding-bottom: 2px;
  }

  .ims-toolbar nav a {
    white-space: nowrap;
    /* Comfortable tap target inside the scroll row */
    display: inline-block;
    padding: 0.5rem 0;
  }

  .ims-toolbar .region-dropdown {
    flex-shrink: 0;
  }
}

