.bibh-resource-upload,
.bibh-resource-upload-card {
    width: 100%;
    max-width: none;
    border-radius: 18px;
    margin: 12px 0;
    padding: 20px 22px;
    background: #fff;
    border: 1px solid #e5e5e5;
}

.bibh-resource-upload__form {
    width: 100%;
}

.bibh-upload-title {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
    color: #1f1f1f;
}

.bibh-resource-upload-card .bibh-field {
    margin-bottom: 14px;
}

.bibh-resource-upload-card .bibh-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #2b2b2b;
}

.bibh-resource-upload-card input[type="text"],
.bibh-resource-upload-card input[type="search"],
.bibh-resource-upload-card input[type="url"],
.bibh-resource-upload-card input[type="file"],
.bibh-resource-upload-card textarea,
.bibh-resource-upload-card select,
.bibh-resource-upload-card input[type="number"] {
    width: 100%;
    height: 42px;
    padding: 9px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    font-size: 14px;
    color: #1f1f1f;
    background: #fff;
    box-shadow: none;
}

.bibh-resource-upload-card textarea {
    min-height: 110px;
    resize: vertical;
    padding: 10px 12px;
}

.bibh-resource-upload-card select {
    height: 42px;
    background-color: #fff;
}

.bibh-resource-upload-card select[multiple] {
    height: auto;
    min-height: 120px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.bibh-resource-upload-card .bibh-field__hint {
    margin: 4px 0 14px;
    font-size: 12px;
    color: #6b6b6b;
}

.bibh-resource-upload-card .bibh-toggle-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 6px;
}

.bibh-resource-upload-card .bibh-kind-toggle {
    border: 1px solid #d8d8d8;
    background: #fafafa;
    border-radius: 14px;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 14px;
    color: #3a3a3a;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.bibh-resource-upload-card .bibh-kind-toggle:hover {
    background: #f1f5f3;
    border-color: #c8d8cd;
}

.bibh-resource-upload-card .bibh-kind-toggle.is-active {
    background: #e6f3eb;
    border-color: #9cccab;
    color: #2f5b3f;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.bibh-resource-upload-card .bibh-kind-toggle:focus-visible {
    outline: 2px solid #4b8f6b;
    outline-offset: 2px;
}

.bibh-resource-upload-card .bibh-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 14px;
}

.bibh-resource-upload-card .bibh-field-row .bibh-field {
    margin-bottom: 0;
}

.bibh-resource-upload-card .bibh-submit-row {
    margin-top: 8px;
}

.bibh-resource-upload-card .bibh-submit-button {
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 11px 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
}


.bibh-resource-upload-card .bibh-submit-button:focus-visible {
    outline: 2px solid #336f4b;
    outline-offset: 2px;
}

.bibh-resource-upload-card .bibh-hidden {
    display: none;
}

.bibh-multiselect__native {
    display: none;
}

.bibh-multiselect__wrapper {
    position: relative;
}

.bibh-multiselect__control {
    width: 100%;
    min-height: 42px;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    background: #fff;
    color: #1f1f1f;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-align: left;
}

.bibh-multiselect__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bibh-multiselect__placeholder {
    font-size: 14px;
    color: #6b6b6b;
}

.bibh-multiselect__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border-radius: 999px;
    border: 1px solid #d6d6d6;
    padding: 4px 10px;
    font-size: 13px;
    color: #1f1f1f;
}

.bibh-multiselect__remove {
    border: none;
    background: transparent;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    color: #4f4f4f;
    padding: 3px !important;
    box-shadow: none !important;
}

.bibh-multiselect__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
    display: none;
    z-index: 20;
}

.bibh-multiselect__wrapper.is-open .bibh-multiselect__dropdown {
    display: block;
}

.bibh-multiselect__option {
    width: 100%;
    text-align: left;
    border: none;
    background: #fff;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 14px;
    color: #1f1f1f;
    cursor: pointer;
}

.bibh-multiselect__option:hover {
    background: #3f8170 !important;
}

.bibh-multiselect__group {
    padding: 8px 10px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #6b6b6b;
    text-transform: uppercase;
}

.bibh-url-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bibh-url-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bibh-url-row input[type="url"] {
    flex: 1;
}

.bibh-url-row .bibh-url-add,
.bibh-url-row .bibh-url-remove {
  box-shadow: none;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
}

.bibh-url-add {
    margin-top: 8px;
}

.bibh-url-row--base .bibh-url-remove {
    display: none;
}

.bibh-field,
.bibh-filter {
    margin-bottom: 12px;
}

.bibh-field label,
.bibh-filter label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

#bibh_resource_time_minutes,
.bibh-field input[type="text"],
.bibh-field input[type="search"],
.bibh-field input[type="url"],
.bibh-field textarea,
.bibh-field select,
.bibh-filter input,
.bibh-filter select,
.bibh-field input[type="number"] {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
}

