.hub-icon {
    width: 20px;
    height: 20px;
    display: block;
    flex: 0 0 20px;
}

.button-with-icon {
    gap: 8px;
}

.button:focus-visible,
.icon-button:focus,
.hub-select-trigger:focus-visible,
.hub-select-option:focus-visible,
.hub-file-input:focus + .hub-file-dropzone,
.hub-file-clear:focus-visible,
.brand-type-chip:focus-visible {
    outline: 3px solid rgba(87, 182, 81, .28);
    outline-offset: 2px;
}

.hub-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    border: 0 !important;
    white-space: nowrap !important;
}

.hub-select {
    position: relative;
    min-width: 0;
    margin-top: 7px;
    font-weight: 500;
}

.library-control .hub-select {
    margin-top: 0;
}

.hub-select-trigger {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 13px;
    border: 1px solid #d6ded9;
    border-radius: 12px;
    color: #243128;
    background: #fff;
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.library-control .hub-select-trigger {
    height: 44px;
    border-radius: 11px;
    font-size: 13px;
}

.hub-select-arrow {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-right: 2px solid #738078;
    border-bottom: 2px solid #738078;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .15s ease;
}

.hub-select.is-open .hub-select-trigger {
    border-color: #57b651;
    box-shadow: 0 0 0 4px rgba(87, 182, 81, .12);
}

.hub-select.is-open .hub-select-arrow {
    transform: translateY(2px) rotate(225deg);
}

.hub-select-listbox {
    position: fixed;
    z-index: 10000;
    max-height: min(320px, calc(100vh - 24px));
    padding: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #dce5de;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(20, 38, 26, .18);
}

.hub-select-listbox[hidden] {
    display: none;
}

.hub-select-option {
    position: relative;
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 8px 34px 8px 11px;
    border: 0;
    border-radius: 9px;
    color: #3e4d44;
    background: transparent;
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.hub-select-option:hover,
.hub-select-option.is-active {
    background: #f1f6f1;
}

.hub-select-option.is-selected {
    color: #347731;
    background: #eaf6e9;
    font-weight: 750;
}

.hub-select-option.is-selected::after {
    position: absolute;
    right: 12px;
    width: 9px;
    height: 5px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: "";
    transform: translateY(-2px) rotate(-45deg);
}

.hub-field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
}

.hub-file-picker {
    position: relative;
    min-width: 0;
    margin-bottom: 14px;
}

.hub-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

.hub-file-dropzone {
    min-height: 108px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0;
    padding: 17px;
    border: 1px dashed #9fc69d;
    border-radius: 14px;
    background: #f6fbf6;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.hub-file-dropzone:hover,
.hub-file-dropzone.is-dragging {
    border-color: #57b651;
    background: #edf8ec;
}

.hub-file-prompt {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hub-file-prompt .hub-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    color: #438f3e;
}

.hub-file-prompt strong,
.hub-file-prompt small,
.hub-file-selection strong,
.hub-file-selection small {
    display: block;
}

.hub-file-prompt strong {
    margin-bottom: 4px;
    color: #28372e;
    font-size: 14px;
}

.hub-file-prompt small,
.hub-file-selection small {
    color: #758279;
    font-size: 12px;
    font-weight: 500;
}

.hub-file-selection {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 15px;
    border: 1px solid #cfe3cd;
    border-radius: 14px;
    background: #f4faf3;
}

.hub-file-selection[hidden] {
    display: none;
}

.hub-file-selection strong {
    max-width: min(60vw, 560px);
    margin-bottom: 4px;
    overflow: hidden;
    color: #2d4133;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hub-file-clear {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid #d8e2da;
    border-radius: 50%;
    color: #59675e;
    background: #fff;
    font-size: 21px;
    cursor: pointer;
}

.brand-type-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -10px 0 22px;
    padding: 0 3px;
}

.brand-type-filter[hidden] {
    display: none;
}

.brand-type-filter > span {
    color: #748078;
    font-size: 12px;
    font-weight: 750;
}

.brand-type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.brand-type-chip {
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid #dce4de;
    border-radius: 99px;
    color: #526057;
    background: #fff;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.brand-type-chip.is-active {
    color: #347731;
    border-color: #b9d9b6;
    background: #eaf6e9;
}

.docx-viewer-body {
    display: block;
    padding: 20px;
    background: #e8ede9;
}

.docx-loading {
    min-height: 260px;
    display: grid;
    place-items: center;
    color: #66746b;
}

.docx-shell {
    width: min(760px, 100%);
    margin: 0 auto;
}

.docx-filename {
    margin: 0 0 9px;
    overflow: hidden;
    color: #59675e;
    font-size: 12px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docx-page {
    min-height: 720px;
    padding: clamp(30px, 7vw, 72px);
    color: #202720;
    background: #fff;
    border: 1px solid #dde4df;
    box-shadow: 0 12px 36px rgba(21, 38, 26, .1);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.58;
}

.docx-page h1,
.docx-page h2,
.docx-page h3,
.docx-page h4,
.docx-page h5,
.docx-page h6 {
    margin: 1.2em 0 .45em;
    color: #17211b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.22;
}

.docx-page h1:first-child,
.docx-page h2:first-child,
.docx-page p:first-child {
    margin-top: 0;
}

.docx-title {
    font-size: 30px;
    font-weight: 750;
}

.docx-subtitle {
    color: #647068;
    font-size: 18px;
}

.docx-list {
    padding-left: 20px;
}

.docx-list::before {
    margin-right: 8px;
    content: "•";
}

.docx-table-wrap {
    margin: 20px 0;
    overflow-x: auto;
}

.docx-page table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
}

.docx-page td {
    padding: 9px 10px;
    border: 1px solid #ccd5cf;
    vertical-align: top;
}

.docx-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 18px auto;
}

.docx-truncated {
    margin-top: 30px;
    padding: 12px;
    color: #5f6d64;
    background: #f2f5f2;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
}

@media (max-width: 620px) {
    .hub-select-option {
        min-height: 44px;
    }

    .hub-file-dropzone {
        min-height: 96px;
        align-items: stretch;
        flex-direction: column;
    }

    .hub-file-dropzone .button {
        width: 100%;
    }

    .brand-type-filter {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        margin-top: -6px;
    }

    .docx-viewer-body {
        padding: 10px;
    }

    .docx-page {
        min-height: 520px;
        padding: 26px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hub-select-arrow,
    .hub-file-dropzone {
        transition: none;
    }
}
