/* OneNav Child - local favorites, aligned with parent theme tokens. */
.oc-home-favorites,
.oc-home-favorites * {
    box-sizing: border-box;
}

body.home .oc-home-favorites,
body.front-page .oc-home-favorites {
    width: 100%;
    margin: 20px 0 0;
}

.oc-home-favorites[data-position="before_content"] {
    margin: 0 0 20px;
}

.oc-home-favorites [hidden] {
    display: none !important;
}

.oc-favorites-heading,
.oc-favorites-title-wrap,
.oc-favorites-actions {
    display: flex;
    min-width: 0;
    align-items: center;
}

.oc-favorites-heading {
    min-height: 44px;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.oc-favorites-title-wrap {
    gap: 8px;
}

.oc-favorites-title-wrap h3 {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    overflow: hidden;
    margin: 0;
    color: var(--main-color, #484b4f);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oc-favorites-title-wrap h3 i {
    flex: 0 0 auto;
    color: var(--theme-color, #f1404b);
}

.oc-favorites-kicker,
.oc-favorites-count {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.oc-favorites-kicker {
    color: var(--main-color, #484b4f);
    background: var(--theme-color-bg, rgba(241, 64, 75, .1));
}

.oc-favorites-count {
    min-width: 24px;
    padding: 0 6px;
    color: var(--muted-color2, #66686b);
    background: var(--main-bg-color, #fff);
    border: 1px solid var(--border-color, rgba(116, 116, 116, .12));
    font-variant-numeric: tabular-nums;
}

.oc-favorites-actions {
    flex: 0 0 auto;
    gap: 8px;
}

.oc-favorites-privacy {
    color: var(--muted-color2, #66686b);
    font-size: 12px;
}

.oc-favorites-clear,
.oc-favorite-remove,
.oc-favorite-toggle {
    display: inline-grid;
    place-items: center;
    border: 0;
    color: var(--muted-color2, #66686b);
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    transition: color .2s ease, background-color .2s ease, opacity .2s ease, transform .2s ease;
}

.oc-favorites-clear {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    gap: 6px;
    padding: 0 10px;
    border-radius: var(--theme-border-radius-md, 8px);
    font: inherit;
    font-size: 12px;
}

.oc-favorites-clear:hover,
.oc-favorites-clear:focus-visible,
.oc-favorite-remove:hover,
.oc-favorite-remove:focus-visible {
    color: var(--theme-color, #f1404b);
    background: var(--theme-color-bg, rgba(241, 64, 75, .1));
}

.oc-favorites-clear:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.oc-favorites-empty {
    display: flex;
    min-height: 68px;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border: 1px solid var(--border-color, rgba(116, 116, 116, .1));
    border-radius: var(--theme-border-radius-lg, 10px);
    color: var(--main-color, #484b4f);
    background: var(--main-bg-color, #fff);
}

.oc-favorites-empty-icon {
    display: inline-grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    overflow: hidden;
    place-items: center;
    border-radius: var(--theme-border-radius-md, 8px);
    color: var(--theme-color, #f1404b);
    background: var(--theme-color-bg, rgba(241, 64, 75, .1));
}

.oc-favorites-empty > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.oc-favorites-empty strong {
    overflow: hidden;
    color: var(--main-color, #484b4f);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oc-favorites-empty small {
    overflow: hidden;
    color: var(--muted-color2, #66686b);
    font-size: 12px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oc-favorites-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: var(--home-card-padding, 10px);
}

.oc-favorite-item {
    position: relative;
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
}

.oc-favorite-item > .sites-body {
    padding-right: 48px;
}

/* The hub is generated by the child, so mirror the parent homepage card rules here. */
body.home .oc-local-hub .sites-item,
body.front-page .oc-local-hub .sites-item {
    min-height: 68px;
    overflow: hidden;
    border: 1px solid var(--oc-home-border, #e4eaf1);
    border-radius: var(--oc-home-radius, 9px);
    background: var(--oc-surface, #fff);
    box-shadow: var(--oc-home-shadow, 0 4px 14px rgba(30, 55, 90, .055));
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

body.home .oc-local-hub .sites-item .sites-body,
body.front-page .oc-local-hub .sites-item .sites-body {
    min-width: 0;
    min-height: 68px;
    padding: 10px 11px;
    color: inherit;
    touch-action: manipulation;
}

body.home .oc-local-hub .sites-item .item-header,
body.front-page .oc-local-hub .sites-item .item-header {
    flex: 0 0 auto;
    margin-right: 10px;
}

body.home .oc-local-hub .sites-item .item-body,
body.front-page .oc-local-hub .sites-item .item-body {
    min-width: 0;
}

body.home .oc-local-hub .sites-item .item-image,
body.front-page .oc-local-hub .sites-item .item-image {
    border: 1px solid #edf1f5;
    background: #fff;
}

body.home .oc-local-hub .sites-item .item-title,
body.front-page .oc-local-hub .sites-item .item-title {
    color: #293548;
    font-size: 13px;
    font-weight: 650;
}

body.home .oc-local-hub .sites-item .item-body > .text-muted,
body.front-page .oc-local-hub .sites-item .item-body > .text-muted {
    margin-top: 3px;
    color: var(--oc-home-muted, #7b8798) !important;
    font-size: 11px;
    line-height: 1.45;
}

body.home .oc-local-hub .sites-item:hover,
body.home .oc-local-hub .sites-item:focus-within,
body.front-page .oc-local-hub .sites-item:hover,
body.front-page .oc-local-hub .sites-item:focus-within {
    border-color: #bfd3ff;
    box-shadow: 0 9px 22px rgba(37, 99, 235, .11);
    transform: translateY(-2px);
}

body.home.io-black-mode .oc-local-hub .sites-item,
body.front-page.io-black-mode .oc-local-hub .sites-item,
html.io-black-mode body.home .oc-local-hub .sites-item,
html.io-black-mode body.front-page .oc-local-hub .sites-item {
    border-color: rgba(255, 255, 255, .09);
    background: #262d35;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .16);
}

body.home.io-black-mode .oc-local-hub .sites-item .item-title,
body.front-page.io-black-mode .oc-local-hub .sites-item .item-title,
html.io-black-mode body.home .oc-local-hub .sites-item .item-title,
html.io-black-mode body.front-page .oc-local-hub .sites-item .item-title {
    color: #e8ebef !important;
}

.oc-favorite-remove {
    position: absolute;
    top: 50%;
    right: 0;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    transform: translateY(-50%);
}

.sites-item.has-oc-favorite-control {
    position: relative;
}

.sites-item.has-oc-favorite-control .item-body {
    padding-right: 32px;
}

.oc-favorite-toggle {
    position: absolute;
    z-index: 3;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: var(--muted-color3, #a5a8aa);
    background: transparent;
    opacity: 0;
}

.oc-favorite-toggle i {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, .94);
    background: color-mix(in srgb, var(--main-bg-color, #fff) 92%, transparent);
    transition: color .2s ease, background-color .2s ease;
}

.sites-item:hover .oc-favorite-toggle,
.sites-item:focus-within .oc-favorite-toggle,
.oc-favorite-toggle.is-active,
.oc-favorite-toggle:focus-visible {
    opacity: 1;
}

.oc-favorite-toggle:hover,
.oc-favorite-toggle:focus-visible,
.oc-favorite-toggle.is-active {
    color: #d97706;
    background: transparent;
}

.oc-favorite-toggle:hover i,
.oc-favorite-toggle:focus-visible i,
.oc-favorite-toggle.is-active i {
    background: #fff7db;
}

.oc-favorite-toggle:active,
.oc-favorite-remove:active {
    transform: scale(.94);
}

.oc-favorites-clear:focus-visible,
.oc-favorite-item > .sites-body:focus-visible,
.oc-favorite-remove:focus-visible,
.oc-favorite-toggle:focus-visible {
    outline: 3px solid rgba(var(--theme-color-rgb, 241, 64, 75), .25);
    outline-offset: 2px;
}

body.io-black-mode .oc-favorites-count,
body.io-black-mode .oc-favorites-empty,
html.io-black-mode body .oc-favorites-count,
html.io-black-mode body .oc-favorites-empty {
    border-color: rgba(255, 255, 255, .09);
    background: #26292d;
}

body.io-black-mode .oc-favorites-title-wrap h3,
body.io-black-mode .oc-favorites-empty strong,
html.io-black-mode body .oc-favorites-title-wrap h3,
html.io-black-mode body .oc-favorites-empty strong {
    color: #e8ebef;
}

body.io-black-mode .oc-favorites-privacy,
body.io-black-mode .oc-favorites-empty small,
html.io-black-mode body .oc-favorites-privacy,
html.io-black-mode body .oc-favorites-empty small {
    color: #aeb6c2;
}

body.io-black-mode .oc-favorite-toggle i,
html.io-black-mode body .oc-favorite-toggle i {
    background: rgba(38, 41, 45, .94);
}

body.io-black-mode .oc-favorite-toggle:hover i,
body.io-black-mode .oc-favorite-toggle:focus-visible i,
body.io-black-mode .oc-favorite-toggle.is-active i,
html.io-black-mode body .oc-favorite-toggle:hover i,
html.io-black-mode body .oc-favorite-toggle:focus-visible i,
html.io-black-mode body .oc-favorite-toggle.is-active i {
    color: #fbbf24;
    background: #443817;
}

/* Unified local hub: favorites and recent visits share one compact surface. */
body.home .oc-local-hub,
body.front-page .oc-local-hub {
    padding: 14px;
    border: 1px solid var(--border-color, rgba(116, 116, 116, .1));
    border-radius: var(--theme-border-radius-lg, 10px);
    background: var(--main-bg-color, #fff);
    box-shadow: 0 6px 18px rgba(30, 55, 90, .045);
}

.oc-local-hub-head,
.oc-local-hub-title-wrap,
.oc-local-hub-tabs,
.oc-local-hub-panel-head {
    display: flex;
    min-width: 0;
    align-items: center;
}

.oc-local-hub-head {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.oc-local-hub-title-wrap {
    gap: 8px;
}

.oc-local-hub-title-wrap h3 {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    overflow: hidden;
    margin: 0;
    color: var(--main-color, #484b4f);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oc-local-hub-title-wrap h3 i {
    color: var(--theme-color, #f1404b);
}

.oc-local-hub-kicker {
    flex: 0 0 auto;
    color: var(--muted-color2, #66686b);
    font-size: 11px;
}

.oc-local-hub-tabs {
    flex: 0 0 auto;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--border-color, rgba(116, 116, 116, .1));
    border-radius: 10px;
    background: var(--body-bg-color, #f5f6f7);
}

.oc-local-hub-tab {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    border: 0;
    border-radius: 7px;
    color: var(--muted-color2, #66686b);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    transition: color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.oc-local-hub-tab:hover,
.oc-local-hub-tab:focus-visible {
    color: var(--main-color, #484b4f);
}

.oc-local-hub-tab.is-active {
    color: var(--theme-color, #f1404b);
    background: var(--main-bg-color, #fff);
    box-shadow: 0 2px 8px rgba(30, 55, 90, .08);
}

.oc-local-hub-tab .oc-favorites-count {
    min-width: 20px;
    min-height: 20px;
    padding: 0 5px;
    border: 0;
    background: var(--theme-color-bg, rgba(241, 64, 75, .1));
}

.oc-local-hub-tab:focus-visible {
    outline: 3px solid rgba(var(--theme-color-rgb, 241, 64, 75), .25);
    outline-offset: 2px;
}

.oc-local-hub-panel[hidden] {
    display: none !important;
}

.oc-local-hub-panel-head {
    min-height: 36px;
    justify-content: flex-end;
    gap: 8px;
    margin: -4px 0 8px;
    color: var(--muted-color2, #66686b);
    font-size: 11px;
}

.oc-local-hub-panel-head .oc-favorites-clear,
.oc-local-hub-panel-head .oc-recent-links-clear {
    min-height: 36px;
}

body.io-black-mode .oc-local-hub,
html.io-black-mode body .oc-local-hub {
    border-color: rgba(255, 255, 255, .09);
    background: #202327;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
}

body.io-black-mode .oc-local-hub-title-wrap h3,
html.io-black-mode body .oc-local-hub-title-wrap h3 {
    color: #e8ebef;
}

body.io-black-mode .oc-local-hub-tabs,
html.io-black-mode body .oc-local-hub-tabs {
    border-color: rgba(255, 255, 255, .09);
    background: #181a1d;
}

body.io-black-mode .oc-local-hub-tab.is-active,
html.io-black-mode body .oc-local-hub-tab.is-active {
    color: #fbbf24;
    background: #30343a;
    box-shadow: none;
}

@media (max-width: 767px) {
    body.home .oc-home-favorites,
    body.front-page .oc-home-favorites {
        margin-top: 16px;
    }

    .oc-favorites-heading {
        gap: 8px;
        margin-bottom: 8px;
    }

    .oc-favorites-kicker,
    .oc-favorites-privacy {
        display: none;
    }

    .oc-favorites-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.home .oc-local-hub,
    body.front-page .oc-local-hub {
        padding: 12px;
    }

    .oc-local-hub-head {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .oc-local-hub-title-wrap {
        min-height: 32px;
    }

    .oc-local-hub-kicker {
        margin-left: auto;
    }

    .oc-local-hub-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .oc-local-hub-tab {
        width: 100%;
    }

    .oc-favorite-toggle {
        opacity: 1;
    }

    body.home .oc-local-hub .sites-item,
    body.front-page .oc-local-hub .sites-item {
        min-height: 64px;
        border-radius: 8px;
        transform: none;
    }

    body.home .oc-local-hub .sites-item .sites-body,
    body.front-page .oc-local-hub .sites-item .sites-body {
        min-height: 64px;
        padding: 9px;
    }

    body.home .oc-local-hub .sites-item .item-header,
    body.front-page .oc-local-hub .sites-item .item-header {
        margin-right: 8px;
    }

    body.home .oc-local-hub .sites-item .item-media,
    body.front-page .oc-local-hub .sites-item .item-media {
        width: 36px;
    }

    body.home .oc-local-hub .sites-item .item-title,
    body.front-page .oc-local-hub .sites-item .item-title {
        font-size: 13px;
        line-height: 1.4;
    }

    body.home .oc-local-hub .sites-item .item-body > .text-muted,
    body.front-page .oc-local-hub .sites-item .item-body > .text-muted {
        margin-top: 2px;
        font-size: 10.5px;
        line-height: 1.35;
    }
}

@media (max-width: 479px) {
    .oc-favorites-clear span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .oc-favorites-clear,
    .oc-favorite-item,
    .oc-favorite-remove,
    .oc-favorite-toggle,
    .oc-favorite-toggle i,
    .oc-local-hub-tab {
        transition: none !important;
        transform: none !important;
    }
}

/* Final visual pass: one parent-style module surface, without a card inside a card. */
body.home .oc-local-hub,
body.front-page .oc-local-hub {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.home .oc-local-hub .oc-local-hub-head,
body.front-page .oc-local-hub .oc-local-hub-head {
    min-height: 48px;
    align-items: flex-end;
    gap: 18px;
    margin: 0 0 14px;
    padding: 0 2px 10px;
    border-bottom: 1px solid var(--border-color, rgba(116, 116, 116, .1));
}

body.home .oc-local-hub .oc-local-hub-title-wrap,
body.front-page .oc-local-hub .oc-local-hub-title-wrap {
    flex: 1 1 auto;
    align-items: baseline;
    gap: 9px;
}

body.home .oc-local-hub .oc-local-hub-title-wrap h3,
body.front-page .oc-local-hub .oc-local-hub-title-wrap h3 {
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -.01em;
}

body.home .oc-local-hub .oc-local-hub-title-wrap h3 i,
body.front-page .oc-local-hub .oc-local-hub-title-wrap h3 i {
    margin-right: 3px !important;
    color: var(--theme-color, #f1404b);
}

body.home .oc-local-hub .oc-local-hub-kicker,
body.front-page .oc-local-hub .oc-local-hub-kicker {
    color: var(--muted-color2, #66686b);
    font-size: 11px;
}

body.home .oc-local-hub .oc-local-hub-tabs,
body.front-page .oc-local-hub .oc-local-hub-tabs {
    gap: 16px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

body.home .oc-local-hub .oc-local-hub-tab,
body.front-page .oc-local-hub .oc-local-hub-tab {
    position: relative;
    min-height: 36px;
    gap: 5px;
    padding: 0 2px;
    border-radius: 0;
    color: var(--muted-color2, #66686b);
    background: transparent;
    box-shadow: none;
    font-size: 12px;
    font-weight: 500;
}

body.home .oc-local-hub .oc-local-hub-tab::after,
body.front-page .oc-local-hub .oc-local-hub-tab::after {
    position: absolute;
    right: 0;
    bottom: -11px;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--theme-color, #f1404b);
    content: '';
    opacity: 0;
    transform: scaleX(.5);
    transition: opacity .2s ease, transform .2s ease;
}

body.home .oc-local-hub .oc-local-hub-tab.is-active,
body.front-page .oc-local-hub .oc-local-hub-tab.is-active {
    color: var(--theme-color, #f1404b);
    background: transparent;
    box-shadow: none;
}

body.home .oc-local-hub .oc-local-hub-tab.is-active::after,
body.front-page .oc-local-hub .oc-local-hub-tab.is-active::after {
    opacity: 1;
    transform: scaleX(1);
}

body.home .oc-local-hub .oc-local-hub-panel-head,
body.front-page .oc-local-hub .oc-local-hub-panel-head {
    min-height: 30px;
    justify-content: space-between;
    margin: 0 2px 8px;
    color: var(--muted-color2, #66686b);
    font-size: 11px;
}

body.home .oc-local-hub .oc-favorites-list,
body.front-page .oc-local-hub .oc-favorites-list,
body.home .oc-local-hub .oc-recent-links-list,
body.front-page .oc-local-hub .oc-recent-links-list {
    gap: 12px;
}

body.home .oc-local-hub .oc-favorite-item > .sites-body,
body.front-page .oc-local-hub .oc-favorite-item > .sites-body,
body.home .oc-local-hub .oc-recent-item > .sites-body,
body.front-page .oc-local-hub .oc-recent-item > .sites-body {
    padding: 10px 11px !important;
}

body.home .oc-local-hub .oc-favorite-item > .sites-body {
    padding-right: 48px !important;
}

body.home .oc-local-hub .oc-favorite-remove {
    top: 50%;
    right: 6px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transform: translateY(-50%);
}

body.home .oc-local-hub .oc-favorite-remove i {
    font-size: 13px;
}

body.io-black-mode .oc-local-hub .oc-local-hub-head,
html.io-black-mode body .oc-local-hub .oc-local-hub-head {
    border-color: rgba(255, 255, 255, .09);
}

body.io-black-mode .oc-local-hub .oc-local-hub-tab.is-active,
html.io-black-mode body .oc-local-hub .oc-local-hub-tab.is-active {
    color: #fbbf24;
}

body.io-black-mode .oc-local-hub .oc-local-hub-tab.is-active::after,
html.io-black-mode body .oc-local-hub .oc-local-hub-tab.is-active::after {
    background: #fbbf24;
}

@media (max-width: 767px) {
    body.home .oc-local-hub .oc-local-hub-head,
    body.front-page .oc-local-hub .oc-local-hub-head {
        align-items: stretch;
        gap: 6px;
        margin-bottom: 10px;
        padding-bottom: 0;
        border-bottom: 0;
    }

    body.home .oc-local-hub .oc-local-hub-title-wrap,
    body.front-page .oc-local-hub .oc-local-hub-title-wrap {
        min-height: 32px;
        align-items: center;
    }

    body.home .oc-local-hub .oc-local-hub-tabs,
    body.front-page .oc-local-hub .oc-local-hub-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        width: 100%;
        border-bottom: 1px solid var(--border-color, rgba(116, 116, 116, .1));
    }

    body.home .oc-local-hub .oc-local-hub-tab,
    body.front-page .oc-local-hub .oc-local-hub-tab {
        min-height: 38px;
    }

    body.home .oc-local-hub .oc-local-hub-tab::after,
    body.front-page .oc-local-hub .oc-local-hub-tab::after {
        bottom: -1px;
    }

    body.home .oc-local-hub .oc-favorites-list,
    body.front-page .oc-local-hub .oc-favorites-list,
    body.home .oc-local-hub .oc-recent-links-list,
    body.front-page .oc-local-hub .oc-recent-links-list {
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.home .oc-local-hub .oc-local-hub-tab::after,
    body.front-page .oc-local-hub .oc-local-hub-tab::after {
        transition: none;
    }
}
