* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

html {
    scroll-padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

.scroll-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    right: calc(1rem + env(safe-area-inset-right, 0px));
    z-index: 10050;
    min-width: 48px;
    min-height: 48px;
    padding: 0 14px;
    margin: 0;
    border: none;
    border-radius: 999px;
    background-color: #55aaaa;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, background-color 0.15s ease;
}

.scroll-to-top.scroll-to-top--visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.scroll-to-top:hover,
.scroll-to-top:focus {
    background-color: #449999;
    color: #ffffff;
    outline: none;
}

.scroll-to-top:focus-visible {
    outline: 2px solid #222222;
    outline-offset: 2px;
}

.topnav {
    --search-max-width: 280px;
    overflow: hidden;
    background-color: #FFFFFF;
    border-bottom: 1px solid #dddddd;
}

.topnav-main-row {
    display: none;
}

.topnav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.topnav a {
    display: block;
    color: black;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 17px;
}

.topnav a:hover {
    background-color: #ddd;
    color: black;
}

.topnav a.active {
    background-color: #55aaaa;
    color: white;
}

.topnav .nav-auth {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0;
    font-size: inherit;
}

.topnav .nav-auth a {
    float: none;
}

.topnav .nav-auth-user {
    padding: 14px 16px;
    font-size: 17px;
    margin-right: 0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topnav .nav-auth-logout {
    display: inline;
    margin: 0;
}

.topnav .nav-auth-logout-btn {
    padding: 14px 16px;
    font-size: 17px;
    vertical-align: baseline;
    border: none;
    background: transparent;
    color: black;
    text-decoration: none;
    cursor: pointer;
    line-height: inherit;
}

.topnav .nav-auth-logout-btn:hover {
    background-color: #ddd;
    color: black;
    text-decoration: none;
}

.topnav .search-container {
    float: right;
    margin-left: auto;
    padding: 6px 8px;
    max-width: var(--search-max-width);
}

.topnav .search-container-mobile {
    display: none;
}

.topnav-toggle {
    display: none;
    border: 1px solid #55aaaa;
    background-color: #ffffff;
    color: #222222;
    border-radius: 6px;
    cursor: pointer;
}

.topnav-toggle-icon {
    font-size: 30px;
    line-height: 1;
    display: inline-block;
}

.topnav input[type=text] {
    padding: 6px;
    margin-top: 8px;
    font-size: 17px;
    border: none;
    background: #f6f6f6;
}

.topnav .search-container button {
    float: right;
    padding: 6px 10px;
    margin-top: 8px;
    margin-right: 16px;
    background: #ddd;
    font-size: 17px;
    border: none;
    cursor: pointer;
}

.topnav .search-container button:hover {
    background: #55aaaa;
}

@media screen and (max-width: 900px) {
    .topnav {
        --topnav-mobile-toggle-height: 60px;
        /* Keep original header band height; only the search/toggle controls use 60px */
        min-height: 96px;
    }

    .topnav-main-row {
        min-height: 96px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 12px;
        gap: 12px;
    }

    .topnav-toggle {
        display: block;
        min-width: var(--topnav-mobile-toggle-height);
        min-height: var(--topnav-mobile-toggle-height);
        padding: 10px 14px;
    }

    .topnav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        border-top: 1px solid #dddddd;
        padding-bottom: 10px;
    }

    .topnav.is-mobile-open .topnav-links {
        display: flex;
    }

    .topnav .search-container {
        float: none;
        margin-left: auto;
        padding: 0;
        width: auto;
    }

    .topnav .search-container-desktop {
        display: none;
    }

    .topnav .search-container-mobile {
        display: block;
        flex: 0 1 auto;
        min-width: 0;
        max-width: min(var(--search-max-width), 100%);
        margin-left: 0;
    }

    .topnav .search-container form {
        display: flex;
        align-items: center;
        gap: 0;
        width: 100%;
        min-width: 0;
    }

    .topnav .search-container-mobile form {
        align-items: stretch;
        min-height: var(--topnav-mobile-toggle-height);
    }

    .topnav .search-container-mobile form input[type=text] {
        height: var(--topnav-mobile-toggle-height);
        padding: 0 12px;
        margin-top: 0;
    }

    .topnav .search-container-mobile button {
        height: var(--topnav-mobile-toggle-height);
        padding: 0 14px;
        min-width: 48px;
    }

    .topnav .topnav-links a,
    .topnav .topnav-links .nav-auth,
    .topnav .topnav-links .nav-auth a,
    .topnav .topnav-links .nav-auth-user,
    .topnav .topnav-links .nav-auth-logout-btn {
        float: none;
        display: block;
        text-align: left;
        width: 100%;
        margin: 0;
        padding: 18px 18px;
        line-height: 1.2;
    }

    .topnav .topnav-links .nav-auth {
        margin-left: 0;
        display: block;
        padding: 0;
    }

    .topnav .nav-auth-logout {
        display: block;
    }

    .topnav .search-container form input[type=text] {
        flex: 1 1 0%;
        min-width: 0;
        margin-top: 0;
    }

    .topnav .search-container button {
        float: none;
        flex-shrink: 0;
        margin-top: 0;
        margin-right: 0;
    }

    .topnav a.active {
        text-align: left;
    }

}

