/* Filter and Sort UI */
.dsi-filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.dsi-filter-group {
    flex-grow: 1;
    min-width: 150px; /* Ensure filters don't get too small */
}

.dsi-filter-input,
.dsi-filter-select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    background-color: #ffffff;
    color: #334155;
    -webkit-appearance: none; /* Remove default browser styling for selects */
    -moz-appearance: none;
    appearance: none;
}

.dsi-filter-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23334155' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 0.8em 0.8em;
    padding-right: 2.5rem; /* Make space for the arrow */
}

.dsi-filter-input:focus,
.dsi-filter-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
    outline: none;
}

/* Loading state */
.dsi-card-list-container.dsi-loading {
    position: relative;
    min-height: 150px; /* Prevent layout shift */
}

.dsi-card-list-container.dsi-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dsi-card-list-container.dsi-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments for filters */
@media (max-width: 600px) {
    .dsi-filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .dsi-filter-group {
        min-width: unset;
        width: 100%;
    }
}

/* Modern card & detail layout for Dog Snack Info */

/* Archive header */
.dsi-archive {
    margin: 2rem 0;
}

.dsi-archive-header {
    margin-bottom: 1.5rem;
}

.dsi-archive-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.4rem;
}

.dsi-archive-header p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

/* Card grid */
.dsi-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Smaller min-width for cards */
    gap: 1rem; /* Reduced gap */
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.dsi-card {
    border-radius: 0.75rem; /* Slightly smaller radius */
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05); /* Softer shadow */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.dsi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.dsi-card-header {
    padding: 0.5rem 0.75rem 0; /* Reduced padding */
}

.dsi-card-body {
    padding: 0.5rem 0.75rem; /* Reduced padding */
}

.dsi-card-title {
    font-size: 1rem; /* Reduced font size */
    margin: 0.25rem 0 0.5rem;
}

.dsi-card-title a {
    text-decoration: none;
    color: inherit;
}

.dsi-card-thumb {
    margin-bottom: 0.5rem;
}

.dsi-card-note {
    font-size: 0.8rem; /* Reduced font size */
    color: #64748b;
    line-height: 1.5;
    margin: 0;
    flex-grow: 1; /* Allow note to take up space */
}

.dsi-card-footer {
    padding: 0.5rem 0.75rem 0.75rem; /* Reduced padding */
    margin-top: auto; /* Pushes footer to the bottom */
    text-align: right; /* Align link to the right */
}

.dsi-card-link {
    font-size: 0.8rem; /* Reduced font size */
    padding: 0.25rem 0.75rem; /* Reduced padding */
}

.dsi-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}


.dsi-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    line-height: 1.4;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
}

.dsi-chip-safety {
    font-weight: 600;
}

/* Safety color accents */
.dsi-safety-safe .dsi-chip-safety {
    border-color: #bbf7d0;
    background: #ecfdf3;
    color: #15803d;
}

.dsi-safety-caution .dsi-chip-safety {
    border-color: #facc15;
    background: #fefce8;
    color: #92400e;
}

.dsi-safety-danger .dsi-chip-safety {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

/* Safety icon within chip */
.dsi-chip-safety .dsi-safety-icon {
    width: 1em; /* Adjust size as needed */
    height: 1em;
    margin-right: 0.25em;
    vertical-align: -0.125em; /* Align with text */
}

/* Card image & placeholder */
.dsi-card-thumb {
    margin: 0.25rem 0 0.5rem;
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative; /* For absolute positioning of img */
    width: 100%; /* Take full width of card */
    padding-bottom: 100%; /* Creates a square aspect ratio */
    height: 0; /* Reset height as padding-bottom handles it */
}

.dsi-card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure images cover the area */
}

.dsi-card-thumb-placeholder {
    background-color: #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #94a3b8;
    position: absolute; /* Match img positioning */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0.75rem;
}

.dsi-card-thumb-placeholder svg {
    width: 50px;
    height: 50px;
}

/* Card hover effect */
.dsi-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.dsi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.1);
}

.dsi-card-note {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
}

.dsi-card-meta-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dsi-card-meta-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.dsi-meta-label {
    color: #94a3b8;
}

.dsi-meta-value {
    font-weight: 500;
    color: #0f172a;
}

/* Card footer */
.dsi-card-footer {
    padding: 0.75rem 1rem 1rem;
    margin-top: auto;
}

.dsi-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
}

.dsi-card-link:hover {
    background: #e2e8f0;
}

/* Detail layout */
.dsi-detail {
    margin: 2rem 0;
    border-radius: 1.25rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    padding: 1.75rem 1.5rem 1.5rem;
}

