/* --- General Setup --- */
:root {
    --border-color: #000;
    --border-width: 2px;
    --label-bg-color: #eee;
    --base-font-size: 6pt;
    --font-family: "Noto Sans JP", sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@page {
    size: A4 portrait;
    margin: 0;
}

body {
    background-color: #808080;
    font-family: var(--font-family);
    font-size: var(--base-font-size);
    line-height: 1.5;
    -webkit-print-color-adjust: exact;
    font-optical-sizing: auto;
    font-style: normal;
    -webkit-text-size-adjust: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
}

.page {
    background: #fff;
    width: 210mm;
    height: 297mm;
    min-width: 210mm;
    max-width: 210mm;
    padding: 20mm 20mm 0;
    box-sizing: border-box;
}

/* --- Print Styles --- */
@media print {
    body {
        background-color: #fff;
    }
    .page {
        margin: 0;
        padding: 10mm;
        box-shadow: none;
        min-height: 0;
    }
    .footer {
        position: static;
    }
}

table {
    display: table;
    border-spacing: 0;
    width: 100%;
    height: max-content;
    table-layout: fixed; /* 固定レイアウトに変更 */
    border-collapse: separate; /* PDF生成時のスタイルを安定化 */
    /* border: solid var(--border-width) var(--border-color); */
}
tbody {
    vertical-align: middle;
    border-color: inherit;
    width: 100%;
}
tr {
    border-color: inherit;
    width: 100%;
}
th,
td {
    display: table-cell;
    vertical-align: middle;
    /* border: solid 1px var(--border-color); */
    padding: 1em 0;
}
th {
    font-weight: bold;
    text-align: center;
    font-size: 1em;
}
td {
    /* font-size: 1em; */
    /* padding: 1em; */
    font-size: 1.25em;
    line-height: 1.25;
    padding: 0.5em;
    height: 100%;
}
td.common_vertical_td {
    padding: 0;
    vertical-align: text-bottom;
}
.border_none {
    border: none;
}
.bold {
    font-weight: bold;
}

.bt-bold {
    border-top: solid var(--border-width) var(--border-color);
}
.bb-bold {
    border-bottom: solid var(--border-width) var(--border-color);
}
.br-bold {
    border-right: solid var(--border-width) var(--border-color);
}
.bl-bold {
    border-left: solid var(--border-width) var(--border-color);
}
.bt-light {
    border-top: solid 1px var(--border-color);
}
.bb-light {
    border-bottom: solid 1px var(--border-color);
}
.br-light {
    border-right: solid 1px var(--border-color);
}
.bl-light {
    border-left: solid 1px var(--border-color);
}

.label_bg {
    background-color: var(--label-bg-color);
}

.kaitori__pdf_header {
    display: block;
    width: 100%;
}

.kaitori__pdf_header__title {
    font-size: 1.4em;
    font-weight: 700;
    padding: 0 1em;
    border-bottom: solid 1px var(--border-color);
    margin-bottom: 5pt;
}

.kaitori__pdf_date {
    text-align: center;
    margin-left: auto;
    font-size: 0.9em;
    width: 22em;
    padding: 0.25em 0;
    border: solid var(--border-width) var(--border-color);
    border-bottom: none;
}
.kaitori__pdf_date .year,
.kaitori__pdf_date .month,
.kaitori__pdf_date .day {
    display: inline-block;
    min-width: 4em;
}

.selected_items_heading {
    font-size: 1em;
    font-weight: bold;
    border: solid var(--border-width) var(--border-color);
}

.selected_items_header th {
    padding: 0.2em;
}

.selected_items_header th:nth-child(3) {
    /* border-right: solid var(--border-width) var(--border-color); */
}

.selected_item_cell:nth-child(3) {
    /* border-right: solid var(--border-width) var(--border-color); */
}

.selected_item_cell .selected_item_name,
.selected_item_cell .selected_item_quantity,
.selected_item_cell .selected_item_price {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3lh;
}

.selected_item_cell {
    padding: 0.5em 1em;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow: hidden;
    /* 列幅を強制的に固定 */
    width: auto !important;
}

/* 買取品目テーブルの列幅をより厳密に指定 */
.selected_items_header th:nth-child(1), /* 商品名 */
.selected_item_cell[data-item_index]:nth-child(1) {
    width: 25% !important;
    min-width: 25% !important;
    max-width: 25% !important;
}

.selected_items_header th:nth-child(2), /* 数量 */
.selected_item_cell[data-item_index]:nth-child(2) {
    width: 8.33% !important;
    min-width: 8.33% !important;
    max-width: 8.33% !important;
}

.selected_items_header th:nth-child(3), /* 金額 */
.selected_item_cell[data-item_index]:nth-child(3) {
    width: 16.67% !important;
    min-width: 16.67% !important;
    max-width: 16.67% !important;
}

.selected_items_header th:nth-child(4), /* 商品名 */
.selected_item_cell[data-item_index]:nth-child(4) {
    width: 25% !important;
    min-width: 25% !important;
    max-width: 25% !important;
}

.selected_items_header th:nth-child(5), /* 数量 */
.selected_item_cell[data-item_index]:nth-child(5) {
    width: 8.33% !important;
    min-width: 8.33% !important;
    max-width: 8.33% !important;
}

.selected_items_header th:nth-child(6), /* 金額 */
.selected_item_cell[data-item_index]:nth-child(6) {
    width: 16.67% !important;
    min-width: 16.67% !important;
    max-width: 16.67% !important;
}

.pdf__footer {
    display: flex;
    align-items: center;
    margin-top: 20pt;
}
.pdf__footer__left,
.pdf__footer__right {
    display: block;
    width: 50%;
}
.pdf__footer__left {
    display: flex;
    justify-content: center;
}
.pdf__footer__left img {
    display: block;
    width: auto;
    height: auto;
    max-width: 75%;
    max-height: 100%;
    object-fit: contain;
}
.pdf__footer__right {
    display: block;
}
.pdf__footer__right__company_name {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 5pt;
}
.pdf__footer__right__tel {
    margin-top: 5pt;
}

.job {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    list-style: none;
    gap: 0 0.5em;
    font-size: 0.9em;
    margin: 0;
    padding: 0;
}
.job li {
    position: relative;
}
.job li:before {
    content: "";
    position: absolute;
    top: calc(((1lh - 1em) / 2) + 0.1em);
    left: 0.5px;
    width: 0.6em;
    height: 0.6em;
    border-radius: 50%;
    border: solid 0.2em var(--border-color);
    display: none;
}
.other_job {
    display: inline-flex;
    justify-content: center;
    min-width: 6em;
}
.job.company .company:before {
    display: block;
}
.job.self .self:before {
    display: block;
}
.job.public .public:before {
    display: block;
}
.job.student .student:before {
    display: block;
}
.job.housewife .housewife:before {
    display: block;
}
.job.parttime .parttime:before {
    display: block;
}
.job.unemployed .unemployed:before {
    display: block;
}
.job.other .other:before {
    display: block;
}

.certificate_list {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    list-style: none;
    gap: 0 0.5em;
    font-size: 0.9em;
    margin: 0;
    padding: 0;
}
.certificate_list li {
    position: relative;
}
.certificate_list li:before {
    content: "";
    position: absolute;
    top: calc(((1lh - 1em) / 2) + 0.1em);
    left: 0.5px;
    width: 0.6em;
    height: 0.6em;
    border-radius: 50%;
    border: solid 0.2em var(--border-color);
    display: none;
}
.other_job {
    display: inline-flex;
    justify-content: center;
    min-width: 6em;
}
.certificate_list.driver_license .driver_license:before {
    display: block;
}
.certificate_list.insurance .insurance:before {
    display: block;
}
.certificate_list.student_card .student_card:before {
    display: block;
}
.certificate_list.other .other:before {
    display: block;
}

.birth {
    text-align: center;
}
.birth_type {
    position: relative;
    display: inline-block;
    letter-spacing: 0.25em;
    text-indent: 0.25em;
}
.birth_type:before {
    content: "";
    display: block;
    width: 1em;
    height: 1em;
    border-radius: 50%;
    border: solid 1px var(--border-color);
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    display: none;
}
.birth_type.showa:before {
    display: block;
    translate: -1.5em 0;
}
.birth_type.heisei:before {
    display: block;
}
.birth_type.reiwa:before {
    display: block;
    translate: 1.5em 0;
}

.birth_year,
.birth_month,
.birth_day {
    display: inline-block;
    width: 3em;
}
.age {
    display: inline-block;
    width: 3em;
}

.address {
    position: relative;
    display: block;
    width: 100%;
}

.zipcode_code {
    display: flex;
    align-items: center;
}
.zipcode_1 {
    display: inline-block;
    width: 3em;
    text-align: center;
}
.zipcode_2 {
    display: inline-block;
    width: 4em;
    text-align: center;
}
.address_detail {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin-top: 1em;
    gap: 0.5em;
}
.address1_content,
.address2_content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.address1,
.address2 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14em;
}
.address3_content {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}
.address3 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.address1_pref,
.address2_pref {
    position: relative;
    display: block;
    letter-spacing: 0.2em;
    line-height: 1.2;
    font-size: 0.9em;
    padding-left: 0.2em;
}

