.phv-upload-instance .csv-table-container {
    max-height: 400px;
    overflow-y: scroll;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    width: 100vw;
    max-width: 100%;
    overflow-x: auto;
}

.phv-upload-instance table.csv-preview {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.phv-upload-instance table.csv-preview th,
.phv-upload-instance table.csv-preview td {
    border: 1px solid #ddd;
    padding: 4px 8px;
    font-size: 14px;
}

.phv-upload-instance table.csv-preview th {
    position: sticky;
    top: 0;
    background: #f9f9f9;
}

.phv-upload-instance .notice-success {
    color: green;
    margin-top: 10px;
}

.phv-upload-instance .notice-pending {
    margin-top: 15px;
    padding: 15px 20px;
    background-color: #fff8e1;
    border: 2px solid #f9a825;
    border-left: 6px solid #f57f17;
    border-radius: 6px;
    color: #5d4037;
    font-size: 15px;
    line-height: 1.7;
}

.phv-upload-instance .notice-pending .pending-title {
    font-size: 17px;
    font-weight: bold;
    color: #e65100;
    margin-bottom: 8px;
}

/* 電話番号・FAX入力欄の幅を桁数に合わせて縮小 */
.phv-upload-instance .tel-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.phv-upload-instance .tel-input-group input[type="tel"] {
    width: 80px !important;
    min-width: 60px;
    box-sizing: border-box;
}

.phv-upload-instance .highlight-column {
    background-color: #ffffcc;
}

.phv-upload-instance .delete-options {
    margin-bottom: 10px;
}

.phv-upload-instance [data-phv-role="drugNameCleanBtn"] {
    margin-left: 10px;
    padding: 5px 10px;
    border-radius: 5px;
}

/* ファイルアップロードエリア */
.phv-upload-instance .file-upload-area {
    border: 2px dashed #4a90d9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    background: #f0f6ff;
    text-align: center;
}

.phv-upload-instance .file-upload-area .upload-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.phv-upload-instance .file-upload-area .upload-label {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

/* 自動モード切り替えスイッチ */
.phv-upload-instance .mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 14px;
    background: #e8f0fe;
    border: 1px solid #b0c4de;
    border-radius: 6px;
}
.phv-upload-instance .mode-switch input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.phv-upload-instance .mode-switch label {
    font-weight: bold;
    cursor: pointer;
}
.phv-upload-instance .auto-status {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}
.phv-upload-instance .auto-status.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}
.phv-upload-instance .auto-status.warn {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

/* 文字コード手動指定トグル */
.phv-upload-instance .encoding-manual-toggle {
    margin-top: 10px;
    margin-bottom: 10px;
}

.phv-upload-instance .encoding-manual-toggle label {
    cursor: pointer;
    font-size: 13px;
    color: #555;
}

.phv-upload-instance .encoding-manual-toggle input[type="checkbox"] {
    margin-right: 4px;
    cursor: pointer;
}

.phv-upload-instance .encoding-select-area {
    margin-top: 6px;
    padding: 8px 12px;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: inline-block;
}

/* 表のスクロールと独立して、検索条件と件数を確認できるようにする。 */
.phv-upload-instance [hidden] {
    display: none !important;
}
.phv-upload-instance .phv-row-filter,
.phv-upload-instance .phv-sheet-area {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 10px 0;
}
.phv-upload-instance .phv-row-filter input,
.phv-upload-instance .phv-sheet-area select {
    max-width: 100%;
    box-sizing: border-box;
}
.phv-upload-instance .phv-row-summary {
    font-size: 12px;
    line-height: 1.8;
    color: #4b5563;
    margin: -10px 0 16px;
    overflow-wrap: anywhere;
}
.phv-upload-instance .phv-upload-help,
.phv-upload-instance [data-phv-role="filterCount"] {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.6;
}
.phv-upload-instance .phv-input-notice {
    color: #92400e;
    line-height: 1.6;
    margin: 8px 0;
    overflow-wrap: anywhere;
}
.phv-upload-instance .phv-cell-error {
    background: #fff0f0;
    color: #9b1c1c;
}
.phv-upload-instance .phv-preview-empty {
    padding: 12px;
    color: #4b5563;
}
.phv-upload-instance .notice-error {
    color: #b91c1c;
    margin-top: 10px;
}
