:root {
    color-scheme: light;
    --bg: #f3f3f3;
    --card: #ffffff;
    --text: #1c1c1c;
    --muted: #6a6a6a;
    --line: #dcdcdc;
    --line-strong: #bdbdbd;
    --accent: #1c1c1c;
    --accent-text: #ffffff;
    --danger: #8a2b2b;
    --ok: #1f5a38;
    --focus: #5a5a5a;
    --input: #ffffff;
    --flash-error-border: #e3c1c1;
    --flash-ok-border: #c5ddd0;
    --score-4: #c2410c;
    --score-3: #f97316;
    --score-2: #eab308;
    --result-val: #2563eb;
    --radius: 8px;
    --max: 44rem;
    --font: "Yu Mincho", YuMincho, "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif JP", serif;
    --font-display: "Noto Sans JP", "Hiragino Sans", Meiryo, sans-serif;
    --font-mono: "Share Tech Mono", ui-monospace, monospace;
    --card-shadow: none;
    --border-w: 1px;
    --corner-mark-size: max(2.6rem, calc(var(--radius, 8px) + 1.7rem));
    --corner-mark-top: max(0.2rem, calc(var(--radius, 8px) * 0.42));
    --corner-mark-right: max(0.28rem, calc(var(--radius, 8px) * 0.48));
}

html.theme-dark {
    color-scheme: dark;
    --bg: #121212;
    --card: #1c1c1c;
    --text: #ececec;
    --muted: #9a9a9a;
    --line: #333333;
    --line-strong: #4a4a4a;
    --accent: #ececec;
    --accent-text: #161616;
    --danger: #e08a8a;
    --ok: #7dba96;
    --focus: #b0b0b0;
    --input: #242424;
    --flash-error-border: #5a3030;
    --flash-ok-border: #2d4a3a;
    --score-4: #fb923c;
    --score-3: #fdba74;
    --score-2: #facc15;
    --result-val: #60a5fa;
    --font: "Noto Sans JP", "Hiragino Sans", Meiryo, sans-serif;
    --font-display: "Noto Sans JP", "Hiragino Sans", Meiryo, sans-serif;
}

html.theme-bokequest {
    color-scheme: light;
    --bg: #f7f8ec;
    --card: #f7f8ec;
    --text: #444444;
    --muted: #666699;
    --line: #000000;
    --line-strong: #000000;
    --accent: #330000;
    --accent-text: #ffffff;
    --danger: #ff0000;
    --ok: #006600;
    --focus: #336699;
    --input: #ffffff;
    --flash-error-border: #ffcccc;
    --flash-ok-border: #cccccc;
    --score-4: #ff0000;
    --score-3: #ff6600;
    --score-2: #0066cc;
    --result-val: #ff0000;
    --radius: 0px;
    --border-w: 1px;
    --font: "Yu Mincho", YuMincho, "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif JP", serif;
    --font-display: "Kosugi", "MS UI Gothic", "Yu Gothic", "YuGothic", sans-serif;
    --font-mono: "Courier Prime", "Courier New", Courier, monospace;
    --page-bg: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 5px), repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 4px), radial-gradient(ellipse at 30% 20%, #4a322e, transparent 55%), radial-gradient(ellipse at 80% 80%, #3a2428, transparent 50%), #32201e;
    --header-bg: #330000;
    --header-text: #ffffff;
    --header-border: #000000;
    --nav-color: #eeeeee;
    --nav-hover-color: #ffffff;
    --nav-hover-bg: #4a1010;
    --button-bg: #7fffd4;
    --button-color: #000000;
}

