@font-face {
    font-family: "Cormorant Garamond";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/fonts/cormorant-garamond-cyrillic-600-normal.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Cormorant Garamond";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

:where(:root) {
    --btn-bg: var(--accent);
    --btn-text: var(--on-accent);
    --btn-border: transparent;
    --btn-radius: 999px;
    --btn-hover-bg: var(--btn-bg);
    --btn-active-bg: var(--btn-bg);
    --btn-pattern: none;
    --btn-pattern-size: auto;
    --btn-pattern-repeat: repeat;
    --btn-icon: none;
    --btn2-bg: var(--accent-soft);
    --btn2-text: var(--accent);
    --btn2-border: transparent;
    --btn2-radius: 999px;
    --btn2-hover-bg: var(--btn2-bg);
    --btn2-active-bg: var(--btn2-bg);
    --btn2-pattern: none;
    --btn2-pattern-size: auto;
    --btn2-pattern-repeat: repeat;
    --btn2-icon: none;
    --photo-frame: none;
    --photo-frame-slice: 1;
    --photo-frame-width: 0px;
    --deco-header: none;
    --deco-footer: none;
    --deco-card: none;
    --deco-block-head: none;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font: 400 15px/1.55 var(--font-body);
    overflow-wrap: anywhere;
    color: var(--text);
    background-color: var(--bg);
    background-image: var(--bg-image);
    background-position: center;
    background-size: var(--bg-size);
}

a {
    color: var(--accent);
    text-decoration: none;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.1;
}

p {
    margin: 0;
}

.wrap {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
}

.test-env,
.preview,
.draft {
    flex: none;
    margin: 0;
    padding: 0.25em 1rem;
    text-align: center;
    font-weight: 600;
    color: var(--on-danger);
    background: var(--danger);
}

.preview,
.draft {
    color: var(--on-warning);
    background: var(--warning);
}

header.top {
    flex: none;
    position: relative;
    z-index: 10;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

header.top::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - 4px);
    height: 21px;
    background: var(--deco-header) var(--deco-header-repeat, repeat-x) left top / auto 21px;
    pointer-events: none;
}

.top .wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-right: auto;
}

.brand picture {
    display: contents;
}

.brand img {
    flex: none;
    width: auto;
    height: 46px;
}

.brand span {
    min-width: 0;
    font: 400 0.68rem/1.2 var(--font-body);
    color: var(--muted);
    text-wrap: balance;
}

nav.menu ul {
    display: flex;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav.menu a {
    display: block;
    padding: 7px 11px;
    border-radius: 8px;
    color: var(--text);
}

nav.menu a[aria-current] {
    color: var(--accent);
}

.lang {
    flex: none;
    display: flex;
    gap: 2px;
    font-size: 0.85rem;
}

.lang a,
.lang span {
    padding: 4px 8px;
    border-radius: 6px;
}

.lang span {
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
}

.burger {
    flex: none;
    display: none;
}

.burger summary {
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    list-style: none;
    cursor: pointer;
}

.burger summary::-webkit-details-marker {
    display: none;
}

.burger[open] nav.menu {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.burger nav.menu ul {
    flex-direction: column;
    padding: 8px 16px 16px;
}

footer {
    flex: none;
    position: relative;
    padding: 6px 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    background: var(--surface);
    border-top: 1px solid var(--line);
}

footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% - 2px);
    height: 14px;
    background: var(--deco-footer) var(--deco-footer-repeat, repeat-x) left bottom / auto 14px;
    pointer-events: none;
}

@media (max-width: 399px) {
    .top .wrap {
        gap: 8px;
    }

    .brand {
        gap: 6px;
    }

    .brand img {
        height: 40px;
    }
}

@media (max-width: 899px) {
    .burger {
        display: block;
    }

    .top > .wrap > nav.menu {
        display: none;
    }
}

@media (min-width: 640px) and (max-height: 500px) {
    .top .wrap {
        height: 44px;
    }

    .brand img {
        height: 38px;
    }

    .burger[open] nav.menu {
        top: 44px;
    }

    footer {
        display: none;
    }
}

@media (min-width: 900px) and (min-height: 501px) {
    .top .wrap {
        height: 64px;
    }

    .brand img {
        height: 56px;
    }
}

body:has(> main.home) {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

main.home {
    position: relative;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(124px, auto) minmax(0, 1fr);
    grid-template-areas: "pet" "info";
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.pet-slot {
    grid-area: pet;
    min-height: 0;
}

.info {
    grid-area: info;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tabs-r {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tabs {
    flex: none;
    display: flex;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}

.tabs label {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    cursor: pointer;
}

#tab-about:checked ~ .tabs [for=tab-about],
#tab-breed:checked ~ .tabs [for=tab-breed] {
    color: var(--on-accent);
    background: var(--accent);
}

#tab-about:focus-visible ~ .tabs [for=tab-about],
#tab-breed:focus-visible ~ .tabs [for=tab-breed] {
    outline: 2px solid var(--text);
    outline-offset: -4px;
}

#tab-about:checked ~ .p2,
#tab-breed:checked ~ .p1 {
    display: none;
}

.panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
}

.phead {
    display: none;
    flex: none;
    position: relative;
    padding: 14px 24px 12px;
    color: var(--on-accent);
    background: var(--deco-block-head) left top / 240px auto var(--deco-block-head-repeat, repeat), var(--accent);
}

.phead h2 {
    font-size: 2.1rem;
}

.phead .eyebrow {
    margin-bottom: 4px;
    color: color-mix(in srgb, var(--on-accent) 75%, transparent);
}

.eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.pbody {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
    padding: 12px 14px 14px;
}

.pbody .eyebrow {
    margin-bottom: -6px;
}

.lead,
.note {
    color: var(--muted);
}

.note {
    font-size: 0.8rem;
    font-style: italic;
}

