:root {
    --primary-color: #e60012;
    --primary-hover: #c00010;
    --primary-soft: rgba(230, 0, 18, 0.08);
    --text-color: #1f2937;
    --muted-text: #667085;
    --bg-color: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border-color: #e5e7eb;
    --border-strong: #d0d5dd;
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 18px 44px rgba(15, 23, 42, 0.08);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background: linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
    color: var(--text-color);
    margin: 0;
    padding: 18px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.container {
    max-width: 620px;
    margin: 28px auto;
    background: var(--surface);
    padding: 34px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(229, 231, 235, 0.8);
}

.admin-shell {
    max-width: 1800px;
    margin: 0 auto;
}

.admin-container {
    max-width: 100%;
    padding: 28px;
    background: transparent;
    box-shadow: none;
    border: none;
}

.admin-surface {
    background: transparent;
}

.confirm-container {
    max-width: 1040px;
}

h1, h2, h3, h4, p { margin-top: 0; }

h2 {
    color: #111827;
    margin-bottom: 10px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

h3 {
    margin-bottom: 6px;
    font-size: 1.05rem;
    font-weight: 800;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-lead {
    color: var(--muted-text);
    font-size: 0.95rem;
    line-height: 1.75;
    margin: 0;
}

.form-container h2 {
    text-align: center;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-top-bar {
    align-items: flex-start;
}

.logout-link,
.mini-link {
    color: #344054;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    transition: 0.2s ease;
}

.logout-link:hover,
.mini-link:hover {
    color: var(--primary-color);
    border-color: rgba(230, 0, 18, 0.35);
    background: #fff;
}

/* フォーム */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #344054;
}

.required::after { content: " *"; color: var(--primary-color); }

select,
input[type="text"],
input[type="number"],
input[type="email"],
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    font-size: 1rem;
    background-color: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 42px;
    appearance: none;
}

select:focus,
input:focus,
textarea:focus {
    border-color: rgba(230, 0, 18, 0.45);
    outline: none;
    box-shadow: 0 0 0 4px rgba(230, 0, 18, 0.08);
}

input:disabled {
    background-color: #f8fafc;
    color: #98a2b3;
    cursor: not-allowed;
    border-style: dashed;
}

.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
    display: none;
}

.search-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.95rem;
}

.search-item:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
}

.selected-badge,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #475467;
    background: #eef2f7;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.selected-badge {
    margin-top: 10px;
    padding: 8px 14px;
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #fed7d7;
    font-size: 0.86rem;
    gap: 8px;
}

.badge-clear-btn {
    display: inline-flex;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(197, 48, 48, 0.1);
    color: #c53030;
    font-size: 11px;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    border: none;
    padding: 0;
}

.switch-manual-trigger,
.back-to-search-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: #475467;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #d0d5dd;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    text-decoration: none;
}

.switch-manual-trigger:hover,
.back-to-search-link:hover {
    color: var(--primary-color);
    border-color: rgba(230, 0, 18, 0.35);
    background: #fff7f7;
}

.manual-form-card {
    border: 1px dashed rgba(230, 0, 18, 0.45);
    padding: 18px;
    border-radius: 14px;
    background: #fffafa;
    margin-top: 8px;
}

