*,
::before,
::after {
    line-height: 1.5;
}

html {
    overflow-x: hidden;
}

body {
    --color-body-background: var(--color-neutral-white);
    height: 100%;
    max-width: 100%;
    margin-top: 0;
    overflow-x: hidden;
    background: var(--color-body-background);
    font-size: 16px;
}

body>header {
    anchor-name: --header;
    padding-top: 0.5rem;
}

body>header,
main {
    max-width: 60rem;
    margin: 0 auto;
}

dialog>* {
    max-width: 100%;
    padding: 0;
}

dialog table {
    width: 100%;
    table-layout: fixed;
}

.dads-h {
    padding-top: 1rem;
}

input,
textarea {
    font-family: inherit;
    font-size: inherit;
}

output {
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column-reverse;
    border: none;
}

output article {
    display: flex;
    align-items: baseline;
    border-radius: .375rem;
    min-width: 14rem;
    max-width: 22rem;
    background: #1c1c1c;
    color: #f5f5f5;
    font-size: .875rem;
    line-height: 1.45;
    cursor: pointer;
    user-select: none;
    opacity: 0;
    translate: 1.5rem 0;
    transition: opacity .2s ease, translate .2s ease;
    pointer-events: none;
}

output article.show {
    opacity: 1;
    translate: 0 0;
    pointer-events: auto;
}

output article.hide {
    opacity: 0;
    translate: 1.5rem 0;
    transition-duration: .15s;
    pointer-events: none;
}

output article span {
    /* toast icon */
    font-weight: 700;
    font-size: .8125rem;
    flex-shrink: 0;
    padding: 0 .125rem;
    opacity: .7;
}

article.info {
    background: var(--color-neutral-solid-gray-300);
}

article.success {
    background: var(--color-semantic-success-1);
}

article.warning {
    background: var(--color-semantic-warning-yellow-2);
}

/* --- CoC7th (html記述順) ─── */

#header_hgroup {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

#header_hgroup>* {
    display: inline-flex;
}

#header_hgroup>p {
    white-space: pre-wrap;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    padding-bottom: calc((1.5 - 1) / 2 * (2rem - 0.9rem));
}

#header_button-1 {
    anchor-name: --header_button-1;
}

#header_ul-1 {
    position-anchor: --header_button-1;
}

#header_button-2 {
    anchor-name: --header_button-2;
}

#header_ul-2 {
    position-anchor: --header_button-2;
}

.dads-button.dice {
    min-width: auto;
}

.list-box-trigger>span {
    display: inline-block;
    width: 1em;
    margin-inline-end: calc(8 / 16 * 1rem);
}

main>section,
#modal:modal fieldset {
    border: 1px solid var(--color-neutral-solid-gray-300);
    margin: 0.25rem 0 0;
}

#main_section-1_section-2,
#main_section-1_section-3,
#main_section-1_section-4,
#main_section-1_section-5 {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#main_section-1_section-2>span,
#main_section-1_section-3>span,
#main_section-1_section-4>span #main_section-1_section-5>span {
    display: inline-flex;
    align-items: baseline;
    gap: 0.375rem;
}

#main_section-1_section-6>article {
    --color-layer-1: var(--color-neutral-white);
    --color-layer-2: var(--color-neutral-solid-gray-50);
    --color-layer-3: var(--color-neutral-solid-gray-100);
    --line-height-1: 0.2rem;
    --line-height-2: 0.1rem;
    --line-height-3: 0rem;
    padding-top: 0.3rem;
    background-color: var(--color-layer-1);
}

#main_section-1_section-6>article>span:not(:first-child) {
    display: inline-block;
    background-color: var(--color-layer-2);
    padding-top: 0.3rem;
    vertical-align: bottom;
}

#main_section-1_section-6>article>span>span:last-child {
    display: inline-block;
    background-color: var(--color-layer-3);
    padding-top: 0;
    vertical-align: bottom;
}

#main_section-3 {
    display: flex;
    align-items: flex-end;
    gap: 0.3rem;
}

#main_modal {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

#modal:modal {
    position: relative;
    display: flex;
    position-anchor: --header;
    top: calc(anchor(--header bottom) + 0.5rem);
    left: 0;
    margin: 0 auto;
    height: calc(100dvh - 112px - 0.5rem);
    width: 100%;
    max-width: 60rem;
    margin-top: 0;
    margin-bottom: 0;
    background-color: var(--color-body-background);
    padding: 0;
    padding-bottom: 1rem;
    overflow: visible;
    border: 1px solid currentcolor;
    border-radius: calc(8 / 16 * 1rem);
}

@media (width >=40rem) {
    #modal:modal>* {
        padding: 0 1rem;
    }
}

#modal_header {
    position: absolute;
    top: -4rem;
    right: 0.5rem;
    background: transparent;
}

#modal_header button {
    display: inline-block;
}

#modal_header_button-2 {
    --button-color: var(--color-primitive-green-600);
    --button-hover-color: var(--color-primitive-green-700);
    --button-active-color: var(--color-primitive-green-900);
    --button-outline-hover-bg-color: var(--color-primitive-green-200);
    --button-outline-active-bg-color: var(--color-primitive-green-300);
    position: relative;
    color: transparent;
}

#modal_header_button-2::before {
    content: "✓";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.4em;
    height: 1.4em;
    margin: auto;
    border-radius: 50%;
    background-color: transparent;
    border: 1.5px solid var(--color-neutral-white);
    color: var(--color-neutral-white);
    font-size: 0.9em;
    line-height: 1;
}

#modal_section {
    overflow: auto;
    flex: 1;
}

#modal fieldset {
    padding-left: 0;
    padding-right: 0.125rem;
}