.lead,
.row p,
.row span,
.desc p {
    text-align: justify;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.row {
    flex: none;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    list-style: none;
}

.row > * {
    flex: 0 0 78%;
    padding: 12px 14px;
    scroll-snap-align: start;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.row h3 {
    margin-bottom: 4px;
    font-size: 1.2rem;
    color: var(--accent);
}

.row p,
.row span {
    font-size: 0.88em;
    line-height: 1.5;
    color: var(--muted);
}

.steps {
    counter-reset: step;
}

.steps li {
    counter-increment: step;
    display: grid;
    grid-template-columns: auto 1fr;
    align-content: start;
    column-gap: 10px;
}

.steps li::before {
    content: counter(step);
    grid-row: span 2;
    font-family: var(--font-heading);
    font-size: 1.9rem;
    line-height: 1;
    color: var(--accent);
}

.steps b {
    display: block;
    margin-bottom: 2px;
}

.slider {
    position: relative;
    flex: none;
}

.arrow {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .arrow:not([hidden]) {
        position: absolute;
        top: 50%;
        display: grid;
        place-items: center;
        width: 32px;
        height: 32px;
        padding: 0 0 3px;
        font: inherit;
        font-size: 1.5rem;
        line-height: 1;
        color: var(--accent);
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 50%;
        transform: translateY(-50%);
        cursor: pointer;
    }

    .arrow.prev {
        left: 4px;
    }

    .arrow.next {
        right: 4px;
    }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .steps {
        scroll-behavior: smooth;
    }
}

.deco {
    display: none;
}

.deco > div {
    position: absolute;
    inset: 0;
    background-position: center bottom;
    background-size: contain;
    background-repeat: no-repeat;
}

.garland {
    overflow: hidden;
}

.garland > img {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: 16px;
    border-radius: var(--radius);
}

@media (min-width: 640px) {
    main.home {
        grid-template-columns: 240px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        grid-template-areas: "pet info";
    }

    .row > * {
        flex-basis: 46%;
    }
}

@media (min-width: 640px) and (max-height: 500px) {
    main.home {
        gap: 10px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .tabs label {
        padding: 6px 8px;
        font-size: 1.15rem;
    }

    .pbody {
        gap: 10px;
        padding: 10px 12px;
    }
}

@media (min-width: 900px) {
    main.home {
        grid-template-columns: minmax(0, 1fr) 280px;
        grid-template-areas: "info pet";
        gap: 20px;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .pbody {
        gap: 16px;
        padding: 18px 24px 20px;
    }

    .row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        overflow: visible;
    }

    .lead {
        font-size: 0.97rem;
    }
}

@media (min-width: 760px) and (min-height: 860px) {
    .info {
        gap: 16px;
    }

    .tabs,
    .pbody > .eyebrow {
        display: none;
    }

    .phead {
        display: block;
    }

    #tab-about:checked ~ .p2,
    #tab-breed:checked ~ .p1 {
        display: flex;
    }

    .panel {
        border-top: 1px solid var(--line);
        border-radius: var(--radius);
    }

    .p1 {
        flex: 0 1 auto;
    }

    .p2 {
        flex: 1 1 auto;
    }

    .row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        overflow: visible;
    }
}

@media (min-width: 760px) and (max-width: 1099px) and (min-height: 860px) {
    main.home {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 220px minmax(0, 1fr);
        grid-template-areas: "pet" "info";
    }

    .phead {
        padding: 10px 20px 8px;
    }

    .phead h2 {
        font-size: 1.7rem;
    }
}

@media (min-width: 1200px) and (min-height: 860px) {
    body {
        font-size: 16px;
    }

    main.home {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
}

@media (min-width: 640px) and (max-height: 500px) {
    main.home {
        grid-template-columns: minmax(0, 1fr) 220px;
        grid-template-areas: "info pet";
    }

    .row {
        display: flex;
        overflow-x: auto;
    }

    .row > * {
        flex-basis: 40%;
    }
}

.nophoto {
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    aspect-ratio: 4 / 5;
    padding: 0 4px;
    text-align: center;
    background: url("/no-photo.svg") center / cover;
}

.nophoto b {
    font: 600 max(12px, 8cqw) / 1.1 var(--font-heading);
    color: color-mix(in srgb, var(--accent) 50%, var(--text));
}

.nophoto span {
    margin: 1.5cqw 0 7cqw;
    font-size: max(10px, 4cqw);
    line-height: 1.3;
    color: var(--accent);
    opacity: 0.85;
}

@container (width < 160px) {
    .nophoto b {
        margin-bottom: 7cqw;
    }

    .nophoto span {
        display: none;
    }
}

@container (width < 100px) {
    .nophoto b {
        display: none;
    }
}

.pet {
    position: relative;
    display: flex;
    height: 100%;
    overflow: hidden;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.pet .ph {
    flex: none;
    position: relative;
    align-self: flex-start;
    width: 112px;
    aspect-ratio: 4 / 5;
}

.pet::after,
.phead::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 72px;
    height: 63px;
    background: var(--deco-card) right top / contain var(--deco-card-repeat, no-repeat);
    pointer-events: none;
}

.pet .ph::before,
.stage::before,
.tiles a::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border: var(--photo-frame-width) solid transparent;
    border-image: var(--photo-frame) var(--photo-frame-slice) / var(--photo-frame-width) stretch;
    pointer-events: none;
}

.stage::before {
    border-width: calc(var(--photo-frame-width) * 1.5);
    border-image-width: calc(var(--photo-frame-width) * 1.5);
}

.pet .ph img {
    display: block;
    width: auto;
    height: 100%;
    aspect-ratio: 4 / 5;
    margin: 0 auto;
    object-fit: cover;
    background: var(--accent-soft);
}

.pet .nophoto {
    height: 100%;
    margin: 0 auto;
}

.pet .body {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
}

.pet .kicker,
.pet dt,
.pet dd {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet .kicker {
    font-size: 0.7rem;
    line-height: 1.125rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.pet h3 {
    min-height: 2lh;
    margin-bottom: 4px;
    font-size: 1.25rem;
    overflow-wrap: break-word;
}

.pet h3:first-child {
    margin-top: 1.125rem;
}

.pet dl {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 8px;
    min-height: 3lh;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.25rem;
}

.pet dt {
    font-weight: 700;
}

.pet dd {
    margin: 0;
}

.pet .go {
    display: inline-block;
    margin-top: 2px;
    font-size: 0.82rem;
    color: var(--accent);
}

.pet .body,
.pet .ph > * {
    transition: opacity 0.4s;
}

.pet.fade .body,
.pet.fade .ph > * {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .pet .body,
    .pet .ph > * {
        transition: none;
    }
}

@media (min-width: 640px) {
    .pet {
        flex-direction: column;
    }

    .pet .ph {
        flex: 0 1 auto;
        align-self: stretch;
        width: auto;
        box-sizing: content-box;
        min-height: 0;
        padding: 12px 12px 0;
    }

    .pet .body {
        flex: none;
        padding: 8px 12px 10px;
    }
}

@media (min-width: 900px) {
    .pet .body {
        padding: 12px 16px 14px;
    }

    .pet h3 {
        font-size: 1.35rem;
    }
}

@media (min-width: 640px) and (max-height: 500px) {
    .pet .ph {
        min-height: 90px;
    }

    .pet h3 {
        font-size: 1.1rem;
    }

    .pet .body {
        padding: 8px 12px 10px;
    }
}

@media (min-width: 760px) and (max-width: 1099px) and (min-height: 860px) {
    .pet {
        flex-direction: row;
    }

    .pet .ph {
        flex: none;
        height: 100%;
        padding: 0;
    }

    .pet .body {
        flex: 1;
        padding: 16px 20px;
    }

    .pet h3 {
        font-size: 1.6rem;
    }

    .pet dl {
        grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 4px 12px;
        font-size: 0.9rem;
    }
}

@media (min-width: 1460px) {
    .deco {
        display: block;
        position: absolute;
        top: 16px;
        bottom: 16px;
        width: calc((100vw - 1140px) / 2 - 32px);
        container-type: size;
    }

    .deco.left {
        right: calc(100% + 16px);
        --tall: var(--deco-left-tall);
        --compact: var(--deco-left-compact);
    }

    .deco.right {
        left: calc(100% + 16px);
        --tall: var(--deco-right-tall);
        --compact: var(--deco-right-compact);
    }
}

@container (max-aspect-ratio: 7/10) {
    .deco > div {
        background-image: var(--tall);
    }
}

@container (min-aspect-ratio: 7/10) {
    .deco > div {
        background-image: var(--compact);
    }
}

body:has(.vw[open]) {
    overflow: hidden;
}

main.animal {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 10px;
    padding-bottom: 24px;
}

.crumbs {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.82rem;
    color: var(--muted);
}

.crumbs a {
    color: var(--muted);
}

.crumbs i {
    margin: 0 6px;
    font-style: normal;
    opacity: 0.6;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.gallery {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
}

.stage {
    position: relative;
    justify-self: center;
    width: min(100% + 32px, 57.6vh);
    width: min(100% + 32px, 57.6svh);
    margin: 0 -16px;
    aspect-ratio: 4 / 5;
    background: var(--photo-bg);
}

.slides {
    display: flex;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    list-style: none;
}

.slides::-webkit-scrollbar,
.thumbs::-webkit-scrollbar,
.vs::-webkit-scrollbar {
    display: none;
}

.slides li {
    flex: 0 0 100%;
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    cursor: zoom-in;
}

.slides img,
.slides video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slides video {
    object-fit: contain;
}

.news :is(img, video),
.gallery :is(img, video),
.vw :is(img, video) {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    background: color-mix(in srgb, var(--photo-bg) 55%, transparent);
    border: 2px solid color-mix(in srgb, var(--photo-fg) 85%, transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.play::after {
    content: "";
    position: absolute;
    top: 17px;
    left: 23px;
    border: 13px solid transparent;
    border-right: 0;
    border-left: 20px solid var(--photo-fg);
}

.vbadge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 2px 8px;
    font-size: 0.75rem;
    color: var(--photo-fg);
    background: color-mix(in srgb, var(--photo-bg) 60%, transparent);
    border-radius: 999px;
    pointer-events: none;
}

.stage .nav {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0 0 3px;
    font: inherit;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    border: 0;
    border-radius: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.stage .prev {
    left: 10px;
}

.stage .next {
    right: 10px;
}

.stage .count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 2px 9px;
    font-size: 0.78rem;
    color: var(--surface);
    background: color-mix(in srgb, var(--text) 60%, transparent);
    border-radius: 999px;
}

.stage .zoom {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 44px;
    height: 44px;
    font: inherit;
    font-size: 1.6rem;
    color: var(--photo-fg);
    background: color-mix(in srgb, var(--photo-fg) 15%, transparent);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.stage .zoom {
    opacity: 0;
}

.stage .zoom:focus-visible {
    opacity: 1;
}

.thumbs {
    display: none;
    gap: 8px;
    margin: 10px 0 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
    list-style: none;
}

.thumbs button {
    flex: none;
    box-sizing: content-box;
    width: 60px;
    aspect-ratio: 4 / 5;
    padding: 0;
    overflow: hidden;
    background: var(--photo-bg);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
}

.thumbs button[aria-current] {
    border-color: var(--accent);
}

.thumbs img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbs .v {
    position: relative;
}

.thumbs .v::after,
.rail .v::after,
.tiles .v::after {
    content: "\25B6";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    color: var(--photo-fg);
    background: color-mix(in srgb, var(--photo-bg) 30%, transparent);
}

.dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.dots i {
    width: 6px;
    height: 6px;
    background: var(--line);
    border-radius: 50%;
}

.dots i.on {
    background: var(--accent);
}

.vw[open] {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "bar bar" "rail main";
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: var(--text);
    background: var(--surface);
    border: 0;
}

.vbar {
    grid-area: bar;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 8px 16px;
    border-bottom: 1px solid var(--line);
}

.vbar h2 {
    min-width: 0;
    margin-right: auto;
    overflow: hidden;
    font-size: 1.35rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.vnum {
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
    color: var(--muted);
}

.vnum::before {
    content: attr(data-max);
    display: block;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}

.vclose,
.vbar .share button {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0 0 3px;
    font: inherit;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 50%;
    box-shadow: none;
    cursor: pointer;
}

.vbar .share button::after {
    content: none;
}

.mouse .vclose:hover,
.mouse .vbar .share button:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.vbar .share button {
    padding: 0;
}

.rail {
    grid-area: rail;
    min-width: 0;
    padding: 6px 10px 16px;
    overflow-y: auto;
    scrollbar-width: thin;
    border-right: 1px solid var(--line);
}

.rail h3 {
    display: flex;
    justify-content: space-between;
    padding: 12px 4px 8px;
    font: 600 0.8rem/1 var(--font-body);
    color: var(--muted);
}

.rail ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rail button {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    padding: 0;
    overflow: hidden;
    background: var(--photo-bg);
    border: 2px solid transparent;
    border-radius: 10px;
    outline-offset: 2px;
    cursor: pointer;
}

.rail button[aria-current] {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.rail button:not([aria-current]) img {
    opacity: 0.8;
}

.rail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vmain {
    grid-area: main;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.vs {
    display: flex;
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    list-style: none;
}

.vs li {
    position: relative;
    flex: 0 0 100%;
    display: grid;
    place-items: center;
    padding: 16px 92px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    container-type: size;
}

.pic {
    position: relative;
    margin: 0;
    line-height: 0;
}

.pic img {
    display: block;
    width: min(100cqw, var(--w) * 1px, 100cqh * var(--w) / var(--h));
    aspect-ratio: var(--w) / var(--h);
    border-radius: 6px;
}

.vs video {
    display: block;
    width: 100cqw;
    height: 100cqh;
}

.vs video[style] {
    width: min(100cqw, 100cqh * var(--w) / var(--h));
    height: min(100cqh, 100cqw * var(--h) / var(--w));
}

.arr {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 50%;
    box-shadow: 0 4px 18px color-mix(in srgb, var(--photo-bg) 14%, transparent);
    transform: translateY(-50%);
    cursor: pointer;
}

.arr svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: var(--text);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mouse .arr:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.mouse .arr:hover svg {
    stroke: var(--on-accent);
}

.arr.prev {
    left: 18px;
}

.arr.next {
    right: 18px;
}

.who {
    flex: none;
    padding: 6px 14px;
    font: inherit;
    font-size: 0.85rem;
    white-space: nowrap;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}

.vbar .share {
    position: relative;
    flex: none;
}

.vbar .share [role=status] {
    position: absolute;
    top: 50%;
    right: calc(100% + 8px);
    padding: 6px 12px;
    white-space: nowrap;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    transform: translateY(-50%);
    pointer-events: none;
}

.vbar .share [role=status]:empty {
    display: none;
}

.who[aria-pressed="true"] {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
}

.vq {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 14px 0 12px;
    font: inherit;
    font-size: 0.88rem;
    white-space: nowrap;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}

.vq[hidden] {
    display: none;
}

.vq svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.vq span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.vq b {
    font-weight: 600;
}

.mouse .vq:hover,
.vq[aria-expanded="true"] {
    color: var(--accent);
    background: var(--accent-soft);
}

.vqm {
    display: none;
    inset: auto;
    min-width: 150px;
    margin: 0;
    padding: 6px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--photo-bg) 25%, transparent);
}

.vqm:popover-open {
    display: block;
}

.vqm button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 0 12px 0 8px;
    font: inherit;
    font-size: 0.95rem;
    color: inherit;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.vqm button::before {
    content: "";
    width: 1em;
}

.vqm [aria-pressed="true"] {
    font-weight: 600;
    color: var(--accent);
}

.vqm [aria-pressed="true"]::before {
    content: "\2713";
}

.vqm [aria-pressed="true"][data-now]::after {
    content: attr(data-now);
    margin-left: auto;
    padding-left: 12px;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--muted);
}

.mouse .vqm button:hover,
.vqm button:focus-visible {
    background: var(--accent-soft);
}

@media (max-width: 399px) {
    .vq {
        padding: 0 11px;
    }

    .vq b {
        display: none;
    }
}

.fr {
    position: absolute;
    line-height: 1.2;
    border: 2px solid transparent;
    border-radius: 8px;
}

.fr::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100% + 4px, 44px);
    height: max(100% + 4px, 44px);
    transform: translate(-50%, -50%);
}

span.fr {
    cursor: default;
}

.fr b,
.tip {
    padding: 6px 10px;
    font: 600 0.82rem/1 var(--font-body);
    white-space: nowrap;
    color: var(--text);
    background: var(--surface);
    border-radius: 999px;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--photo-bg) 25%, transparent);
}

.fr b {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    width: max-content;
    max-width: var(--room);
    line-height: 1.25;
    white-space: normal;
    border-radius: 14px;
    transform: translateY(-6px);
}

.fr.end b {
    right: 0;
    left: auto;
    text-align: right;
}

.fr.in b {
    top: 6px;
    bottom: auto;
    transform: none;
}

a.fr b,
.tip.go {
    color: var(--accent);
}

a.fr b::after,
.tip.go::after {
    content: " \2192";
}

.vw.all .fr {
    border-color: var(--photo-fg);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--photo-bg) 35%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--photo-bg) 35%, transparent);
}

