#menber {
    height: 150px;
    width: 220px; /* 横幅を固定 */
    max-width: 100%;
    box-sizing: border-box;
    resize: vertical;
}
#inputpanel {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
}

.input-label-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 220px;
    flex: 0 0 auto; /* 横幅を固定し、伸びないように */
    max-width: 300px; /* 必要に応じて調整 */
}

.input-label {
    margin-bottom: 6px;
    font-weight: normal; /* 太字を解除 */
}

#absent {
    height: 150px;
    width: 220px; /* 横幅を固定 */
    max-width: 100%;
    box-sizing: border-box;
    resize: vertical;
}
.distance {
    margin: 5px;
    padding: 5px;
}
#groupedMembers {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 16px;
}

.group {
    border: 2px solid #4CAF50;
    border-radius: 8px;
    padding: 12px;
    background: #f9fff9;
    min-width: 0;
    box-sizing: border-box;
    margin-bottom: 16px;
    text-align: left;
    word-break: break-all;
    font-size: 2em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* 幅を可変にする */
    flex: 1 1 0;
    max-width: 100%;
}
.group > div {
    font-size: 0.9em; /* メンバー部分をやや小さく */
}
.member-count {
    font-size: 0.95em;
    color: #555;
    margin-left: 4px;
    margin-bottom: 4px;
}

/* 画面サイズに応じて自動で列数を調整 */
@media (min-width: 1600px) {
    .group {
        flex-basis: calc(16.666% - 16px); /* 6列 */
        max-width: calc(16.666% - 16px);
    }
}
@media (min-width: 1200px) and (max-width: 1599px) {
    .group {
        flex-basis: calc(20% - 16px); /* 5列 */
        max-width: calc(20% - 16px);
    }
}
@media (min-width: 900px) and (max-width: 1199px) {
    .group {
        flex-basis: calc(25% - 16px); /* 4列 */
        max-width: calc(25% - 16px);
    }
}
@media (min-width: 600px) and (max-width: 899px) {
    .group {
        flex-basis: calc(33.333% - 16px); /* 3列 */
        max-width: calc(33.333% - 16px);
    }
}
@media (max-width: 599px) {
    .group {
        flex-basis: calc(50% - 16px); /* 2列 */
        max-width: calc(50% - 16px);
    }
}

body.dark-mode {
    background: #222;
    color: #eee;
}
body.dark-mode .group {
    background: #2c2c2c;
    border-color: #90caf9;
    color: #eee;
}
body.dark-mode #inputpanel,
body.dark-mode .input-label-area {
    background: #232323;
}
body.dark-mode textarea,
body.dark-mode input,
body.dark-mode button {
    background: #333;
    color: #eee;
    border-color: #555;
}
body.dark-mode .member-count {
    color: #bbb;
}

#darkModeButton {
    align-self: flex-end;
    margin-top: 16px;
    padding: 10px 18px;
    font-size: 1em;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ダークモード時のボタン色調整 */
body.dark-mode #darkModeButton {
    background: #444;
    color: #fff;
    border-color: #888;
}

#titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

#titlebar h1 {
    margin: 0;
}

#darkModeButton {
    padding: 8px 14px;
    font-size: 1em;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