#modal_section_fieldset-1,
#modal_section_fieldset-3 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

#modal_section_fieldset-1_label-2,
#modal_section_fieldset-1_label-6 {
    color: transparent;
}

#modal_section_fieldset-1_label-2 input,
#modal_section_fieldset-1_label-6 input {
    color: revert;
}

#modal_section_fieldset-1 :is(input, .dads-input, .dads-input-number),
#modal_section_fieldset-4 .dads-input {
    width: 17rem;
}

#modal_section_fieldset-2 table {
    margin-top: 0.5rem;
}

@media (width >=40rem) {
    #modal_section_fieldset-2_table-1,
    #modal_section_fieldset-2_table-2 {
        display: inline-table;
        width: max-content;
    }
}

#modal_section_fieldset-2 th,
#modal_section_fieldset-2 td {
    width: 4rem;
}

#modal_section_fieldset-2 th,
#modal_section_fieldset-4 th,
#modal_section_fieldset-4 td:nth-child(2),
#modal_section_fieldset-4 td:nth-child(4),
#modal_section_fieldset-4 td:nth-child(5),
#modal_section_fieldset-4 td:nth-child(6) {
    text-align: center;
}

#modal_section_fieldset-2 td:nth-child(2),
#modal_section_fieldset-2 td:nth-child(3),
#modal_section_fieldset-2 td:nth-child(4),
#modal_section_fieldset-2 td:nth-child(5),
#modal_section_fieldset-4 td:nth-child(3),
#modal_section_fieldset-4 td:nth-child(7) {
    text-align: right;
}

#modal_section_fieldset-2 input,
#modal_section_fieldset-4 input[inputmode="numeric"] {
    width: 100%;
}

#modal_section_fieldset-4 th:nth-child(3),
#modal_section_fieldset-4 th:nth-child(7),
#modal_section_fieldset-4 td:nth-child(3),
#modal_section_fieldset-4 td:nth-child(7) {
    width: 2.5rem;
}

@media (width >=40rem) {
    #modal_section_fieldset-4 th:nth-child(3),
    #modal_section_fieldset-4 th:nth-child(7),
    #modal_section_fieldset-4 td:nth-child(3),
    #modal_section_fieldset-4 td:nth-child(7) {
        width: 4rem;
    }
}

#modal_section_fieldset-4 th:nth-child(4),
#modal_section_fieldset-4 th:nth-child(5),
#modal_section_fieldset-4 th:nth-child(6),
#modal_section_fieldset-4 td:nth-child(4),
#modal_section_fieldset-4 td:nth-child(5),
#modal_section_fieldset-4 td:nth-child(6) {
    width: 3rem;
}

#modal_section_fieldset-4 input[inputmode="numeric"] {
    padding: 0.5rem;
}

#modal_section_fieldset-4_table_tbody_tr-5_td-1_button {
    anchor-name: --modal_fieldset-4_table_tbody_tr-5_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-5_td-1_ul {
    position-anchor: --modal_fieldset-4_table_tbody_tr-5_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-6_td-1_button {
    anchor-name: --modal_fieldset-4_table_tbody_tr-6_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-6_td-1_ul {
    position-anchor: --modal_fieldset-4_table_tbody_tr-6_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-23_td-1_button {
    anchor-name: --modal_fieldset-4_table_tbody_tr-23_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-23_td-1_ul {
    position-anchor: --modal_fieldset-4_table_tbody_tr-23_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-24_td-1_button {
    anchor-name: --modal_fieldset-4_table_tbody_tr-24_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-24_td-1_ul {
    position-anchor: --modal_fieldset-4_table_tbody_tr-24_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-25_td-1_button {
    anchor-name: --modal_fieldset-4_table_tbody_tr-25_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-25_td-1_ul {
    position-anchor: --modal_fieldset-4_table_tbody_tr-25_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-42_td-1_button {
    anchor-name: --modal_fieldset-4_table_tbody_tr-42_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-42_td-1_ul {
    position-anchor: --modal_fieldset-4_table_tbody_tr-42_td-1_button;
}

#modal_section_fieldset-4 td:nth-child(2) {
    font-size: 0;
}

#modal_section_fieldset-4 td:nth-child(2) * {
    font-size: 1rem;
}

#modal_section_fieldset-4 td:nth-child(2):has(.list-box-trigger) .dads-input:not(.hidden) {
    display: revert;
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    vertical-align: middle;
    width: 4rem;
}

#modal_section_fieldset-4 td:nth-child(2):has(.dads-input:not(.hidden)) .list-box-trigger {
    font-size: 0;
    padding-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

#modal_section_fieldset-4_table_tbody_tr-46_td-1_button {
    anchor-name: --modal_fieldset-4_table_tbody_tr-46_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-46_td-1_ul {
    position-anchor: --modal_fieldset-4_table_tbody_tr-46_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-50_td-1_button {
    anchor-name: --modal_fieldset-4_table_tbody_tr-50_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-50_td-1_ul {
    position-anchor: --modal_fieldset-4_table_tbody_tr-50_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-55_td-1_button {
    anchor-name: --modal_fieldset-4_table_tbody_tr-55_td-1_button;
    padding-inline-start: 0;
}

#modal_section_fieldset-4_table_tbody_tr-55_td-1_ul {
    position-anchor: --modal_fieldset-4_table_tbody_tr-55_td-1_button;
}

#modal_section_fieldset-4_table_tbody_tr-55 .dads-input {
    width: 6rem;
}

#modal_section_fieldset-6 label,
#modal_section_fieldset-6 textarea {
    display: inline-block;
    vertical-align: top;
}