.vw.all .fr b,
.fr:focus-visible b {
    display: block;
}

.tip {
    position: fixed;
    z-index: 3;
    pointer-events: none;
}

.vw.all .tip {
    display: none;
}

.vdesc {
    flex: none;
    width: 100%;
    max-width: 72ch;
    max-height: 30%;
    margin: 0 auto;
    padding: 6px 16px 10px;
    overflow-y: auto;
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--muted);
}

.vdesc p {
    margin: 0 0 4px;
}

.vw :is(.pic img, span.fr) {
    cursor: zoom-in;
}

.vw.zoomed .pic img {
    cursor: grab;
}

.vw.zoomed .pic img:active {
    cursor: grabbing;
}

.vw.full[open] {
    grid-template: "main" minmax(0, 1fr) / minmax(0, 1fr);
    background: var(--photo-bg);
}

.vw.full .vbar {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    padding: 8px;
    border: 0;
}

.vw.full :is(.vbar > :not(.vclose, .vq, .vqm), .rail, .vdesc, .arr, .fr, .tip) {
    display: none;
}

.full :is(.vclose, .vq) {
    color: var(--photo-fg);
    background: color-mix(in srgb, var(--photo-bg) 50%, transparent);
    border-color: color-mix(in srgb, var(--photo-fg) 60%, transparent);
}

