:root {
    color-scheme: light;
    font-family: system-ui, "Hiragino Sans", "Yu Gothic", sans-serif;
    color: #172e29;
    background: #eff4f1;
    --green: #205e49;
    --border: #d5e2da;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.6; }
.wrap { width: min(68rem, calc(100% - 2rem)); margin-inline: auto; }
.top { background: #163b32; color: #fff; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .85rem; }
.top a { color: inherit; font-size: .875rem; }
.top .brand { margin: 0; font-size: 1.125rem; font-weight: 750; text-decoration: none; overflow-wrap: anywhere; }
main { padding-block: 2rem 3rem; }
h1, h2, h3, p { margin-block: 0 .6rem; }
h1 { font-size: clamp(1.65rem, 5vw, 2.25rem); letter-spacing: .035em; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.15rem; overflow-wrap: anywhere; }
a { color: var(--green); text-underline-offset: .18em; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: .8rem; padding: clamp(1rem, 3vw, 1.5rem); margin-block: 1rem; }
.form { display: grid; gap: .9rem; max-width: 44rem; }
.form h2, .form p { margin: 0; }
.form label { display: grid; align-content: start; gap: .25rem; font-weight: 600; }
input:not([type="radio"]), select, textarea {
    width: 100%; min-width: 0; border: 1px solid #a7bbb1; border-radius: .4rem;
    background: #fff; color: inherit; font: inherit; padding: .55rem .65rem;
}
textarea { resize: vertical; }
button {
    justify-self: start; min-height: 2.75rem; background: var(--green); color: white; border: 1px solid var(--green);
    border-radius: .45rem; padding: .45rem 1rem; font: inherit; font-weight: 700; cursor: pointer;
}
.secondary { background: white; color: var(--green); }
:focus-visible { outline: 3px solid #2575a4; outline-offset: 3px; }
.pair { display: grid; grid-template-columns: 1fr 2fr; gap: .8rem; }
.actions, .event-link { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.message { padding: .65rem .8rem; border-radius: .4rem; background: #dceee4; }
.error { background: #fce9e7; color: #8d2721; }
.intro { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .2rem 1rem; color: #3c554e; }
.table-frame { overflow: auto; border: 1px solid var(--border); border-radius: .8rem; background: white; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
th, td { text-align: center; padding: .65rem .8rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
thead th { background: #e3eee7; }
tbody tr:last-child > * { border-bottom: 0; }
tr > th:first-child { position: sticky; left: 0; text-align: left; min-width: 10rem; border-right: 1px solid var(--border); }
tbody th { background: #fff; }
tbody th a { display: block; max-width: 12rem; white-space: normal; overflow-wrap: anywhere; }
small { display: block; color: #50655d; font-size: .875rem; font-weight: normal; }
.best { color: #164c76; background: #e9f4fc; }
.yes { color: #17634b; background: #eaf6ee; }
.maybe { color: #805719; background: #fff4d7; }
.no { color: #8b3735; background: #fbeceb; }
.section-title { margin-top: 2rem; }
.schedule { scroll-margin-top: 1rem; }
.kind { display: inline-block; border-radius: .4rem; background: #e6f1ea; color: var(--green); padding: .1rem .5rem; font-weight: 700; font-size: .875rem; margin-bottom: .35rem; }
.details { color: #3c554e; overflow-wrap: anywhere; }
.notes, .comment { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment { border-top: 1px solid var(--border); margin-top: .85rem; padding-top: .6rem; }
summary { cursor: pointer; color: var(--green); font-weight: 700; padding-block: .35rem; }
.answer { margin-top: .65rem; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { padding: 0; font-weight: 600; }
.choices { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .35rem; }
.choices label {
    display: flex; align-items: center; padding: .55rem .65rem; gap: .4rem; border: 1px solid var(--border);
    border-radius: .45rem; cursor: pointer;
}
input[type="radio"] { margin: 0; accent-color: var(--green); }
@media (max-width: 36rem) {
    main { padding-top: 1.25rem; }
    .pair { grid-template-columns: 1fr; }
    th, td { padding-inline: .55rem; }
    tr > th:first-child { min-width: 8.7rem; }
    tbody th a { max-width: 8.5rem; }
}
.slot-forms, .slot-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .8rem; }
.slot-forms { gap: 1.25rem; }
.slot-forms .form { align-content: start; justify-items: start; }
.slot-forms .form > label, .slot-dates { width: 100%; }
@media (max-width: 44rem) {
    .slot-forms { grid-template-columns: 1fr; }
}
@media (max-width: 30rem) {
    .slot-dates { grid-template-columns: 1fr; }
}
.board, .board-top-inner { width: calc(100% - 1rem); }
.board { padding-top: .65rem; }
.board .intro { margin-bottom: .3rem; gap: 0 .75rem; font-size: .875rem; }
.board-intro-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.board .table-frame {
    border-radius: .3rem;
    --total-column: 1.55rem;
}
.board table, .board-memos { font-size: .8125rem; }
.board table {
    --row-line-height: 1.15em;
    width: max-content;
    line-height: var(--row-line-height);
}
.board th, .board td {
    padding: .2rem .18rem;
    border-right: 1px solid var(--border);
}
.board thead th { position: sticky; top: 0; z-index: 3; background: #dcebe4; }
.board tbody tr > :first-child { position: static; }
.board thead tr > :first-child { left: auto; }
.board tbody th a { max-width: none; white-space: nowrap; }
.board .member-column {
    --member-width: calc(2em + .125rem + 1px);
    padding-inline: .0625rem;
    font-weight: 400;
    width: var(--uniform-member-width, var(--member-width));
    min-width: var(--uniform-member-width, var(--member-width));
    max-width: var(--uniform-member-width, var(--member-width));
    white-space: nowrap;
    overflow: hidden;
}
.board .member-column > span { display: inline-block; }
.board .numbered-member {
    display: inline-grid;
    justify-items: center;
    vertical-align: middle;
    text-decoration: none;
}
.board .numbered-member .member-name-text { text-decoration: underline; text-underline-offset: .18em; }
.board .member-number { font-variant-numeric: tabular-nums; }
.board .total { min-width: var(--total-column); }

.member-editor-heading {
    position: sticky;
    inset-block-start: 0;
    z-index: 5;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .25rem 1rem;
    flex-wrap: wrap;
    padding: .45rem .5rem;
    border-bottom: 1px solid var(--border);
    background: #eff4f1;
}
.member-editor-heading h2 { margin: 0; overflow-wrap: anywhere; }
.member-editor-table {
    width: 100%;
    background: white;
    border: 1px solid var(--border);
    border-radius: .45rem;
}
.member-editor-table th, .member-editor-table td { padding: .35rem .5rem; }
.member-editor-table tr > th:first-child { position: static; min-width: 0; white-space: normal; }
.member-editor-table tbody th { font-weight: 400; background: transparent; }
.member-editor-table tbody tr:nth-child(even) { background: #f4f7f5; }
.member-editor-table td { width: 1%; }
.member-editor-choices { display: flex; gap: .25rem; min-width: 0; }
.member-editor-choice { position: relative; cursor: pointer; }
.member-editor-choice input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: inherit;
}
.member-editor-choice span {
    display: grid;
    place-items: center;
    width: clamp(1.7rem, 7vw, 2.65rem);
    height: 2.55rem;
    background: #f0f3f1;
    color: #23352f;
    border: 1px solid #cedbd4;
    border-radius: .4rem;
    font-size: 1.05rem;
}
.member-editor-choice input:checked + span { background: #52665c; color: white; border-color: transparent; }
.member-editor-choice.best input:checked + span { background: #1e6293; }
.member-editor-choice.yes input:checked + span { background: #167451; }
.member-editor-choice.maybe input:checked + span { background: #8a610b; }
.member-editor-choice.no input:checked + span { background: #af3440; }
.member-editor-choice input:focus-visible + span { outline: 3px solid #2575a4; outline-offset: 2px; }
.member-editor-choice input:disabled { cursor: default; }
.member-editor-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    bottom: 0;
    padding: .55rem;
    background: #eff4f1;
    border-top: 1px solid var(--border);
}

.danger { background: #a33332; border-color: #a33332; }
.danger-link { color: #a33332; }

.board .event-row-actions { display: flex; align-items: center; justify-content: space-between; gap: .25rem; }
.board .event-row-actions form { display: flex; margin: 0; }
.board .event-row-actions > a:first-child { margin-inline-end: auto; }
.board .add-event-row,
.board .delete-event-row {
    display: grid;
    place-items: center;
    min-inline-size: 1.25rem;
    block-size: var(--row-line-height);
    min-block-size: 0;
    padding: 0 .15rem;
    border-radius: .2rem;
    font-size: inherit;
    line-height: 1;
}
.board .delete-event-row {
    border: 1px solid #a33332;
    background: #a33332;
    color: white;
    text-decoration: none;
}
.inline-event-editor { position: relative; display: inline-grid; max-inline-size: 100%; }
.inline-event-editor input { padding: .15rem .5rem; }
.inline-event-editor input:focus-visible {
    outline: 1px solid #71877e;
    outline-offset: 1px;
}
.inline-event-error { color: #8d2721; white-space: normal; overflow-wrap: anywhere; }
.inline-event-error:empty { display: none; }
.inline-event-measure {
    position: absolute;
    inset: 0 auto auto 0;
    inline-size: max-content;
    white-space: pre;
    visibility: hidden;
    pointer-events: none;
}
.board .inline-event-editor { max-inline-size: none; margin-inline-end: auto; flex-shrink: 0; }
.board tbody th[scope="row"] { font-weight: 400; }
[data-edit-label] { color: inherit; font-weight: 400; text-decoration: none; }
.plain-slot-label { color: #65766e; }

.board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .45rem;
}
.board-years { display: flex; align-self: end; gap: .25rem; }
.board-years a {
    display: block;
    padding: .3rem .8rem;
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: .35rem .35rem 0 0;
    font-size: .9rem;
    text-decoration: none;
}
.board-years a[aria-current="page"] { background: var(--green); border-color: var(--green); color: white; }
.board-toolbar .heading-actions { align-items: center; gap: .65rem; padding-bottom: .3rem; font-size: .875rem; }
.heading-action {
    display: inline-block;
    min-width: 4.4rem;
    min-height: 2rem;
    padding: .3rem .75rem;
    border: 1px solid #42806a;
    border-radius: .35rem;
    background: linear-gradient(#fff, #e6f1eb);
    box-shadow: 0 2px 0 #42806a, 0 3px 4px #163b3229;
    color: var(--green);
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
}
.heading-actions { display: flex; gap: .35rem; }
.heading-action:active,
.heading-action[aria-pressed="true"] {
    transform: translateY(2px);
    border-color: #164b3a;
    background: linear-gradient(#174b3a, #246b52);
    box-shadow: inset 0 2px 4px #102f26b3, 0 1px 0 #ffffffa6;
    color: white;
}
#member-order-form { max-width: none; }
.member-order-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    inline-size: min(100%, 18rem);
    align-items: stretch;
    gap: .28rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.member-order-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .15rem;
}
.member-order-handle,
.member-remove {
    min-height: 1.55rem;
    border: 1px solid var(--border);
    border-radius: .25rem;
    font-size: .8125rem;
    line-height: 1.2;
}
.member-order-handle {
    justify-self: stretch;
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .15rem .3rem;
    background: #f4f7f5;
    color: inherit;
    font-weight: 400;
    text-align: start;
    overflow-wrap: anywhere;
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.member-grip {
    flex: none;
    inline-size: 8px;
    block-size: 12px;
    background: radial-gradient(circle, #80918a 1px, transparent 1.25px) 0 0 / 4px 4px;
}
.member-remove {
    display: grid;
    place-items: center;
    padding-inline: .3rem;
    color: #a33332;
    text-decoration: none;
}
.is-dragging .member-order-handle { background: #dceee4; cursor: grabbing; }
#member-order-form button:disabled { opacity: .55; cursor: default; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.member-editor-memo { margin-block: 1rem; }
.member-editor-memo label { display: block; font-weight: 600; margin-block-end: .25rem; }
.board-memos { margin-block-start: 1rem; max-inline-size: 55rem; }
.board-memo-list, .event-comments-list {
    display: grid;
    grid-template-columns: max-content fit-content(35%) minmax(0, 1fr);
    column-gap: .45rem;
}
.board-memo-list {
    list-style: none;
    padding: 0;
    margin-block: 0 .5rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: .35rem;
}
.board-memo-list li { padding: .3rem .6rem; overflow-wrap: anywhere; }
.board-memo-list li + li { border-block-start: 1px solid var(--border); }
.board-memo-list li:not([hidden]), .event-comments-list li {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: baseline;
}
.board-memo-list li span { white-space: pre-wrap; }
.board-memo-list time, .event-comments-list time, .missing-comment-time { color: #566a61; font-variant-numeric: tabular-nums; white-space: nowrap; }

.member-editor-table .member-event-comment { width: clamp(7rem, 30vw, 24rem); }
.member-event-comment input { padding: .35rem .45rem; }
.event-comments-trigger {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: 400;
    line-height: inherit;
    text-align: start;
}
.event-comments-trigger.plain-slot-label { color: #65766e; }
.event-comments-dialog {
    box-sizing: border-box;
    width: min(38rem, calc(100% - 2rem));
    max-height: 80vh;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: .5rem;
    color: inherit;
}
.event-comments-dialog::backdrop { background: #162a24aa; }
.event-comments-heading { display: flex; align-items: start; justify-content: space-between; gap: .75rem; }
.event-comments-heading h2 { overflow-wrap: anywhere; }
.event-comments-heading button { min-height: 2rem; white-space: nowrap; }
.event-comments-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.event-comments-list li { padding: .45rem 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.event-comments-list span { white-space: pre-wrap; }
.event-comment-note {
    position: relative;
    display: inline-block;
    width: .85em;
    height: .9em;
    margin-inline-start: .35em;
    vertical-align: -.06em;
    background: #f7ce59;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
}
.event-comment-note::after {
    position: absolute;
    inset: auto 0 0 auto;
    width: 30%;
    height: 30%;
    background: #b97d14;
    content: '';
}

@media (max-width: 36rem) {
    .member-editor-table, .member-editor-table tbody { display: block; }
    .member-editor-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
    .member-editor-table tbody tr {
        display: grid;
        grid-template-columns: max-content minmax(0, 1fr);
        align-items: center;
        gap: .3rem .45rem;
        padding: .4rem .5rem;
        border-bottom: 1px solid var(--border);
    }
    .member-editor-table tbody tr:last-child { border-bottom: 0; }
    .member-editor-table tbody th,
    .member-editor-table tbody td { padding: 0; border: 0; }
    .member-editor-table tbody th { grid-column: 1 / -1; overflow-wrap: anywhere; }
    .member-editor-table tbody td,
    .member-editor-table .member-event-comment { width: auto; }
    .member-event-comment input { font-size: 1rem; }
}

.year-add-form { margin-block-start: .75rem; }
.board-date-add { margin-block: .35rem .6rem; }
.board-date-add summary { cursor: pointer; color: var(--green); }
.board-date-add .form { margin-top: .5rem; }
.member-year-tabs { border-bottom: 1px solid var(--border); }

.team-share-link { margin-block-start: .75rem; overflow-wrap: anywhere; }

.team-switcher { display: flex; flex-wrap: wrap; gap: .45rem .75rem; margin-block-end: .65rem; }
.team-switcher a[aria-current="page"] { font-weight: 700; }

.registration-link {
    display: inline-block;
    padding: .5rem .9rem;
    border-radius: .35rem;
    background: var(--green);
    color: white;
    text-decoration: none;
}
.registration-choices { display: flex; flex-wrap: wrap; gap: .35rem .7rem; }
.registration-format { flex-direction: column; align-items: flex-start; }
.registration-choices label { display: flex; align-items: center; gap: .3rem; font-weight: 400; }

.event-comment-unread:not([hidden]) {
    display: inline-block;
    width: .46rem;
    height: .46rem;
    margin-inline-start: .2em;
    vertical-align: .25em;
    border-radius: 50%;
    background: #b22132;
}

/* メンテナンス予定のお知らせ（TcMaintenance。上の帯の上） */
.tc-maint {
	padding: 8px 16px; text-align: center; font-size: 13px; font-weight: 700; line-height: 1.6;
	color: #7c4a03; background: #fef3c7; border-bottom: 1px solid #fcd34d;
}

/* 開発用（TECLAB_ENV=dev で <html class="is-dev">）。admin.css と同じ、画面の端に内側へ薄れていく淡いオレンジと右下の「開発」 */
html.is-dev::before {
	content: ''; position: fixed; inset: 0; z-index: 2147483646;
	box-shadow: inset 0 0 0 1px rgba(249,115,22,.8), inset 0 0 36px 6px rgba(249,115,22,.5); pointer-events: none;
}
html.is-dev::after {
	content: '開発';
	position: fixed;
	right: 8px;
	bottom: 8px;
	z-index: 2147483647;
	padding: 1px 10px 2px 12px;
	border-radius: 6px 0 0 0;
	background: #f97316;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.5;
	pointer-events: none;
}