html.theme-bokegram {
    color-scheme: light;
    --bg: #faf9f3;
    --card: #fcfcfc;
    --text: #222222;
    --muted: #666666;
    --line: #777777;
    --line-strong: #333333;
    --accent: #222222;
    --accent-text: #ffffff;
    --danger: #ff0000;
    --ok: #336699;
    --focus: #002bff;
    --input: #ffffff;
    --flash-error-border: #ffcccc;
    --flash-ok-border: #b0d0e6;
    --score-4: #ff4500;
    --score-3: #ff6347;
    --score-2: #002bff;
    --result-val: #ff4500;
    --radius: 0px;
    --border-w: 1px;
    --font: "Yu Gothic", YuGothic, "Yu Gothic Medium", "Hiragino Sans", Meiryo, "Noto Sans JP", sans-serif;
    --font-display: "Yu Gothic", YuGothic, "Hiragino Sans", "Noto Sans JP", sans-serif;
    --font-mono: "Courier Prime", "Courier New", Courier, monospace;
    --page-bg: repeating-conic-gradient(#1a1a1a 0% 25%, #111111 0% 50%) 0 0 / 56px 56px;
    --header-bg: #222222;
    --header-text: #ffffff;
    --header-border: #333333;
    --nav-color: #eeeeee;
    --nav-hover-color: #ffffff;
    --nav-hover-bg: #444444;
    --button-bg: #b0d0e6;
    --button-color: #222222;
}

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

html {
    font-size: 10px;
}

@media (min-width: 641px) {
    html {
        font-size: 16px;
    }
}

body {
    margin: 0;
    color: var(--text);
    background: var(--page-bg, var(--bg));
    background-attachment: fixed;
    font-family: var(--font);
    line-height: 1.65;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.wrap {
    width: min(var(--max), calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    background: var(--header-bg, var(--card));
    color: var(--header-text, var(--text));
    border-bottom: 1px solid var(--header-border, var(--line));
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.5rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.08em;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.15rem;
    font-size: 0.92rem;
}

.nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--nav-color, var(--muted));
    padding: 0.35rem 0.55rem;
    border-radius: var(--radius);
}

.nav a:hover {
    color: var(--nav-hover-color, var(--text));
    background: var(--nav-hover-bg, var(--bg));
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--nav-color, var(--muted));
    padding: 0.35rem 0.55rem;
    white-space: nowrap;
}

main.wrap {
    padding: 1.75rem 0 2.5rem;
}

h1 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0 0 0.75rem;
}

h1 .fa-solid,
.lead .fa-solid {
    color: var(--muted);
}

h2,
.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
    margin: 0 0 0.75rem;
}

.panel-title .fa-solid {
    color: var(--muted);
    width: 1.15em;
    text-align: center;
}

.panel-title .title-aside {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: 0;
}

.label-note {
    font-weight: 400;
    color: var(--muted);
}

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

.lead {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.hint,
.crumb {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
}

.crumb {
    margin: 0 0 0.75rem;
}

.flash {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius);
    border: var(--border-w) solid var(--line);
    background: var(--card);
    box-shadow: var(--card-shadow);
}

.flash-error {
    border-color: var(--flash-error-border);
    color: var(--danger);
}

.flash-success {
    border-color: var(--flash-ok-border);
    color: var(--ok);
}

.panel {
    background: var(--card);
    border: var(--border-w) solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    margin: 1.1rem 0;
    box-shadow: var(--card-shadow);
}

.empty {
    display: grid;
    justify-items: center;
    gap: 0.55rem;
    padding: 1.75rem 1.5rem;
    text-align: center;
    color: var(--muted);
    background: var(--card);
    border: var(--border-w) dashed var(--line);
    border-radius: var(--radius);
}

.empty-icon {
    font-size: 1.6rem;
}

.topic-list,
.admin-list,
.work-list,
.result-list,
.name-list,
.breakdown {
    list-style: none;
    margin: 0;
    padding: 0;
}

.topic-list {
    display: grid;
    gap: 0.75rem;
}

.topic-card {
    display: grid;
    gap: 0.4rem;
    padding: 1rem 1.1rem;
    background: var(--card);
    border: var(--border-w) solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    box-shadow: var(--card-shadow);
}

.topic-card:hover {
    border-color: var(--line-strong);
}

.topic-card-top,
.topic-flags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.topic-card-body {
    font-weight: 400;
    font-size: 1.05rem;
    white-space: pre-wrap;
}

.topic-card-image img,
.admin-thumb img {
    display: block;
    width: auto;
    max-width: 50%;
    max-height: 8rem;
    height: auto;
    object-fit: contain;
    object-position: left top;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: none;
}

.admin-thumb {
    margin: 0.35rem 0;
}