.vw.full[open],
.vw.full .vs {
    touch-action: pan-x;
}

.vw.full .vs li {
    padding: 0;
    overflow: clip;
}

.vw.full .pic img {
    border-radius: 0;
}

@media (max-width: 699px) and (orientation: portrait) {
    .vw[open] {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) auto;
        grid-template-areas: "bar" "main" "rail";
    }

    .vbar {
        gap: 8px;
        padding: 6px 8px 6px 12px;
    }

    .vbar h2 {
        font-size: 1.1rem;
    }

    .rail {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 10px;
        overflow-x: auto;
        overflow-y: hidden;
        border-top: 1px solid var(--line);
        border-right: 0;
    }

    .rail h3 {
        flex: none;
        gap: 6px;
        padding: 0 2px;
        font-size: 0.72rem;
        writing-mode: vertical-rl;
        rotate: 180deg;
    }

    .rail ul {
        display: flex;
        gap: 6px;
    }

    .rail li {
        flex: none;
    }

    .rail button {
        width: 84px;
    }

    .vs li {
        padding: 10px 8px 34px;
    }

    .arr {
        width: 48px;
        height: 48px;
        background: color-mix(in srgb, var(--surface) 88%, transparent);
    }

    .arr.prev {
        left: 8px;
    }

    .arr.next {
        right: 8px;
    }
}

@media (max-height: 499px) and (orientation: landscape) {
    .vw[open] {
        grid-template-columns: 121px minmax(0, 1fr);
    }

    .vbar {
        padding: 4px 8px 4px 12px;
    }

    .vbar h2 {
        font-size: 1.05rem;
    }

    .rail {
        padding: 4px 6px 10px;
    }

    .rail h3 {
        padding: 8px 2px 6px;
        font-size: 0.7rem;
    }

    .vs li {
        padding: 6px 70px 28px;
    }

    .arr {
        width: 48px;
        height: 48px;
    }

    .arr.prev {
        left: 8px;
    }

    .arr.next {
        right: 8px;
    }
}

.sheet {
    min-width: 0;
}

.sheet > * + * {
    margin-top: 10px;
}

.status {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
}

.sheet h1 {
    font-size: clamp(1.9rem, 6vw, 2.6rem);
}

.share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.share button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font: 600 0.9rem/1.4 var(--font-body);
    color: var(--btn2-text);
    background: var(--btn2-pattern) left top / var(--btn2-pattern-size) var(--btn2-pattern-repeat), var(--btn2-bg);
    border: 0;
    border-radius: var(--btn2-radius);
    box-shadow: inset 0 0 0 1px var(--btn2-border);
    cursor: pointer;
}

.mouse .share button:hover {
    background-color: var(--btn2-hover-bg);
}

