.public-body {
    min-height: 100vh;
}

.public-shell {
    position: relative;
    z-index: 1;
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
    padding: 54px 0 36px;
}

.public-hero {
    border-top: 1px solid var(--ink);
    padding-top: 16px;
    margin-bottom: 36px;
}

.hero-kicker {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .2em;
}

.hero-line {
    width: 74px;
    height: 2px;
    background: var(--red);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
    gap: 48px;
    align-items: end;
    padding: 36px 0 18px;
}

.hero-grid h1 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(48px, 7.4vw, 104px);
    line-height: .94;
    font-weight: 600;
    letter-spacing: -.06em;
}

.hero-grid h1 em {
    color: var(--red);
    font-style: normal;
    letter-spacing: -.08em;
}

.hero-subtitle {
    margin: 22px 0 0;
    color: var(--muted);
    letter-spacing: .16em;
    font-size: 14px;
}

.hero-meta {
    border-left: 1px solid var(--line);
    padding-left: 28px;
}

.hero-count {
    font-family: var(--serif);
    font-size: 72px;
    line-height: .9;
    color: var(--red);
}

.hero-count-label {
    margin-top: 6px;
    font-size: 12px;
    letter-spacing: .14em;
}

.hero-meta p {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.matrix-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--ink);
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(244, 241, 235, .94);
    backdrop-filter: blur(10px);
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    border-bottom: 1px solid var(--ink);
    padding: 6px 0;
}

.search-mark {
    color: var(--red);
    font-size: 24px;
    line-height: 1;
}

.search-wrap input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    padding: 4px 0;
}

.search-wrap input::placeholder {
    color: #999287;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.filter-tab {
    border: 1px solid transparent;
    background: transparent;
    padding: 7px 13px;
    cursor: pointer;
    font-size: 13px;
    transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.filter-tab:hover,
.filter-tab.is-active {
    border-color: var(--ink);
}

.filter-tab.is-active {
    background: var(--ink);
    color: var(--white);
}

.matrix-header {
    display: grid;
    grid-template-columns: minmax(150px, .72fr) repeat(3, minmax(220px, 1fr));
    gap: 0;
    margin-top: 18px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.matrix-header > div {
    padding: 0 16px;
}

.matrix-list {
    border-top: 1px solid var(--ink);
}

.matrix-row {
    display: grid;
    grid-template-columns: minmax(150px, .72fr) repeat(3, minmax(220px, 1fr));
    border-bottom: 1px solid var(--line);
    min-height: 248px;
    animation: row-in .6s both;
}

.matrix-row:nth-child(2) { animation-delay: .03s; }
.matrix-row:nth-child(3) { animation-delay: .06s; }
.matrix-row:nth-child(4) { animation-delay: .09s; }
.matrix-row:nth-child(5) { animation-delay: .12s; }

@keyframes row-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.member-cell,
.platform-cell {
    padding: 22px 16px;
    min-width: 0;
}

.member-cell {
    position: relative;
    background: rgba(255, 255, 255, .34);
}

.row-index {
    display: block;
    color: var(--red);
    font-family: var(--serif);
    font-size: 12px;
}

.member-cell h2 {
    margin: 38px 0 0;
    font-family: var(--serif);
    font-size: clamp(25px, 2.5vw, 38px);
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: .02em;
}

.member-rule {
    display: block;
    width: 32px;
    height: 2px;
    background: var(--red);
    margin-top: 22px;
}

.platform-cell {
    border-left: 1px solid var(--line);
    transition: background .2s ease;
}

.matrix-row:hover .platform-cell {
    background: rgba(255, 255, 255, .48);
}

.platform-label {
    color: var(--red);
    font-size: 10px;
    letter-spacing: .12em;
    margin-bottom: 10px;
}

.platform-cell h3 {
    margin: 0 0 8px;
    font-family: var(--serif);
    font-size: 20px;
    line-height: 1.25;
    font-weight: 600;
    word-break: break-word;
}

.platform-stats {
    min-height: 22px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 11px;
}

.platform-stats b {
    color: var(--ink);
    font-weight: 600;
}

.qr-button {
    position: relative;
    display: block;
    width: 180px;
    height: 180px;
    margin-top: 14px;
    padding: 10px;
    border: 1px solid var(--line);
    background: var(--white);
    cursor: zoom-in;
    overflow: hidden;
}

.qr-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .24s ease;
}

.qr-button:hover img {
    transform: scale(1.035);
}

.qr-hover {
    position: absolute;
    inset: auto 8px 8px;
    background: rgba(23, 23, 23, .9);
    color: var(--white);
    font-size: 10px;
    letter-spacing: .08em;
    padding: 5px 7px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s ease, transform .2s ease;
}

.qr-button:hover .qr-hover {
    opacity: 1;
    transform: translateY(0);
}

.platform-cell.is-empty {
    color: #b4ada2;
}

.platform-empty {
    margin-top: 48px;
    font-size: 12px;
    letter-spacing: .12em;
}

.matrix-empty {
    text-align: center;
    padding: 80px 20px;
    border-bottom: 1px solid var(--line);
}

.matrix-empty span {
    color: var(--red);
    font-size: 10px;
    letter-spacing: .2em;
}

.matrix-empty h2 {
    font-family: var(--serif);
    font-size: 34px;
    margin: 12px 0 6px;
}

.matrix-empty p {
    color: var(--muted);
}

.qr-dialog {
    width: min(460px, calc(100vw - 32px));
    border: 0;
    padding: 28px;
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 30px 90px rgba(23, 23, 23, .28);
}

.qr-dialog::backdrop {
    background: rgba(20, 18, 15, .72);
    backdrop-filter: blur(4px);
}

.qr-dialog-close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: 0;
    background: transparent;
    font-size: 30px;
    cursor: pointer;
}