.admin-topic-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.admin-topic-link:hover {
    color: inherit;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.admin-table th,
.admin-table td {
    padding: 0.65rem 0.45rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.admin-table th {
    font-weight: 500;
    color: var(--muted);
    font-size: 0.85rem;
}

.admin-table-action {
    width: 1%;
    white-space: nowrap;
}

.admin-table-action .inline {
    margin: 0;
}

.admin-table-action .button {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
}

.admin-table .work-body {
    margin: 0;
}

.admin-vote-score {
    color: var(--muted);
}

.admin-vote-groups {
    display: grid;
    gap: 0.75rem;
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.admin-vote-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.admin-vote-name {
    margin: 0;
    font-weight: 500;
}

.admin-vote-head .muted {
    margin: 0.15rem 0 0;
}

.admin-table-nested {
    margin-top: 0;
}

.topic-card-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.badge,
.type-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    width: fit-content;
}

.badge {
    border: 1px solid var(--text);
}

.type-chip {
    color: var(--muted);
    background: var(--bg);
}

.person-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    background: var(--bg);
    border-radius: 999px;
    font-size: 0.92rem;
}

.badge-posting {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.badge-voting {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

.badge-result {
    background: #ea580c;
    color: #fff;
    border-color: #ea580c;
}

.badge-scheduled {
    background: transparent;
    color: var(--muted);
    border-color: var(--line);
}

.prompt {
    text-align: center;
    padding: 1.15rem 0.9rem;
    margin: 0.25rem 0 1.25rem;
    border: var(--border-w) solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--card-shadow);
}

.prompt-pin {
    position: sticky;
    top: 0;
    z-index: 30;
    padding-bottom: 1.25rem;
    background: var(--page-bg, var(--bg));
    background-attachment: fixed;
}

.prompt-pin .prompt {
    margin-bottom: 0;
}

.prompt-pin .vote-guide {
    margin: 0.85rem 0 0;
}

.odai-label {
    display: none;
}

.prompt-title {
    font-size: 1.05rem;
    font-weight: 400;
    margin: 0 0 0.5rem;
}

.prompt-body,
.work-body {
    white-space: pre-wrap;
    margin: 0.35rem 0;
}

.blank-fill {
    color: #ea580c;
}

.prompt-body {
    font-size: 1.08rem;
    font-weight: 400;
    line-height: 1.55;
    text-align: center;
}

.prompt-image {
    display: inline-block;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    text-align: center;
}

.prompt-image img {
    display: block;
    margin: 0 auto;
    border: 0;
    border-radius: 0;
}

.prompt-image-caption {
    margin: 0.55rem 0 0;
    font-size: 1.08rem;
    font-weight: 400;
    line-height: 1.55;
    text-align: center;
    white-space: pre-wrap;
}

@media (min-width: 641px) {
    .prompt-image {
        max-width: 70%;
    }
}

.meta-list {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 0.35rem 0.75rem;
    margin: 1rem 0;
}

.meta-list dt {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.meta-list dd {
    margin: 0;
}

.meta-list.compact {
    font-size: 0.92rem;
}

.name-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
}

.name-slash {
    margin: 0;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.name-count {
    margin: 0.35rem 0 0;
    text-align: center;
    color: var(--muted);
}

.form {
    display: grid;
    gap: 0.9rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    align-items: start;
}

.form label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.92rem;
    min-width: 0;
    max-width: 100%;
}

.form .score-zone {
    display: block;
    gap: 0;
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 2.6rem;
}

.password-toggle {
    position: absolute;
    right: 0.1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: var(--muted);
    border: 0;
    padding: 0.35rem 0.55rem;
    width: auto;
    gap: 0;
}

.password-toggle:hover {
    color: var(--text);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
}

.stat-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.1rem;
}

.stat-line span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.55rem 0.65rem;
    border: var(--border-w) solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    background: var(--input);
    color: inherit;
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border: 0;
    border-radius: var(--radius);
    background: var(--button-bg, var(--accent));
    color: var(--button-color, var(--accent-text));
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    width: fit-content;
}

.button-link,
.linkish {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    color: var(--muted);
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    width: auto;
}

.admin-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.35rem;
    margin-top: 0.85rem;
}

.admin-actions > a.button,
.admin-actions > .inline {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    display: flex;
    gap: 0;
}

.admin-actions .button {
    width: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.2rem;
    padding: 0.45rem 0.15rem 0.35rem;
    font-size: 1rem;
    white-space: nowrap;
}

.admin-action-label {
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.2;
}

.admin-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.35rem;
}

.admin-head-actions .button {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.2rem;
    padding: 0.45rem 0.55rem 0.35rem;
    font-size: 1rem;
    white-space: nowrap;
    min-width: 4.4rem;
}

.own-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.75rem;
}

.own-actions .inline {
    margin: 0;
}

.own-actions .button {
    padding: 0.4rem 0.8rem;
    font-size: 0.88rem;
    white-space: nowrap;
}

