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

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
}

html {
    font-size: 1.125rem !important;
}

/* ホーム下端帯・統計ペーパーの退避高（MainLayout の .app-shell-home-footer と揃える） */
:root {
    /* ホーム下端帯は「崩れ防止の退避」用途のため小さめ */
    --app-home-footer-strip: calc(28px + env(safe-area-inset-bottom, 0px));
}
.mud-input-label {
    font-size: 1.125rem !important;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #4d70d4;
    color: #fff;
    border-bottom: 1px solid #ccc;
}

/* MainLayout: ヘッダーは上に固定、本文（MudMainContent）だけ縦スクロール */
.app-shell-root {
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.app-shell-root .app-shell-layout.mud-layout {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-shell-root .app-header {
    flex-shrink: 0;
}

.app-shell-root .app-shell-loading {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f9fcff;
    padding: 16px;
    text-align: center;
}

.app-shell-root .mud-main-content.app-shell-main,
.app-shell-root .app-shell-main.mud-main-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
}

/* Bootstrap .min-vh-100 は 100vh 固定。タブレット縦などで実表示より長くなり下端の固定フッターが画面外に出るため dvh を優先 */
.app-shell-main .min-vh-100 {
    min-height: 100vh;
    min-height: 100dvh;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.user-info {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}


input[readonly] {
    background-color: #e9ecef; /* ?O???[?w?i */
    cursor: not-allowed; /* ?J?[?\?????X */
}

.truncate {
    white-space: nowrap; /* ???s????1?s??\?? */
    overflow: hidden; /* ???o???????????B?? */
    text-overflow: ellipsis; /* ????L?? (?c) ??\?? */
    vertical-align: middle;
    margin: 0; /* ?????????? */
}

.mud-button-like {
    border-radius: 4px; /* MudButton ??p?? */
    padding: 6px 16px; /* MudButton ??????]?? */
    min-width: 64px; /* MudButton ??????o */
    height: 36px; /* MudButton ????????? */
    background-color: var(--mud-palette-tertiary); /* MudButton ??????F */
    color: white; /* ?A?C?R???F */
}

/* mud-button-like + Color.Error 併用時：Tertiary 背景のまま赤アイコンになり不整合になるため */
.mud-button-like.mud-button-like-danger {
    background-color: var(--mud-palette-error, #c62828) !important;
    color: #fff !important;
}

.mud-button-like.mud-button-like-danger .mud-icon-root,
.mud-button-like.mud-button-like-danger .mud-svg-icon {
    color: #fff !important;
    fill: #fff !important;
}

/* 商談フッター：車検証QRへ（Tertiary 帯の上に黄色アイコン） */
.mud-button-like.mud-button-qr-icon .mud-icon-root,
.mud-button-like.mud-button-qr-icon .mud-svg-icon {
    color: #ffeb3b !important;
    fill: #ffeb3b !important;
}

/* 商談登録・修正：フッターにアイコンが増えたときの折り返し */
.negotiation-footer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2px 4px;
    width: 100%;
    min-height: 80px;
    height: auto;
    padding: 4px 0;
    box-sizing: border-box;
}

/* ------------------------------------------------------------------
   GNS ????p?e?[?u???iInstructJointPartsDonorPopup ???j
   scoped / ?????????e???????????r?????m????\??
   ------------------------------------------------------------------ */
table.gns-data-table {
    border-collapse: collapse !important;
    border: 1px solid #78909c !important;
    background: #fff !important;
}

table.gns-data-table > thead > tr > th,
table.gns-data-table > tbody > tr > th {
    border: 1px solid #78909c !important;
    padding: 11px 14px !important;
    line-height: 1.5 !important;
}

table.gns-data-table > tbody > tr > td,
table.gns-data-table > thead > tr > td,
table.gns-data-table > tfoot > tr > td {
    border: 1px solid #cfd8dc !important;
    padding: 10px 14px !important;
    line-height: 1.5 !important;
}

table.gns-data-table.gns-data-table--cyan > thead > tr > th {
    background: #e0f7fa !important;
    color: #004d40 !important;
}

/* GNS �R�A���i�^���Y���i���T�}���[�i�����т��m���Ɂj */
.gns-summary-kpi-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 商談登録・詳細：査定ブロックは親の横幅いっぱい（各 MudPaper も列内で全幅） */
.negotiation-appraisal-stack-wrap {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

/* 別途精算：カード内も全幅（金額＋期限の2列は MudGrid で列幅いっぱいに配分） */
.negotiation-appraisal-betsuto-inner {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 別途精算：車検証有効期限は参照のみ（入力は書類確認エリアの日付） */
.negotiation-shaken-expiry-reference {
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    padding: 6px 8px 8px;
    background: linear-gradient(165deg, #eef1f6 0%, #e0e5ee 45%, #d6dce6 100%);
    border: 1px dashed #6a7588;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.negotiation-shaken-expiry-reference .mud-input-control > .mud-input-control-input-container > .mud-input-slot input {
    cursor: not-allowed !important;
    color: #3a4250 !important;
}

.negotiation-shaken-expiry-reference .mud-input-label {
    color: #5c6575 !important;
}

/* -------------------------------------------------------------------------- */
/* 解体作業結果登録：タブレット／タッチ端末向け（固定フッター・十分な余白） */
/* -------------------------------------------------------------------------- */
.work-results-page-scroll {
    margin-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
    padding-bottom: 8px;
}

@media (max-width: 599.98px) {
    .work-results-page-scroll {
        margin-bottom: calc(200px + env(safe-area-inset-bottom, 0px));
    }
}

.work-results-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    z-index: 1250;
    background-color: #f0f0f0;
    padding: 0.5rem 0.75rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

/* 各ページの MudPaper 固定フッター（inline z-index:1100 より手前・タブレットで隠れ対策） */
.mud-main-content .mud-paper[style*="position:fixed"][style*="bottom:0"] {
    z-index: 1200 !important;
    max-width: 100vw;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box;
}

/* Home: 統計 MudPaper が position:absolute; height:% のため親に height が要る。下端帯・セーフエリア分を差し引く。タブレット縦はヘッダー2段を想定して多めに確保 */
.home-root-container {
    position: relative;
    box-sizing: border-box;
    height: calc(100vh - 50px - var(--app-home-footer-strip));
    height: calc(100dvh - 50px - var(--app-home-footer-strip));
    min-height: calc(100vh - 50px - var(--app-home-footer-strip));
    min-height: calc(100dvh - 50px - var(--app-home-footer-strip));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 959.98px) {
    .home-root-container {
        height: calc(100dvh - 108px - var(--app-home-footer-strip));
        min-height: calc(100dvh - 108px - var(--app-home-footer-strip));
    }
}

.home-layout {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    gap: 0.35rem;
}

.home-menu-section {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.home-stats-section {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.home-stats-section.is-open {
    flex: 1 1 42%;
    max-height: 52%;
    min-height: 10rem;
}

.home-stats-section.is-collapsed {
    flex: 0 0 auto;
}

.home-stats-toolbar {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 0.15rem;
}

.home-quick-access {
    position: static;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.35rem 0 0.15rem;
    box-sizing: border-box;
}

/* ホーム画面：599px未満のみ（iPad・PCのホームレイアウトは変更しない） */
@media (max-width: 599.98px) {
    .home-root-container {
        padding: 0.5rem 0.65rem !important;
    }

    .home-root-container .home-layout {
        gap: 0.25rem;
    }

    .home-root-container .mud-tab-panel-content {
        padding-top: 0.5rem !important;
    }

    .home-root-container .home-tabs .mud-tabs-tabbar {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #fff;
    }

    .home-root-container .home-tabs .mud-tabs-tabbar-content {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        scrollbar-width: none;
    }

    .home-root-container .home-tabs .mud-tabs-tabbar-content::-webkit-scrollbar {
        display: none;
    }

    .home-root-container .home-tabs .mud-tabs-tabbar-inner {
        min-width: 0;
    }

    .home-root-container .home-tabs .mud-tabs-tabbar-wrapper {
        width: max-content;
        transform: none !important;
    }

    .home-root-container .home-tabs .mud-tabs-scroll-button {
        display: none !important;
    }

    .home-root-container .home-tabs .mud-tab,
    .home-root-container .home-tabs .mud-button-root.mud-tab,
    .home-root-container .soft-blue-tabs .mud-tab,
    .home-root-container .soft-blue-tabs .mud-button-root.mud-tab {
        width: auto !important;
        flex: 0 0 auto !important;
        min-height: 36px;
        padding: 0.35rem 0.55rem;
        margin-right: 4px;
        font-size: 0.78rem;
        line-height: 1.2;
        white-space: nowrap;
        border-radius: 8px 8px 0 0;
        background-color: #b5d8ff;
        color: #000;
    }

    .home-root-container .home-tabs .mud-tab.mud-tab-active,
    .home-root-container .home-tabs .mud-button-root.mud-tab.mud-tab-active,
    .home-root-container .soft-blue-tabs .mud-tab.mud-tab-active,
    .home-root-container .soft-blue-tabs .mud-button-root.mud-tab.mud-tab-active {
        background-color: #9bbeff;
        border-bottom: 3px solid #000;
    }

    .home-root-container .home-menu-actions .big-button,
    .home-root-container .home-menu-actions .mud-button-root {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: 42px;
        font-size: 0.88rem;
        padding: 0.35rem 0.65rem;
        justify-content: center;
        text-transform: none;
    }

    .home-root-container .home-quick-access {
        padding: 0.5rem 0 0.35rem;
        justify-content: stretch;
        border-top: 1px solid #e8ecef;
        margin-top: 0.15rem;
    }

    .home-root-container .home-quick-access .mud-button-root {
        width: 100%;
        justify-content: center;
        min-height: 40px;
    }

    .home-root-container .home-stats-toolbar {
        padding: 0.15rem 0;
    }

    /* 実績表：閉じているときはコンパクト、開いたら全画面オーバーレイ */
    .home-root-container .home-stats-section.is-open {
        position: fixed;
        inset: 0;
        z-index: 2100;
        flex: none;
        max-height: none;
        min-height: 0;
        height: 100dvh;
        background: #f3f6f9;
        padding:
            env(safe-area-inset-top, 0px)
            env(safe-area-inset-right, 0px)
            env(safe-area-inset-bottom, 0px)
            env(safe-area-inset-left, 0px);
        box-sizing: border-box;
    }

    .home-root-container .home-stats-section.is-open .home-stats-toolbar {
        flex: 0 0 auto;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        padding: 0.45rem 0.35rem 0.5rem;
        border-bottom: 1px solid #d5dde6;
        background: #fff;
    }

    .home-root-container .home-stats-fullscreen-title {
        font-weight: 700;
        color: #1a3a5c;
        margin: 0;
        flex: 1 1 auto;
        min-width: 0;
    }

    .home-root-container .home-stats-toggle-btn {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .home-root-container .home-stats-section.is-open .responsive-home-paper {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .home-root-container .home-stats-section.is-open .responsive-home-paper-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0.35rem 0.5rem 0.5rem;
    }

    .home-root-container .home-stats-section.is-open .responsive-home-table-scroll {
        flex: 1 1 auto;
        min-height: 0;
    }
}

.work-results-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.work-results-footer-inner .mud-button-root {
    min-height: 48px;
    touch-action: manipulation;
}

/* エアバッグ結果画面など：フッターを2ボタンにしたとき */
.work-results-footer-inner--two .mud-button-root {
    flex: 1 1 45%;
    max-width: 50%;
}

@media (min-width: 600px) {
    .work-results-footer-inner {
        flex-wrap: nowrap;
    }

    .work-results-footer-inner .mud-button-root {
        flex: 1 1 0;
        min-width: 0;
    }
}

@media (max-width: 599.98px) {
    .work-results-footer-inner {
        flex-direction: column;
    }

    .work-results-footer-inner > * {
        width: 100%;
    }

    .work-results-footer-inner .mud-button-root {
        width: 100%;
    }
}

.work-results-scroll-fab {
    position: fixed !important;
    bottom: calc(112px + env(safe-area-inset-bottom, 0px)) !important;
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
    z-index: 1090;
}

@media (max-width: 599.98px) {
    .work-results-scroll-fab {
        bottom: calc(204px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* 触媒実績：1画面に2件（sm以上）、各カード内は縦並び */
.catalyst-work-result-grid {
    width: 100%;
}

.catalyst-work-result-grid__item {
    display: flex;
    min-width: 0;
}

.catalyst-work-result-line {
    border: 1px solid #ddd;
    box-sizing: border-box;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.catalyst-work-result-line .mud-select {
    width: 100%;
    min-width: 0;
}

.catalyst-work-digit-field {
    width: 100%;
}

.catalyst-item-select-popover .mud-list-item {
    min-height: 2.75rem;
    align-items: center;
}

.catalyst-item-select-popover .mud-list-item-text {
    white-space: normal;
    line-height: 1.35;
}

/* テンキーダイアログ：固定フッターより手前・キー同士の余白 */
.touch-digit-picker-dialog.mud-dialog {
    z-index: 1500;
}

.touch-digit-picker-dialog .mud-dialog-content {
    padding: 12px 16px 4px;
    overflow: visible;
}

.touch-digit-picker-dialog .mud-dialog-actions {
    padding-top: 0.25rem;
}

/* QR読取（解体メニュー入口）：カメラ枠をタブレット幅に追従 */
.qr-vim-reader-panel {
    width: 100%;
    max-width: min(100%, 480px);
    box-sizing: border-box;
}