.dsi-detail-header {
    margin-bottom: 1.5rem;
}

.dsi-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.dsi-detail-title {
    margin: 0;
    font-size: 2rem; /* Increased font size for prominence */
    line-height: 1.2;
    color: #0f172a;
}

.dsi-detail-reviewed {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: #64748b;
}

/* REMOVED .dsi-detail-layout */

@media (max-width: 768px) {
    .dsi-detail {
        padding: 1.25rem 1rem;
    }
    /* REMOVED .dsi-detail-layout grid-template-columns */
}

/* Detail main */
.dsi-detail-thumb {
    margin-bottom: 1rem;
    border-radius: 1rem;
    overflow: hidden;
}

.dsi-detail-thumb img {
    max-width: 100%;
    height: auto; /* Maintain aspect ratio */
    max-height: 400px; /* Example max height, can be adjusted */
    object-fit: contain; /* Ensure the whole image is visible within the bounds */
    display: block; /* Remove extra space below image */
    border-radius: 1rem; /* Match parent border-radius */
}

.dsi-detail-content {
    font-size: 1rem; /* Slightly increased font size */
    line-height: 1.6;
    color: #334155;
    margin-bottom: 2rem;
}

.dsi-detail-content p:last-child {
    margin-bottom: 0;
}

.dsi-detail-content a {
    text-decoration: none; /* Remove underline from links in content */
    color: #3b82f6; /* Keep link color */
}

/* Card body and footer padding for conciseness */
.dsi-card-body {
    padding: 0.75rem 1rem;
}

.dsi-card-footer {
    padding: 0.75rem 1rem 1rem;
}

/* REMOVED .dsi-detail-sidebar */

.dsi-panel {
    border-radius: 0.9rem;
    border: 1px solid #e2e8f0;
    padding: 1.2rem; /* Increased padding */
    background: #f8fafc;
}

.dsi-panel-warning {
    background: #fef2f2;
    border-color: #fecaca;
}

.dsi-panel-refs {
    background: #f9fafb;
}

.dsi-panel-title {
    margin: 0 0 0.8rem; /* Adjusted margin */
    font-size: 1.1rem; /* Increased font size */
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0; /* Section separator */
    padding-bottom: 0.5rem;
}

.dsi-panel-warning .dsi-panel-title {
    border-color: #fecaca; /* Match warning panel border */
}

.dsi-panel-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Increased gap between list items */
}

.dsi-panel-list li {
    font-size: 0.9rem; /* Adjusted font size */
    line-height: 1.5;
    color: #334155;
    display: flex; /* For icon alignment */
    align-items: flex-start;
    gap: 0.5rem;
}

.dsi-panel-list li .dsi-meta-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.dsi-meta-icon {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.125em;
    color: #94a3b8; /* Match label color */
}

.dsi-meta-value {
    font-weight: 400;
    color: #0f172a;
}

.dsi-ref-item a {
    font-size: 0.85rem; /* Adjusted font size */
    word-break: break-all;
    color: #3b82f6;
    text-decoration: none; /* Remove underline from reference links */
}

.dsi-detail-medical-notice {
    margin: 1rem 0 0; /* Adjusted margin */
    font-size: 0.8rem;
    color: #64748b;
    padding-top: 0.8rem;
    border-top: 1px solid #e2e8f0; /* Separator for notice */
}

.dsi-panel-warning .dsi-detail-medical-notice {
    border-color: #fecaca; /* Match warning panel border */
}

/* Pagination styles */
.dsi-pagination-container {
    margin-top: 2rem;
    text-align: center;
}

.dsi-pagination {
    display: inline-block;
    padding: 0;
    margin: 0;
}

.dsi-pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.dsi-pagination li {
    display: inline-block;
}

