:root {
    --color-bg: #f5f6f8;
    --color-surface: #ffffff;
    --color-border: #dde1e6;
    --color-text: #2a2e35;
    --color-muted: #6b7280;
    --color-primary: #2f6fed;
    --color-primary-dark: #2557c2;
    --color-danger: #d64545;
    --color-success: #2f9e57;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.6;
}

a {
    color: var(--color-primary);
}

header.app-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

header.app-header .app-title {
    font-weight: bold;
    font-size: 16px;
    color: var(--color-text);
    text-decoration: none;
}

nav.app-nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

nav.app-nav a {
    text-decoration: none;
    color: var(--color-muted);
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    font-size: 14px;
    background: var(--color-surface);
}

nav.app-nav a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

nav.app-nav a.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.logout-link {
    display: inline-block;
    font-size: 13px;
    font-weight: bold;
    color: var(--color-text);
    text-decoration: none;
    padding: 7px 16px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.logout-link:hover {
    background: #fdf1f1;
    border-color: var(--color-danger);
    color: var(--color-danger);
}

main.app-main {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px 40px;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

h1 {
    font-size: 20px;
    margin: 0 0 16px;
    padding-left: 12px;
    border-left: 4px solid var(--color-primary);
}

h2 {
    font-size: 16px;
    margin: 0 0 12px;
    padding-left: 10px;
    border-left: 3px solid var(--color-primary);
}

.menu-rows {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.menu-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

@media (max-width: 700px) {
    .menu-row {
        grid-template-columns: 1fr;
    }
}

.menu-grid a,
.menu-row a {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: 8px;
    padding: 18px 20px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: bold;
    font-size: 17px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    transition: transform .12s ease, box-shadow .12s ease;
}

.menu-grid a .text-muted,
.menu-row a .text-muted {
    display: block;
    margin-top: 5px;
    font-weight: normal;
    font-size: 13px;
}

/* メニューカードを段ごとに色分け */
.menu-row-1 a {
    border-left-color: var(--color-primary);
    background: #f1f6fe;
}

.menu-row-2 a {
    border-left-color: var(--color-success);
    background: #f0faf3;
}

.menu-row-3 a {
    border-left-color: #c9861f;
    background: #fdf7ec;
}

.menu-row-4 a {
    border-left-color: #7c5cbf;
    background: #f6f2fb;
}

.menu-grid a:hover,
.menu-row a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
}

form .field {
    margin-bottom: 14px;
}

label {
    display: block;
    font-size: 13px;
    color: var(--color-muted);
    margin-bottom: 4px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 15px;
    background: var(--color-surface);
    color: var(--color-text);
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text);
    font-size: 15px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
    font-size: 14px;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
}

.checkbox-group label:hover {
    border-color: var(--color-primary);
}

.checkbox-group label:has(input:checked) {
    background: #eaf1fd;
    border-color: var(--color-primary);
    font-weight: bold;
}

.checkbox-group-heading {
    font-weight: bold;
    color: var(--color-primary-dark);
    margin: 16px 0 6px;
    padding-left: 8px;
    border-left: 3px solid var(--color-primary);
}

.checkbox-group-heading:first-child {
    margin-top: 0;
}

button,
.btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

button:hover,
.btn:hover {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    border-bottom: 1px solid var(--color-border);
    padding: 8px 10px;
    text-align: right;
    vertical-align: top;
}

th:first-child, td:first-child,
th.text-left, td.text-left {
    text-align: left;
}

thead th {
    color: var(--color-primary-dark);
    font-weight: normal;
    font-size: 13px;
    white-space: nowrap;
    border-bottom: 2px solid var(--color-primary);
}

th.th-2line {
    text-align: center;
}

th.col-saturday, td.col-saturday {
    background: #e3f0fd;
}

th.col-sunday, td.col-sunday,
th.col-holiday, td.col-holiday {
    background: #fde8e8;
}

.holiday-label {
    color: var(--color-danger);
    font-size: 11px;
}

.shift-hour-select.is-rest {
    border: 2px solid var(--color-danger);
}

td.cell-rest {
    background: #f5b5b5;
}

.attendance-count {
    display: inline-block;
    margin-top: 2px;
    font-size: 22px;
    font-weight: bold;
    color: var(--color-primary-dark);
}

.attendance-total-hours {
    display: block;
    font-size: 11px;
    font-weight: normal;
    color: var(--color-muted);
}

td.has-non-production {
    box-shadow: inset 0 0 0 2px var(--color-success);
}

select.is-workday {
    border: 2px solid var(--color-danger);
}

/* 前月・翌月の列は背景色だけで区別し、文字は薄くせず通常の濃さで表示する。 */
th.col-other-month, td.col-other-month {
    background: #f5f6f8;
}

td.cell-lines div {
    white-space: nowrap;
}

td.cell-lines div + div {
    margin-top: 6px;
}

.mold-qty-label {
    display: inline-block;
    width: 3.5em;
}

.mold-qty-num {
    display: inline-block;
    width: 3em;
    text-align: right;
}

.print-only {
    display: none;
}

.table-scroll {
    overflow-x: auto;
}

.table-scroll th:first-child,
.table-scroll td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--color-surface);
    box-shadow: 2px 0 3px -1px rgba(0, 0, 0, 0.15);
}