@media screen and (max-width: 340px) {
    .topnav .search-container-mobile button {
        flex-shrink: 1;
        min-width: 0;
    }
}

@media screen and (min-width: 901px) {
    .topnav-links {
        display: flex;
    }

    .topnav-main-row {
        display: none;
    }

    .topnav .search-container {
        margin-left: auto;
        order: 100;
    }

    .topnav .search-container-desktop {
        display: block;
    }

    .topnav .search-container-mobile {
        display: none;
    }

    .topnav .search-container-desktop form {
        display: flex;
        align-items: center;
        gap: 0;
    }

    .topnav .search-container-desktop input[type=text] {
        margin-top: 0;
        float: none;
        flex: 1 1 0%;
        min-width: 0;
    }

    .topnav .search-container-desktop button {
        float: none;
        margin-top: 0;
    }
}

html body {
    background: #ffffff;
}

/* Index page only: alphabet + Pages row — cell hover darkening (inline teal selection unchanged) */
.page-index .letter-wrap td,
.page-index .table-scrollbar td.page-button {
    transition: box-shadow 0.15s ease;
}

.page-index .letter-wrap td:hover,
.page-index .table-scrollbar td.page-button:hover {
    box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

/* Start CSS for the slider check box*/
/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: #55aaaa;
}

input:focus + .slider {
    box-shadow: 0 0 1px #55aaaa;
}

input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/*START collapsable advanced search*/
/*REF: https://www.w3schools.com/howto/howto_js_collapsible.asp*/
/* Style the button that is used to open and close the collapsible content */
.collapsible {
    background-color: #e9e9e9;
    cursor: pointer;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
}

/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
.active, .collapsible:hover {
    background-color: #55aaaa;
}

/* Style the collapsible content. Note: hidden by default */
.advanced_search_collapse {
    /*background-color: white;*/
    /*max-height: 0;*/ /*TODO uncomment for dynamic drop down*/
    overflow: hidden;
    margin-top: .25em;
    margin-bottom: 1em;
}

.advanced_search_trans {
    transition: max-height 0.2s ease-out;
}

/*END collapsable advanced search*/

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 400px;
    width: 100%;
    margin: 16px auto 0;
}

/* Social login: white icon tile + full-width colored label (matches common OAuth button patterns) */
.login-provider {
    display: flex;
    align-items: stretch;
    min-height: 48px;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 1rem;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.login-provider:hover {
    filter: brightness(0.96);
    color: #fff;
}

.login-provider:focus {
    outline: 2px solid #250;
    outline-offset: 2px;
}

.login-provider__icon {
    flex: 0 0 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.login-provider__svg {
    display: block;
}

.login-provider--google {
    background: #4285f4;
}

.login-provider--google .login-provider__icon {
    border: 1px solid #4285f4;
}

.login-provider--facebook {
    background: #3b5998;
}

.login-provider--facebook .login-provider__icon {
    border: 1px solid #3b5998;
}

.login-provider__label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    text-align: center;
}

.rhodo-detail-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25em;
    margin-top: 0.25em;
}

.rhodo-detail-toolbar__left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.rhodo-detail-toolbar__right {
    margin-left: auto;
}

.rhodo-edit-panel {
    display: none;
    margin-bottom: 1em;
    padding: 0.75em;
    border: 2px solid black;
    background-color: #fafafa;
}

.rhodo-edit-panel.is-open {
    display: block;
}

.rhodo-edit-form__table {
    width: 100%;
}