.form-post {
    margin-inline: auto;
    justify-items: center;
    width: min(100%, 28rem);
}

.form-post label {
    width: 100%;
}

.button-danger {
    background: var(--danger);
}

.button:disabled {
    opacity: 0.45;
    cursor: default;
}

.row-actions,
.page-head,
.inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.page-head {
    justify-content: space-between;
}

.page-head h1 {
    margin: 0;
}

.page-head p {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin: 0;
}

.admin-page-setting {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 0 0 1.1rem;
    font-size: 0.92rem;
}

.admin-page-setting label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.admin-page-setting input[type="number"] {
    width: 4.5rem;
}

.admin-page-setting select {
    width: auto;
    min-width: 6.5rem;
}

.admin-page-setting button {
    padding: 0.4rem 0.8rem;
    font-size: 0.88rem;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    margin: 1.25rem 0 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    padding: 0.35rem 0.6rem;
    border: var(--border-w) solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    color: inherit;
    text-decoration: none;
    font-size: 0.88rem;
}

.pagination a:hover {
    border-color: var(--line-strong);
    background: var(--bg);
}

.pagination .is-current {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
}

.pagination .is-disabled {
    color: var(--muted);
    background: transparent;
}

.status-control {
    display: inline-flex;
    margin: 0;
    width: auto;
}

.status-control select {
    width: auto;
    min-width: 7.5rem;
    padding: 0.28rem 0.5rem;
    font-size: 0.85rem;
}

.own-post + .own-post {
    margin-top: 1.15rem;
}

.work-item {
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0.95rem 0.9rem;
    min-height: 3.15rem;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--input);
}

.work-item .work-body {
    margin: 0;
}

.work-list {
    display: grid;
    gap: 0.45rem;
}

.work-card {
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0.95rem 2.1rem 0.95rem 0.9rem;
    min-height: 3.15rem;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--input);
}

.work-item.work-vote,
.work-item.work-mine {
    padding: 0.95rem 2.1rem 0.95rem 0.9rem;
}

.work-card .work-body,
.work-mine .work-body {
    margin: 0;
}

.work-mine::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    border-top: var(--corner-mark-size, 2.6rem) solid var(--line);
    border-left: var(--corner-mark-size, 2.6rem) solid transparent;
    pointer-events: none;
}

.work-mine.has-vote-bonus::before {
    content: attr(data-bonus);
    position: absolute;
    top: var(--corner-mark-top);
    right: var(--corner-mark-right);
    z-index: 3;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.vote-bonus-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.45;
    text-align: center;
}

.work-vote::before {
    position: absolute;
    top: var(--corner-mark-top);
    right: var(--corner-mark-right);
    z-index: 3;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.work-vote::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    border-top: var(--corner-mark-size, 2.6rem) solid transparent;
    border-left: var(--corner-mark-size, 2.6rem) solid transparent;
    pointer-events: none;
}

.score-zones {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    margin: 0;
    padding: 0;
    border: 0;
}

.score-zone {
    cursor: pointer;
}

.score-zone input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.work-vote .work-body {
    position: relative;
    z-index: 1;
    margin: 0;
    pointer-events: none;
}

.work-vote:has(input[value="4"]:checked) {
    border-color: var(--score-4);
}

.work-vote:has(input[value="4"]:checked)::before {
    content: "4";
}

.work-vote:has(input[value="4"]:checked)::after {
    border-top-color: var(--score-4);
}

.work-vote:has(input[value="3"]:checked) {
    border-color: var(--score-3);
}

.work-vote:has(input[value="3"]:checked)::before {
    content: "3";
}

.work-vote:has(input[value="3"]:checked)::after {
    border-top-color: var(--score-3);
}

.work-vote:has(input[value="2"]:checked) {
    border-color: var(--score-2);
}

.work-vote:has(input[value="2"]:checked)::before {
    content: "2";
}

.work-vote:has(input[value="2"]:checked)::after {
    border-top-color: var(--score-2);
}

.vote-guide {
    margin: 0 0 1rem;
}

.vote-guide-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    min-height: 3.15rem;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--input);
    overflow: hidden;
    pointer-events: none;
}

.vote-guide-part {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
}

.vote-guide-part.is-4 {
    color: var(--score-4);
}

.vote-guide-part.is-3 {
    color: var(--score-3);
}

.vote-guide-part.is-2 {
    color: var(--score-2);
}