.table-scroll thead th:first-child {
    z-index: 2;
}

/* シフト表・試作時間タブの表を見やすくする */
.shift-grid-table {
    font-size: 15px;
}

.shift-grid-table th,
.shift-grid-table td {
    padding: 10px 8px;
}

.shift-grid-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--color-surface);
}

.shift-grid-table thead th:first-child {
    z-index: 3;
}

.shift-grid-table tbody tr:hover td {
    background: #eef6ff;
}

.shift-grid-table tbody tr:hover td.col-saturday {
    background: #d3e8fb;
}

.shift-grid-table tbody tr:hover td.col-sunday,
.shift-grid-table tbody tr:hover td.col-holiday {
    background: #fbd9d9;
}

.shift-grid-table tbody tr:hover td.cell-rest {
    background: #f0a3a3;
}

.shift-grid-table tbody td.text-left {
    font-weight: bold;
    white-space: nowrap;
}

.shift-grid-table .shift-hour-select {
    width: 100%;
    min-width: 92px;
    font-size: 14px;
}

.shift-grid-table select.is-workday {
    width: 100%;
    min-width: 80px;
    font-size: 14px;
}

@media print {
    @page {
        size: landscape;
        margin: 8mm;
    }

    header.app-header,
    .tab-bar,
    .flash,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .card {
        border: none;
        box-shadow: none;
        padding: 0;
        margin-bottom: 12px;
    }

    .print-only {
        display: block;
    }

    .table-scroll {
        overflow: visible;
    }

    .table-scroll th:first-child,
    .table-scroll td:first-child {
        position: static;
        box-shadow: none;
    }

    table {
        table-layout: fixed;
        width: 100%;
        font-size: 10px;
    }

    th, td {
        padding: 2px 3px;
        overflow: hidden;
        white-space: nowrap;
    }

    th:first-child, td:first-child {
        width: 60px;
        white-space: normal;
    }
}