.bibh-field textarea {
    min-height: 90px;
}

.bibh-field__hint {
    margin: 0;
    font-size: 12px;
    color: #6b6b6b;
}

.bibh-resource-library__table-wrap {
    width: 100%;
    max-width: 860px;
    border-radius: 14px;
    margin: 12px auto;
    padding: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.bibh-alert {
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.bibh-alert-success {
    background: #e7f7ed;
    border: 1px solid #b3e6c6;
}

.bibh-resource-library__filters {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: flex-end;
}

/* Search box */
.bibh-filter--search {
    flex: 1 1 220px;
    min-width: 200px;
}

.bibh-search {
    position: relative;
}

.bibh-search__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    pointer-events: none;
}

.bibh-resource-library .bibh-search__input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1.5px solid #e2e8f0;
    border-radius: 30px;
    font-family: 'League Spartan', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    color: #203d48;
    background: #fff;
}

.bibh-resource-library .bibh-search__input:focus {
    outline: none;
    border-color: #91d1db;
}

.bibh-resource-library__filters select[multiple] {
    min-height: 120px;
    height: auto;
}

.bibh-resource-library__table {
    width: 100%;
    border-collapse: collapse;
    min-width: 540px;
}

.bibh-resource-library__table th,
.bibh-resource-library__table td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    text-align: left;
}

.bibh-resource-library__table thead {
    background: rgba(0, 0, 0, 0.04);
    color: #2b2b2b;
    font-weight: 700;
}

.bibh-pagination {
    margin: 14px 16px;
}

.bibh-pagination ul {
    display: flex;
    list-style: none;
    padding: 0;
    gap: 8px;
    justify-content: center;
}

/* Title cell: inline description + time pill */
.bibh-resource-library__table td.bibh-title-cell {
    min-width: 200px;
}

.bibh-resource-title {
    font-weight: 700;
    color: #203d48;
    line-height: 1.35;
}

.bibh-resource-desc {
    font-weight: 500;
    color: #718096;
    font-size: 12.5px;
    margin-top: 3px;
    line-height: 1.4;
}

.bibh-resource-time {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #326860;
    background: #e8f7fa;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 6px;
}

/* Friendlier empty states */
.bibh-untagged {
    color: #718096;
    font-style: italic;
    font-size: 12px;
    font-weight: 600;
}

.bibh-resource-library__empty {
    text-align: center;
    color: #718096;
    font-weight: 600;
    padding: 28px 16px;
}

/* Loading state during AJAX fetch */
.bibh-resource-library__results {
    position: relative;
    transition: opacity 0.15s ease;
}

.bibh-resource-library__results.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.bibh-resource-library {
    overflow: visible;
}

.bibh-resource-library__table-wrap {
    overflow: visible;
    overflow-x: auto;
}

.bibh-resource-library__table td .bibh-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    font-size: 13px;
    line-height: 1.2;
    border-radius: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.bibh-resource-library__table td .bibh-action-btn svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

.bibh-resource-library__table td .bibh-action-btn + .bibh-action-btn {
    margin-left: 6px;
}

@media (max-width: 800px) {
    .bibh-resource-upload-card .bibh-field-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .bibh-resource-upload,
    .bibh-resource-library__table-wrap {
        margin: 10px auto;
        padding: 12px;
    }

    .bibh-resource-library__table {
        min-width: 480px;
    }
}

.bibh-multiselect__control:hover, .bibh-multiselect__control:focus {
    border-color: #e0e0e0 !important;
    background-color: #ffffff !important;
}

/* Action buttons stack neatly */
.bibh-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Responsive: table on desktop, cards on mobile (CSS only, no dual markup) */
@media (max-width: 620px) {
    .bibh-resource-library__table-wrap {
        max-width: none;
        border: none;
        box-shadow: none;
        background: transparent;
        overflow: visible;
    }

    .bibh-resource-library__table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
    }

    .bibh-resource-library__table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .bibh-resource-library__table,
    .bibh-resource-library__table tbody,
    .bibh-resource-library__table tr,
    .bibh-resource-library__table td {
        display: block;
        width: 100%;
    }

    .bibh-resource-library__table tr {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        padding: 14px 16px;
        margin-bottom: 14px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    }

    .bibh-resource-library__table td {
        border: none;
        padding: 6px 0;
        text-align: left;
    }

    .bibh-resource-library__table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        color: #718096;
        margin-bottom: 3px;
    }

    /* Title cell already carries its own heading-style title; hide redundant label. */
    .bibh-resource-library__table td.bibh-title-cell[data-label]::before {
        display: none;
    }

    .bibh-resource-library__table td.bibh-title-cell {
        padding-top: 0;
    }

    .bibh-resource-library__empty {
        text-align: center;
    }

    .bibh-resource-library__table td.bibh-resource-library__empty[data-label]::before {
        display: none;
    }
}



/* ============================================================
   Browse table polish — match approved prototype (2.1.0)
   ============================================================ */