.button-center,
.form-actions {
    justify-self: center;
}

.form-actions {
    display: flex;
    justify-content: center;
}

.vote-confirm-actions {
    flex-direction: row-reverse;
    gap: 0.75rem;
    align-items: center;
}

.result-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
    align-items: center;
    margin-bottom: 0.45rem;
}

.result-cards {
    display: grid;
    gap: 0.75rem;
    list-style: none;
    margin: 0 0 1.1rem;
    padding: 0;
}

.result-card {
    background: var(--card);
    border: var(--border-w) solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--card-shadow);
}

.result-author {
    font-weight: 500;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.85em;
    row-gap: 0.15em;
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
    cursor: pointer;
    list-style: none;
}

.result-meta::-webkit-details-marker,
.result-meta::marker {
    display: none;
}

.result-breakdown {
    margin: 0.7rem 0 0;
}

.result-voters {
    display: grid;
    gap: 0.2rem;
    margin-top: 0.55rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.result-voters-row {
    display: grid;
    grid-template-columns: 2.4em 1fr;
    gap: 0.55rem;
    margin: 0;
    line-height: 1.6;
}

.result-voters-row span:last-child {
    color: var(--text);
}

.result-lead {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
}

.result-paren {
    display: none;
}

.result-val {
    color: var(--result-val);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    width: fit-content;
}

.rank-1 {
    background: #8a7a3d;
    color: #fff;
}

.rank-2 {
    background: #6e6e6e;
    color: #fff;
}

.rank-3 {
    background: #7a5c4a;
    color: #fff;
}

.rank-other {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--line);
}

.ok-icon {
    color: var(--ok);
}

.ng-icon {
    color: var(--muted);
}