.flash {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.flash-success {
    background: #eaf7ee;
    color: var(--color-success);
    border: 1px solid #bfe7cb;
    font-weight: bold;
    font-size: 15px;
}

.flash-success::before {
    content: "✓ ";
}

@keyframes save-flash-fade {
    from { background-color: #bdf0cc; }
    to { background-color: transparent; }
}

.save-flash {
    animation: save-flash-fade 1.8s ease-out;
}

.flash-error {
    background: #fbeaea;
    color: var(--color-danger);
    border: 1px solid #f0c2c2;
    font-weight: bold;
}

.flash-warning {
    background: #fdf3e0;
    color: #a8660f;
    border: 1px solid #f0d9a8;
}

.upload-result-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upload-result-item {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.upload-result-item.ok {
    background: #eaf7ee;
    color: var(--color-success);
    border: 1px solid #bfe7cb;
}

.upload-result-item.ok::before {
    content: "✓ ";
    font-weight: bold;
}

.upload-result-item.fail {
    background: #fbeaea;
    color: var(--color-danger);
    border: 1px solid #f0c2c2;
}

.upload-result-item.fail::before {
    content: "✗ ";
    font-weight: bold;
}

.upload-result-filename {
    font-weight: bold;
}

.text-muted {
    color: var(--color-muted);
    font-size: 13px;
}

.filter-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-form .field {
    margin-bottom: 0;
}

.tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-bar a {
    padding: 6px 14px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--color-muted);
    border: 1px solid var(--color-border);
    font-size: 14px;
}

.tab-bar a.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* 日報入力タブ: 「作業の種類」の一覧を、スクロールしても常に見える位置に固定表示する。
   ヘッダー（app-header）自体は固定ではないため、スクロールしてヘッダーが見えなくなった時点で
   この帯が画面上端にくっつく（position: sticky）。 */
.entry-legend-fixed {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 8px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.entry-legend-item {
    white-space: nowrap;
    color: var(--color-text);
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.quality-record-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.stacked-form > select,
.stacked-form > label,
.stacked-form > button {
    display: block;
    margin-bottom: 12px;
}

.stacked-form > div,
.stacked-form > p {
    margin-bottom: 12px;
}

.mold-detail-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.mold-detail-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.badge-inactive {
    background: #eee;
    color: var(--color-muted);
}

.badge-active {
    background: #eaf7ee;
    color: var(--color-success);
}

.badge-urgent {
    background: #fbeaea;
    color: var(--color-danger);
    font-weight: bold;
    font-size: 14px;
    padding: 3px 10px;
}

.badge-calm {
    background: #eee;
    color: var(--color-muted);
}

tr.row-urgent td {
    background: #fff8f4;
}

.table-input {
    width: 72px;
    padding: 5px 6px;
    text-align: right;
    font-size: 14px;
}

.table-input-sm {
    width: 52px;
}

td form {
    display: inline;
}

.login-wrap {
    max-width: 360px;
    margin: 80px auto;
}

.hidden {
    display: none !important;
}

.input-warning {
    border-color: #d69a1f !important;
    background: #fdf3e0 !important;
}

.field-warning-text {
    color: var(--color-danger);
    font-weight: bold;
    font-size: 13px;
    margin: -6px 0 14px;
}

button:disabled,
.btn:disabled {
    background: var(--color-muted);
    cursor: not-allowed;
}

.quality-defect-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 4px 10px;
}

.quality-defect-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    line-height: 1.25;
}

.quality-defect-field input[type="number"] {
    width: 100%;
    padding: 3px 6px;
}

tr.active-row {
    background: #eaf1fd;
}

tr.staff-group-start td {
    border-top: 2px solid var(--color-border);
}

tr.staff-subtotal-row td {
    font-weight: bold;
    background: #f5f6f8;
}

.quality-import-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.quality-import-review-stacked .quality-import-form {
    max-width: 1500px;
}

.quality-import-pdf {
    width: 100%;
    height: 520px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.quality-import-sheet-badge {
    display: inline-block;
    background: #1a73e8;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 999px;
    margin: 0 0 8px;
}

.quality-import-overview {
    position: relative;
    width: 100%;
    max-width: 260px;
    line-height: 0;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

.quality-import-overview-img {
    display: block;
    width: 100%;
    height: auto;
}

.quality-import-overview-box {
    position: absolute;
    border: 3px solid #ff3b30;
    background: rgba(255, 59, 48, 0.15);
    box-sizing: border-box;
    pointer-events: none;
}

.quality-import-sheet-crop {
    width: 100%;
    height: auto;
    max-height: 75vh;
    background-repeat: no-repeat;
    background-color: #f5f6f8;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.quality-import-stage {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
}

.quality-import-stage legend {
    font-weight: bold;
    padding: 0 6px;
}

/* 写真から取り込む画面（品質管理・日報入力共通）をコンパクトに詰める */
.quality-import-sheet-fields .field {
    margin-bottom: 8px;
}

.quality-import-sheet-fields .field label {
    margin-bottom: 2px;
}

.quality-import-sheet-fields .text-muted {
    margin: 2px 0 0;
    font-size: 12px;
}

.quality-import-row-fieldset {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
}

.quality-import-row-fieldset legend {
    font-weight: bold;
    font-size: 13px;
    padding: 0 6px;
}

.field-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.field-row .field {
    flex: 1 1 120px;
    min-width: 100px;
}

.quality-import-sheet-block {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
    border-top: 2px solid var(--color-border);
    padding-top: 16px;
    margin-top: 16px;
}

.quality-import-sheet-photo {
    flex: 3 1 480px;
    position: sticky;
    top: 10px;
}

.quality-import-sheet-fields {
    flex: 2 1 380px;
    min-width: 320px;
}

.quality-import-sheet-block:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.quality-sheet-photo-thumb {
    max-width: 160px;
    max-height: 160px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    display: block;
    margin-bottom: 4px;
}

.quality-sheet-photo-link {
    margin-bottom: 16px;
}

.qprint-category-heading label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* 品質管理: 白紙シート印刷の「行の並び順を決める」欄。①②③…のバッジのすぐ横で
   直接、何番目に表示するかを選べるようにするための見本兼編集フォーム。 */
.qprint-order-sample {
    background: #fdfcf9;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 10px 14px;
    margin: 12px 0 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qprint-order-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.qprint-order-row-label {
    flex: 1;
    min-width: 0;
}

.qprint-order-row select {
    width: auto;
    min-width: 70px;
}

.qprint-item-name {
    flex: 1;
    min-width: 0;
}

.checkbox-group label input.qprint-order-input {
    width: 52px;
    flex: none;
}

.checkbox-group label select.qprint-order-select {
    width: 64px;
    flex: none;
}

.qprint-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 2px;
    border-radius: 50%;
    background: #b3401f;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-right: 4px;
}

/* 品質管理: 白紙シート印刷（A4を5等分して使う現行サイズの用紙）。
   丸で囲む代わりに□チェック、自由記入の代わりにマス目にすることで、
   AI写真取り込み（gemini_extract_quality_sheet）が読み取りやすい紙面にするための改善版。 */
.qprint-page {
    max-width: 210mm;
    margin: 0 auto;
    background: #fdfcf9;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}

.qprint-ticket {
    width: 210mm;
    min-height: 71mm;
    color: #17160f;
    border-bottom: .35mm dashed #c7c2b4;
    padding: 1.4mm 2.1mm 1.25mm;
    box-sizing: border-box;
}

.qprint-ticket:last-child {
    border-bottom: none;
}

.qprint-hdr-line {
    display: flex;
    flex-direction: column;
    gap: .15mm;
    font-size: 2.1mm;
    line-height: 1.05;
    margin-bottom: .2mm;
}

.qprint-hdr-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .9mm 2mm;
}

.qprint-hdr-group {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .9mm 1.25mm;
}

.qprint-hdr-group b {
    font-weight: 700;
    white-space: nowrap;
}

.qprint-item {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.qprint-divider {
    color: #c7c2b4;
}

.qprint-chk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4mm;
    height: 2.4mm;
    border: .25mm solid #17160f;
    border-radius: .35mm;
    margin-right: .35mm;
}

.qprint-u {
    display: inline-block;
    border-bottom: .3mm solid #17160f;
    min-width: 5.3mm;
    height: 3mm;
}

.qprint-u-filled {
    border-bottom: none;
    min-width: 14mm;
    height: 3mm;
    line-height: 3mm;
    font-weight: 700;
    font-size: 2.4mm;
    text-align: center;
}

.qprint-tbl {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

.qprint-tbl th, .qprint-tbl td {
    border: .25mm solid #4a453c;
    padding: 1.25mm .5mm;
    text-align: center;
    font-size: 2mm;
    line-height: 1.15;
    vertical-align: middle;
    overflow: hidden;
}

.qprint-tbl thead th {
    font-weight: 700;
    font-size: 1.9mm;
    background: #eef1f4;
}

.qprint-col-stage { width: 7.9mm; }
.qprint-col-date { width: 17.5mm; }
.qprint-col-name { width: 12.3mm; }
.qprint-col-qty { width: 9.8mm; }
.qprint-col-defect { width: 8.4mm; }
.qprint-col-total { width: 8.6mm; }
.qprint-col-done { width: 14mm; }

.qprint-date-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4mm;
}

.qprint-dbox {
    display: inline-block;
    width: 4.6mm;
    height: 6.5mm;
    border: .25mm solid #4a453c;
}

.qprint-sl {
    font-size: 1.75mm;
}

.qprint-digit-box {
    display: inline-block;
    width: 7.2mm;
    height: 7mm;
    border: .25mm solid #4a453c;
}

.qprint-digit-box.qprint-wide {
    width: 8.4mm;
}

.qprint-stage-cell {
    text-align: left;
    font-weight: 700;
    font-size: 1.9mm;
    padding-left: .9mm;
}

.qprint-done-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .7mm;
    font-size: 1.55mm;
    line-height: 1.15;
}

.qprint-num {
    display: inline-block;
    width: 9.5mm;
    height: 7mm;
    border: .3mm solid #17160f;
}

.qprint-nadash {
    color: #b8b2a4;
}

/* 日報用紙印刷（entry.php）: 品質管理の白紙シート印刷と同じ考え方で、AIが写真から読み取りやすいよう
   番号チェック・マス目形式にした日報の白紙用紙。A4を分割せず1枚まるごと使う。 */
.dprint-page {
    max-width: 210mm;
    margin: 0 auto;
    background: #fdfcf9;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
    padding: 5mm 12mm;
    box-sizing: border-box;
    color: #17160f;
}

.dprint-title {
    text-align: center;
    font-size: 7mm;
    margin: 0 0 2mm;
}

.dprint-hdr-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3.5mm 12mm;
    font-size: 4mm;
    margin-bottom: 2mm;
}

.dprint-hdr-group {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 1.5mm;
}

.dprint-hdr-group b {
    font-weight: 700;
    white-space: nowrap;
}

.dprint-legend {
    margin: 0 0 1.5mm;
    font-size: 3.5mm;
}

.dprint-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1.8mm 6mm;
    margin-top: 1.8mm;
}

.dprint-legend-item {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.dprint-legend-num {
    font-weight: 700;
    margin-right: 1.5mm;
}

.dprint-date-box {
    display: inline-block;
    width: 9.5mm;
    height: 9.5mm;
    border: .3mm solid #4a453c;
    margin: 0 .4mm;
}

/* 商品名一覧（別紙として単独印刷するシート pprint-page） */
.pprint-note {
    font-size: 3.6mm;
    margin: 0 0 4mm;
}

.pprint-group {
    margin-bottom: 3.5mm;
    font-size: 4mm;
    line-height: 1.5;
}

.pprint-cat {
    display: block;
    font-weight: 700;
    font-size: 4.2mm;
    border-bottom: .3mm solid #4a453c;
    padding-bottom: .8mm;
    margin-bottom: 1mm;
}

.pprint-items {
    padding-left: 1mm;
}

.dprint-tbl {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
    margin-top: 2.5mm;
}

.dprint-tbl th, .dprint-tbl td {
    border: .3mm solid #4a453c;
    padding: 1mm;
    text-align: center;
    font-size: 3.6mm;
    vertical-align: middle;
    height: 11.5mm;
}

.dprint-tbl thead th {
    font-weight: 700;
    font-size: 3.3mm;
    background: #eef1f4;
    height: auto;
}

.dprint-tbl tfoot td {
    height: auto;
    padding: 1.8mm 2.4mm;
}

.dprint-proc-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .6mm;
    padding: 0 .5mm;
}

.dprint-proc-opt {
    display: inline-flex;
    align-items: center;
    gap: .5mm;
    white-space: nowrap;
    font-size: 3mm;
}

.dprint-chk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.3mm;
    height: 3.3mm;
    border: .3mm solid #4a453c;
    border-radius: .4mm;
    margin-right: .4mm;
}