.dsi-pagination a,
.dsi-pagination .current {
    display: block;
    padding: 0.5rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #475569;
    font-size: 0.9rem;
    min-width: 38px;
    text-align: center;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.dsi-pagination a:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.dsi-pagination .current {
    background-color: #60a5fa;
    border-color: #60a5fa;
    color: #ffffff;
    font-weight: 600;
    cursor: default;
}

.dsi-pagination .dots {
    padding: 0.5rem 0.8rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Loading state for pagination */
.dsi-pagination-container.dsi-loading {
    position: relative;
    min-height: 50px; /* Prevent layout shift */
}

.dsi-pagination-container.dsi-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dsi-pagination-container.dsi-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    margin-left: -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

/* Collapsible sections */
.dsi-collapsible-section .dsi-panel-title {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 0.5rem; /* Space for icon */
    /* Styles to make button look like h2 */
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    font-size: 1.1rem; /* Match h2 font size */
    color: #0f172a; /* Match h2 color */
    margin: 0 0 0.8rem; /* Match h2 margin */
    border-bottom: 1px solid #e2e8f0; /* Match h2 border */
    padding-bottom: 0.5rem;
}

.dsi-collapsible-section .dsi-panel-title:focus {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.dsi-toggle-icon {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    position: relative;
    transition: transform 0.3s ease-in-out;
}

.dsi-toggle-icon::before,
.dsi-toggle-icon::after {
    content: '';
    position: absolute;
    background-color: #64748b;
    border-radius: 1px;
}

.dsi-toggle-icon::before {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.dsi-toggle-icon::after {
    width: 2px;
    height: 100%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.3s ease-in-out;
}

.dsi-collapsible-section.dsi-expanded .dsi-toggle-icon::after {
    transform: translateX(-50%) rotate(90deg); /* Rotate to hide vertical bar */
}

.dsi-collapsible-content {
    padding-top: 0.8rem;
    border-top: 1px solid #e2e8f0;
    margin-top: 0.8rem;
}

.dsi-collapsible-section.dsi-expanded .dsi-collapsible-content {
    border-color: #cbd5e1; /* Darker border when expanded */
}

.dsi-panel-warning .dsi-collapsible-content {
    border-color: #fecaca;
}

/* New styles for detail page design improvements */

/* Overall Detail Container */
.dsi-detail {
    max-width: 1000px; /* Constrain overall width for better readability */
    margin-left: auto;
    margin-right: auto;
    padding: 2.5rem; /* More generous padding */
    border-radius: 1.5rem; /* More rounded corners */
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1); /* Stronger shadow */
}

/* Top Summary Box */
.dsi-summary-box {
    background-color: #e0f2fe; /* Light blue background */
    border: 1px solid #90cdf4;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #0f172a;
    line-height: 1.6;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Detail Header */
.dsi-detail-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.dsi-detail-title {
    font-size: 2.8rem; /* Larger title */
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.dsi-title-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: #60a5fa; /* Blue icon */
}

.dsi-detail-reviewed {
    font-size: 0.95rem;
    color: #94a3b8;
    margin-top: 0.75rem;
}

/* New Top Section (Image + Content) */
.dsi-top-section {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Image on left (1fr), content on right (2fr) */
    gap: 2rem;
    margin-bottom: 2.5rem; /* Space before full-width sections */
    align-items: start; /* Align items to the top */
}

.dsi-top-section .dsi-detail-thumb {
    margin-bottom: 0; /* Remove margin-bottom as it's now in a grid */
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Enforce square aspect ratio */
    height: 0;
    overflow: hidden;
}

.dsi-top-section .dsi-detail-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure image covers the square area */
    border-radius: 1.25rem;
}

.dsi-top-section .dsi-detail-content {
    margin-bottom: 0; /* Remove margin-bottom as it's now in a grid */
}

/* Full Width Sections (Cards) */
.dsi-full-width-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem; /* Space between full-width cards */
}

/* Adjust existing .dsi-panel to be used as .dsi-card-panel */
.dsi-card-panel {
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    padding: 1.5rem;
    background-color: #ffffff; /* Default white background for cards */
    border: 1px solid #e2e8f0;
}

.dsi-card-panel .dsi-panel-title {
    font-size: 1.3rem; /* Larger panel titles */
    font-weight: 600;
    border-bottom: none; /* Remove default border */
    padding-bottom: 0;
    margin-bottom: 1rem;
}

.dsi-card-panel .dsi-panel-list {
    gap: 1rem; /* More space between list items in cards */
}

.dsi-card-panel .dsi-panel-list li {
    font-size: 1rem;
    line-height: 1.6;
}

.dsi-card-panel .dsi-meta-icon {
    width: 1.3em;
    height: 1.3em;
    color: #64748b; /* Default icon color */
}

/* Specific Card Panel Styles */
.dsi-card-panel:nth-of-type(1) { /* Targeting the first card (Feeding Guide) */
    background-color: #e0f7fa; /* Light blue background */
    border-color: #80deea;
}

.dsi-card-panel.dsi-card-panel-warning { /* Targeting the warning card */
    background-color: #fff3e0;
    border-color: #ffcc80;
}

.dsi-card-panel.dsi-card-panel-warning .dsi-panel-title {
    color: #d97706; /* Darker orange title */
}

.dsi-card-panel.dsi-card-panel-warning .dsi-meta-icon {
    color: #d97706; /* Darker orange icons */
}

/* Red emphasis for toxic parts */
.dsi-text-danger {
    color: #ef4444; /* Red color */
    font-weight: 600;
}

/* Veterinarian Notice */
.dsi-veterinarian-notice {
    background-color: #f8fafc; /* Light gray background */
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-top: 0; /* Removed margin-top as it's now part of dsi-full-width-sections gap */
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
    text-align: center;
}

/* Responsive adjustments for detail page */
@media (max-width: 768px) {
    .dsi-detail {
        padding: 1.5rem;
    }
    .dsi-detail-title {
        font-size: 2rem;
        gap: 0.5rem;
    }
    .dsi-title-icon {
        width: 2rem;
        height: 2rem;
    }
    .dsi-top-section {
        grid-template-columns: 1fr; /* Stack image and content vertically */
        gap: 1.5rem;
    }
    .dsi-top-section .dsi-detail-thumb {
        margin-bottom: 0; /* No extra margin when stacked */
    }
    .dsi-top-section .dsi-detail-content {
        padding-right: 0; /* No padding-right when stacked */
    }
    .dsi-summary-box {
        font-size: 1rem;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .dsi-detail-title {
        font-size: 1.6rem;
    }
    .dsi-title-icon {
        width: 1.8rem;
        height: 1.8rem;
    }
    .dsi-detail {
        padding: 1rem;
    }
    .dsi-summary-box {
        font-size: 0.9rem;
        padding: 0.8rem;
    }
    .dsi-card-panel {
        padding: 1rem;
    }
    .dsi-card-panel .dsi-panel-title {
        font-size: 1.1rem;
    }
    .dsi-card-panel .dsi-panel-list li {
        font-size: 0.9rem;
    }
    .dsi-veterinarian-notice {
        font-size: 0.85rem;
        padding: 0.8rem;
    }
}
/* --- Gemini Agent Added Styles for DSI Plugin (Revised) --- */

/* Styling for meta labels to appear like tags/chips */
.dsi-detail dt.dsi-meta-label {
    display: inline-block; /* Make it behave like a block but flow inline */
    background-color: #60a5fa; /* Blue background for labels */
    color: #ffffff; /* White text color for labels */
    padding: 5px 10px; /* Padding inside the tag */
    border-radius: 15px; /* Rounded corners */
    margin-right: 10px; /* Space between label and value */
    font-size: 0.9em; /* Slightly smaller font */
    line-height: 1.2; /* Adjust line height */
    white-space: nowrap; /* Prevent text from wrapping inside the tag */
    font-weight: bold; /* Ensure labels are bold */
}

/* Ensure values remain as plain text and are not styled like tags */
.dsi-detail dd.dsi-meta-value {
    display: inline; /* Allow value to flow inline with label if space permits */
    background-color: transparent; /* No background */
    color: #333; /* Default text color */
    padding: 0; /* No padding */
    border-radius: 0; /* No rounded corners */
    margin-left: 0; /* Remove default dd indentation */
    font-weight: normal; /* Ensure values are not bold by default */
}

/* For the "먹이면 안 되는 부분" specific styling, apply to the span inside the label */
.dsi-detail dt.dsi-meta-label .dsi-text-danger {
    color: #ffffff; /* Change to white */
    font-weight: bold;
}

/* --- End Gemini Agent Added Styles (Revised) --- */

/* --- Gemini Agent Added Styles for DSI Plugin (Consistency) --- */

/* Styling for meta labels within the warning panel */
.dsi-card-panel-warning dt.dsi-meta-label {
    background-color: #f97316; /* A suitable orange for warning labels */
    color: #ffffff; /* White text for contrast */
}

/* --- End Gemini Agent Added Styles (Consistency) --- */
/* --- 1. Hero Section --- */
.dsi-hero-section {
    display: grid;
    grid-template-columns: 1fr; /* Mobile-first: single column */
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    align-items: center;
}

.dsi-hero-thumb {
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.1);
}

.dsi-hero-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.dsi-hero-content .dsi-detail-header {
    text-align: left;
    margin-bottom: 1rem;
}

.dsi-hero-content .dsi-detail-title {
    font-size: 2.5rem;
    justify-content: flex-start;
}

.dsi-hero-content .dsi-summary-box {
    margin-bottom: 1rem;
}

.dsi-hero-content .dsi-detail-content {
    margin-bottom: 0;
}

/* --- 2. Tabs Section --- */
.dsi-tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.dsi-tab-button {
    padding: 0.75rem 1.25rem;
    border: 2px solid transparent;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    background-color: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: -2px; /* Overlap the bottom border */
    transition: all 0.2s ease-in-out;
}

.dsi-tab-button:hover {
    background-color: #f8fafc;
    color: #334155;
}

.dsi-tab-button.active {
    color: #3b82f6;
    border-color: #3b82f6 #3b82f6 #ffffff #3b82f6;
}

.dsi-tab-panel {
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background-color: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.dsi-tab-panel.active {
    display: block;
}

.dsi-tab-panel[hidden] {
    display: none;
}

.dsi-tab-panel .dsi-panel-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.dsi-tab-panel .dsi-panel-list > div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dsi-tab-panel .dsi-meta-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dsi-tab-panel .dsi-meta-label.dsi-label-danger {
    color: #ef4444;
}

.dsi-tab-panel .dsi-meta-value {
    font-size: 1rem;
    color: #334155;
    line-height: 1.6;
}

.dsi-ref-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dsi-ref-list li a {
    text-decoration: underline;
    color: #3b82f6;
}

/* --- 3. Footer --- */
.dsi-detail-footer {
    margin-top: 2.5rem;
    text-align: center;
}

/* --- Responsive for new layout --- */
@media (min-width: 768px) {
    .dsi-hero-section {
        grid-template-columns: 300px 1fr; /* Image on left, content on right */
        gap: 2.5rem;
    }

    .dsi-tab-panel .dsi-panel-list {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for panel lists on larger screens */
    }
}


/* --- 4. Icon Styling --- */
.dsi-tab-panel .dsi-meta-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dsi-meta-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* --- 5. Filter Button Group --- */
.dsi-filter-group-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.dsi-filter-group-buttons .dsi-filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.dsi-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background-color: #f1f5f9;
    padding: 0.3rem;
    border-radius: 0.75rem;
}

.dsi-filter-button {
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background-color: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s ease-in-out;
}

.dsi-filter-button:hover {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.dsi-filter-button.active {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: #334155;
}

/* Color coding for safety buttons */
.dsi-filter-button.dsi-safety-safe.active {
    color: #16a34a;
    border-color: #bbf7d0;
}
.dsi-filter-button.dsi-safety-caution.active {
    color: #f59e0b;
    border-color: #fde68a;
}
.dsi-filter-button.dsi-safety-danger.active {
    color: #ef4444;
    border-color: #fecaca;
}

@media (max-width: 600px) {
    .dsi-filter-group-buttons {
        width: 100%;
    }
    .dsi-filter-buttons {
        justify-content: space-between;
        width: 100%;
    }
    .dsi-filter-button {
        flex-grow: 1;
        text-align: center;
    }
}

/* --- Mobile Accordion Styles --- */
@media (max-width: 768px) {
    .dsi-accordion-header {
        width: 100%;
        background-color: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        padding: 0.75rem 1.25rem;
        text-align: left;
        font-size: 1rem;
        font-weight: 600;
        color: #334155;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: background-color 0.2s ease;
        margin-top: 0.5rem;
    }

    .dsi-accordion-header:hover {
        background-color: #f1f5f9;
    }

    .dsi-accordion-header[aria-expanded="true"] {
        background-color: #e0f2fe;
        border-color: #bae6fd;
        color: #0c4a6e;
    }

    .dsi-accordion-header::after {
        content: '+';
        font-size: 1.5rem;
        font-weight: 300;
        color: #94a3b8;
        transition: transform 0.3s ease;
    }

    .dsi-accordion-header[aria-expanded="true"]::after {
        content: '−';
        transform: rotate(180deg);
        color: #0c4a6e;
    }

    .dsi-tab-panel {
        border-top: none;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        margin-top: -1px;
    }
}

/* --- Empty State Message Styles --- */
.dsi-no-results {
    text-align: center;
    padding: 3rem 1rem;
    font-size: 1.1rem;
    color: #64748b;
    background-color: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 0.75rem;
    margin: 2rem auto;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.dsi-no-results::before {
    content: '';
    display: block;
    width: 60px;
    height: 60px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='%2394a3b8'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375H12m-2.25 0H6.75a3.375 3.375 0 00-3.375 3.375v1.5m7.5-6l-3 3m0 0l-3-3m9 1.5l2.25 2.25M15 10.5l4.5 4.5m-4.5-4.5l4.5 4.5' /%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* --- Sticky Detail Header on Mobile --- */
@media (max-width: 768px) {
    .dsi-detail-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background-color: #ffffff; /* Ensure it stands out */
        padding: 1rem 0; /* Add some vertical padding */
        box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Subtle shadow */
        margin-bottom: 0; /* Remove default margin-bottom */
    }

    .dsi-detail-header .dsi-detail-title {
        font-size: 1.8rem; /* Adjust title size for sticky header */
    }

    .dsi-detail-header .dsi-detail-badges {
        justify-content: center; /* Center badges in sticky header */
    }
}