.share button:active:not(.vbar *) {
    background-color: var(--btn2-active-bg);
}

.chat-want::after,
.chat-open::after,
.share button::after {
    content: "";
    position: absolute;
    top: -6px;
    right: 0;
    width: 16px;
    height: 16px;
    background: var(--btn-icon) center / contain no-repeat;
    pointer-events: none;
}

.share button::after {
    background-image: var(--btn2-icon);
}

.share svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.share [role=status] {
    font-size: 0.85rem;
    color: var(--muted);
}

.sale {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.chat-want {
    position: relative;
    padding: 5px 16px;
    font: 600 0.9rem/1.4 var(--font-body);
    color: var(--btn-text);
    background: var(--btn-pattern) left top / var(--btn-pattern-size) var(--btn-pattern-repeat), var(--btn-bg);
    border: 0;
    border-radius: var(--btn-radius);
    box-shadow: inset 0 0 0 1px var(--btn-border);
    cursor: pointer;
}

.mouse :is(.chat-want, .chat-open):hover {
    background-color: var(--btn-hover-bg);
}

:is(.chat-want, .chat-open):active {
    background-color: var(--btn-active-bg);
}

.sheet .facts {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 10px;
    margin-bottom: 0;
    font-size: 0.92rem;
}

.facts dt {
    font-weight: 700;
}

.facts dd {
    margin: 0;
}

.desc::before {
    content: "";
    display: flow-root;
    margin-bottom: 10px;
    border-top: 1px solid var(--line);
}

.desc p {
    margin: 0 0 8px;
}

.blocks {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trio {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.block {
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.bh {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px 7px;
    color: var(--on-accent);
    background: var(--deco-block-head) left top / 240px auto var(--deco-block-head-repeat, repeat), var(--accent);
}

.bh h2 {
    margin-right: auto;
    font-size: 1.45rem;
}

.bc {
    padding: 5px 14px;
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--accent);
    background: var(--on-accent);
    border-radius: 999px;
}

details.block {
    container-type: inline-size;
}

details.block > summary {
    list-style: none;
    cursor: pointer;
}

details.block > summary::-webkit-details-marker {
    display: none;
}

.hint {
    font-size: 0.85rem;
    white-space: nowrap;
    color: color-mix(in srgb, var(--on-accent) 85%, transparent);
}

.chev {
    flex: none;
    width: 26px;
    height: 26px;
    line-height: 24px;
    text-align: center;
    border: 1px solid color-mix(in srgb, var(--on-accent) 60%, transparent);
    border-radius: 50%;
    transition: transform 0.2s;
}

details[open] > summary .chev {
    transform: rotate(180deg);
}

@container (max-width: 290px) {
    .hint {
        display: none;
    }
}

.bb {
    padding: 12px 16px 14px;
}

.kv {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}

.kv span {
    color: var(--muted);
}

.kv b {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--accent);
}

.list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
}

.list li:last-child {
    border-bottom: 0;
}

.list b {
    font-weight: 600;
}

.list small {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
}

.list .d {
    white-space: nowrap;
    font-size: 0.9rem;
    color: var(--muted);
}

.ped {
    display: flex;
    flex-direction: column;
    grid-template-columns: repeat(var(--g), minmax(0, 1fr));
    grid-template-rows: auto repeat(var(--rows), minmax(52px, auto));
    gap: 6px;
}

.ped .gh {
    display: none;
    grid-row: 1;
    grid-column: var(--c);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.pc {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    grid-row: var(--r);
    grid-column: var(--c);
    padding: 6px 10px;
    overflow-wrap: anywhere;
    background: var(--bg);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: 8px;
}

.pc::before {
    content: attr(data-role);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.pc.g2 {
    margin-left: 16px;
}

.pc.g3 {
    margin-left: 32px;
}

.pc.g4 {
    margin-left: 48px;
}

.pc.g5 {
    margin-left: 64px;
}

.pc.m {
    border-left-color: var(--accent);
}

.pc.f {
    border-left-color: color-mix(in srgb, var(--accent) 45%, var(--surface));
}

.pc b,
.pc a {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
}

.pc a {
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
    text-underline-offset: 3px;
}

.pc.none {
    background: none;
    border-style: dashed;
    border-left-width: 1px;
}

.legend {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--muted);
}

@container (min-width: 520px) {
    .ped:not(:has(.g4)) {
        display: grid;
        gap: 6px 10px;
    }

    .ped:not(:has(.g4)) .gh {
        display: block;
    }

    .ped:not(:has(.g4)) .pc {
        margin-left: 0;
    }

    .ped:not(:has(.g4)) .pc::before {
        display: none;
    }
}

@container (min-width: 840px) {
    .ped {
        display: grid;
        gap: 6px 10px;
    }

    .ped .gh {
        display: block;
    }

    .ped .pc {
        margin-left: 0;
    }

    .pc::before {
        display: none;
    }
}

.more {
    margin-top: 4px;
    font-size: 0.88rem;
}

.more summary {
    color: var(--accent);
    cursor: pointer;
}

.years {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 6px;
}

.yr {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.years label {
    padding: 4px 12px;
    font-size: 0.88rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}

.yr:checked + label {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
}

.yr:focus-visible + label {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.year {
    display: none;
    order: 1;
    flex-basis: 100%;
    min-width: 0;
}

.yr:checked + label + .year {
    display: block;
}

.cls {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    padding: 6px 0;
    border-bottom: 2px solid var(--line);
}

.cls b {
    font-family: var(--font-heading);
    font-size: 1.3rem;
}

.cls span {
    font-size: 0.88rem;
    color: var(--muted);
}

.cls .tot {
    margin-left: auto;
    font-weight: 600;
    color: var(--text);
}

.show {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "when pts i" "cert pts i";
    align-items: center;
    gap: 0 10px;
    width: 100%;
    padding: 8px 0;
    font: inherit;
    text-align: left;
    color: inherit;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

.mouse .show:hover {
    background: var(--accent-soft);
}

.show .when {
    grid-area: when;
}

.show .when b {
    margin-right: 8px;
    font-weight: 600;
}

.show .cert {
    grid-area: cert;
    font-size: 0.86rem;
    color: var(--muted);
}

.show .pts {
    grid-area: pts;
    white-space: nowrap;
    font-weight: 600;
}

.show .pts.excl {
    font-weight: 400;
    text-decoration: line-through;
    color: var(--muted);
}

.show .i {
    grid-area: i;
    width: 22px;
    height: 22px;
    font: 700 0.78rem/22px var(--font-body);
    text-align: center;
    color: var(--surface);
    background: var(--muted);
    border-radius: 50%;
}

.srow {
    position: relative;
}

.years:has(.media) .show {
    grid-template-columns: minmax(0, 1fr) auto 44px auto;
    grid-template-areas: "when pts m i" "cert pts m i";
}

.media {
    position: absolute;
    top: 50%;
    right: 32px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--accent);
    background: none;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.mouse .media:hover {
    background: var(--accent-soft);
}

.media svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
}

.src {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--muted);
}

dialog.det {
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 0;
    color: var(--text);
    background: var(--surface);
    border: 0;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px color-mix(in srgb, var(--photo-bg) 35%, transparent);
}

dialog.det::backdrop {
    background: color-mix(in srgb, var(--photo-bg) 55%, transparent);
}

.dh {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px 10px;
    color: var(--on-accent);
    background: var(--accent);
}

.dh:focus {
    outline: none;
}

.dh > div {
    margin-right: auto;
}

.dh h3 {
    font-size: 1.45rem;
}

.dh p {
    margin-top: 3px;
    font-size: 0.82rem;
    color: color-mix(in srgb, var(--on-accent) 80%, transparent);
}

.dh form {
    margin: 0;
}

.dh button {
    padding: 0 2px;
    font: inherit;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--on-accent);
    background: none;
    border: 0;
    cursor: pointer;
}

.db {
    padding: 6px 16px 14px;
}

.db h4 {
    margin: 8px 0 2px;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.pr {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
}

.pr small {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
}

.pr b {
    white-space: nowrap;
}

.sum {
    padding-top: 8px;
    text-align: right;
}

.sum span {
    display: block;
    color: var(--muted);
}

.sum b {
    font-size: 1.05rem;
}

@media (min-width: 640px) {
    .hero {
        display: flow-root;
    }

    .gallery {
        float: left;
        width: min(50% - 8px, 57.6vh);
        width: min(50% - 8px, 57.6svh);
        margin: 0 16px 8px 0;
    }

    .trio {
        flex-direction: row;
        align-items: flex-start;
    }

    .trio > .block {
        flex: 1 1 0;
    }

    .stage {
        width: 100%;
        margin: 0;
        overflow: hidden;
        border-radius: var(--radius);
    }

    .thumbs {
        display: flex;
    }

    .gallery > .dots {
        display: none;
    }
}

@media (min-width: 640px) and (max-height: 500px) {
    .thumbs {
        display: none;
    }

    .gallery > .dots {
        display: flex;
    }
}

@media (min-width: 900px) {
    main.animal {
        gap: 20px;
        padding-top: 14px;
    }

    .gallery {
        width: min((100% - 28px) * 0.524, (100vh - 212px) * 4 / 5);
        width: min((100% - 28px) * 0.524, (100svh - 212px) * 4 / 5);
        margin-right: 28px;
    }

    .show {
        grid-template-columns: 7.5em minmax(0, 1fr) minmax(0, 1fr) 4.5em 22px;
        grid-template-areas: "when when cert pts i";
    }

    .years:has(.media) .show {
        grid-template-columns: 7.5em minmax(0, 1fr) minmax(0, 1fr) 4.5em 44px 22px;
        grid-template-areas: "when when cert pts m i";
    }

    .show .when {
        display: contents;
    }

    .show .when b {
        grid-column: 1;
    }

    .show .when span {
        grid-column: 2;
    }

    .show .cert {
        font-size: 0.92rem;
    }

    .bh {
        padding: 10px 20px 8px;
    }

    .bb {
        padding: 14px 20px 16px;
    }
}

@media (min-width: 640px) and (max-height: 500px) {
    .gallery {
        width: min(50% - 8px, (100vh - 110px) * 4 / 5);
        width: min(50% - 8px, (100svh - 110px) * 4 / 5);
    }
}

.lh1 {
    margin-bottom: -8px;
    font-size: clamp(1.9rem, 6vw, 2.6rem);
}

.agrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.alb {
    display: block;
    color: var(--text);
}

.alb .cover {
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--accent-soft);
    border-radius: var(--radius);
}

.alb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.alb .tag,
.alb .n {
    position: absolute;
    padding: 2px 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 999px;
}

.alb .tag {
    top: 8px;
    left: 8px;
    color: var(--on-accent);
    background: var(--accent);
}

.alb .n {
    right: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--photo-fg);
    background: color-mix(in srgb, var(--photo-bg) 60%, transparent);
}

.alb .name {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
    font: 600 1.2rem / 1.15 var(--font-heading);
}

@media (prefers-reduced-motion: no-preference) {
    .alb img,
    .tiles img {
        transition: transform 0.25s;
    }

    .mouse .alb:hover img,
    .mouse .tiles a:hover img {
        transform: scale(1.04);
    }
}

.tiles a {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--photo-bg);
    border-radius: var(--radius);
}