.crumb a,
.icon-text {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.crumb a {
    text-decoration: none;
}

.breakdown {
    margin-top: 0.5rem;
    font-size: 0.92rem;
}

.standings {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.95rem;
}

.standings th,
.standings td {
    padding: 0.65rem 0.35rem;
    text-align: center;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.standings th {
    font-weight: 500;
    color: var(--muted);
    font-size: 0.85rem;
}

.standings-rank,
.standings-score,
.standings-vote {
    white-space: nowrap;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.standings-rank {
    width: 4.6rem;
}

.standings-score {
    width: 3.6rem;
}

.standings-vote {
    width: 2.8rem;
}

.standings-name {
    width: auto;
    text-align: left;
    padding-left: 0.7rem;
    padding-right: 0.4rem;
}

.standings tbody tr:last-child td {
    border-bottom: 0;
}

.char-count {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: right;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

@media (max-width: 640px) {
    .header-inner {
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.35rem;
    }

    .logo {
        flex-shrink: 0;
    }

    .nav {
        flex-wrap: nowrap;
        justify-content: flex-end;
        min-width: 0;
        gap: 0;
        font-size: 0.85rem;
    }

    .nav a,
    .nav-user {
        padding: 0.3rem 0.35rem;
    }

    .nav-user {
        min-width: 0;
        max-width: 6.5rem;
        overflow: hidden;
    }

    .meta-list {
        grid-template-columns: 1fr;
    }

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

    .form {
        max-width: 100%;
    }

    input[type="datetime-local"] {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    input[type="datetime-local"]::-webkit-datetime-edit {
        min-width: 0;
        max-width: 100%;
        padding: 0;
    }

    input[type="datetime-local"]::-webkit-calendar-picker-indicator {
        margin-left: 0.15rem;
        flex-shrink: 0;
    }
}

html.theme-bokequest .site-header {
    background: transparent;
    border-bottom: 0;
}

html.theme-bokequest .header-inner {
    background: #330000;
    color: #ffffff;
    border: 1px solid #000000;
    border-bottom: 0;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
}

html.theme-bokequest main.wrap {
    background: #f7f8ec;
    border: 1px solid #000000;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
}

html.theme-bokequest .prompt-pin {
    background: var(--bg);
    background-attachment: scroll;
}

html.theme-bokequest .logo {
    letter-spacing: 0.04em;
    font-weight: 700;
}

html.theme-bokequest .prompt {
    background: #fffff0;
}

html.theme-bokequest .prompt-title,
html.theme-bokequest .prompt-body,
html.theme-bokequest .prompt-image-caption {
    color: #006600;
    font-weight: 700;
}

html.theme-bokequest .topic-card-body,
html.theme-bokequest .result-author,
html.theme-bokequest .work-body {
    color: #0066cc;
    font-weight: 700;
}

html.theme-bokequest .result-val,
html.theme-bokequest .rank-badge,
html.theme-bokequest .standings-score,
html.theme-bokequest .standings-rank,
html.theme-bokequest .vote-guide-part {
    font-family: var(--font-mono);
    font-weight: 700;
}

html.theme-bokequest .rank-1,
html.theme-bokequest .rank-2,
html.theme-bokequest .rank-3 {
    background: transparent;
    color: #ff0000;
    border: 0;
    padding: 0;
    font-size: 1.15rem;
}

html.theme-bokequest .rank-other {
    background: transparent;
    color: #ff6600;
    border: 0;
    padding: 0;
}

html.theme-bokequest .badge,
html.theme-bokequest .type-chip,
html.theme-bokequest .person-chip {
    border-radius: 0;
}

html.theme-bokequest button,
html.theme-bokequest .button:not(.button-link) {
    border: 1px solid #cccccc;
    font-weight: 700;
}

html.theme-bokequest input[type="text"],
html.theme-bokequest input[type="password"],
html.theme-bokequest input[type="number"],
html.theme-bokequest input[type="datetime-local"],
html.theme-bokequest input[type="file"],
html.theme-bokequest select,
html.theme-bokequest textarea {
    border-color: #cccccc;
    color: #336699;
}

html.theme-bokegram .site-header {
    background: transparent;
    border-bottom: 0;
}

html.theme-bokegram .header-inner {
    position: relative;
    background: #222222;
    color: #ffffff;
    border: 3px solid #333333;
    border-bottom: 0;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    padding-bottom: 1.45rem;
    min-height: calc(3.5rem + 1.45rem);
}

html.theme-bokegram .header-inner::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1.45rem;
    background: #b0d0e6;
    border-top: 1px solid #777777;
    pointer-events: none;
}

html.theme-bokegram main.wrap {
    background: #faf9f3;
    border: 3px solid #333333;
    border-top: 0;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
}

html.theme-bokegram .prompt-pin {
    background: var(--bg);
    background-attachment: scroll;
}

html.theme-bokegram .logo {
    letter-spacing: 0.04em;
    font-weight: 700;
}

html.theme-bokegram .prompt {
    background: #faf9f3;
    border-color: #777777;
}

html.theme-bokegram .prompt-title,
html.theme-bokegram .prompt-body,
html.theme-bokegram .prompt-image-caption {
    color: #222222;
    font-weight: 700;
}

html.theme-bokegram .topic-card-body,
html.theme-bokegram .work-body {
    color: #002bff;
    font-weight: 700;
}

html.theme-bokegram .result-val,
html.theme-bokegram .rank-badge,
html.theme-bokegram .standings-score,
html.theme-bokegram .standings-rank {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #ff4500;
}

html.theme-bokegram .vote-guide-part {
    font-family: var(--font-mono);
    font-weight: 700;
}

html.theme-bokegram .vote-guide-part.is-4 {
    color: var(--score-4);
}

html.theme-bokegram .vote-guide-part.is-3 {
    color: var(--score-3);
}

html.theme-bokegram .vote-guide-part.is-2 {
    color: var(--score-2);
}

html.theme-bokegram .rank-1,
html.theme-bokegram .rank-2,
html.theme-bokegram .rank-3,
html.theme-bokegram .rank-other {
    background: transparent;
    color: #ff4500;
    border: 0;
    padding: 0;
}

html.theme-bokegram .badge,
html.theme-bokegram .type-chip,
html.theme-bokegram .person-chip {
    border-radius: 0;
}

html.theme-bokegram .panel-title,
html.theme-bokegram h2 {
    font-weight: 700;
}

html.theme-bokegram button,
html.theme-bokegram .button:not(.button-link) {
    border: 1px solid #777777;
    font-weight: 700;
}

html.theme-bokegram input[type="text"],
html.theme-bokegram input[type="password"],
html.theme-bokegram input[type="number"],
html.theme-bokegram input[type="datetime-local"],
html.theme-bokegram input[type="file"],
html.theme-bokegram select,
html.theme-bokegram textarea {
    border-color: #777777;
    color: #222222;
}

html.theme-meijin {
    font-size: 15px;
    color-scheme: dark;
    --bg: #121212;
    --card: transparent;
    --text: #ffffff;
    --muted: #d5d5d5;
    --line: rgba(255, 255, 255, 0.22);
    --line-strong: #1c4d8d;
    --accent: #1c4d8d;
    --accent-text: #ffffff;
    --danger: #ffb4b4;
    --ok: #b7f0c8;
    --focus: #8eb6ef;
    --input: #ffffff;
    --flash-error-border: #e7b1b1;
    --flash-ok-border: #b7dcc8;
    --score-4: #d7263d;
    --score-3: #f08c00;
    --score-2: #1a7f37;
    --result-val: #ffffff;
    --radius: 4px;
    --border-w: 3px;
    --font: "Noto Sans JP", "Hiragino Sans", Meiryo, sans-serif;
    --font-display: "Noto Sans JP", "Hiragino Sans", Meiryo, sans-serif;
    --page-bg: #121212 url("brick.png") repeat;
    --header-bg: #0f2755;
    --header-text: #ffffff;
    --header-border: #0f2755;
    --nav-color: #ffffff;
    --nav-hover-color: #ffffff;
    --nav-hover-bg: rgba(255, 255, 255, 0.12);
    --button-bg: #1c4d8d;
    --button-color: #ffffff;
}

@media (min-width: 641px) {
    html.theme-meijin {
        font-size: 24px;
        --max: calc(44rem * 16 / 24);
    }
}

html.theme-meijin .site-header {
    background: #0f2755;
    border-bottom: 0;
}

html.theme-meijin .logo {
    font-weight: 700;
    letter-spacing: 0.04em;
}

html.theme-meijin .odai-label,
html.theme-meijin .panel-title,
html.theme-meijin h2 {
    display: flex;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.45rem;
}

html.theme-meijin .panel {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

html.theme-meijin .panel:has(.name-slash),
html.theme-meijin .panel:has(.standings) {
    background: #1d4d8d;
    border-radius: 4px;
    padding: 1.15rem 1.2rem;
    color: #ffffff;
}

html.theme-meijin .panel:has(.standings) {
    background: #0f2755;
}

html.theme-meijin .name-count,
html.theme-meijin .standings th,
html.theme-meijin .title-aside {
    color: rgba(255, 255, 255, 0.82);
}

html.theme-meijin .standings th,
html.theme-meijin .standings td {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

html.theme-meijin .prompt {
    background: #ffffff;
    color: #111111;
    text-align: left;
    border: 0;
    border-radius: 4px;
    box-shadow: none;
    padding: 0.95rem 1.7rem;
}

html.theme-meijin .prompt-body,
html.theme-meijin .prompt-title,
html.theme-meijin .prompt-image-caption {
    color: #111111;
    text-align: left;
    font-weight: 400;
}

html.theme-meijin .prompt-body,
html.theme-meijin .prompt-image-caption,
html.theme-meijin .work-body {
    font-size: 0.96rem;
}

html.theme-meijin .prompt-image {
    display: block;
    max-width: none;
    text-align: left;
}

html.theme-meijin .prompt-image img {
    margin: 0;
    max-height: 8.5rem;
    width: auto;
}

html.theme-meijin .work-list {
    gap: 0.7rem;
}

html.theme-meijin .work-card,
html.theme-meijin .vote-guide-row {
    background: #ffffff;
    color: #111111;
    border: 3px solid #1c4d8d;
    border-radius: 4px;
}

html.theme-meijin .work-card {
    padding-top: 1.2rem;
    padding-bottom: 1.2rem;
}

html.theme-meijin .work-item {
    background: #1c4d8d;
    color: #111111;
    border: 3px solid #1c4d8d;
    border-radius: 4px;
    padding: 0.45rem 0.5rem 2.35rem;
}

html.theme-meijin .work-item .work-body {
    background: #ffffff;
    color: #111111;
    border-radius: 3px;
    padding: 0.42rem 0.7rem;
    font-weight: 500;
}

html.theme-meijin .work-card .work-body {
    color: #111111;
    font-weight: 500;
}

html.theme-meijin .work-vote:has(input[value="4"]:checked) {
    border-color: var(--score-4);
}

html.theme-meijin .work-vote:has(input[value="3"]:checked) {
    border-color: var(--score-3);
}

html.theme-meijin .work-vote:has(input[value="2"]:checked) {
    border-color: var(--score-2);
}

html.theme-meijin .work-mine::after {
    border-top-color: #1c4d8d;
}

html.theme-meijin .blank-fill {
    color: #ff6600;
}

html.theme-meijin .vote-guide-part {
    font-weight: 700;
}

html.theme-meijin .topic-card {
    background: #ffffff;
    color: #111111;
    border: 3px solid #1c4d8d;
}

html.theme-meijin .topic-card-body {
    color: #111111;
    font-weight: 500;
}

html.theme-meijin .admin-list .topic-card-body,
html.theme-meijin main.wrap > .topic-card-body {
    display: block;
    background: #ffffff;
    color: #111111;
    border-radius: 4px;
    box-shadow: none;
    padding: 0.95rem 1.7rem;
    margin: 0.55rem 0 0;
    font-weight: 400;
    font-size: 0.96rem;
}

html.theme-meijin .topic-card .muted,
html.theme-meijin .topic-card-meta {
    color: #555555;
}

html.theme-meijin .result-cards {
    gap: 1.15rem;
}

html.theme-meijin .result-card {
    background: #0f2755;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 1.15rem 1.2rem;
}

html.theme-meijin .result-card .work-body {
    background: #ffffff;
    color: #111111;
    border-radius: 3px;
    padding: 1.15rem 0.75rem;
    font-weight: 500;
}

html.theme-meijin .result-author {
    color: #b7c0cc;
    font-size: 0.75rem;
    font-weight: 400;
}

html.theme-meijin .result-breakdown {
    margin: 0;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(186, 198, 214, 0.55);
}

html.theme-meijin .result-card .work-body {
    margin-bottom: 0.8rem;
}

html.theme-meijin .result-meta {
    color: #b7c0cc;
    column-gap: 0.9em;
}

html.theme-meijin .result-lead {
    gap: 0.75em;
}

html.theme-meijin .result-sep,
html.theme-meijin .result-voted {
    display: none;
}

html.theme-meijin .result-paren {
    display: inline;
}

html.theme-meijin .result-total {
    color: #8ec8ff;
    font-size: 1.08rem;
    font-weight: 700;
}

html.theme-meijin .result-total .result-val {
    color: inherit;
    font-weight: inherit;
}

html.theme-meijin .result-score-label {
    color: #8ec8ff;
}

html.theme-meijin .result-rate,
html.theme-meijin .result-rate .result-val,
html.theme-meijin .result-score .result-val {
    color: #b7c0cc;
    font-weight: 400;
}

html.theme-meijin .result-voters,
html.theme-meijin .result-voters-row span:last-child {
    color: rgba(255, 255, 255, 0.82);
}

html.theme-meijin .rank-1,
html.theme-meijin .rank-2,
html.theme-meijin .rank-3,
html.theme-meijin .rank-other {
    border: 0;
    border-radius: 999px;
    padding: 0.22rem 0.72rem;
    color: #ffffff;
}

html.theme-meijin .rank-1 {
    background: linear-gradient(135deg, #f5c842, #f5a623);
}

html.theme-meijin .rank-2 {
    background: linear-gradient(135deg, #d0d0d0, #a8a8a8);
    color: #222222;
}

html.theme-meijin .rank-3 {
    background: linear-gradient(135deg, #e8a96b, #c97c4a);
}

html.theme-meijin .rank-other {
    background: rgba(255, 255, 255, 0.16);
}

html.theme-meijin .flash {
    background: #ffffff;
    color: #111111;
}

html.theme-meijin .flash-error {
    color: #8a2b2b;
}

html.theme-meijin .flash-success {
    color: #1f5a38;
}

html.theme-meijin .empty {
    background: rgba(15, 39, 85, 0.88);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

html.theme-meijin input[type="text"],
html.theme-meijin input[type="password"],
html.theme-meijin input[type="number"],
html.theme-meijin input[type="datetime-local"],
html.theme-meijin input[type="file"],
html.theme-meijin select,
html.theme-meijin textarea {
    color: #111111;
    background: #ffffff;
    border-color: #c8c8c8;
}

html.theme-meijin button,
html.theme-meijin .button:not(.button-link) {
    font-weight: 700;
}

html.theme-meijin .button-link,
html.theme-meijin .crumb,
html.theme-meijin .crumb a {
    color: #dbe7ff;
}

html.theme-meijin .pagination a,
html.theme-meijin .pagination span {
    background: #ffffff;
    color: #111111;
    border-color: #1c4d8d;
}

html.theme-meijin .pagination .is-current {
    background: #1c4d8d;
    color: #ffffff;
    border-color: #1c4d8d;
}