.btn-submit,
.btn-secondary,
.btn-warning,
.btn-confirm-mail {
    border: none;
    padding: 13px 16px;
    font-size: 0.95rem;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.btn-submit:hover,
.btn-secondary:hover,
.btn-warning:hover,
.btn-confirm-mail:hover { transform: translateY(-1px); }

.btn-submit {
    background-color: var(--primary-color);
    color: #fff;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 10px 24px rgba(230, 0, 18, 0.2);
}

.btn-submit:hover { background-color: var(--primary-hover); }

.btn-secondary {
    background: #eef2f7;
    color: #344054;
}

.btn-warning {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #fecaca;
}

.btn-confirm-mail {
    background: linear-gradient(180deg, #2f6fde 0%, #255ec0 100%);
    color: #fff;
    white-space: nowrap;
    font-size: 0.84rem;
}

/* 管理画面 */
.admin-header { margin-bottom: 20px; }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(110px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.summary-card {
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 18px;
    padding: 16px 16px 14px;
    box-shadow: var(--shadow-sm);
}

.summary-label {
    font-size: 0.8rem;
    color: var(--muted-text);
    font-weight: 700;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 1.7rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.tone-neutral .summary-value { color: #344054; }
.tone-danger .summary-value { color: #d92d20; }
.tone-info .summary-value { color: #175cd3; }
.tone-sky .summary-value { color: #026aa2; }
.tone-success .summary-value { color: #027a48; }
.tone-warning .summary-value { color: #b54708; }
.tone-green .summary-value { color: #027a48; }
.tone-slate .summary-value { color: #475467; }

.admin-note-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #dbe7f5;
    background: linear-gradient(180deg, #f8fbff 0%, #f2f7fd 100%);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.admin-note-title {
    flex: 0 0 auto;
    color: #175cd3;
    font-weight: 800;
    font-size: 0.85rem;
}

.admin-note-body {
    color: #475467;
    font-size: 0.9rem;
    line-height: 1.6;
}

.subtle-action {
    color: #98a2b3;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tab-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.modern-tabs {
    padding: 0;
    border: none;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid #e4e7ec;
    background: rgba(255,255,255,0.82);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.94rem;
    color: #667085;
    border-radius: 999px;
    transition: 0.18s ease;
    box-shadow: var(--shadow-sm);
}

.tab-btn:hover {
    color: #344054;
    border-color: #d0d5dd;
    background: #fff;
}

.tab-btn.active {
    color: #fff;
    background: linear-gradient(180deg, #253147 0%, #101828 100%);
    border-color: #101828;
}

.tab-btn.active .badge {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

.badge.bg-red {
    background: #fff1f3;
    color: #d92d20;
}

.tab-btn.active .badge.bg-red {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

.admin-card {
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(229, 231, 235, 0.88);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.table-card-head {
    padding: 18px 20px 12px;
}

.table-help {
    color: var(--muted-text);
    font-size: 0.88rem;
    margin: 0;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table-wrapper {
    border-top: 1px solid #edf2f7;
    padding-bottom: 6px;
}

.admin-table {
    width: 100%;
    min-width: 1520px;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.9rem;
    vertical-align: middle;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    font-weight: 800;
    color: #475467;
    font-size: 0.84rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

td {
    white-space: nowrap;
    color: #344054;
    background: #fff;
}

.request-row:hover td { background: #fcfcfd; }

.empty-row {
    text-align: center;
    color: #98a2b3;
    padding: 44px 0 !important;
}

td.thumb-cell,
td.upload-cell,
td.email-cell,
td.message-cell { white-space: normal; }

.category-badge {
    margin-left: 0;
    background: #f2f4f7;
    color: #344054;
    border: 1px solid #eaecf0;
}

.name-text { font-size: 1rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.strong { font-weight: 700; }
.email-text { color: #475467; word-break: break-all; }
.muted-inline { color: #98a2b3; font-style: italic; }
.empty-muted { color: #98a2b3; }
.empty-image-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #667085;
    font-size: 0.78rem;
    font-weight: 700;
}

.priority-select {
    min-width: 86px;
    padding: 8px 30px 8px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 800;
    font-size: 0.84rem;
    cursor: pointer;
    appearance: none;
    text-align: center;
    outline: none;
}

.pr-通常 { background-color: #f8fafc; color: #475467; border-color: #d0d5dd; }
.pr-高 { background-color: #fff1f3; color: #d92d20; border-color: #fecdd3; }

.st-未対応 { background-color: #fff1f3; color: #d92d20; border-color: #fda4af; }
.st-画像作成中 { background-color: #eff8ff; color: #175cd3; border-color: #b2ddff; }
.st-画像確認中 { background-color: #f0f9ff; color: #026aa2; border-color: #a5f3fc; }
.st-画像確認済み { background-color: #ecfdf3; color: #027a48; border-color: #abefc6; }
.st-印刷済み { background-color: #fffaeb; color: #b54708; border-color: #fedf89; }
.st-発送済み { background-color: #ecfdf3; color: #027a48; border-color: #abefc6; }
.st-完了 { background-color: #f2f4f7; color: #475467; border-color: #d0d5dd; }

.thumb-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.thumb-wrapper {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 64px;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    background: #f0f2f5;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.thumb-wrapper.loading-shimmer {
    background: linear-gradient(90deg, #f0f2f5 25%, #e6e8eb 37%, #f0f2f5 63%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.25s, transform 0.2s;
    cursor: pointer;
    display: block;
    opacity: 0;
}

.thumb-img.loaded { opacity: 1; }
.thumb-img:hover { transform: scale(1.08); }

.btn-delete-img {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(229, 62, 98, 0.96);
    color: #fff;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: none;
    line-height: 18px;
    text-align: center;
    padding: 0;
    z-index: 10;
    font-weight: bold;
}

.upload-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    max-width: 160px;
}

.file-label {
    background: #fff;
    border: 1px dashed #cbd5e1;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    display: inline-block;
    color: #475467;
    transition: 0.16s ease;
}

.file-label:hover {
    border-color: rgba(37, 99, 235, 0.35);
    background: #f8fbff;
}

.file-input { display: none; }
.file-count-text { font-size: 0.76rem; color: #667085; }

.message-mini {
    max-width: 220px;
    font-size: 0.82rem;
    color: #475467;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-count {
    color: #111827;
}

.message-last {
    color: #667085;
    line-height: 1.55;
}

.sp-label { display: none; }

/* 確認画面 */
.request-summary {
    background: #f8fafc;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid #edf2f7;
    line-height: 1.9;
}

.status-pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: #edf2f7;
    font-weight: 800;
}

.confirm-images {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.confirm-images img {
    max-width: 260px;
    max-height: 180px;
    object-fit: contain;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    background: #fff;
    padding: 6px;
    box-shadow: var(--shadow-sm);
}

.chat-box {
    height: 380px;
    overflow-y: auto;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 16px;
    padding: 16px;
}

.chat-empty {
    color: #98a2b3;
    text-align: center;
    padding: 40px 0;
}

.chat-message { margin-bottom: 14px; }
.chat-message.mine { text-align: right; }

.chat-meta {
    font-size: 0.75rem;
    color: #98a2b3;
    margin-bottom: 4px;
}

.chat-bubble {
    display: inline-block;
    max-width: 72%;
    padding: 11px 14px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e4e7ec;
    text-align: left;
    line-height: 1.65;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.chat-message.mine .chat-bubble {
    background: #eff8ff;
    border-color: #b2ddff;
}

.message-form { margin-top: 16px; }

.confirm-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.confirm-actions .btn-submit {
    width: auto;
    margin-top: 0;
}

/* ステータス操作 */
.status-cell {
    min-width: 172px;
}

.status-current-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 10px;
    white-space: nowrap;
}

.status-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.btn-status-next,
.btn-confirm-mail {
    border: none;
    border-radius: 12px;
    background: linear-gradient(180deg, #eb0017 0%, #c40013 100%);
    color: #fff;
    padding: 10px 14px;
    font-size: 0.83rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(230, 0, 18, 0.18);
    white-space: nowrap;
}

.btn-status-next:hover,
.btn-confirm-mail:hover { background: linear-gradient(180deg, #f2142a 0%, #b8000e 100%); }

.btn-status-next:disabled,
.btn-confirm-mail:disabled,
.btn-status-back:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-status-back {
    border: none;
    background: transparent;
    color: #98a2b3;
    padding: 0 4px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn-status-back:hover { color: #667085; }

@media (max-width: 1200px) {
    .summary-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
}

@media (max-width: 768px) {
    body { padding: 8px; }
    .container { margin: 10px auto; padding: 24px 20px; border-radius: 16px; }
    .admin-container { padding: 10px; margin: 0; }
    h2 { font-size: 1.5rem; text-align: left; margin-bottom: 10px; }
    .top-bar { flex-direction: column; align-items: stretch; }
    .admin-top-bar { gap: 12px; }
    .logout-link { align-self: flex-start; }
    select, input[type="text"], input[type="number"], input[type="email"], textarea { padding: 14px; font-size: 16px; }

    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .summary-card { padding: 14px; }
    .summary-value { font-size: 1.45rem; }
    .admin-note-bar { flex-direction: column; align-items: flex-start; }

    .tab-container { gap: 8px; }
    .tab-btn {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
        padding: 11px 10px;
        font-size: 0.85rem;
    }

    .table-card-head { padding: 16px 16px 8px; }
    .table-wrapper { overflow-x: visible; border: none; }
    table, tbody, tr, td { display: block; width: 100%; box-sizing: border-box; }
    thead { display: none; }
    .request-row {
        background: #fff;
        margin: 0 12px 14px;
        border-radius: 18px;
        padding: 14px 14px 10px;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
        border: 1px solid #e5e7eb;
        overflow: hidden;
    }
    td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 12px 0;
        border-bottom: 1px dashed #edf2f7;
        font-size: 0.9rem;
        white-space: normal;
        gap: 12px;
        background: transparent !important;
    }
    td:last-child { border-bottom: none; }
    .sp-label {
        display: inline-block;
        font-weight: 800;
        color: #667085;
        font-size: 0.82rem;
        margin-right: 10px;
        flex: 0 0 92px;
    }
    .thumb-container { justify-content: flex-end; }
    .upload-box { align-items: flex-end; width: auto; max-width: 100%; }
    .priority-select { width: 110px; }
    .message-mini { max-width: 100%; align-items: flex-end; text-align: right; }
    .chat-bubble { max-width: 88%; }
    .confirm-images img { max-width: 100%; }
    .status-cell {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        min-width: 0;
    }
    .status-action-buttons { align-items: flex-end; }
}


/* ===============================
   v5 responsive polish
   発注画面・管理画面・確認画面 共通のレスポンシブ強化
================================ */

body.page-form,
body.page-confirm {
    padding: 0;
    min-height: 100vh;
}

.form-page-shell,
.confirm-page-shell {
    min-height: 100vh;
    padding: 34px 18px;
    background:
        radial-gradient(circle at 10% 0%, rgba(230, 0, 18, 0.08), transparent 28%),
        radial-gradient(circle at 92% 8%, rgba(37, 99, 235, 0.08), transparent 26%),
        linear-gradient(180deg, #f8fafc 0%, #eef3f9 100%);
}

.form-shell {
    max-width: 980px;
    padding: 0;
    overflow: hidden;
}

.form-hero,
.confirm-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    padding: 30px 32px 24px;
    background: linear-gradient(135deg, #ffffff 0%, #fbfdff 100%);
    border-bottom: 1px solid #edf2f7;
}

.form-hero h2,
.confirm-hero h2 {
    margin-bottom: 8px;
}

.form-progress {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 18px 32px;
    background: #fff;
    border-bottom: 1px solid #edf2f7;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #667085;
    font-size: 0.88rem;
    font-weight: 800;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 999px;
    padding: 10px 12px;
}

.progress-item span {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    background: #e4e7ec;
    color: #475467;
    border-radius: 50%;
    font-size: 0.78rem;
}

.progress-item.active {
    color: #b8000e;
    background: #fff5f5;
    border-color: #ffe0e3;
}

.progress-item.active span {
    color: #fff;
    background: var(--primary-color);
}

.modern-form {
    padding: 26px 32px 32px;
    background: #fff;
}

.form-section-card {
    border: 1px solid #edf2f7;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    padding: 22px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
    margin-bottom: 18px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.section-heading h3 {
    margin: 0 0 4px;
    font-size: 1.08rem;
}

.section-heading p {
    margin: 0;
    color: #667085;
    line-height: 1.65;
    font-size: 0.9rem;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: var(--primary-color);
    background: #fff5f5;
    border: 1px solid #ffe0e3;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 18px;
}

.form-group-wide {
    grid-column: 1 / -1;
}

.manual-grid {
    display: grid;
    grid-template-columns: 0.7fr 1fr 1fr;
    gap: 14px;
}

.form-submit-area {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 0 0;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 34%);
}

.form-submit-area p {
    margin: 0;
    color: #667085;
    font-size: 0.88rem;
    line-height: 1.55;
}

.form-submit-area .btn-submit {
    width: auto;
    min-width: 220px;
    margin: 0;
}

/* confirm */
.confirm-shell {
    max-width: 1240px;
    padding: 0;
    overflow: hidden;
}

.confirm-status-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 180px;
}

.confirm-status-label {
    color: #667085;
    font-weight: 800;
    font-size: 0.78rem;
}

.confirm-layout {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    gap: 20px;
    padding: 24px;
    background: #fff;
}

.confirm-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.modern-summary,
.confirm-image-card,
.chat-panel {
    border: 1px solid #edf2f7;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.modern-summary {
    padding: 20px;
}

.summary-list {
    margin: 12px 0 0;
}

.summary-list > div {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f2f4f7;
}

.summary-list > div:last-child {
    border-bottom: none;
}

.summary-list dt {
    color: #667085;
    font-size: 0.82rem;
    font-weight: 800;
}

.summary-list dd {
    margin: 0;
    color: #1f2937;
    font-weight: 700;
    word-break: break-word;
}

.panel-heading {
    padding: 18px 18px 0;
}

.panel-heading p {
    margin: 0;
    color: #667085;
    font-size: 0.86rem;
    line-height: 1.6;
}

.confirm-image-card .confirm-images {
    padding: 16px 18px 18px;
}

.empty-image-panel {
    width: 100%;
    padding: 28px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px dashed #d0d5dd;
    color: #98a2b3;
    text-align: center;
    font-weight: 700;
}

.chat-panel {
    padding-bottom: 18px;
    height: 100%;
}

.chat-panel .chat-box {
    margin: 16px 18px 0;
    height: 480px;
}

.chat-panel .message-form {
    margin: 16px 18px 0;
}

.chat-panel textarea {
    resize: vertical;
}

.confirm-actions {
    justify-content: flex-end;
}

.confirm-actions .btn-submit,
.confirm-actions .btn-secondary,
.confirm-actions .btn-warning {
    min-width: 140px;
}

/* 管理画面レスポンシブ強化 */
.admin-table-wrapper::-webkit-scrollbar {
    height: 10px;
}

.admin-table-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.admin-table-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
}

@media (max-width: 1280px) {
    .admin-container {
        padding: 20px;
    }

    .summary-grid {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }

    .admin-table {
        min-width: 1460px;
    }
}

@media (max-width: 960px) {
    .form-page-shell,
    .confirm-page-shell {
        padding: 18px 10px;
    }

    .form-hero,
    .confirm-hero {
        flex-direction: column;
        padding: 24px 22px 20px;
    }

    .form-progress {
        grid-template-columns: 1fr;
        padding: 16px 22px;
    }

    .modern-form {
        padding: 20px 22px 24px;
    }

    .form-grid,
    .manual-grid {
        grid-template-columns: 1fr;
    }

    .form-section-card {
        padding: 18px;
    }

    .form-submit-area {
        position: static;
        flex-direction: column;
        align-items: stretch;
    }

    .form-submit-area .btn-submit {
        width: 100%;
        min-width: 0;
    }

    .confirm-layout {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .confirm-status-box {
        align-items: flex-start;
    }

    .chat-panel .chat-box {
        height: 420px;
    }

    .confirm-actions {
        justify-content: stretch;
    }

    .confirm-actions .btn-submit,
    .confirm-actions .btn-secondary,
    .confirm-actions .btn-warning {
        flex: 1 1 100%;
        width: 100%;
    }

    .admin-note-bar {
        align-items: flex-start;
    }

    .modern-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .modern-tabs .tab-btn {
        flex: 0 0 auto;
    }
}

@media (max-width: 768px) {
    .admin-table {
        min-width: 0;
    }

    .admin-card {
        border-radius: 18px;
    }

    .request-row {
        display: block;
    }

    .request-row td:nth-child(1),
    .request-row td:nth-child(6),
    .request-row td:nth-child(15) {
        background: #fcfdff !important;
    }

    .admin-table-wrapper {
        padding: 0 0 10px;
    }

    .table-help {
        display: none;
    }
}

@media (max-width: 560px) {
    body {
        padding: 0;
    }

    .form-page-shell,
    .confirm-page-shell {
        padding: 0;
    }

    .form-shell,
    .confirm-shell {
        min-height: 100vh;
        border-radius: 0;
        margin: 0;
        box-shadow: none;
        border: none;
    }

    .form-hero,
    .confirm-hero {
        padding: 22px 18px 18px;
    }

    .form-hero h2,
    .confirm-hero h2 {
        font-size: 1.55rem;
    }

    .modern-form {
        padding: 18px 14px 22px;
    }

    .form-progress {
        padding: 14px;
    }

    .form-section-card {
        border-radius: 16px;
        padding: 16px;
    }

    .section-heading {
        gap: 10px;
    }

    .section-number {
        width: 36px;
        height: 36px;
        border-radius: 12px;
        font-size: 0.86rem;
    }

    .confirm-layout {
        padding: 14px;
        gap: 14px;
    }

    .summary-list > div {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .chat-panel .chat-box {
        height: 360px;
        margin: 14px 14px 0;
    }

    .chat-panel .message-form {
        margin: 14px 14px 0;
    }

    .chat-bubble {
        max-width: 92%;
    }

    .confirm-images {
        gap: 10px;
    }

    .confirm-images img {
        max-width: 100%;
        width: 100%;
        max-height: none;
    }

    .admin-container {
        padding: 8px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-card {
        border-radius: 14px;
    }

    .tab-btn {
        flex: 0 0 auto !important;
        min-width: 130px;
    }

    .request-row {
        margin: 0 6px 12px;
    }

    td {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .sp-label {
        flex: none;
    }

    .message-mini,
    .status-cell,
    .upload-box {
        align-items: flex-start !important;
        text-align: left;
    }

    .status-action-buttons {
        align-items: flex-start !important;
    }

    .btn-status-next,
    .btn-confirm-mail {
        width: 100%;
        text-align: center;
    }
}


/* ===============================
   v6 確認メールフロー調整
   画像確認中タブ廃止 / 送信済み・再送対応
================================ */

.summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.confirm-mail-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 10px;
    align-items: flex-start;
}

.btn-confirm-mail.sent {
    background: linear-gradient(180deg, #344054 0%, #1d2939 100%);
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.16);
}

.btn-confirm-mail.sent:hover {
    background: linear-gradient(180deg, #475467 0%, #344054 100%);
}

.confirm-sent-note {
    color: #475467;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.45;
    white-space: nowrap;
}

.confirm-sent-note.muted {
    color: #98a2b3;
    font-weight: 700;
}

.status-cell .status-action-buttons {
    margin-top: 4px;
}

@media (max-width: 560px) {
    .confirm-mail-area {
        width: 100%;
        align-items: stretch;
    }

    .confirm-mail-area .btn-confirm-mail {
        width: 100%;
        text-align: center;
    }

    .confirm-sent-note {
        white-space: normal;
    }
}