/* chips, badges, action pills — apply at all widths (also inside mobile cards) */
.bibh-chip{display:inline-block;font-size:11px;font-weight:700;padding:3px 9px;border-radius:20px;background:#e8f7fa;color:#326860;white-space:nowrap;}
.bibh-chip--type{background:#eef1f3;color:#203d48;}
.bibh-dot{color:#a0aec0;}
.bibh-lo-codes{display:inline-flex;flex-wrap:wrap;gap:4px;}
.bibh-lo{font-size:11px;font-weight:700;background:#eef6f3;color:#326860;padding:2px 7px;border-radius:6px;}
.bibh-actions{display:flex;flex-direction:column;gap:6px;align-items:flex-start;}
.bibh-resource-library__table td .bibh-action-btn{padding:6px 13px;border-radius:20px;font-weight:700;}
.bibh-resource-library__table td .bibh-action-btn--open{background:#e8f7fa;color:#326860;}
.bibh-resource-library__table td .bibh-action-btn--download{background:#3f8170;color:#fff;}
.bibh-resource-library__table td .bibh-action-btn + .bibh-action-btn{margin-left:0;}

/* desktop table look — borderless, rounded, row hover (scoped so mobile cards are untouched) */
@media (min-width:621px){
  .bibh-resource-library__table-wrap{background:#fff;border-radius:18px;overflow:hidden;overflow-x:auto;box-shadow:0 2px 12px rgba(0,0,0,.06);}
  .bibh-resource-library__table{min-width:540px;}
  .bibh-resource-library__table th,
  .bibh-resource-library__table td{border:none;border-bottom:1px solid #e2e8f0;padding:14px 16px;vertical-align:top;}
  .bibh-resource-library__table thead th{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.4px;color:#718096;background:#f7f9fa;vertical-align:middle;}
  .bibh-resource-library__table tbody tr:last-child td{border-bottom:none;}
  .bibh-resource-library__table tbody tr{transition:background .12s ease;}
  .bibh-resource-library__table tbody tr:hover{background:#e8f7fa;}
}

/* ============================================================
   Restored "?" description tooltip + filter width to match table
   ============================================================ */
.bibh-title-with-tooltip{display:flex;align-items:flex-start;gap:8px;}
.bibh-info-tooltip{position:relative;display:inline-flex;flex:0 0 auto;}
.bibh-tooltip-toggle{width:20px;height:20px;border-radius:50%;background:#d6e492;border:none;cursor:pointer;font-weight:800;font-size:12px;line-height:1;color:#2c4a1f;text-align:center;padding:0;display:inline-flex;align-items:center;justify-content:center;}
.bibh-tooltip-toggle:focus{outline:2px solid #3f8170;outline-offset:2px;}
.bibh-tooltip-panel{position:absolute;left:calc(100% + 10px);top:50%;transform:translateY(-50%);min-width:220px;max-width:280px;background:#fff;border:1px solid #e0e0e0;box-shadow:0 8px 18px rgba(0,0,0,.16);padding:10px 12px;border-radius:8px;z-index:9999;visibility:hidden;opacity:0;transition:opacity .15s ease,visibility .15s ease;}
.bibh-tooltip-panel::before{content:'';position:absolute;left:-7px;top:50%;transform:translateY(-50%);border-width:8px;border-style:solid;border-color:transparent #fff transparent transparent;filter:drop-shadow(-2px 2px 2px rgba(0,0,0,.08));}
.bibh-info-tooltip:hover .bibh-tooltip-panel,.bibh-info-tooltip:focus-within .bibh-tooltip-panel{visibility:visible;opacity:1;}
.bibh-tooltip-panel p{margin:0 0 6px;font-size:13px;line-height:1.4;color:#203d48;}
.bibh-tooltip-panel p:last-child{margin-bottom:0;}

/* keep the filter/search toolbar the same width as the table (max-width 860px, centred) */
.bibh-resource-library__filters{max-width:860px;margin-left:auto;margin-right:auto;}

/* Left-align filters + table so they sit close to the sidebar (not centred) */
.bibh-resource-library__filters { margin-left: 0; margin-right: 0; }
.bibh-resource-library__table-wrap { margin-left: 0; margin-right: 0; }

/* Full-width browse: fill the content area (remove the 860px cap) */
.bibh-resource-library__filters { max-width: none; }
.bibh-resource-library__table-wrap { max-width: none; }

/* Mobile: keep the "?" description tooltip on-screen — show it as a centred popover */
@media (max-width: 620px) {
	.bibh-tooltip-panel {
		position: fixed;
		left: 50%;
		right: auto;
		top: 50%;
		bottom: auto;
		transform: translate(-50%, -50%);
		width: 86vw;
		max-width: 340px;
		min-width: 0;
		z-index: 10001;
	}
	.bibh-tooltip-panel::before { display: none; }
}