.tiles a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.tiles img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (min-width: 600px) {
    .agrid {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        gap: 20px;
    }
}

.feed {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ni {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text);
}

.ni img {
    flex: none;
    width: 96px;
    height: auto;
    background: var(--accent-soft);
    border-radius: var(--radius);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.nt {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.nt time {
    font-size: 0.82rem;
    color: var(--muted);
}

.nt h2 {
    overflow-wrap: anywhere;
    font-size: 1.25rem;
}

.nt p:not(.note) {
    text-align: justify;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.pages {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pages a {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.pages a[rel="next"] {
    margin-left: auto;
}

.mouse .ni:hover h2 {
    color: var(--accent);
}

@media (min-width: 600px) {
    .feed {
        gap: 20px;
    }

    .ni {
        gap: 20px;
    }

    .ni img {
        width: 200px;
    }

    .nt h2 {
        font-size: 1.5rem;
    }
}

.news {
    display: flow-root;
    max-width: 70ch;
}

.news > * {
    margin: 0 0 16px;
}

.news > :last-child {
    margin-bottom: 0;
}

.news > time {
    display: block;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--muted);
}

.news .lh1 {
    margin-bottom: 12px;
}

.news .rich :is(ul, ol) {
    display: flow-root;
}

.news figure {
    clear: both;
}

.news figure button {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    background: none;
    border: 0;
    cursor: zoom-in;
}

.news figure button:disabled,
.pub figure > button:disabled {
    cursor: default;
}

.news figure button:not(:has(img)) {
    aspect-ratio: 16 / 9;
    background: var(--photo-bg);
    border-radius: var(--radius);
}

.news figure img {
    display: block;
    width: 100%;
    height: auto;
    background: var(--photo-bg);
    border-radius: var(--radius);
}

.news figcaption {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--muted);
}

@media (min-width: 600px) {
    .news figure:is(.left, .right) {
        clear: none;
        width: 45%;
        margin-top: 4px;
    }

    .news figure.left {
        float: left;
        margin-right: 20px;
    }

    .news figure.right {
        float: right;
        margin-left: 20px;
    }
}

.links {
    max-width: 70ch;
    margin-top: 28px;
}

.links h2 {
    margin-bottom: 10px;
    font-size: 1.25rem;
}

.links ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.links a {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
    padding: 8px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.links :is(img, i) {
    flex: none;
    width: 64px;
    height: 80px;
    object-fit: cover;
    background: var(--photo-bg);
    border-radius: 6px;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.links span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.links small {
    font-size: 0.8rem;
    color: var(--muted);
}

.links b {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.mouse .links a:hover b {
    color: var(--accent);
}

.guides {
    max-width: 70ch;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.guides li {
    border-bottom: 1px solid var(--line);
}

.guides a {
    display: block;
    padding: 14px 0;
    overflow-wrap: anywhere;
    font: 600 1.2rem / 1.25 var(--font-heading);
    color: var(--text);
}

.mouse .guides a:hover {
    color: var(--accent);
}

.guides .note {
    margin: -8px 0 12px;
}

.jump {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 6px;
    margin: 0 -16px;
    padding: 8px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}

.jump::-webkit-scrollbar {
    display: none;
}

.jump a {
    flex: none;
    padding: 5px 12px;
    font-size: 0.9rem;
    white-space: nowrap;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.jump a span {
    margin-left: 2px;
    font-size: 0.85em;
    color: var(--muted);
}

.jump a[aria-current] {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
}

.jump a[aria-current] span {
    color: inherit;
    opacity: 0.8;
}

.grp {
    scroll-margin-top: 60px;
}

.grp h2 {
    margin: 4px 0 10px;
    padding-bottom: 6px;
    font-size: 1.7rem;
    color: var(--accent);
    border-bottom: 1px solid var(--line);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ac {
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.ac .ph {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    background: var(--photo-bg);
}

.ac .ph img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ac .status {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--surface);
}

.ac .tx {
    min-width: 0;
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px 12px;
}

.ac h3 {
    font-size: 1.6rem;
}

.ac h3 a {
    color: var(--text);
}

.ac .facts {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 8px;
    margin: 0;
    font-size: 0.88rem;
}

@container (width < 260px) {
    .ac .facts {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0;
    }

    .ac .facts dt:not(:first-child) {
        margin-top: 5px;
    }
}

.ac .go {
    margin-top: auto;
    padding-top: 4px;
    font-size: 0.88rem;
}

@media (min-width: 640px) and (max-width: 999px) {
    .cards {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (min-width: 900px) {
    .cards {
        gap: 18px;
    }
}

@media (max-width: 479px) {
    .jump {
        gap: 5px;
    }

    .jump a {
        padding: 4px 10px;
        font-size: 0.84rem;
    }

    .jump a span {
        display: none;
    }
}

.rich {
    max-width: 70ch;
    line-height: 1.65;
}

.rich > * {
    margin: 0 0 0.9em;
}

.rich h2,
.rich h3 {
    margin-top: 1.3em;
    line-height: 1.2;
}

.rich h2 {
    font-size: 1.6rem;
}

.rich h3 {
    font-size: 1.3rem;
}

.rich > :first-child {
    margin-top: 0;
}

.rich > :last-child {
    margin-bottom: 0;
}

.rich p,
.rich li {
    -webkit-hyphens: auto;
    hyphens: auto;
}

.rich ul,
.rich ol {
    padding-left: 1.5em;
}

.rich li + li,
.rich li > ul,
.rich li > ol {
    margin-top: 0.35em;
}

.rich a,
.rich u {
    text-decoration: underline 1px;
    text-underline-offset: 0.2em;
}

@media (min-width: 480px) {
    .rich p,
    .rich li {
        text-align: justify;
    }
}

.pub {
    display: flow-root;
    max-width: 70ch;
    overflow-wrap: anywhere;
}

.pub > * {
    margin: 0 0 1.1em;
}

.pub .rich :is(ul, ol) {
    display: flow-root;
}

.pub figure {
    clear: both;
}

.pub figure > button {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    background: var(--photo-bg);
    border: 0;
    border-radius: var(--radius);
    cursor: zoom-in;
}

.pub figure > button:not(:has(img)) {
    aspect-ratio: 16 / 9;
}

.pub img {
    display: block;
    width: 100%;
    height: auto;
}

.pub figcaption {
    margin-top: 0.4em;
    font-size: 0.9rem;
    color: var(--muted);
}

.pub figcaption p {
    margin: 0;
}

@media (min-width: 640px) {
    .pub .left {
        float: left;
        clear: left;
        width: 45%;
        margin: 0.3em 1.5em 1em 0;
    }

    .pub .right {
        float: right;
        clear: right;
        width: 45%;
        margin: 0.3em 0 1em 1.5em;
    }
}

main.review-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 10px;
    padding-bottom: 24px;
}

main.review-page > :not(h1) {
    max-width: 70ch;
}

.review-rules,
.review-own,
.review-card {
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.review-rules ul {
    margin: 0.9em 0 0;
    padding-left: 1.2em;
}

.review-own {
    overflow-wrap: anywhere;
}

.review-own p {
    margin: 0.5em 0 0;
}

.review-comment {
    padding-left: 12px;
    border-left: 3px solid var(--accent);
    overflow-wrap: anywhere;
}

.review-comment p {
    margin: 0;
}

.review-comment p + p {
    margin-top: 0.5em;
}

.review-own .stars {
    margin-left: 0.4em;
    color: var(--accent);
    white-space: nowrap;
}

.review-card {
    max-width: 70ch;
    overflow-wrap: anywhere;
}

.review-card p {
    margin: 0;
}

.review-card p + p {
    margin-top: 0.5em;
}

.review-card .review-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 10px;
}

.review-text {
    margin-top: 0.5em;
}

.review-meta time {
    font-size: 0.82rem;
    color: var(--muted);
}

.review-meta .stars,
.review-rating .stars {
    color: var(--accent);
    white-space: nowrap;
}

.review-card .links {
    margin-top: 12px;
}

.review-reply {
    margin-top: 12px;
    padding-left: 12px;
    border-left: 3px solid var(--accent);
}

.review-rating {
    margin: 0;
    font-weight: 600;
}

.block .review-card {
    padding: 0;
    background: none;
    border: 0;
}

.block .feed > li + li {
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.review-correction,
.review-kept,
.review-until {
    margin: 0;
}

.review-done {
    font-weight: 600;
}

form.review {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

form.review[hidden] {
    display: none;
}

form.review .links {
    margin-top: 0;
}

form.review label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--muted);
}

form.review :is(input, textarea) {
    min-width: 0;
    padding: 8px 10px;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
}

form.review textarea {
    resize: vertical;
}

form.review > button,
.review-edit {
    align-self: flex-start;
    min-height: 44px;
    padding: 8px 18px;
    font: 600 0.9rem/1.4 var(--font-body);
    color: var(--on-accent);
    background: var(--accent);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

form.review > button:disabled {
    opacity: 0.6;
    cursor: default;
}

form.review .stars {
    display: flex;
    margin: 0;
    padding: 0;
    border: 0;
}

form.review .stars legend {
    padding: 0;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: var(--muted);
}

form.review .stars label {
    position: relative;
    display: block;
    width: 44px;
    height: 44px;
    color: var(--line);
    cursor: pointer;
}

form.review .stars label::before {
    content: "\2605";
    content: "\2605" / "";
    display: block;
    font-size: 2rem;
    line-height: 44px;
    text-align: center;
}

form.review .stars span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

form.review .stars input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

form.review .stars label:is(:has(input:checked), :has(~ label input:checked)) {
    color: var(--accent);
}

form.review .stars label:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    border-radius: 8px;
}

.review-status:empty {
    display: none;
}

.review-status {
    margin: 0;
}

main.chat-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 10px;
    padding-bottom: 24px;
}

.chat-open {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 15;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    font: 600 0.95rem/1.2 var(--font-body);
    color: var(--btn-text);
    background: var(--btn-pattern) left top / var(--btn-pattern-size) var(--btn-pattern-repeat), var(--btn-bg);
    border: 0;
    border-radius: var(--btn-radius);
    box-shadow: inset 0 0 0 1px var(--btn-border), 0 6px 20px color-mix(in srgb, var(--text) 30%, transparent);
    cursor: pointer;
}

.chat-open svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
}

.chat-open span {
    display: none;
}

dialog.chat[open] + .chat-open,
.chat-open[hidden] {
    display: none;
}

dialog.chat {
    position: fixed;
    inset: 0;
    z-index: 20;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    color: var(--text);
    background: var(--surface);
    border: 0;
}

dialog.chat[open] {
    display: flex;
    flex-direction: column;
}

dialog.chat [hidden] {
    display: none;
}

.chat-log {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 12px 16px;
    overflow-y: auto;
    list-style: none;
}

.chat-log:empty {
    display: none;
}

.chat-log li {
    align-self: flex-start;
    max-width: 85%;
    padding: 7px 12px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.chat-log li.visitor {
    align-self: flex-end;
    background: var(--accent-soft);
    border-color: var(--accent-soft);
}

.chat-log p {
    white-space: pre-wrap;
}

.chat-log img {
    display: block;
    max-width: 100%;
    border-radius: 8px;
}

.chat-shot {
    display: block;
    max-width: 100%;
    padding: 0;
    background: none;
    border: 0;
    cursor: zoom-in;
}

.chat-shot img {
    max-height: min(320px, 50svh);
}

.chat-log time {
    display: block;
    font-size: 0.75rem;
    text-align: right;
    color: var(--muted);
}

.chat-animal {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.chat-animal span {
    overflow-wrap: anywhere;
}

.chat-animal img {
    flex: none;
    width: 48px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.chat-log .chat-animal {
    margin-bottom: 6px;
}

.chat-attach {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 16px;
    border-top: 1px solid var(--line);
}

.chat-attach .chat-animal {
    flex: 1;
}

.chat-attach button {
    flex: none;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.chat-start,
.chat-send,
.chat-ended {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 12px 16px;
}

.chat-start,
.chat-ended {
    flex: 1;
    overflow-y: auto;
}

.chat-send {
    flex-direction: row;
    align-items: flex-end;
    border-top: 1px solid var(--line);
}

.chat label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--muted);
}

.chat input,
.chat textarea {
    min-width: 0;
    padding: 8px 10px;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    resize: vertical;
}

.chat-send textarea {
    flex: 1;
    resize: none;
}

.chat-start > button,
.chat-send > button,
.chat-ended > button {
    align-self: flex-end;
    min-height: 44px;
    padding: 8px 18px;
    font: 600 0.9rem/1.4 var(--font-body);
    color: var(--on-accent);
    background: var(--accent);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.chat-send > .chat-pick {
    flex: none;
    width: 44px;
    padding: 0;
    color: var(--accent);
    background: none;
    border: 1px solid var(--accent);
}

.chat-pick svg {
    display: block;
    width: 24px;
    height: 24px;
    margin: auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
}

.chat-pick[aria-disabled="true"] {
    opacity: 0.5;
    cursor: help;
}

.chat .dh button {
    min-width: 44px;
    min-height: 44px;
    margin: -8px -12px -8px 0;
}

.chat button:disabled {
    opacity: 0.6;
    cursor: progress;
}

.chat-status {
    padding: 0 16px 8px;
    font-size: 0.85rem;
    color: var(--muted);
}

.chat-status:empty {
    display: none;
}

.chat-note {
    padding: 8px 16px 10px;
    font-size: 0.75rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.chat-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0 16px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
}

.chat-tools button {
    min-height: 44px;
    padding: 0;
    font: 600 0.85rem/1.3 var(--font-body);
    color: var(--accent);
    text-align: left;
    background: none;
    border: 0;
    cursor: pointer;
}

.chat-tools .chat-delete {
    color: var(--muted);
}

.chat-device,
.chat-switch {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 1 auto;
    min-height: 0;
    padding: 12px 16px;
    overflow-y: auto;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--line);
}

.chat-device img {
    align-self: center;
    flex: none;
    width: min(180px, 50vw);
    aspect-ratio: 1;
    border-radius: 8px;
}

.chat-device img:not([src]) {
    visibility: hidden;
}

.chat-device > div,
.chat-switch > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-device button,
.chat-switch button {
    min-height: 44px;
    padding: 6px 14px;
    font: 600 0.85rem/1.4 var(--font-body);
    color: var(--accent);
    background: none;
    border: 1px solid var(--accent);
    border-radius: 999px;
    cursor: pointer;
}

.chat-switch button[value] {
    color: var(--on-accent);
    background: var(--accent);
}

dialog.chat:has(> :is(.chat-device, .chat-switch):not([hidden])) > :is(.chat-log, .chat-note) {
    display: none;
}

@media (max-height: 500px) {
    dialog.chat:has(> .chat-device:not([hidden])) > :is(.chat-send, .chat-attach) {
        display: none;
    }

    .chat-device {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-content: start;
        gap: 10px 16px;
    }

    .chat-device img {
        grid-row: 1 / span 3;
    }

    .chat-device > :not(img) {
        grid-column: 2;
    }
}

.chat-view {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--photo-bg);
    border: 0;
    cursor: zoom-out;
}

.chat-view img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chat-view button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--photo-fg);
    background: color-mix(in srgb, var(--photo-bg) 55%, transparent);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

@media (min-width: 640px) {
    .chat-open {
        padding: 10px 18px 10px 14px;
    }

    .chat-open span {
        display: inline;
    }
}

@media (min-width: 640px) and (min-height: 501px) {
    dialog.chat {
        inset: auto 16px 16px auto;
        width: min(380px, calc(100vw - 32px));
        height: min(600px, calc(100dvh - 32px));
        overflow: hidden;
        border-radius: var(--radius);
        box-shadow: 0 20px 60px color-mix(in srgb, var(--text) 30%, transparent);
    }
}