.address1_pref.to:before,
.address1_pref.dou:before,
.address1_pref.fu:before,
.address1_pref.ken:before {
    content: "";
    display: block;
    border-radius: 50%;
    border: solid 1px var(--border-color);
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    width: 1.2em;
    height: 1.2em;
}
.address1_pref.to:before {
    transform: translate(-0.6em, -0.6em);
}
.address1_pref.dou:before {
    transform: translate(0.6em, -0.6em);
}
.address1_pref.fu:before {
    transform: translate(-0.6em, 0.6em);
}
.address1_pref.ken:before {
    transform: translate(0.6em, 0.6em);
}

.address2_pref.shi:before,
.address2_pref.ku:before,
.address2_pref.cho:before,
.address2_pref.son:before {
    content: "";
    display: block;
    border-radius: 50%;
    border: solid 1px var(--border-color);
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    width: 1.2em;
    height: 1.2em;
}
.address2_pref.shi:before {
    transform: translate(-0.6em, -0.6em);
}
.address2_pref.ku:before {
    transform: translate(0.6em, -0.6em);
}
.address2_pref.cho:before {
    transform: translate(-0.6em, 0.6em);
}
.address2_pref.son:before {
    transform: translate(0.6em, 0.6em);
}

.common_vertical_box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
}
.common_vertical_box_top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-bottom: solid 1px var(--border-color);
    font-weight: bold;
}
.common_vertical_box_bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: calc(100% - 1lh - 1px);
}
.bold {
    font-weight: bold;
}

