/* The class uses the outer window width so narrow desktop frames stay original. */
.lab-mobile-nav { display: none; }
html.lab-mobile { overflow-wrap: anywhere; }
html.lab-mobile body {
    box-sizing: border-box;
    margin: 0;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    font-size: 16px !important;
    line-height: 1.7;
    -webkit-text-size-adjust: 100%;
}
html.lab-mobile img { max-width: 100%; height: auto; vertical-align: middle; }
html.lab-mobile body > p { margin: 18px 0; }
html.lab-mobile body > p a {
    display: inline-block;
    box-sizing: border-box;
    min-height: 44px;
    padding: 8px 2px;
}
html.lab-mobile body > p > strong[style] { font-size: 28px !important; line-height: 1.3; }
html.lab-mobile :is(.aa, .aaa) { font-size: 28px; line-height: 1.3; }
html.lab-mobile .bb { font-size: 20px; line-height: 1.5; }
html.lab-mobile table { width: 100% !important; max-width: 100%; table-layout: fixed; }
html.lab-mobile td { overflow-wrap: anywhere; }
html.lab-mobile input:not([type=checkbox]):not([type=radio]),
html.lab-mobile textarea {
    box-sizing: border-box;
    max-width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    font: 16px/1.5 Arial, sans-serif;
}
html.lab-mobile :is(input[type=text], input[type=password], textarea) { width: 100%; }
html.lab-mobile textarea { min-height: 150px; resize: vertical; }
html.lab-mobile :is(input[type=submit], input[type=reset], input[type=button]) { margin: 6px 4px 6px 0; }
html.lab-mobile input[type=checkbox] { width: 20px; height: 20px; vertical-align: middle; }
html.lab-mobile a:focus-visible,
html.lab-mobile summary:focus-visible,
html.lab-mobile input:focus-visible,
html.lab-mobile textarea:focus-visible { outline: 2px solid #e94259; outline-offset: 3px; }

html.lab-mobile .lab-mobile-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -16px -16px 24px;
    padding: 8px 16px;
    border-bottom: 1px solid #ffffff30;
    background: #110822f2;
    color: #fff;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    font: 16px/1.5 Arial, sans-serif;
    text-align: left;
}
html.lab-mobile .lab-mobile-nav > a {
    display: flex;
    align-items: center;
    min-height: 44px;
    color: #fff;
    text-decoration: none;
}
html.lab-mobile .lab-mobile-nav details { position: relative; }
html.lab-mobile .lab-mobile-nav summary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid #ffffff40;
    border-radius: 8px;
    cursor: pointer;
    list-style: none;
}
html.lab-mobile .lab-mobile-nav summary::-webkit-details-marker { display: none; }
html.lab-mobile .lab-mobile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(280px, calc(100vw - 32px));
    max-height: calc(100dvh - 90px);
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    border: 1px solid #ffffff40;
    border-radius: 10px;
    background: #130a28;
    box-shadow: 0 10px 30px #0008;
}
html.lab-mobile .lab-mobile-menu a {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 4px 12px;
    box-sizing: border-box;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
}
html.lab-mobile .lab-mobile-menu a[aria-current=page] { color: #ffec7a; background: #ffffff12; }
html.lab-mobile .lab-mobile-menu a:hover { background: #ffffff18; }

/* Gadget tables describe cards rather than tabular measurements. */
html.lab-mobile[data-lab-page=seika] :is(table, tbody, tr, td) { display: block; box-sizing: border-box; width: 100%; }
html.lab-mobile[data-lab-page=seika] body > table { padding: 14px; margin-bottom: 20px; border-color: #ffffff70; text-align: left; }
html.lab-mobile[data-lab-page=seika] td { border: 0; padding: 6px 0; }
html.lab-mobile[data-lab-page=seika] body > table > tbody > tr:first-child {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #ffffff40;
}
html.lab-mobile[data-lab-page=seika] body > table > tbody > tr:first-child > td { font-size: 14px; }
html.lab-mobile[data-lab-page=seika] body > table > tbody > tr:first-child > td:nth-child(2) { font-size: 19px; font-weight: 700; }
html.lab-mobile[data-lab-page=seika] td > img { display: block; margin: auto; max-height: 360px; width: auto; object-fit: contain; }
html.lab-mobile[data-lab-page=seika] body > br { display: none; }
html.lab-mobile[data-lab-page=bbs] body > table:first-of-type :is(tbody, tr, td) { display: block; box-sizing: border-box; width: 100%; text-align: left; }
html.lab-mobile[data-lab-page=bbs] body > table:first-of-type td { padding: 4px 0; }
html.lab-mobile[data-lab-page=bbs] body > table:first-of-type tr { margin-bottom: 12px; }
