@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=M+PLUS+Rounded+1c:wght@400;500;700;800&family=Noto+Emoji:wght@400;500;700&display=swap');

html {
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
}

body {
    margin: 0 0 0 0;
    padding: 0 0 0 0;
    overflow-x: hidden;
    line-height: 1.4;
    font-size: 14pt;
    font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", sans-serif;
    background: #366938;
}

body.profile {
    background: #693638;
}

div.topMenu, div.bottomMenu {
    display: table;
    text-align: center;
    max-height: 64px; /* Hides bottom menu when there are no visible elements */
    margin-left: auto;
    margin-right: auto;
    color: white;
    background-color: #366938;
    font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", sans-serif;
    width: 100%;
    vertical-align: middle;
    border-bottom: 2px solid yellowgreen;
}

div#pageTop {
    position: sticky;
    top: 0px;
    z-index: 99999;
}

div.languageMenu {
    display: none;   /* table, for display */
    text-align: center;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    color: white;
    background-color: #366938;
    font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", sans-serif;
    width: 100%;
    vertical-align: middle;
    border-bottom: 2px dotted yellowgreen;
}

div.bottomMenu {
    margin-bottom: 0.5ex;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

div.topMenu.profile, div.bottomMenu.profile {
    background-color: #693638;
    border-bottom: 2px solid burlywood;
}

div.languageMenu.profile {
    background-color: #693638;
    border-bottom: 2px dotted burlywood;
}

@keyframes activateMenuButton {
    from { background-color: #366938; }
    to { background-color: #699C6A; }
}

@keyframes activateProfileMenuButton {
    from { background-color: #693638; }
    to { background-color: #9C696A; }
}

@keyframes authorTitleHover {
    from { background-color: whitesmoke; }
    to { background-color: lightgray; }
}

@keyframes localZoosHover {
    0% { background: radial-gradient(gold 0%, #693638 130%); }
    20% { background: radial-gradient(gold 0%, #693638 142.5%); }
    40% { background: radial-gradient(gold 0%, #693638 155%); }
    60% { background: radial-gradient(gold 0%, #693638 167.5%); }
    80% { background: radial-gradient(gold 0%, #693638 180%); }
    100% { background: radial-gradient(gold 0%, #693638 192.5%); }
}

@keyframes pandaTitleHover {
    from { background-color: yellowgreen; }
    to { background-color: #9AED32; }
}

@keyframes pandaLoveTitleHover {
    from { background-color: #EDC1D7; }
    to { background-color: #FFD1D7; }
}

@keyframes sectionButtonHover {
    from { background-color: yellowgreen; }
    to { background-color: whitesmoke; }
}

@keyframes sectionButtonActivated {
    from { background-color: whitesmoke; }
    to { background-color: plum; }
}

@keyframes sectionButtonActivatedHover {
    from { background-color: plum; }
    to { background-color: whitesmoke; }
}

@keyframes summaryLinkHover {
    from { background-color: #9771A7; }
    to { background-color: #C7A1E7; }
}

button.logo {
    display: inline-block;
    border: none;
    color: white;
    line-height: 1.4;
    font-size: 14pt;
    font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", sans-serif;
    background-color: #366938;
    height: 64px;
    float: left;
}

button.logo.profile {
    background-color: #693638;
}

button.menu {
    display: inline-block;
    border: none;
    color: white;
    line-height: 1.4;
    font-size: 14pt;
    font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", sans-serif;
    background-color: #366938;
    height: 64px;
    width: 142px;  /* Fixed width keeps them looking consistent across languages */
}

button.menu.flag {
    /* Flag buttons swap the display language after the language button is clicked */
    display: inline-block;
    border: none;
    color: white;
    line-height: 1.4;
    font-size: 14pt;
    font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", sans-serif;
    background-color: #366938;
    height: 64px;
    width: 64px;
}

button.menu.flag > div.buttonContent > div.buttonIcon {
    padding-right: 0px;   /* No padding on the flag menu icons, since no text */
}

button.menu.disabled {
    /* TODO: Needs to grayscale all button contents */
    background-color: #696969
}

button.menu.hidden {
    display: none;
}

button.menu.profile, button.menu.flag.profile {
    background-color: #693638;
}

button.menu.message {
    width: 260px;   /* Longer button for message text */
}

button.menu:hover, button.menu.flag:hover, button.logo:hover  {
    animation: activateMenuButton;
    animation-duration: 0.3s;
    background-color: #699C6A;
    cursor: pointer;
}

button.menu.profile:hover, button.menu.flag.profile:hover, button.logo.profile:hover {
    animation: activateProfileMenuButton;
    animation-duration: 0.3s;
    background-color: #9C696A;
}

button.menu:active, button.menu.flag:active, button.logo:active {
    animation: activateMenuButton;
    animation-duration: 0.6s;
    animation-direction: alternate;
}

button.menu.profile:active, button.menu.flag.profile:active, button.logo.profile:active {
    animation: activateProfileMenuButton;
    animation-duration: 0.6s;
    animation-direction: alternate;
}

div.buttonContent {
    display: table;
    border: none;
    margin-left: auto;
    margin-right: auto;
    /* Need to kill text highlighting so long-press events work */
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

div.buttonIcon {
    display: table-cell;
    font-size: 24pt;
    padding-right: 8px;
    text-align: left;
    /* Need to kill text highlighting so long-press events work */
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

div.buttonText {
    display: table-cell;
    text-align: left;
    /* Need to kill text highlighting so long-press events work */
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

div.buttonText.condensed {
    letter-spacing: -3.7px;
    font-size: 13.5pt;
}

button.sectionButton:hover {
    animation: sectionButtonHover;
    animation-duration: 0.3s;
    background-color: whitesmoke;
    cursor: pointer;
}

button.sectionButton:active {
    animation: sectionButtonHover;
    animation-duration: 0.6s;
    animation-direction: alternate;
}

button.sectionButton {
    display: inline-block;
    border: 1px solid #002200;
    line-height: 1.4;
    font-size: 12pt;
    font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", sans-serif;
    background-color: yellowgreen;
    height: 5ex;   /* One lines of 12pt text */
    color: black;
}

button.sectionButton.selected {
    background-color: plum;
}

button.sectionButton.selected:hover {
    animation: sectionButtonActivatedHover;
    animation-duration: 0.6s;
    background-color: whitesmoke;
}

button.sectionButton.selected:active  {
    animation: sectionButtonActivated;
    animation-duration: 0.6s;
    background-color: plum;
}

button.sectionButton.two {
    width: calc(90% / 2);
}

button.sectionButton.three {
    width: calc(90% / 3);
}

button.sectionButton.four {
    width: calc(90% / 4);
}

button.sectionButton.two:nth-child(2n) {
    border-right: none;
}

div.topSearch, div.bottomSearch {
    display: table;
    text-align: center;
    vertical-align: middle;
    height: 64px;
    background-color: white;
    font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", sans-serif;
    width: 100%;
    margin: 0 0 0 0;
    padding: 0 0 0 0;
}

div.bottomSearch {
    display: none;
}

div.shrinker {
    margin-left: auto;
    margin-right: auto;
    max-width: 868px;
}

form {
    margin: 0 0 0 0;
    padding: 0 0 0 0;
}

input.search {
    font-family: sans-serif;
    border-radius: 0;  /* Disable rounding on iOS */
    -webkit-appearance: none;  /* Guarantees styles work on Desktop Safari */
    font-size: 50px;
    width: 100%;
    border: 0px solid;
    vertical-align: middle;
    margin: 0 0 0 0;
    padding: 0 0 0 0;
    height: 64px;
}

input[type='text'] {
    font-family: sans-serif;
    vertical-align: middle;
    border-radius: 0;  /* Disable rounding on iOS */
}

input.search[disabled] {
    font-family: sans-serif;
    background-color: white;
    color: white;
}

input.search[disabled]::placeholder {
    font-family: sans-serif;
    background-color: white;
    color: lightgray;
}

input#searchSubmit {
    display: none;
}

input.search::placeholder {
    color: #E4A880; /* The light green, but with RR and GG byte switched */
}

div.profile.nameBar {
    font-family: sans-serif;
    font-size: 38pt;
    width: 100%;
    border: 0px solid;
    vertical-align: middle;
    margin: 0 0 0 0;
    padding: 0 0 0 0;
    background-color: #FFDECE;
    text-align: center;
}

div.profileDossier ul {
    margin-bottom: 0.5ex;
}

img.fullFrame {
    height: calc(100% - 130px);
    width: 100%;
    object-fit: cover; /* Images on the initial page maintain aspect ratio w/o scaling */
    opacity: 0.4;
    background: linear-gradient(to right, #A8E480, #366938, #A8E480); /* Granny Smith Apples! */
}

div#contentFrame {
    padding-top: 1ex;
    padding-bottom: 1ex;
    margin-left: auto;
    margin-right: auto;
    z-index: 1;
    background: linear-gradient(to right, #A8E480, #366938, #A8E480); /* Granny Smith Apples! */
}

div#contentFrame.mothersDay, div#contentFrame.birthdayPandas, div.mediaFrame {
    text-align: center;
}

/* Class to add to hidden sections on about/links page */
div.hidden, img.hidden {
    display: none;
}

div.pandaResult, div.zooResult, div.profileFrame {
    display: table;
    clear: both;
    margin-top: 1ex;
    margin-bottom: 1ex;
    border: 1px solid #033605; /* Bamboo Green */
    background-color: #EEE8AA;
    text-align: left;   /* In case gallery styles make contentFrame centered */
}

div.profileFrame.zoos {
    background-color: rgba(0,0,0,0);
    border: 0px solid;
}

div.qrcodeFrame {
    margin-left: 30px;
    margin-right: 30px;
    width: 260px;
    text-align: center;
}

span.qrcodeText {
    color: black;
    font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", sans-serif;
    font-size: 10pt;
    font-weight: bold;
    line-height: 1.5;
    text-decoration: underline;
}

div.qrcodeFrame button {
    width: 260px;
    background-color: rgb(240, 240, 240);
    padding-bottom: 1.5ex;
    padding-top: 1.5ex;
    border-radius: 1em;
    border: 0.5ex solid olive;
    cursor: pointer;
}

/* QR codes can't be made as opaque PNGs so I animate the border instead */
div.qrcodeFrame button:hover {
    border: 0.5ex solid gold;
}

div.qrcodeFrame > button > img {
    display: block;
    width: 180px;
    height: 180px;
    background-color: rgb(240,240,240);
    margin-left: auto;
    margin-right: auto;
}

div.pandaTitle a, div.pandaDossier a, div.pandaFamily a, div.zooDossier a, div.profileDossier a, div.zooHistory a {
    text-decoration: none !important;
    color: black;
}

p.furigana {
    display: inline;
    font-size: 80%;
    margin-left: 1ex;
}

div.emptyResult {
    display: table;
    position: relative;
    clear: both;
    height: 65vh;
    max-height: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    margin-top: 1ex;
    margin-bottom: 1ex;
    border: 1px solid #033605; /* Bamboo Green */
    vertical-align: middle;
}

div.emptyResult img {
    height: 65vh;
    max-width: 100%;
    max-height: 600px;
}

div.emptyResult div.overlay {
    position: absolute;
    font-size: 22pt;
    color: white;
    top: 70%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0 0 0 0;
    padding: 0 0 0 0;
}

div.pandaPhoto, div.zooPhoto {
    display: table-cell;
    vertical-align: middle;
    background-color: black;
    position: relative;
    /* Prevents errant drags of these photos */
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

div.pandaPhoto img, div.zooPhoto img {
    width: auto;
    height: auto;
    max-width: 320px;
    max-height: 320px;
    z-index: 1;
}

a.navigatorLink {
    display: none;
}

span.navigator {
    position: absolute;
    top: 0;
    left: 0;
    height: 32pt;
    z-index: 2;
    background-color: rgba(0,0,0,0.8);
    color: white;
    font-size: 22pt;
    border-bottom: 1px solid white;
    border-right: 1px solid white;
    border-bottom-right-radius: 0.8ex;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
    width: 36px;
}

span.navigator.threeDigits {
    font-size: 18pt;
    line-height: 1.7;
    padding-left: 0px;
    padding-right: 10px;
    letter-spacing: -1px;
}

span.navigator.fourDigits {
    font-size: 18pt;
    line-height: 1.7;
    padding-left: 0px;
    padding-right: 26px;
    letter-spacing: -1px;
}

/* Copy toasts or other on-element toasts */
span.notifier {
    position: fixed;
    display: none;
    top: 0;
    left: 0;
    height: 32pt;
    z-index: 2;
    background-color: rgba(0,0,0,0.8);
    color: white;
    font-size: 22pt;
    border-bottom: 1px solid white;
    border-right: 1px solid white;
    border-bottom-right-radius: 0.8ex;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
}

span.notifier.condensed {
    letter-spacing: -2px;
}

img.preload {
    display: none;
}

img.aboutFocus.replace,
img.twinFocus.replace {
    /* JS needs to replace the src before displaying these */
    display: none;
}

div.pandaDossier, div.zooDossier, div.profileDossier {
    display: table-cell;
    vertical-align: top;
    background-color: #EDC1D7; /* Pink Lady Apples */
    border-left: 1px solid #033605; /* Bamboo Green */
}

div.profileDossier {
    width: 100%;
    background-color: #EEE8AA;
    padding-bottom: 0.5ex;
}

div.pandaTitle, div.zooTitle {
    display: block;
    text-align: left;
    min-width: 300px;
    min-height: 32pt;
    background-color: yellowgreen;
    padding-left: 18px;
}

div.pandaTitle:hover {
    animation: pandaTitleHover;
    animation-duration: 0.3s;
    background-color: #9AED32;   /* Brighter Yellowgreen */
}

div.profileLocation {
    min-width: 300px;
    min-height: 32pt;
}

div.pandaName, div.zooName, div.gender {
    display: inline-block;
    font-size: 22pt;
    margin: 0 0 0 0;
    padding: 0 0 0 0;
}

div.pandaName.profile {
    font-size: 34pt;
    font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", sans-serif;
}

div.gender {
    margin-right: 0.5ex;
}

div.gender.center {
    margin-left: 0.5ex;
    margin-right: 0.5ex;
}

div.gender img {
    height: 18pt;
}

div.gender.profile img {
    height: 30pt;
}

div.gender.caption {
    margin-right: 0.2ex;
    margin-left: 0px;
    padding: 0 0 0 0;
}

div.gender.caption img {
    height: 10pt;
}

div.pandaDetails, div.zooDetails {
    display: block;
    min-width: 300px;
    background-color: #9771A7; /* Grapes */
    padding-top: 0.5ex;
    padding-bottom: 0.5ex;
}

div.pandaDetails p, div.zooDetails p {
    display: inline-block;
    margin-left: 18px;
    margin-top: 0.5ex;
    margin-bottom: 0.5ex;
    padding-top: 0ex;
    padding-bottom: 0ex;
}

ul.zooCounts {
    background-color: #EDC1D7;
    margin-top: 0px;
    margin-bottom: 0px;
    padding-top: 1ex;
    padding-bottom: 0.5ex;
    padding-left: 0px;
    list-style: none;
}

ul.zooCounts > li {
    margin-left: 14px;
    padding-bottom: 0.5ex;
}

div.brightness-150 {
    filter: brightness(150%);
}

h3, h4 {
    display: inline-block;
    margin-left: 18px;
    margin-top: 1ex;
    margin-bottom: 0ex;
    padding: 0 0 0 0;
    text-decoration: underline;
}

h3.ja, h4.ja, h3.zh, h4.zh {
    /* Family headers kanji w/underlines doesn't look right */
    text-decoration: none;
    font-weight: normal;
    border-bottom: 2px solid black;
}

div.species h4 {
    text-decoration: none;
    margin-left: 14px;
}

div.profileFrame > div.profileDossier > ul.pandaList li {
    margin-left: 4px;
}

div.family {
    display: flex;
    flex-direction: row;
    min-width: 300px;
    flex-wrap: wrap;
    overflow: hidden;
}

div.family.vertical, div.family.vertical.onlyDesktop {
    display: flex;
    flex-direction: column;
}

div.family.vertical.onlyDesktop {
    align-content: start;   /* Makes lists swing left */
}

div.family.vertical.onlyDesktop > div {
    width: 30%;
}

div.family.vertical.onlyDesktop > div.double, div.family.vertical.onlyDesktop > div.triple {
    width: 60%;
}

div.family.vertical.onlyMobile {
    display: flex;
    flex-direction: row;
}

div.parents, div.litter, div.siblings, div.children, div.names {
    display: inline-block;
    vertical-align: top;
    margin-left: 10px;
    flex-grow: 0.1;   /* Give a little bit of extra space relative to # of columns */
}

div.zooHistory, div.profilePhotos {
    display: inline-block;
    vertical-align: top;
    flex-grow: 0.1;   /* Give a little bit of extra space relative to # of columns */
    text-align: center;
    width: 100%;
}

ul.zooList {
    border: 1px solid black;
    background-color:  #EDC1D7;
    margin-left: 0.5em;
    margin-right: 0.5em;
}

ul.zooList li {
    text-align: center;
    padding-left: 2ex;
    padding-right: 2ex;
    padding-top: 0.5ex;
    padding-bottom: 0.5ex;
}

/* Add these after an element to guarantee that its display will force a new flex line.
   On Firefox, CSS "page-break-after" works for this, but on Chrome it does not. */
hr.divider {
    display: block;
    width: 100%;
    border: 0px solid;
    margin: 0 0 0 0;
}

hr.divider.onlyMobile {
    display: none;
}

div.zooDivider {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-size: 30px;
    padding-top: 0.5ex;
    padding-bottom: 0.5ex;
}

ul.pandaList, ul.linkList, ul.nicknameList {
    text-align: left;
    list-style: none;
    margin-left: 10px;
    margin-top: 0.5ex;
    margin-bottom: 0.5ex;
    padding: 0 0 0 0;
}

ul.tagList {
    text-align: left;
    list-style: none;
    margin-left: 20px;
    margin-top: 0.5ex;
    margin-bottom: 0.5ex;
    padding: 0 0 0 0;
}

ul.tagList li {
    text-align: center;
    line-height: 1.7;
}

div.nicknameContainer, div.othernamesContainer {
    display: inline-block;
    vertical-align: top;
    margin-left: 18px;
    margin-right: 18px;
}

div.nicknameContainer h4, div.othernamesContainer h4 {
    margin-left: 0px;
}

ul.nicknameList {
    font-size: 12pt;
    margin-left: 0px;
}

ul.nicknameList li {
    padding-bottom: 0.2ex;
}

ul.zooList {
    text-align: left;
    list-style: none;
    margin-top: 0.5ex;
    margin-bottom: 0.5ex;
    padding: 0 0 0 0;
    display: inline-block;
}

ul.pandaList.double {
    column-count: 2;
    column-gap: 1.5em;
}

ul.pandaList.triple {
    column-count: 3;
    column-gap: 1.5em;
}

ul.pandaList.double.onlyMobile, ul.pandaList.triple.onlyMobile {
    column-count: 1;
}

ul.pandaList li, ul.linkList li, ul.nicknameList li, ul.tagList li {
    /* white-space: nowrap; */   /* !!! Turning this on makes an overflow bug on iOS */
}

/* By applying list padding inside the list items, this ensures that multicolumn
   lists don't send their padding across to the next column. */
ul.pandaList li > a, ul.linkList li > a, ul.tagList li > a {
    display: inline-block;
    padding-bottom: 0.75ex;
}

ul.pandaList li a.passedAway {
    color: gray;
}

ul.pandaList.en > li > a > span.condensed,
ul.pandaList.es > li > a > span.condensed,
ul.pandaList.np > li > a > span.condensed,
ul.pandaList.pt > li > a > span.condensed {
    font-size: 12.5pt;
}

ul.pandaList.en > li > a > span.ultraCondensed,
ul.pandaList.es > li > a > span.ultraCondensed,
ul.pandaList.np > li > a > span.ultraCondensed,
ul.pandaList.pt > li > a > span.ultraCondensed {
    letter-spacing: -1px;
    font-size: 10pt;
}

ul.pandaList.ja > li > a > span.condensed,
ul.pandaList.zh > li > a > span.condensed {
    letter-spacing: -1px;
    font-size: 12.5pt;
}

ul.pandaList.ja > li > a > span.ultraCondensed,
ul.pandaList.zh > li > a > span.ultraCondensed {
    letter-spacing: -3px;
    font-size: 11.5pt;
}

ul.pandaList > li > a > span.condensed.adjusted {
    letter-spacing: 0px;
    font-size: 12.5pt;
}

ul.pandaList > li > a > span.ultraCondensed.adjusted {
    letter-spacing: 0px;
    font-size: 10pt;
}

h5.birthdayMessage > span.condensed,
h5.groupMediaAuthor > span.condensed,
h5.halloweenMessage > span.condensed,
h5.memorialMessage > span.condensed,
h5.updateAuthor > span.condensed,
h5.updateAuthorCredit > span.condensed {
    letter-spacing: -1px;
}

h5.birthdayMessage > span.ultraCondensed,
h5.groupMediaAuthor > span.ultraCondensed,
h5.halloweenMessage > span.ultraCondensed,
h5.memorialMessage > span.ultraCondensed,
h5.updateAuthor > span.ultraCondensed,
h5.updateAuthorCredit > span.ultraCondensed {
    letter-spacing: -2px;
    font-size: 11pt;
}

h5.birthdayMessage > span.condensed.adjusted,
h5.halloweenMessage > span.condensed.adjusted,
h5.memorialMessage > span.condensed.adjusted {
    letter-spacing: 0px;
}

h5.birthdayMessage > span.ultraCondensed.adjusted,
h5.halloweenMessage > span.ultraCondensed.adjusted,
h5.memorialMessage > span.ultraCondensed.adjusted {
    letter-spacing: 0px;
    font-size: 11pt;
}

h4.parentsHeading, h4.litterHeading, h4.siblingsHeading, h4.childrenHeading {
    padding-bottom: 0.25ex;
}

div.footer {
    display: table;
    width: 100%;
    text-align: left;
    font-size: 10pt;
    background-color: #366938;
    color: white;
    bottom: 0px;
    margin: 0 0 0 0;
    padding: 0 0 0 0;
}

div.footer.profile {
    background-color: #693638;
}

div.footer p {
    margin-top: 0px;
    margin-bottom: 0px;
    padding-top: 1ex;
    padding-bottom: 1ex;
    margin-left: 14px;
    margin-right: 8px;
}

div.footer a {
    color: white;
}

a.emojiLink {
    text-decoration: none !important;   /* iPhone seems to require the !important */
}

div.hiddenSlug {
    display: none;
}

div.sectionMenu {
    margin: 1ex;
    text-align: center;
}

div.sectionMenuItem {
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    padding-top: 1ex;
    padding-bottom: 1ex;
}

div.pandaAbout, div.pandaLinks {
    color: white;
    margin-left: 14px;
    margin-right: 8px;
}

div.pandaAbout.desktopOnly, div.pandaAbout.mobileOnly {
    display: none;
}

div.aboutTags {
    /* Roughly centered multicolumn contents */
    margin-left: 5%;
    margin-right: 5%;
}

div.pandaLinks ul.bamboo li:before {
    content: "🎍";
    margin-right: 8px;
}

div.pandaLinks ul.heart li:before {
    content: "❤️";
    margin-right: 8px;
}

div.pandaLinks ul.panda li:before {
    content: "🐼";
    margin-right: 8px;
}

div.pandaAbout h5.caption > a, div.pandaLinks > ul > li > a {
    color: white;
    text-decoration: none !important;
}

div.pandaAbout > p > a, div.pandaLinks > p > a, div.pandaAbout > ul > li > a, div.pandaLinks > ul > li > a {
    color: white;  /* Links in About page body text keep underlines */
}

div.pandaAbout > ul.tagList > li > a {
    text-decoration: none !important;
}

div.pandaAbout h4 {
    color: white;
    text-decoration: none !important;
    margin-top: 0.1ex;  /* Mobile, underneath About-page heading */
}

div.pandaAbout h4 > a {
    color: white;
    font-style: italic;
    text-decoration: none !important;
}

div.pandaAbout h4.privacy {
    color: white;
    margin-left: 0px;
    padding-bottom: 1em;
}

div.pandaAbout h4.privacy > a {
    color: white;
    font-style: normal;
    text-decoration: underline !important;
}

div.photoSample a {
    color: black;
    text-decoration: none !important;
}

/* Hack to make some buttons have an animation highlight even when hovering
   over the outer link of the button. */
div.photoSample a:hover > h5.caption.familyName,
div.photoSample a:hover > h5.caption.groupMediaName,
div.photoSample a:hover > h5.caption.memorialMessage,
div.photoSample a:hover > h5.caption.pandaName,
div.photoSample a:hover > h5.caption.updateName,
div.photoSample a:hover > h5.caption.updateTagName,
div.photoSample a:hover > h5.caption.zooName {
    animation: pandaTitleHover;
    animation-duration: 0.3s;
    background-color: #9AED32;   /* Brighter Yellowgreen */
}

div.photoSample a:hover > h5.caption.updateName.newContributor {
    animation: pandaLoveTitleHover;
    animation-duration: 0.3s;
    background-color: #FFD1D7;
}

/* For when the author is a separate link, give it a separate hover style */
div.photoSample a:hover > h5.caption.groupMediaAuthor,
div.photoSample a:hover > h5.caption.updateAuthor {
    animation: authorTitleHover;
    animation-duration: 0.3s;
    background-color: lightgray;
}

/* Animate the Local Zoos button too */
div.frontPageSummary a:hover > p.summaryEmphasis {
    animation: localZoosHover 0.3s linear;
    background: radial-gradient(gold 0%, #693638 192.5%);   /* Panda Gold */
}

h5.caption {
    text-align: center;
    margin-top: 0.7ex;
    margin-bottom: 1ex;
    margin-left: 8px;
    margin-right: 8px;
    line-height: 2.3ex;   /* Even height regardless of font size */
}

h5.birthdayMessage {
    line-height: 2.3ex;
}

div.detailsNameTitle {
    display: block;
    text-align: center;
    background-color: #bcbcbc;
}

div.detailsName {
    display: block;
    text-align: center;
    background-color: #dedede;
    border-left: 1px solid #033605; /* Bamboo Green */
    border-right: 1px solid #033605; /* Bamboo Green */
    border-top: 1px solid #033605; /* Bamboo Green */
}

div.detailsLocation {
    display: block;
    text-align: center;
    min-width: 300px;
    background-color: whitesmoke;
    margin-bottom: 1ex;
}

span.detail {
    display: block;
font-size: 10pt;
}

div.detailsVideo {
    background-color: #366938; /* Match the menu background */
    border: 1px solid #033605; /* Bamboo Green */
}

div#contentFrame.about, div#contentFrame.links {
    background: radial-gradient(ellipse at top, #366938, #002200); /* Light to dark, top to bottom */
}

/* C28660 is Goldenrod, E4A880 is Sunflower */
div#contentFrame.profile {
    background: radial-gradient(ellipse at top, #C28660, #693638); /* Light to dark, top to bottom */
}

div#contentFrame.about div.shrinker, div#contentFrame.links div.shrinker {
    margin-left: auto;
    margin-right: auto;
    max-width: 680px;
}

div#contentFrame.options div.shrinker {
    display: flex;
    flex-direction: column;
    row-gap: 10px;
    justify-content: space-between;
}

div#contentFrame.options h3 {
    margin-left: 0px;
}

h2 {
    display: inline-block;
    margin-left: 0px;
    margin-top: 1ex;
    margin-bottom: 0ex;
}

/* Making youtube center and scale with the viewport requires hacks */
div.youtube {
    position: relative;
    margin-left: auto;
    margin-right: auto;
    display: block;
    height: 0;
    padding-top: 25px;
    padding-bottom: 53%;
}

div.youtube iframe {
    position: absolute;
    top: 0px;
    width: 100%;
    height: 100%;
}

img.aboutFocus {
    display: inline;
    width: 100%;
    text-align: center;
}

img.twinFocus {
    display: inline;
    width: 49%;
    text-align: center;
}

img.footerRpnLogo {
    width: 40px;
    float: left;
    margin-right: 4pt;
    margin-top: 3pt;
}

ul.linkList.multiColumn {
    column-count: 2;
}

ul.tagList.multiColumn {
    column-count: 3;
}

div.arrivalsHeader,
div.birthdaySummary,
div.creditSummary,
div.departuresHeader,
div.frontPageSummary,
div.halloweenSummary,
div.memorialSummary,
div.profileSummary,
div.residentsHeader,
div.tagSummary {
    text-align: center;
}

div.arrivalsHeader p,
div.birthdaySummary p,
div.creditSummary p,
div.departuresHeader p,
div.frontPageSummary p,
div.halloweenSummary p,
div.memorialSummary p,
div.profileSummary p,
div.residentsHeader p,
div.tagSummary p {
    display: inline-block;
    background-color: #9771A7; /* Grapes */
    color: black;   /* default to black text, even if inside an anchor tag */
    border: 1px solid #002200;
    padding: 1ex;
    margin: 1ex;
}

div.birthdaySummary a:hover > p,
div.memorialSummary a:hover > p,
div.tagSummary a:hover > p {
   animation: summaryLinkHover;
   animation-duration: 0.3s;
   background-color: #C7A1E7;   /* Ligher grape */
}

div.arrivalsHeader p,
div.departuresHeader p,
div.residentsHeader p {
    background-color: lightsalmon;
    min-width: 226px;   /* 2/3 of the mobile min viewport width */
}

div.halloweenSummary p {
    background-color: black;
    border: 1px solid white;
    color: white;
}

div.birthdaySummary p.summaryEmphasis {
    background-image: radial-gradient(#9771A7 0%, #693638 150%);   /* Rich Grapes */
    margin-top: 0.7ex;
    margin-left: 10px;
    margin-right: 10px;
    margin-bottom: 0ex;
    padding: 1ex;
}

div.frontPageSummary p.summaryEmphasis {
    background-image: radial-gradient(gold 0%, #693638 130%);   /* Panda Gold */
    font-size: 19.5pt;
    margin-top: 0.5ex;
    margin-left: 10px;
    margin-right: 10px;
    margin-bottom: 0ex;
    padding: 1ex;
}

p.summaryEmphasis > a {
    color: black;
    text-decoration: none !important;
}

div.profileSummary {
    margin-top: 1em;
}

div.photoSample {
    display: inline-block;
    width: 160px;
    margin-bottom: 10px;
    padding: 5px;
    vertical-align: top;
}

div.photoSample.quarterPage {
    width: 25%;
}

div.photoSample.halfPage {
    width: 35%;
}

div.photoSample.fullPage {
    width: 60%;
}

div.photoSample > img,
div.photoSample > a > img {
    border: 1px solid #002200;
    width: 100%;
}

div.photoSample h5 {
    background-color: yellowgreen;
    border: 1px solid #002200;
    padding: 0 0 0 0;
    margin-left: auto;
    margin-right: auto;
    width: 80%;
}

div.photoSample h5.updateName.halloweenMessage {
    background-color: orangered;
}

div.photoSample h5.updateAuthor.halloweenMessage {
    background-color: whitesmoke;
    margin-top: 0px;
}

div.photoSample h5.caption.familyName,
div.photoSample h5.caption.groupMediaName, 
div.photoSample h5.caption.updateName {
    margin-bottom: 0px;
    border-bottom: 0px solid;
    line-height: 2.3ex;
}

div.photoSample h5.caption.familyTitle, 
div.photoSample h5.caption.groupMediaAuthor, 
div.photoSample h5.caption.updateAuthor,
div.photoSample h5.caption.updateAuthorCredit {
    background-color: whitesmoke;
    margin-top: 0px;
    border-top: 0px solid;
    line-height: 2.3ex;
}

div.photoSample h5.caption.groupMediaAuthor,
div.photoSample h5.caption.groupMediaName,
div.photoSample h5.caption.updateName,
div.photoSample h5.caption.updateAuthor,
div.photoSample h5.caption.updateAuthorCredit,
div.photoSample h5.caption.updateTagName {
    width: 100%;
    overflow-x: hidden;
}

div.photoSample h5.caption.newContributor {
    background-color: #EDC1D7; /* Pink Lady Apples */
}

div.photoSample h5.caption.zoo.one {
    background-color: cornflowerblue;
}

div.photoSample h5.caption.zoo.two {
    background-color: burlywood;
}

div.photoSample h5.caption.zoo.three {
    background-color: orchid;
}

div.photoSample h5.caption.zoo.four {
    background-color: lightgreen;
}

div.photoSample h5.caption.shortMessage {
    margin-bottom: 0px;
    border-bottom: 0px solid;
    line-height: 2.3ex;
}

div.photoSample h5.caption.birthdayMessage, 
div.photoSample h5.caption.halloweenMessage,
div.photoSample h5.caption.memorialMessage {
    overflow-x: hidden;
}

div.photoSample h5.caption.authorCredit {
    background-color: whitesmoke;
    margin-top: 0px;
    border-top: 0px solid;
    word-break: break-all;
    line-height: 2.3ex;
}

div.photoSample h5.caption.familyTitle > span.condensed {
    /* Font changes break container size */
    letter-spacing: -1.5px;
}

div.photoSample h5.caption.familyTitle > span.ultraCondensed {
    letter-spacing: -2.5px;
}

.floatingTopBtn {
    position: fixed;
    right: 24px;
    bottom: 24px;

    width: 56px;
    height: 56px;

    border-radius: 999px;
    border: 1px solid #fff3;

    background: #2b532de0;
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;

    transition: opacity 0.2s ease, transform 0.2s ease;

    z-index: 9999;
}

.floatingTopBtn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.floatingTopBtn:hover {
    background: #264b28ec;
}

body.profile .floatingTopBtn {
    background: #633537e0;
}

body.profile .floatingTopBtn:hover {
    background: #532d2fec;
}

/* Portrait mode, default for iPhones and for frames that are in a 
   similar layout / resolution. Shorten the padding details, and turn
   the two-column results layout into a single-column layout. */
@media screen and (max-width: 670px) {
    button.logo {
        display: none;
    }
    
    button.menu {
        width: 80px;
        height: auto;
        padding: 0 0 0 0;
    }

    button.menu.message {
        width: 160px;   /* 2x a normal button size, for message text */
    }

    button.menu.flag {
        /* Divide 320px by number of buttons you expect to have per-row */
        /* For more than 5 buttons, use wide buttons to split across two rows */
        width: 80px;
    }

    div.buttonIcon {
        display: table-row;
        font-size: 24pt;
        padding: 0 0 0 0;
        text-align: center;
    }

    div.buttonText {
        display: table-row;
        font-size: 10pt;
        letter-spacing: -0.1ex;
        padding: 0 0 0 0;
        text-align: center;
        word-break: keep-all;  /* Fix iPhone text overflow for "Random" ja */
    }

    div.buttonText.message {
        /* Message buttons always have text to right of icon */
        display: table-cell;
        text-align: left;
    }

    div.buttonText.condensed, div.buttonText.message.condensed {
        font-size: 10pt;
        letter-spacing: -1px;
    }

    button.sectionButton {
        font-size: 10pt;
        padding: 0 0 0 0;
        height: 7.6ex;   /* Two lines of 10pt text */
    }

    button.sectionButton:active {
        padding: 0 0 0 0;
    }

    button.sectionButton.two {
        width: calc(98% / 2);
    }
    
    button.sectionButton.three {
        width: calc(98% / 3);
    }
    
    button.sectionButton.four {
        width: calc(98% / 4);
    }    

    div#contentFrame {
        padding-top: 0.1ex;
        padding-bottom: 0.1ex;
    }

    p.updatePhotosMessage {
        letter-spacing: -1px;
    }    

    div.pandaAbout, div.pandaLinks {
        position: relative;
        max-width: 100%;
        width: 100%;
        padding-left: 0px;
        padding-right: 0px;
        margin-left: 0px;
    }

    div.aboutTags {
        margin-left: 0px;
        margin-right: 0px;
    }

    input.search {
        padding-left: 4px;
        padding-bottom: 0vh;
        margin: 0 0 0 0;
    }

    div.pandaResult, div.zooResult, div.profileFrame {
        padding-bottom: 0ex;
        margin-top: 0.7ex;
        margin-bottom: 0.7ex;
        border: 0px solid;
    }

    div.profileDossier {
        display: block;
    }

    div.qrcodeFrame {
        width: 100%;
        margin-left: 0px;
    }

    div.emptyResult {
        display: none;
    }

    div.pandaPhoto, div.zooPhoto {
        display: block;
        text-align: center;
        padding-bottom: 0ex;
    }

    div.pandaPhoto img, div.zooPhoto img {
        width: 100%;
        height: auto;
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
        max-height: 100%;
    }

    div.pandaTitle, div.zooTitle {
        text-align: center;
        padding: 0 0 0 0;
    }

    div.gender {
	    margin-left: 0.5ex;
    }

    div.pandaName {
        margin-right: 0.5ex;
    }

    div.zooName {
        margin-left: 0.5ex;
        margin-right: 0.5ex;
    }

    div.pandaDossier, div.zooDossier, div.profileFrame, div.profileDossier {
        display: block;
        border: 0px solid;
    }

    div.family {
        flex-direction: row;
    }

    div.family.vertical.onlyDesktop {
        flex-direction: row;
    }

    div.family.vertical.onlyMobile {
        /* This requires JS to set a height for the flow to work */
        flex-direction: column;
    }

    div.family.vertical > div {
        width: 50%;
    }

    div.family.vertical > hr.divider {
        page-break-after: always;
    }

    div.profileFrame > div.profileDossier > ul.pandaList > li {
        margin-left: 4px;
    }

    div.parents, div.litter, div.siblings, div.children, div.names {
        text-align: left;
        flex-grow: 1;   /* Expand out things to simulate column gap in the lists */
        padding-left: 0px;
    }

    div.zooHistory, div.profilePhotos {
        flex-grow: 1;   /* Expand out things to simulate column gap in the lists */
        padding-left: 0px;
    }

    hr.divider.onlyDesktop {
        display: none;
    }

    hr.divider.onlyMobile {
        display: block;
    }

    div.pandaDetails p, div.zooDetails p {
        margin-left: 14px;
    }

    h2 {
        margin-left: 14px;
        margin-right: 8px;
    }

    h3, h4 {
        margin-left: 4px;    /* Panda family headings */
    }

    div.pandaAbout h4,
    div.pandaAbout h4.privacy {
        margin-left: 14px;   /* Author/about headings */
    }

    div.species h4 {
        text-decoration: none !important;
        margin-left: 8px;
    }

    ul.pandaList, ul.linkList, ul.nicknameList, ul.tagList, ul.zooList {
        list-style: none;
        text-align: left;
        padding-left: 0px;
    }

    h2.linksHeader {
        display: none;
    }

    ul.pandaList, ul.pandaList.double, ul.pandaList.triple {
        margin-left: 0px;   /* Get a little more space on mobile */
    }
    
    ul.linkList {
        margin-left: 14px;
    }

    ul.tagList {
        font-size: 13pt;   /* Assume tags might run long */
        letter-spacing: -1px;
        margin-left: 0px;
        margin-right: 0px;
    }

    ul.zooList {
        margin-left: 4px;
        margin-right: 4px;
    }

    ul.zooList li {
        padding-left: 1ex;
        padding-right: 1ex;
    }

    div.nicknameContainer, div.othernamesContainer {
        margin-left: 8px;
    }
    
    ul.pandaList.double, ul.pandaList.triple {
        column-gap: 0.7em;
    }

    ul.pandaList.double.onlyMobile {
        column-count: 2;
        column-gap: 0.7em;
    }

    /* On small screens, not enough room */
    ul.pandaList.triple, ul.pandaList.triple.onlyMobile {
        column-count: 2;
        column-gap: 0.7em;
    }

    div.profileSummary {
        margin-top: 0px;   /* Vertical rhythm things unnecessary on mobile */
    }

    div.frontPageSummary p.summaryEmphasis {
        padding-left: 0.6ex;
        padding-right: 0.6ex;
    }

    div.profile#contentFrame hr {
        display: none;   /* Vertical rhythm things unnecessary on mobile */
    }

    div.footer {
        text-align: left;
    }

    div.footer p {
        margin-left: 8px;
    }

    div.pandaAbout p, div.pandaLinks p {
        margin-left: 14px;
        margin-right: 8px;
    }

    ul.linkList.multiColumn {
        column-count: 1;
    }

    ul.tagList.multiColumn {
        column-count: 2;
    }

    div.photoSample {
        display: inline-block;
        width: 140px;
        margin-bottom: 10px;
        padding: 5px;
        vertical-align: top;
    }

    /* Don't want too small on mobile */
    div.photoSample.quarterPage {
        width: 45%;
    }

    /* Make the half-page items full-size on mobile */
    div.photoSample.halfPage,
    div.photoSample.fullPage {
        width: 100%;
        padding-left: 0px;
        padding-right: 0px;
    }

    div.photoSample.halfPage > img,
    div.photoSample.halfPage > a > img,
    div.photoSample.fullPage > img,
    div.photoSample.fullPage > a > img {
        border-left: 0px;
        border-right: 0px;
    }

    div.photoSample h5.caption.shortMessage {
        width: 100%;
    }

    div.photoSample h5.caption.birthdayMessage, 
    div.photoSample h5.caption.halloweenMessage,
    div.photoSample h5.caption.memorialMessage {
        width: 100%;
    }
    
    div.photoSample h5.caption.authorCredit {
        width: 100%;
    }

    div.photoSample.halfPage h5.caption,
    div.photoSample.fullPage h5.caption {
        width: 95%;
    }

    .floatingTopBtn {
        width: 48px;
        height: 48px;
        right: 10px;
        margin-bottom:4px
    }
}

/* Reduce padding between top menu icons on smaller screens */
@media screen and (max-width: 415px) {
    div.topMenu div.shrinker button.menu {
        width: fit-content
    }
    div.topMenu div.shrinker button.menu div.buttonContent {
        margin-left: 16px;
        margin-right: 16px;

    }
}

/* ================================================================
   v5 UI RESTYLE — appended override block (visual only, no DOM/JS
   changes). Everything above is the original structural base.
   Source of truth: design/panda-v5.css
   ================================================================ */
/* ============================================================
   Red Panda Finder — panda-v5.css  (rev 2)
   In-place UI restyle of the EXISTING landing DOM.
   Same elements, same ids/classes, zero functional change.
   rev 2: v4 color energy — visible blobs, lime primary action,
   grape/apple accents, white-framed hero photo, tagline stamp.
   ============================================================ */
/* Everything below OVERRIDES the base sheet. When porting, this whole
   block appends to css/panda.css (or ships as a second stylesheet). */

:root{
  --green-deep:#0E2E22; --green:#134C39; --green-800:#103F30;
  --lime:#C6F24E; --lime-2:#B4E63A; --lime-soft:#E7F7AE;
  --grape:#8E57C6; --grape-soft:#EBDDFA; --grape-deep:#6E3FA6;
  --apple:#E45140; --apple-soft:#FBD8D0;
  --cream:#F6F1E3; --white:#FFFFFF;
  --dim-dark:#9FBAA8; --ink-green:#123A2C;
  --ease:cubic-bezier(.34,1.4,.5,1);
}

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
  /* body{overflow-x:hidden} alone doesn't stop iOS Safari from panning
     horizontally when something overflows (the 100vw wave bands rely on
     clipping) — the viewport clip must live on html too. `clip` avoids
     creating a scroll container where supported; `hidden` is the fallback. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0; padding: 0;
  overflow-x: hidden;
  min-height: 100%;
  line-height: 1.4;
  font-size: 14pt;
  font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", system-ui, sans-serif;
  background-color: var(--green-deep);
  /* v4 blobs — big, bright, unmistakable */
  background-image:
    radial-gradient(circle 420px at 92% -80px,  #1E7A58 0%, transparent 68%),
    radial-gradient(circle 360px at -100px 88%, rgba(198,242,78,.34) 0%, transparent 68%),
    radial-gradient(circle 330px at 100% 44%,   rgba(142,87,198,.5)  0%, transparent 68%),
    radial-gradient(circle 280px at 22% 58%,    rgba(228,81,64,.34)  0%, transparent 68%),
    radial-gradient(circle 240px at 55% 8%,     rgba(87,183,194,.28) 0%, transparent 68%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* ---------- sticky header zone ---------- */
div#pageTop { position: sticky; top: 0px; z-index: 99999; }

/* ---------- top menu: floating pill bar ---------- */
div.topMenu, div.bottomMenu {
  display: block;
  text-align: center;
  max-height: none;
  margin: 12px auto 0;
  padding: 0 14px;
  color: white;
  background: transparent;
  border-bottom: 0;
  width: auto;
  max-width: 900px;
}

div.topMenu > div.shrinker, div.bottomMenu > div.shrinker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 868px;
  margin: 0 auto;
  padding: 7px;
  background: rgba(16,63,48,.78);
  border: 1px solid rgba(198,242,78,.35);   /* lime edge, not gray */
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 30px rgba(0,0,0,.28);
}

button.logo {
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--lime);
  color: white;
  line-height: 1;
  font-size: 15pt;
  font-family: "Baloo 2", "Jun 201", "Noto Emoji", sans-serif;
  background: var(--green-800);
  height: 46px; width: 56px;
  border-radius: 999px;
  float: none;
  margin-right: 2px;
  cursor: pointer;
  transform: rotate(-3deg);
  transition: transform .18s var(--ease);
}
button.logo:hover { transform: rotate(3deg) scale(1.06); background: var(--green); }

button.menu, button.menu.flag {
  display: inline-flex; align-items: center; justify-content: center;
  border: none;
  color: #EAF4EC;
  line-height: 1;
  font-size: 12.5pt;
  font-family: "Baloo 2", "Jun 201", "Noto Emoji", sans-serif;
  font-weight: 600;
  letter-spacing: .2px;
  background: rgba(255,255,255,.07);
  height: 46px;
  width: auto;
  padding: 0 16px;
  border-radius: 999px;
  transition: transform .18s var(--ease), background .15s, color .15s;
  cursor: pointer;
}
/* language picker entries: icons.js swaps the flag emoji for the
   language's native name (English / 日本語 …) — style as text pills */
button.menu.flag { width: auto; min-width: 52px; padding: 0 18px; background: rgba(255,255,255,.07); }
span.langName { font-weight: 700; letter-spacing: .3px; }

/* each action gets its own v4 accent */
button#randomButton {
  background: var(--lime);
  color: var(--green-deep);
  transform: rotate(-1.5deg);          /* the playful primary, like v4's badge */
}
button#randomButton:hover { background: var(--lime-2); transform: rotate(1deg) scale(1.04); }
button#aboutButton:hover   { background: var(--grape); color: #fff; }
button#linksButton:hover   { background: var(--apple); color: #fff; }
button#refreshButton:hover, button#languageButton:hover { background: var(--lime); color: var(--green-deep); }
button.menu:hover, button.menu.flag:hover { animation: none; }
button.menu:active, button.menu.flag:active, button.logo:active {
  animation: none;
  transform: scale(.95);
}

button.menu.disabled { background: transparent; color: #5e7a6b; }
button.menu.hidden { display: none; }

div.buttonContent { display: inline-flex; align-items: center; gap: 7px; border: none; margin: 0;
  user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; }
div.buttonIcon { display: block; font-size: 15pt; padding: 0; text-align: center;
  user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; }
div.buttonText { display: block; text-align: left;
  user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; }
div.buttonText.condensed { letter-spacing: -1px; font-size: 12pt; }
button.menu.flag > div.buttonContent > div.buttonIcon { padding: 0; }

/* ---------- language menu ---------- */
div.languageMenu {
  display: none;               /* unchanged: JS toggles it */
  text-align: center;
  margin: 8px auto 0;
  padding: 0 14px;
  background: transparent;
  border-bottom: 0;
  width: auto;
  max-width: 900px;
}
div.languageMenu > div.shrinker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  background: rgba(16,63,48,.85);
  border: 2px dotted var(--lime);
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

/* ---------- search: floating white pill + lime submit ---------- */
div.topSearch, div.bottomSearch {
  display: block;
  height: auto;
  background: transparent;
  width: auto;
  margin: 16px auto 0;
  padding: 0 14px;
  max-width: 900px;
}
div.bottomSearch { display: none; }
/* profile pages: Show.searchBar.toggle reveals #bottomSearch with an
   inline `display:table` — force full width so the table-mode box
   still spans the column like the top bar does */
div.bottomSearch {
  width: 100%;
  box-sizing: border-box;
}

div.topSearch > div.shrinker,
div.bottomSearch > div.shrinker {
  max-width: 868px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 18px 38px rgba(0,0,0,.3);
}
/* the flex row is what pins #searchSubmit (first in the form's DOM) to
   the right end — without it the lime button stacks ABOVE the input,
   which is exactly what happened on the profile bottom bar */
div.topSearch form,
div.bottomSearch form {
  display: flex;
  align-items: center;
  margin: 0; padding: 0;
}

input.search {
  font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", sans-serif;
  font-weight: 700;
  border-radius: 999px;
  -webkit-appearance: none;
  font-size: 21px;
  width: 100%;
  border: 0;
  outline: 0;
  vertical-align: middle;
  margin: 0;
  padding: 0 8px 0 22px;
  height: 52px;
  color: var(--ink-green);
  background: transparent;
}
input.search::placeholder { color: #9aab9d; font-weight: 700; }
input.search[disabled] { background: transparent; color: transparent; }
input.search[disabled]::placeholder { background: transparent; color: #c9d4c6; }

/* the submit input becomes the visible lime search button */
input#searchSubmit {
  display: block;
  order: 2;                    /* sits at the right end of the pill */
  flex: none;
  width: 52px; height: 52px;
  border: 0;
  border-radius: 999px;
  font-size: 0;                /* hide the browser's "Submit" text */
  color: transparent;
  cursor: pointer;
  background-color: var(--lime);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='11' cy='11' r='6.5' fill='none' stroke='%230E2E22' stroke-width='2.6'/><path d='M16 16l4.5 4.5' stroke='%230E2E22' stroke-width='2.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 24px;
  background-position: center;
  transition: transform .18s var(--ease), background-color .15s;
}
input#searchSubmit:hover  { background-color: var(--lime-2); transform: scale(1.05); }
input#searchSubmit:active { transform: scale(.94); }

/* ---------- landing photo: white-framed hero card, full color ---------- */
/* NOTE: the source photo is BLACK & WHITE — the old sheet tinted it with
   opacity .4 over a gradient. Keep the tint idea, push it to v4 colors:
   green→lime duotone instead of a washed-out gray. */
img.fullFrame {
  display: block;
  width: calc(100% - 44px);
  max-width: 1060px;
  height: min(52vh, 540px);
  margin: 24px auto 0;
  object-fit: cover;
  opacity: 1;
  background: var(--green-800);
  /* B/W source → rich green duotone */
  filter: sepia(1) hue-rotate(58deg) saturate(1.35) brightness(.8) contrast(1.1);
  border: 10px solid var(--white);          /* v4 white card frame */
  border-radius: 30px;
  box-shadow: 0 24px 48px rgba(0,0,0,.4);
  transform: rotate(-.6deg);                /* a hint of the v4 sticker tilt */
}

/* ---------- tagline: the hidden site slug becomes a stamp on the photo ----------
   Real content that was always in the page ("Learn about red pandas at your
   local zoo!") — shown only while the landing photo is on screen. */
body:has(img.fullFrame) div.hiddenSlug {
  display: block;
  text-align: center;
  position: relative;
  z-index: 2;
  margin: -30px auto 0;
  padding: 0 14px;
}
body:has(img.fullFrame) div.hiddenSlug p {
  display: inline-block;
  margin: 0;
  background: var(--apple);
  color: #fff;
  font-family: "Baloo 2", "Jun 201", "Noto Emoji", sans-serif;
  font-weight: 600;
  font-size: 16.5pt;
  padding: 12px 26px;
  border-radius: 999px;
  transform: rotate(1.8deg);
  box-shadow: 0 14px 28px rgba(0,0,0,.35);
}
div.hiddenSlug { display: none; }           /* everywhere else: hidden as before */

/* ============================================================
   RESULTS VIEW — same DOM (pandaResult / pandaDossier / family),
   v4 card language instead of the table-strip look.
   ============================================================ */

/* contentFrame becomes a transparent column; blobs show through */
div#contentFrame {
  padding: 1.5ex 14px 4ex;
  margin: 0 auto;
  max-width: 900px;
  z-index: 1;
  background: transparent;
}

/* result card: green table w/ khaki cells → white rounded card */
div.pandaResult, div.zooResult {
  display: flex;
  align-items: stretch;
  clear: both;
  margin: 18px auto;
  max-width: 868px;
  border: 0;
  background-color: var(--white);
  color: var(--ink-green);
  text-align: left;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.32);
}

/* photo cell: black slab → soft green frame area */
div.pandaPhoto, div.zooPhoto {
  display: block;
  flex: none;
  align-self: stretch;
  background-color: var(--green-800);
  position: relative;
  user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none;
}
div.pandaPhoto img, div.zooPhoto img {
  width: 320px;
  height: 100%;
  min-height: 280px;
  max-width: 320px;
  max-height: none;
  object-fit: cover;
  z-index: 1;
}

/* photo counter: hard black box → rounded pill */
span.navigator {
  position: absolute;
  top: 10px; left: 10px;
  height: auto;
  z-index: 2;
  background-color: rgba(0,0,0,.55);
  color: white;
  font-family: "Baloo 2", "Jun 201", "Noto Emoji", sans-serif;
  font-size: 13pt;
  border: 0;
  border-radius: 999px;
  text-align: center;
  padding: 3px 14px;
  width: auto;
  backdrop-filter: blur(6px);
}
span.navigator.threeDigits, span.navigator.fourDigits {
  font-size: 12pt;
  letter-spacing: 0;
  line-height: 1.5;
  padding: 3px 12px;
}

/* dossier cell */
div.pandaDossier, div.zooDossier {
  display: block;
  flex: 1;
  vertical-align: top;
  background-color: var(--white);   /* pink lady → white */
  border-left: 0;
  min-width: 0;
}

/* title: yellowgreen strip → roomy Fredoka header */
div.pandaTitle, div.zooTitle {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  min-width: 0;
  min-height: 0;
  background-color: transparent;
  padding: 16px 20px 4px;
}
div.pandaTitle:hover { animation: none; background-color: transparent; }
div.pandaTitle:hover div.pandaName { color: var(--grape-deep); }
div.pandaName, div.zooName {
  font-family: "Baloo 2", "Jun 201", "Noto Emoji", sans-serif;
  font-size: 20pt;
  color: var(--ink-green);
  transition: color .15s;
}
p.furigana { display: inline; font-size: 60%; margin-left: 1ex; color: #7C8A78; }

/* details: solid grape stripe → soft grape chip row */
div.pandaDetails, div.zooDetails {
  display: block;
  min-width: 0;
  background-color: transparent;
  padding: 6px 14px 4px;
}
div.pandaDetails p, div.zooDetails p {
  display: inline-block;
  margin: 4px;
  padding: 6px 14px;
  background: var(--grape-soft);
  color: var(--grape-deep);
  font-weight: 700;
  font-size: 12pt;
  border-radius: 999px;
}
div.pandaDetails p a, div.zooDetails p a { color: var(--grape-deep) !important; }

/* family: pink block → cream card with mini headings */
div.family {
  display: flex;
  flex-direction: row;
  min-width: 0;
  flex-wrap: wrap;
  overflow: hidden;
  background: var(--cream);
  border-radius: 18px;
  margin: 10px 18px 18px;
  padding: 6px 8px 10px;
}
div.parents, div.litter, div.siblings, div.children, div.names {
  display: inline-block;
  vertical-align: top;
  margin-left: 10px;
  flex-grow: 0.1;
  min-width: 0;
}
/* Layout.js sometimes picks a "vertical" column layout whose fixed 30%
   column widths overflow the new card (4 cols = 120%). Force row+wrap
   with natural widths — the pill lists handle wrapping fine. */
div.family.vertical, div.family.vertical.onlyDesktop { flex-direction: row; }
div.family.vertical.onlyDesktop > div,
div.family.vertical.onlyDesktop > div.double,
div.family.vertical.onlyDesktop > div.triple { width: auto; }
h4.parentsHeading, h4.litterHeading, h4.siblingsHeading, h4.childrenHeading {
  font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", sans-serif;
  font-size: 10.5pt;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #7C8A78;
  margin: 10px 0 4px;
}
ul.pandaList li > a, ul.linkList li > a, ul.tagList li > a {
  display: inline-block;
  padding: 3px 10px;
  margin-bottom: 2px;
  border-radius: 999px;
  font-weight: 700;
  transition: background .15s;
}
ul.pandaList li > a:hover { background: var(--lime-soft); }
ul.pandaList li a.passedAway { color: #6e695f; }

/* links inside cards stay ink, not harsh black */
div.pandaTitle a, div.pandaDossier a, div.pandaFamily a, div.zooDossier a,
div.profileDossier a, div.zooHistory a {
  text-decoration: none !important;
  color: var(--ink-green);
}

/* empty result: keep the joke image, frame it like everything else */
div.emptyResult {
  display: block;
  position: relative;
  clear: both;
  height: auto;
  max-height: none;
  margin: 18px auto;
  max-width: 640px;
  text-align: center;
  border: 0;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.32);
}
div.emptyResult img { height: auto; width: 100%; max-height: 520px; object-fit: cover; }
div.emptyResult div.overlay {
  position: absolute;
  font-size: 20pt;
  font-family: "Baloo 2", "Jun 201", "Noto Emoji", sans-serif;
  color: white;
  top: auto; bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.5);
  padding: 8px 22px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

/* results on phones: photo on top, dossier below */
@media (max-width: 700px) {
  div.pandaResult, div.zooResult { flex-direction: column; margin: 14px auto; }
  div.pandaPhoto img, div.zooPhoto img {
    width: 100%; max-width: none; height: 260px; min-height: 0;
  }
}

/* ============================================================
   PROFILE VIEW — v4 "PART 2": red-brown theme → cream + white
   cards + grape accents. Compound .profile selectors need
   explicit overrides (they out-rank the generic rules).
   ============================================================ */
body.profile {
  background-color: var(--cream);
  background-image:
    radial-gradient(circle 320px at -70px -70px,  rgba(198,242,78,.4)  0%, transparent 68%),
    radial-gradient(circle 280px at 105% 30%,     rgba(142,87,198,.22) 0%, transparent 68%),
    radial-gradient(circle 260px at -60px 75%,    rgba(228,81,64,.16)  0%, transparent 68%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--ink-green);
}

/* menus keep the same dark pill bar on cream */
div.topMenu.profile, div.bottomMenu.profile, div.languageMenu.profile {
  background: transparent;
  border-bottom: 0;
}
button.menu.profile, button.menu.flag.profile { background: rgba(255,255,255,.07); color: #EAF4EC; }
button.logo.profile { background: var(--green-800); }
button.menu.profile:hover, button.menu.flag.profile:hover, button.logo.profile:hover {
  animation: none;
  background: var(--lime);
  color: var(--green-deep);
}

/* goldenrod radial → let the cream body show */
div#contentFrame.profile { background: transparent; }

/* pink name strip → white hero card */
div.profile.nameBar {
  font-family: "Baloo 2", "Jun 201", "Noto Emoji", sans-serif;
  font-size: 30pt;
  width: auto;
  max-width: 868px;
  margin: 14px auto 0;
  padding: 10px 18px;
  background-color: var(--white);
  text-align: center;
  border-radius: 24px;
  box-shadow: 0 14px 32px rgba(18,58,44,.12);
}

/* khaki table frames → white cards */
div.profileFrame {
  display: block;
  margin: 14px auto;
  max-width: 868px;
  border: 0;
  background-color: var(--white);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(18,58,44,.1);
}
div.profileFrame.zoos { background-color: transparent; border: 0; box-shadow: none; }
div.profileDossier {
  display: block;
  width: auto;
  background-color: var(--white);
  border-left: 0;
  padding: 4px 12px 10px;
}

/* profile dossier card: 320px photo cell on the left, info fills the right
   (same grid as the results cards; small photos no longer blow up full-width) */
div.profileFrame:has(> div.pandaPhoto) {
  display: flex;
  align-items: stretch;
}
div.profileFrame div.profileDossier {
  flex: 1;
  min-width: 0;
}
@media (max-width: 700px) {
  div.profileFrame:has(> div.pandaPhoto) { flex-direction: column; }
}

/* section menu: yellowgreen blocks → pills, plum selected → grape */
div.sectionMenu { margin: 12px auto 4px; text-align: center; }
button.sectionButton {
  display: inline-block;
  border: 0;
  line-height: 1.3;
  font-size: 12pt;
  font-family: "Baloo 2", "Jun 201", "Noto Emoji", sans-serif;
  font-weight: 600;
  background-color: var(--white);
  color: var(--ink-green);
  height: auto;
  padding: 10px 18px;
  margin: 3px 2px;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(18,58,44,.12);
  cursor: pointer;
  transition: transform .18s var(--ease), background .15s, color .15s;
}
button.sectionButton:hover { animation: none; background-color: var(--lime); color: var(--green-deep); }
button.sectionButton:active { animation: none; transform: scale(.95); }
button.sectionButton.selected { background-color: var(--grape); color: #fff; }

/* detail strips: grays → soft cards */
div.detailsNameTitle { background-color: var(--cream); border-radius: 10px 10px 0 0; font-weight: 800; }
div.detailsName { background-color: var(--white); border: 0; }
div.detailsLocation { background-color: var(--cream-2, #FBF7EC); margin-bottom: 1ex; border-radius: 0 0 10px 10px; }
div.detailsVideo { background-color: var(--green-800); border: 0; border-radius: 14px; overflow: hidden; }

/* profile back-to-top: brown → grape */
body.profile .floatingTopBtn { background: var(--grape); color: #fff; }
body.profile .floatingTopBtn:hover { background: var(--grape-deep); }

/* ============================================================
   ABOUT / LINKS / SUMMARIES / GALLERY CARDS
   ============================================================ */
div#contentFrame.about, div#contentFrame.links { background: transparent; }

/* summary chips: bordered grape/salmon blocks → v4 soft pills */
div.arrivalsHeader p, div.birthdaySummary p, div.creditSummary p,
div.departuresHeader p, div.frontPageSummary p, div.memorialSummary p,
div.profileSummary p, div.residentsHeader p, div.tagSummary p {
  display: inline-block;
  background-color: var(--grape-soft);
  background-image: none;
  color: var(--grape-deep);
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  margin: 1ex 0.5ex;
  font-weight: 700;
}
div.arrivalsHeader p, div.departuresHeader p, div.residentsHeader p {
  background-color: var(--apple-soft);
  color: #C43A2C;
  min-width: 0;
}
p.summaryEmphasis > a { color: inherit; text-decoration: none !important; }
div.birthdaySummary p.summaryEmphasis {
  background-image: none; background-color: var(--grape); color: #fff;
}
div.frontPageSummary p.summaryEmphasis {
  background-image: none;
  background-color: var(--lime);
  color: var(--green-deep);
  font-family: "Baloo 2", "Jun 201", "Noto Emoji", sans-serif;
  font-size: 17pt;
  border-radius: 999px;
  padding: 10px 24px;
}
div.frontPageSummary a:hover > p.summaryEmphasis {
  animation: none;
  background: var(--lime-2);
}
div.birthdaySummary a:hover > p, div.memorialSummary a:hover > p, div.tagSummary a:hover > p {
  animation: none;
  background-color: var(--grape);
  color: #fff;
}

/* gallery cards (front-page updates, tag pages, memorials) */
div.photoSample {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: top;
}
div.photoSample > img, div.photoSample > a > img {
  border: 0;
  border-radius: 14px;
  width: 100%;
  aspect-ratio: 1 / 1;          /* uniform card heights → captions line up */
  object-fit: cover;
  box-shadow: 0 10px 22px rgba(0,0,0,.3);
}
div.photoSample > a { width: 100%; display: block; }
/* the old sheet forces width:100% on these caption variants with higher
   specificity — pin them all back to a consistent pill width */
div.photoSample h5.caption.groupMediaAuthor,
div.photoSample h5.caption.groupMediaName,
div.photoSample h5.caption.updateName,
div.photoSample h5.caption.updateAuthor,
div.photoSample h5.caption.updateAuthorCredit,
div.photoSample h5.caption.updateTagName,
div.photoSample h5.caption.birthdayMessage,
div.photoSample h5.caption.halloweenMessage,
div.photoSample h5.caption.memorialMessage,
div.photoSample h5.caption.authorCredit {
  width: 92%;
  overflow-x: hidden;
}
div.photoSample h5 { margin-top: 5px; margin-bottom: 0; }
div.photoSample h5 + h5, div.photoSample a + h5 { margin-top: 3px; }
div.photoSample h5 {
  border: 0;
  border-radius: 999px;
  font-family: "M PLUS Rounded 1c", "Jun 201", "Noto Emoji", sans-serif;
  font-weight: 800;
  width: 92%;
  padding: 2px 6px;
}
div.photoSample h5.caption.familyName, div.photoSample h5.caption.groupMediaName,
div.photoSample h5.caption.updateName, div.photoSample h5.caption.pandaName,
div.photoSample h5.caption.zooName, div.photoSample h5.caption.updateTagName {
  background-color: var(--lime-soft);
  color: var(--green);
}
div.photoSample h5.caption.familyTitle, div.photoSample h5.caption.groupMediaAuthor,
div.photoSample h5.caption.updateAuthor, div.photoSample h5.caption.updateAuthorCredit,
div.photoSample h5.caption.authorCredit {
  background-color: rgba(255,255,255,.9);
  color: var(--ink-green);
  border-top: 0;
  /* the base sheet pins margin-top:0 on these author pills with 0-3-2
     specificity, which glued them to the name pill above — match the
     specificity here (later in cascade wins) to restore the gap */
  margin-top: 6px;
}
div.photoSample h5.caption.newContributor { background-color: var(--grape-soft); color: var(--grape-deep); }
div.photoSample a:hover > h5.caption.familyName,
div.photoSample a:hover > h5.caption.groupMediaName,
div.photoSample a:hover > h5.caption.memorialMessage,
div.photoSample a:hover > h5.caption.pandaName,
div.photoSample a:hover > h5.caption.updateName,
div.photoSample a:hover > h5.caption.updateTagName,
div.photoSample a:hover > h5.caption.zooName {
  animation: none;
  background-color: var(--lime);
}
div.photoSample a:hover > h5.caption.groupMediaAuthor,
div.photoSample a:hover > h5.caption.updateAuthor {
  animation: none;
  background-color: var(--white);
}

/* ------------------------------------------------------------
   v4-style wave section divider (landing page)
   The last child of div#contentFrame.birthdayPandas is always the
   "new photos this week" gallery (banner + photoSample cards) —
   see Page.home.render + Gallery.updatedNewPhotoCredits. Turn it
   into a full-bleed cream band with the prototype-v4 wave edges.
   birthdayPandas is only ever set on the landing frame, so this
   cannot leak into results/profile views. CSS-only, zero DOM/JS.
   ------------------------------------------------------------ */
div#contentFrame.birthdayPandas > div:last-child {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100vw;                        /* break out of the 900px column */
  margin-left: calc(50% - 50vw);       /* body has overflow-x:hidden */
  margin-top: 88px;                    /* breathing room for the top wave */
  margin-bottom: 76px;                 /* …and the bottom wave */
  /* keep inner content aligned to the same 900px column */
  padding: 6px max(14px, calc(50vw - 436px)) 30px;
  background: var(--cream);
}
div#contentFrame.birthdayPandas > div:last-child::before,
div#contentFrame.birthdayPandas > div:last-child::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 64px;
  pointer-events: none;
  /* same curve as prototype-v4-mobile.html's .wave svg */
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 70" preserveAspectRatio="none"><path d="M0 40 C 240 80 480 0 720 30 C 960 60 1200 10 1440 34 L1440 70 L0 70 Z" fill="%23F6F1E3"/></svg>') center / 100% 100% no-repeat;
}
div#contentFrame.birthdayPandas > div:last-child::before { top: -63px; }
div#contentFrame.birthdayPandas > div:last-child::after { bottom: -63px; transform: scaleY(-1); }
/* on the cream band, soften the dark-background card shadows */
div#contentFrame.birthdayPandas > div:last-child div.photoSample > img,
div#contentFrame.birthdayPandas > div:last-child div.photoSample > a > img {
  box-shadow: 0 10px 22px rgba(18,58,44,.16);
}
div#contentFrame.birthdayPandas > div:last-child div.photoSample h5.caption.updateAuthor,
div#contentFrame.birthdayPandas > div:last-child div.photoSample h5.caption.updateAuthorCredit {
  background-color: var(--white);
  box-shadow: 0 3px 8px rgba(18,58,44,.10);
}

/* zoo count blocks: pink/bordered → soft cards */
ul.zooCounts { background-color: var(--cream); border-radius: 14px; }
ul.zooList { border: 0; background-color: var(--white); border-radius: 14px; box-shadow: 0 8px 18px rgba(18,58,44,.08); }

/* qr code frame */
div.qrcodeFrame button { background-color: var(--white); border: 4px solid var(--lime); border-radius: 20px; }
div.qrcodeFrame button:hover { border-color: var(--lime-2); }

/* bottom menu (Options / paging): hug its buttons, don't span the page */
div.bottomMenu > div.shrinker {
  width: fit-content;
  min-width: 0;
  margin: 0 auto 14px;
  padding: 7px 10px;
}
/* no visible buttons → no empty pill (old sheet used a max-height hack) */
div.bottomMenu:not(:has(button:not(.hidden))) { display: none; }

/* footer: solid green/brown strip → quiet transparent line */
div.footer, div.footer.profile {
  display: block;
  width: auto;
  text-align: center;
  font-size: 10pt;
  background-color: transparent;
  color: var(--dim-dark);
  padding: 14px 0 20px;
}
div.footer.profile { color: #7C8A78; }
div.footer a { color: inherit; font-weight: 700; }
div.footer p { padding: 0.5ex 14px; }

/* ---------- back-to-top ---------- */
.floatingTopBtn {
  position: fixed;
  right: 18px; bottom: 18px;
  width: 52px; height: 52px;
  border: 0;
  border-radius: 999px;
  background: var(--lime);
  color: var(--green-deep);
  display: grid; place-items: center;
  box-shadow: 0 12px 26px rgba(0,0,0,.35);
  cursor: pointer;
  transition: transform .18s var(--ease);
  z-index: 999;
}
.floatingTopBtn:hover { transform: translateY(-2px) scale(1.05); background: var(--lime-2); }
.floatingTopBtn:active { transform: scale(.94); }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  div.topMenu > div.shrinker { gap: 2px; flex-wrap: wrap; }
  button.menu { padding: 0 11px; font-size: 12pt; flex: 1; }
  div.buttonText { display: none; }        /* icon-only pills on phones */
  button.logo { width: 46px; }
  div.buttonIcon { font-size: 16pt; }
  input.search { font-size: 17px; height: 46px; padding-left: 16px; }
  input#searchSubmit { width: 46px; height: 46px; background-size: 21px; }
  img.fullFrame { width: calc(100% - 28px); height: 48vh; border-radius: 22px; border-width: 7px; margin-top: 16px; }
  body:has(img.fullFrame) div.hiddenSlug p { font-size: 13pt; padding: 10px 18px; }
  body:has(img.fullFrame) div.hiddenSlug { margin-top: -24px; }
}

/* neutralize the base sheet's ≤415px table-era menu rules: their
   0,3,3-specificity selectors beat the v5 pill styles above and blew
   each button up by 32px of buttonContent margin, overflowing both
   the top-menu oval and the viewport on small phones (iPhone mini). */
@media screen and (max-width: 415px) {
  div.topMenu div.shrinker button.menu { width: auto; }
  div.topMenu div.shrinker button.menu div.buttonContent {
    margin-left: 0;
    margin-right: 0;
  }
}

/* ---- Lucide inline icons (js/icons.js) ------------------------
   span.lx wraps each replaced emoji; svg inherits currentColor.  */
span.lx {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.15em;
}
span.lx svg {
  display: block;
  width: 100%;
  height: 100%;
}
div.buttonIcon span.lx {          /* nav buttons: bigger, centered */
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
}
span.lx.lxe {                     /* native color emoji (🌈 deceased marker) */
  width: auto;
  height: 1em;                    /* don't inflate the row line box */
  line-height: 1;
  margin: 0 0.12em;
  vertical-align: -0.1em;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
/* dossier info chips: solid icons so they read as icons, not glyphs */
div.pandaDossier span.lx svg,
div.zooDossier span.lx svg,
div.profileDossier span.lx svg { fill: currentColor; }
div.family span.lx svg { fill: none; }

/* ================================================================
   ENTITY PAGES: native color emoji  (2026-07 revert)
   Panda/zoo result cards and profile pages go back to the original
   color emoji (location 🏡/🗺️, family 👩🏻/👨🏻, birthday 🐣, etc.).
   The monochrome "Noto Emoji" font stays for the site chrome only,
   so it is simply dropped from the stack inside entity containers —
   emoji then fall back to the system color emoji font.
   ================================================================ */
div.pandaResult, div.pandaResult *,
div.zooResult, div.zooResult *,
div.profileFrame, div.profileFrame *,
div.mediaFrame, div.mediaFrame *,
div.profilePhotos, div.profilePhotos *,
div.zooHistory, div.zooHistory * {
  font-family: "M PLUS Rounded 1c", "Jun 201", system-ui, sans-serif;
}
/* restate the display-font elements the wildcard above clobbered
   (same look as before, just without the mono emoji font) */
span.navigator,
div.pandaName, div.zooName,
div.emptyResult div.overlay,
button.sectionButton {
  font-family: "Baloo 2", "Jun 201", sans-serif;
}
/* caption pills: "div.photoSample h5" outranks the wildcard above,
   so drop the mono emoji font at matching specificity here */
div.profilePhotos div.photoSample h5,
div.profileFrame div.photoSample h5,
div.mediaFrame div.photoSample h5 {
  font-family: "M PLUS Rounded 1c", "Jun 201", sans-serif;
}

/* ================================================================
   GENDER BADGES: make sex readable at a glance.
   The bare ♂/♀ glyph images are hard to tell apart, so each one
   becomes a white symbol on a color-coded pill:
   male = blue, female = pink, unknown = gray.
   ================================================================ */
/* Filtering the <img> would also invert its background, so the pill
   color lives on the parent div.gender via :has(). Browsers without
   :has() keep the plain black glyphs (no white-on-white risk). */
@supports selector(div:has(img)) {
  div.gender {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 2.5pt 4.5pt;
  }
  div.gender img { filter: brightness(0) invert(1); }  /* glyph → white */
  div.gender:has(img[src="images/male.svg"])    { background: #2F6DC9; }
  div.gender:has(img[src="images/female.svg"])  { background: #D6448C; }
  div.gender:has(img[src="images/unknown.svg"]) { background: #8A9A8F; }
  div.gender.profile { padding: 4pt 7pt; }
  div.gender.caption { padding: 1.5pt 2.5pt; }
}

/* ================================================================
   ABOUT PAGE — typography polish + playful tag capsules
   (CSS-only, no DOM/JS changes. Scoped to div#contentFrame.about
   and div.aboutTags so nothing leaks into other views.)
   ================================================================ */

/* ---------- typography ---------- */
div#contentFrame.about div.pandaAbout {
  color: #EAF4EC;                    /* softer than pure white */
  max-width: 760px;                  /* comfortable reading measure */
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
}
div#contentFrame.about div.pandaAbout h2 {
  font-family: "Baloo 2", "Jun 201", "Noto Emoji", sans-serif;
  font-size: 25pt;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
  margin: 1.2em 0 0.4em;
  line-height: 1.2;
}
/* lime brush-stroke under each heading */
div#contentFrame.about div.pandaAbout h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--lime-2));
}
div#contentFrame.about div.pandaAbout p {
  line-height: 1.7;
  margin: 0.7em 0;
}
div#contentFrame.about div.pandaAbout > ul:not(.tagList) {
  margin-top: 0.8ex;
  margin-bottom: 1.2ex;
  padding-left: 1.2em;
}
div#contentFrame.about div.pandaAbout > ul:not(.tagList) > li {
  line-height: 1.6;
  margin-bottom: 0.7em;
  padding-left: 0.3em;
}
div#contentFrame.about div.pandaAbout > ul:not(.tagList) > li::marker {
  content: "🐾 ";
  font-size: 90%;
}
/* body links: lime underline accent instead of default blue-ish */
div#contentFrame.about div.pandaAbout > p > a,
div#contentFrame.about div.pandaAbout > ul:not(.tagList) > li > a {
  color: #fff;
  font-weight: 700;
  text-decoration-color: var(--lime);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
div#contentFrame.about div.pandaAbout > p > a:hover,
div#contentFrame.about div.pandaAbout > ul:not(.tagList) > li > a:hover {
  color: var(--lime);
}
/* italic keywords (Search, Enter, Random) → little cream keycap chips */
div#contentFrame.about div.pandaAbout > ul:not(.tagList) > li > i {
  font-style: normal;
  font-weight: 700;
  background: rgba(255,255,255,.14);
  border-radius: 7px;
  padding: 0 7px;
  margin: 0 1px;
}
/* photo captions */
div#contentFrame.about div.pandaAbout h5.caption {
  color: var(--dim-dark);
  font-size: 11pt;
  font-weight: 500;
  line-height: 1.5;
}
div#contentFrame.about div.pandaAbout h5.caption > a { color: var(--dim-dark); font-weight: 700; }
/* author credit under "About Red Pandas" */
div#contentFrame.about div.pandaAbout h4 > a {
  display: inline-block;
  font-style: normal;
  font-weight: 700;
  background: var(--grape-soft);
  color: var(--grape-deep);
  border-radius: 999px;
  padding: 3px 14px;
}

/* ---------- Search Tips tag capsules ---------- */
/* the JS fills div.aboutTags with ul.tagList.multiColumn; flex-wrap
   beats the 3-column layout for pills (column-count is ignored on
   flex containers, so the old rules are harmless) */
div.aboutTags {
  margin-left: auto;
  margin-right: auto;
  max-width: 820px;
}
div.aboutTags ul.tagList,
div.aboutTags ul.tagList.multiColumn {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px 8px;
  margin: 1.5ex 0 3ex;
  padding: 0;
}
div.aboutTags ul.tagList li { line-height: 1.2; }
div.aboutTags ul.tagList li > a {
  display: inline-block;
  padding: 6px 15px;
  margin: 0;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12.5pt;
  text-decoration: none !important;
  box-shadow: 0 4px 10px rgba(0,0,0,.22);
  transition: transform .18s var(--ease), filter .15s;
}
div.aboutTags ul.tagList li > a:hover {
  transform: translateY(-2px) scale(1.05) rotate(-1deg);
  filter: brightness(1.06);
}
div.aboutTags ul.tagList li > a:active { transform: scale(.94); }
/* 5-color candy cycle from the v5 palette */
div.aboutTags ul.tagList li:nth-child(5n+1) > a { background: var(--lime-soft);  color: var(--green-deep); }
div.aboutTags ul.tagList li:nth-child(5n+2) > a { background: var(--grape-soft); color: var(--grape-deep); }
div.aboutTags ul.tagList li:nth-child(5n+3) > a { background: var(--apple-soft); color: #B33325; }
div.aboutTags ul.tagList li:nth-child(5n+4) > a { background: var(--cream);      color: var(--ink-green); }
div.aboutTags ul.tagList li:nth-child(5n+5) > a { background: #CDEFF2;           color: #23616B; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  div#contentFrame.about div.pandaAbout h2 { font-size: 20pt; }
  div.aboutTags ul.tagList li > a { font-size: 11.5pt; padding: 5px 12px; }
}

/* ================================================================
   LINKS PAGE — typography matched to the v5 About treatment
   (CSS-only, scoped to div#contentFrame.links. Covers all four
   tabs: community / zoos / instagrams / special-thanks.)
   ================================================================ */
div#contentFrame.links div.pandaLinks {
  color: #EAF4EC;                    /* softer than pure white */
  max-width: 760px;                  /* comfortable reading measure */
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
}
div#contentFrame.links h2.linksHeader {
  font-family: "Baloo 2", "Jun 201", "Noto Emoji", sans-serif;
  font-size: 25pt;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
  margin: 1.2em 0 0.4em;
  line-height: 1.2;
}
/* lime brush-stroke under the heading, same as About */
div#contentFrame.links h2.linksHeader::after {
  content: "";
  display: block;
  width: 64px;
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--lime-2));
}
div#contentFrame.links div.pandaLinks p {
  line-height: 1.7;
  margin: 0.7em 0;
}
div#contentFrame.links div.pandaLinks ul.linkList {
  margin: 1.2ex 0 3ex;
  padding-left: 0;
}
div#contentFrame.links div.pandaLinks ul.linkList li {
  line-height: 1.6;
  margin-bottom: 0.6em;
  break-inside: avoid;               /* multiColumn: keep item + flags together */
  /* hanging indent: wrapped lines align after the marker icon */
  padding-left: calc(1em + 8px);
  text-indent: calc(-1em - 8px);
}
div#contentFrame.links ul.linkList.multiColumn { column-gap: 2.5em; }
/* links: lime underline accent, same as About body links.
   (base sheet pins text-decoration:none !important at 0-1-4;
   match !important with higher specificity to win) */
div#contentFrame.links div.pandaLinks ul.linkList li > a,
div#contentFrame.links div.pandaLinks > p > a {
  color: #fff;
  font-weight: 700;
  /* base sheet's `text-decoration: none !important` shorthand pins
     line/color/thickness as important — override each longhand */
  text-decoration-line: underline !important;
  text-decoration-color: var(--lime) !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px;
  /* base sheet's display:inline-block turns long "name + flags" into one
     atomic box that overflows its column — let it wrap like normal text */
  display: inline;
  overflow-wrap: anywhere;
  text-indent: 0;
}
div#contentFrame.links div.pandaLinks ul.linkList li > a:hover,
div#contentFrame.links div.pandaLinks > p > a:hover {
  color: var(--lime);
}
/* special-thanks underlined non-links keep the same accent */
div#contentFrame.links div.pandaLinks ul.linkList li u {
  text-decoration-color: var(--lime);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
/* list-marker emoji (🎍 ❤️ 🐼): slightly smaller, steady spacing */
div#contentFrame.links div.pandaLinks ul.linkList li:before {
  font-size: 90%;
  margin-right: 8px;
}
/* zoos tab: the data assigns 🐼 — that's a giant panda, wrong species for
   this site — use a lime Lucide paw print instead (matches About's 🐾) */
div#contentFrame.links div#zooLinks ul.linkList li:before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  background-color: var(--lime);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='4' r='2'/%3E%3Ccircle cx='18' cy='8' r='2'/%3E%3Ccircle cx='20' cy='16' r='2'/%3E%3Cpath d='M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='4' r='2'/%3E%3Ccircle cx='18' cy='8' r='2'/%3E%3Ccircle cx='20' cy='16' r='2'/%3E%3Cpath d='M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* instagram tab: the data assigns the 🎍 marker, which renders as an ugly
   Noto Emoji outline — swap in a lime Lucide instagram glyph via mask */
div#contentFrame.links div#instagramLinks ul.linkList li:before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  background-color: var(--lime);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='20' x='2' y='2' rx='5' ry='5'/%3E%3Cpath d='M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z'/%3E%3Cline x1='17.5' x2='17.51' y1='6.5' y2='6.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='20' x='2' y='2' rx='5' ry='5'/%3E%3Cpath d='M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z'/%3E%3Cline x1='17.5' x2='17.51' y1='6.5' y2='6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 640px) {
  div#contentFrame.links h2.linksHeader { font-size: 20pt; }
  div#contentFrame.links div.pandaLinks { padding: 0 4px; }
}

/* ------------------------------------------------------------
   v4-style wave section dividers (profile page) — FINAL
   Sections ALTERNATE light green / cream (Zoe: 交互 between
   淺綠 #D4EFC0 and the cream body 米黃 #F6F1E3 — nothing else).
   shrinker children are always: 1 profileFrame · 2 summary(where) ·
   3 zooHistory · 4 summary(family) · 5 profilePhotos ·
   6 summary · 7 profilePhotos · [8 summary · 9 profilePhotos]
   Odd sections (pairs 2+3, 6+7) become full-bleed green bands
   with wave edges; even sections stay on the cream body.
   CSS-only, zero DOM/JS. Same curve as the landing wave.
   ------------------------------------------------------------ */
div#contentFrame.profile > div.shrinker > div:nth-child(2),
div#contentFrame.profile > div.shrinker > div:nth-child(3),
div#contentFrame.profile > div.shrinker > div:nth-child(6),
div#contentFrame.profile > div.shrinker > div:nth-child(7) {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100vw;                        /* break out of the 868px column */
  margin-left: calc(50% - 50vw);       /* body has overflow-x:hidden */
  /* keep inner content aligned to the shrinker's 868px column */
  padding-left: max(14px, calc(50vw - 434px));
  padding-right: max(14px, calc(50vw - 434px));
  background-color: #D4EFC0;
}
/* summary chip opens the band: room for the top wave, no seam below */
div#contentFrame.profile > div.shrinker > div:nth-child(2),
div#contentFrame.profile > div.shrinker > div:nth-child(6) {
  margin-top: 92px;
  margin-bottom: 0;
  padding-top: 2px;
  padding-bottom: 4px;
}
/* content closes the band: room for the bottom wave */
div#contentFrame.profile > div.shrinker > div:nth-child(3),
div#contentFrame.profile > div.shrinker > div:nth-child(7) {
  margin-top: 0;
  margin-bottom: 80px;
  padding-bottom: 26px;
}
div#contentFrame.profile > div.shrinker > div:nth-child(2)::before,
div#contentFrame.profile > div.shrinker > div:nth-child(6)::before,
div#contentFrame.profile > div.shrinker > div:nth-child(3)::after,
div#contentFrame.profile > div.shrinker > div:nth-child(7)::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 64px;
  pointer-events: none;
  /* same curve as prototype-v4-mobile.html's .wave svg */
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 70" preserveAspectRatio="none"><path d="M0 40 C 240 80 480 0 720 30 C 960 60 1200 10 1440 34 L1440 70 L0 70 Z" fill="%23D4EFC0"/></svg>') center / 100% 100% no-repeat;
}
div#contentFrame.profile > div.shrinker > div:nth-child(2)::before,
div#contentFrame.profile > div.shrinker > div:nth-child(6)::before { top: -63px; }
div#contentFrame.profile > div.shrinker > div:nth-child(3)::after,
div#contentFrame.profile > div.shrinker > div:nth-child(7)::after { bottom: -63px; transform: scaleY(-1); }
/* on green bands, soften card shadows to match the landing band */
div#contentFrame.profile > div.shrinker > div.profilePhotos div.photoSample > img,
div#contentFrame.profile > div.shrinker > div.profilePhotos div.photoSample > a > img {
  box-shadow: 0 10px 22px rgba(18,58,44,.16);
}

/* ------------------------------------------------------------
   PROFILE HEADER POLISH
   (a) top menu pill / name bar / profile card all compute width
       differently (content-box + different paddings) → border-box
       so all three render exactly 868px wide.
   (b) dossier (right of the photo): consistent left-aligned rows
       with even spacing, QR centered, no stray base margins.
   ------------------------------------------------------------ */
div.topMenu > div.shrinker,
div.bottomMenu > div.shrinker,
div.profile.nameBar {
  box-sizing: border-box;
}

div.profileFrame div.profileDossier {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  padding: 18px 26px 20px;
}
div.profileFrame div.profileDossier div.species h4 { margin: 0 0 2px; }
div.profileFrame div.profileDossier > ul.pandaList { margin: 0; }
div.profileFrame > div.profileDossier > ul.pandaList li { margin-left: 0; }
div.profileFrame div.profileDossier div.qrcodeFrame {
  align-self: center;
  margin: 12px auto 4px;
}
div.profileFrame div.profileDossier div.nicknameContainer h4,
div.profileFrame div.profileDossier div.othernamesContainer h4 { margin: 8px 0 2px; }
div.profileFrame div.profileDossier div.nicknameContainer ul,
div.profileFrame div.profileDossier div.othernamesContainer ul { margin: 0; }