.certificate {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.certificate ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1em 2em;
    list-style: none;
}

.certificate ul li {
    display: block;
}

.certificate ul li {
    display: block;
}

.other_certificate {
    display: inline-block;
    min-width: 20em;
    text-align: center;
}

.account_name_content .common_vertical_box_top {
    min-height: 1lh;
}
.account_name_content .common_vertical_box_bottom {
    min-height: 3lh;
}
.account_name_content .account_name_kana,
.account_name_content .account_name {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0 1em;
    text-align: left;
}

.bank_name,
.branch_name {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    gap: 1em;
}
.bank_name .bank,
.branch_name .branch {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 1lh;
    font-size: 1.5em;
}
.bank_name .bank_category_list,
.branch_name .branch_category_list {
    display: flex;
    flex-direction: column;
    gap: 0.25em 0;
    list-style: none;
    font-size: 0.9em;
    text-align-last: justify;
}

.bank_category_list li {
    border-radius: 9999px;
    padding: 0 0.25em;
}
.bank_category_list.type_bank .type_bank {
    border: solid 1px var(--border-color);
}
.bank_category_list.type_shinkin .type_shinkin {
    border: solid 1px var(--border-color);
}
.bank_category_list.type_shinkumi .type_shinkumi {
    border: solid 1px var(--border-color);
}

.branch_category_list li {
    border-radius: 9999px;
    padding: 0 0.25em;
}
.branch_category_list.branch_honten .branch_honten {
    border: solid 1px var(--border-color);
}
.branch_category_list.branch_shiten .branch_shiten {
    border: solid 1px var(--border-color);
}
.branch_category_list.branch_shutchosho .branch_shutchosho {
    border: solid 1px var(--border-color);
}
.branch_category_list.branch_shisho .branch_shisho {
    border: solid 1px var(--border-color);
}