.qr-dialog-copy span {
    color: var(--red);
    font-size: 10px;
    letter-spacing: .16em;
}

.qr-dialog-copy h2 {
    margin: 6px 0 0;
    font-family: var(--serif);
    font-size: 30px;
}

.qr-dialog-copy p {
    margin: 2px 0 18px;
    color: var(--muted);
}

.qr-dialog img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border: 1px solid var(--line);
    padding: 18px;
}

.qr-dialog-hint {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin: 12px 0 0;
}

.public-footer {
    position: relative;
    z-index: 1;
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 38px;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .08em;
    border-top: 1px solid var(--line);
}

.public-footer a {
    text-decoration: none;
}

.public-footer a:hover {
    color: var(--red);
}

@media (max-width: 900px) {
    .public-shell {
        width: min(100% - 28px, 720px);
        padding-top: 28px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .hero-meta {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 18px 0 0;
    }

    .hero-meta p {
        margin-top: 10px;
    }

    .matrix-toolbar {
        position: static;
        flex-direction: column;
        align-items: stretch;
    }

    .search-wrap {
        min-width: 0;
    }

    .filter-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .filter-tab {
        white-space: nowrap;
    }

    .matrix-header {
        display: none;
    }

    .matrix-list {
        margin-top: 20px;
        display: grid;
        gap: 14px;
        border-top: 0;
    }

    .matrix-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border: 1px solid var(--line);
        background: rgba(255, 255, 255, .55);
        min-height: 0;
    }

    .member-cell {
        grid-column: 1 / -1;
        border-bottom: 1px solid var(--line);
        padding: 18px;
    }

    .member-cell h2 {
        margin-top: 8px;
    }

    .member-rule {
        margin-top: 10px;
    }

    .row-index {
        position: absolute;
        right: 18px;
        top: 18px;
    }

    .platform-cell {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 18px;
    }

    .platform-cell:nth-child(even) {
        border-left: 1px solid var(--line);
    }

    .platform-cell:nth-child(2),
    .platform-cell:nth-child(3) {
        border-top: 0;
    }

    .qr-button {
        width: min(180px, 100%);
        height: auto;
        aspect-ratio: 1;
    }

    .public-footer {
        width: min(100% - 28px, 720px);
    }
}

@media (max-width: 540px) {
    .hero-grid h1 {
        font-size: clamp(46px, 14vw, 68px);
    }

    .hero-count {
        font-size: 58px;
    }

    .matrix-row {
        grid-template-columns: 1fr;
    }

    .platform-cell,
    .platform-cell:nth-child(even) {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .qr-button {
        width: 100%;
        max-width: 220px;
    }
}

.error-page {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    max-width: 720px;
}

.error-page > span {
    color: var(--red);
    font-size: 10px;
    letter-spacing: .2em;
}

.error-page h1 {
    margin: 12px 0;
    font-family: var(--serif);
    font-size: clamp(44px, 7vw, 80px);
    line-height: .98;
    letter-spacing: -.05em;
}

.error-page p {
    max-width: 560px;
    color: var(--muted);
    margin-bottom: 24px;
}