.dprint-digit-box {
    display: inline-block;
    width: 8.5mm;
    height: 8.5mm;
    border: .3mm solid #4a453c;
    margin: 0 .4mm;
}

.dprint-colon {
    padding: 0 .5mm;
}

.dprint-colon-lg {
    font-size: 6.5mm;
    font-weight: 700;
    color: #17160f;
}

.dprint-footer {
    margin-top: 2mm;
}

.dprint-report-box {
    border: .3mm solid #4a453c;
    min-height: 16mm;
    padding: 1.8mm;
    font-size: 3.5mm;
}

@media print {
    .dprint-page {
        box-shadow: none;
        max-width: none;
    }
}

/* 白紙シート印刷: 記入例（1枚だけの実例）。見本のチェック・数字を実際に書き込んだ状態で表示し、
   下に番号つきの説明を添える。白紙5枚分とは別の印刷対象として、ボタンで印刷を出し分ける。 */
.qprint-example-wrap {
    max-width: 210mm;
    margin: 0 auto 24px;
}

.qprint-example-caption {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.qprint-example-badge {
    font-size: 11px;
    letter-spacing: .05em;
    color: #b3401f;
    border: 1px solid #b3401f;
    border-radius: 3px;
    padding: 1px 7px;
}

.qprint-example-page {
    background: #fdfcf9;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}

.qprint-chk-on {
    background: #e3edf5;
    color: #2c4a6e;
    font-weight: 700;
}

.qprint-example-fill {
    font-size: 2mm;
}

.qprint-example-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #b3401f;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}

.qprint-tbl .qprint-example-mark {
    width: 3mm;
    height: 3mm;
    font-size: 1.8mm;
    margin-left: 1mm;
}

.qprint-example-legend {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.8;
}

.qprint-example-legend li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.qprint-example-legend .qprint-example-mark {
    margin-left: 0;
    margin-top: 2px;
    flex: none;
}

@media print {
    .qprint-page,
    .qprint-example-wrap {
        display: none;
    }

    body.qprint-print-blank .qprint-page {
        display: block;
    }

    body.qprint-print-example .qprint-example-wrap {
        display: block;
    }

    .qprint-page {
        box-shadow: none;
        max-width: none;
        page-break-after: always;
        break-after: page;
    }

    .qprint-page:last-of-type {
        page-break-after: auto;
        break-after: auto;
    }

    .qprint-example-page {
        box-shadow: none;
    }

    .qprint-ticket {
        border-bottom: .35mm dashed #999;
    }
}