.rhodo-edit-form__actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rhodo-edit-flash {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

div.content {
    width: 100%;
    max-width: none;
    background-color: #ffffff;
    /*padding-left: 10px;*/
    /*padding-right: 10px;*/
    margin: 50px 0 0;
    overflow-anchor: none;
    /* All pages: room past the last line (index used extra <br/>; detail/search did not). Wide viewports had no bottom inset before. */
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

@media screen and (min-width: 901px) {
    html body {
        background: #d5edd5;
    }

    div.content {
        max-width: 800px;
        margin: 50px auto 0;
    }
}

.results-table {
    width: 100%;
    table-layout: fixed;
}

.picture-table {
    width: 100%;
    table-layout: fixed;
    overflow-anchor: none;
}

.preview-card-img {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
}

.picture-td {
    width: 100%;
    max-width: 100%;
    padding: 3px;
    overflow: hidden;
    box-sizing: border-box;
}

/* Avoid cyclic % heights in table cells (can shrink scrollable height as layout settles). */
.picture-td div {
    min-height: 0;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* One td per row (colspan=2): inner grid keeps a stable table layout. */
.picture-table-row-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    box-sizing: border-box;
}

.picture-table-row-inner--photo-first {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Single colspan cell: draw the center rule on the <td> so it spans the full border box and meets row borders (inner column borders stop short). */
@media screen and (min-width: 900px) {
    .picture-table.bordered-table td.picture-table-cell {
        position: relative;
        padding: 0;
        vertical-align: top;
        overflow: visible;
    }

    .picture-table td.picture-table-cell::before {
        content: "";
        position: absolute;
        z-index: 1;
        pointer-events: none;
        top: -2px;
        bottom: -2px;
        width: 0;
        border-left: 2px solid black;
        /* 1fr 1fr columns: boundary at 50% for text|photo and photo|text order */
        left: 50%;
    }

    /*
     * 3px inset around the image. Rows with the photo on the right (search cards, etc.) need
     * +2px on the side that meets the center rule — the ::before line is 2px wide and otherwise
     * eats the visible gap beside the image. Detail pages use photo-first and keep 3px on every side.
     */
    .picture-table .picture-table-row-inner:not(.picture-table-row-inner--photo-first) .picture-td.picture-table-photo {
        padding: 3px 3px 3px calc(3px + 2px);
        display: flex;
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
    }

    .picture-table .picture-table-row-inner--photo-first .picture-td.picture-table-photo {
        padding: 3px;
        display: flex;
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
    }

    /* width="400" is wider than half of ~800px content; shrink so padding stays visible on all sides. */
    .picture-table .picture-td.picture-table-photo > a:has(img) {
        display: block;
        line-height: 0;
        max-width: 100%;
    }

    .picture-table .picture-td.picture-table-photo img {
        display: block;
        max-width: 100%;
        height: auto;
    }

    /* width:100% + max-width leaves the block narrower than the row — auto margins center it. */
    .picture-table .preview-card-img {
        margin-left: auto;
        margin-right: auto;
    }
}

.picture-table-text {
    min-width: 0;
}

.picture-table-cell h3 {
    font-size: 28px;
}

.picture-table-photo {
    min-width: 0;
}

/* No-photo row: link matches text-column more-link alignment (left on narrow viewports). */
.picture-table-placeholder-link {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

/* Same layout for every row: stack below MOBILE_NAV_BREAKPOINT_PX (see actions.js); photo above caption. */
@media screen and (max-width: 899px) {
    .picture-table .picture-table-row-inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        /* Space before the next row’s image so the more-link isn’t flush against a tappable photo. */
        padding-bottom: 1rem;
    }

    .picture-table .picture-table-photo {
        order: 1;
        width: 100%;
    }

    .picture-table .picture-table-text {
        order: 2;
        width: 100%;
    }

    /* No-photo rows: link below text (matches text-column link placement). */
    .picture-table .picture-table-row-inner:has(.picture-table-placeholder-link) .picture-table-text {
        order: 1;
    }

    .picture-table .picture-table-row-inner:has(.picture-table-placeholder-link) .picture-table-photo {
        order: 2;
    }

    .picture-table .picture-td div {
        height: auto;
        display: block;
    }

    .picture-table .picture-td > a {
        display: block;
    }

    .picture-table .picture-td img {
        width: 100%;
        max-width: none;
        height: auto;
        display: block;
    }

    .picture-table .picture-table-placeholder-link {
        display: block;
        height: auto;
        text-align: left;
    }
}


.bordered-table, .bordered-table td {
    border: 2px solid black;
    border-collapse: collapse;
}

/* Rhodo detail: attributes and picture are separate tables; one shared edge otherwise reads as a double rule. */
.attributes-detail-table + .picture-table,
.attributes-detail-table + .picture-table tr:first-child td {
    border-top: none;
}

.table-description-text {
    padding-left: 10px;
    vertical-align: top
}

.attributes-detail-table {
    width: 100%;
    table-layout: auto;
}

.attributes-detail-table td {
    padding: 8px;
}

/* Label column: shrink-to-fit on small viewports; value column uses remaining width. */
.attributes-detail-table td.key {
    width: 1%;
    white-space: nowrap;
    vertical-align: top;
    padding-right: 10px;
}

/* Desktop: key column ≈ half the photo width below (picture row is 50/50; image ≤ ~400px → ~25% of content). */
@media screen and (min-width: 901px) {
    .attributes-detail-table td.key {
        width: 25%;
    }
}

.attributes-detail-table td.value {
    min-width: 0;
    padding-left: 10px;
}

/* Very narrow viewports: allow labels to wrap so the table does not force horizontal overflow. */
@media screen and (max-width: 420px) {
    .attributes-detail-table td.key {
        white-space: normal;
    }
}

h1 {
    margin-top: 0;
    text-align: center;
}

.description-container {
    padding-top: 20px;
    padding-left: 8px;
}

table.letter-wrap {
    display: block;
}

.letter-wrap td {
    white-space: nowrap;
    display: inline-block;
    vertical-align: top;
    horiz-align: center;
    width: 7.6%;
    min-width: 3em;
}

/*container for wrappable tables*/
.table-scrollbar {
    /*overflow-x: auto;*/
}

/*https://stackoverflow.com/questions/17159708/wrap-table-row-to-the-next-line*/
.table-scrollbar table {
    display: block;
}

.table-scrollbar td {
    white-space: nowrap;
    display: inline-block;
    vertical-align: top;
    horiz-align: center;
    min-width: 10%;
}

.container {
    display: flex;
}

.fixed {
    vertical-align: top;
    /*white-space: nowrap;*/
    padding: 3px;
    width: 100%;
    padding-right: 10px;
}

.fixed img {
    width: 100%;
}

.flex-item {
    flex-grow: 1;
    padding-left: 10px;
    padding-right: 10px;
}

.page-button {
    text-decoration: none;
    text-align: center;

}

.page-button * {
    text-align: center;
    text-decoration: none;
}

/* Index only: alphabet + page-range chips — padding on <td> left a dead zone; link fills the cell */
.page-index .letter-wrap td {
    padding: 0;
}

.page-index .index-letter-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 2.75rem;
    padding: 8px;
    box-sizing: border-box;
    font-size: 26px;
    text-decoration: none;
}

.page-index .table-scrollbar td.page-button {
    padding: 0;
    vertical-align: top;
}

.page-index .index-page-link {
    display: block;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    text-decoration: none;
}

.page-index .index-letter-link:hover,
.page-index .index-letter-link:focus-visible {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.page-index .index-page-link:hover,
.page-index .index-page-link:focus-visible,
.page-index .index-page-link:hover *,
.page-index .index-page-link:focus-visible * {
    text-decoration: underline;
    text-underline-offset: 2px;
}

h3 {
    font-size: 18.72px;
}

.next-page-link {
    font-size: 28px;
}

/*for buttons*/
/*label.btn {*/
/*    flex: 0 !important;*/
/*}*/

@media screen and (max-width: 900px) {
    /* Tighter gap under the taller mobile header; aligns with description-container padding (20px). */
    div.content {
        margin-top: 20px;
    }

    /* Index alphabet: square touch cells, equal row/column gap; columns adapt to width */
    .page-index table.letter-wrap {
        display: block;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .page-index .letter-wrap tbody {
        display: block;
        width: 100%;
    }

    .page-index .letter-wrap tr {
        display: grid;
        /* Min cell tracks ~26px letter + padding; 1fr keeps squares even as columns change */
        grid-template-columns: repeat(auto-fit, minmax(2.75rem, 1fr));
        gap: 0.5rem;
        width: 100%;
        align-content: start;
    }

    .page-index .letter-wrap td {
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        aspect-ratio: 1;
        padding: 0;
        text-align: center;
    }

    .page-index .letter-wrap td a.index-letter-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 8px;
        box-sizing: border-box;
        touch-action: manipulation;
    }

    .page-home .container {
        flex-direction: column;
    }
}