* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Segoe UI", sans-serif;
    background: #eef1f5;
    color: #1f2430;
}

.room-entry {
    position: relative;
    z-index: 2;
    max-width: 380px;
    margin: 15vh auto 0;
    padding: 32px 28px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.room-entry h1 {
    font-size: 1.1rem;
    margin: 0 0 20px;
}

.room-entry-error {
    color: #ff2d55;
    font-size: 0.85rem;
    margin: -8px 0 16px;
}

.room-entry-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.room-entry-form input {
    padding: 12px 14px;
    border: 1px solid #e5e2da;
    border-radius: 10px;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 0.15em;
}

.room-entry-form button {
    padding: 12px;
    border: none;
    border-radius: 999px;
    background: #1f2430;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.room-entry-form button:hover {
    background: #2f6fed;
}

.request-form-page {
    max-width: 420px;
}

.request-form-body {
    position: relative;
    min-height: 100vh;
    background: #11141c;
}

.request-form-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(160deg, #171a24, #2a3050);
}

.request-form-bg-click-catch {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: block;
}

.back-to-catalog {
    position: relative;
    z-index: 2;
    display: inline-block;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: #6b7280;
    text-decoration: none;
}

.back-to-catalog:hover {
    color: #2f6fed;
    text-decoration: underline;
}

.request-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    text-align: left;
}

.request-form-note {
    margin: 14px 0 0;
    font-size: 0.75rem;
    color: #6b7280;
}

.request-form-page .room-entry-form input {
    text-align: left;
    letter-spacing: normal;
    font-size: 0.95rem;
}

.chat-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 28px 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-body-shell {
    background: #e9e3d5;
}

.chat-page-boxed {
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(30, 22, 12, 0.1);
    border-left: 1px solid #e5e2da;
    border-right: 1px solid #e5e2da;
}

.chat-back-link {
    margin: 0 0 12px;
    font-size: 0.85rem;
}

.chat-back-link a {
    color: #6b7280;
    text-decoration: none;
}

/* === 取引情報カード === */

.transaction-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    padding: 18px 20px;
    margin-bottom: 16px;
}

.payment-status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.payment-status-paid {
    background: #e6f4ea;
    color: #1e7a34;
}

.transaction-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.transaction-summary-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.transaction-payment-action {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

.transaction-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.transaction-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}

.transaction-status-badge {
    align-self: flex-start;
    padding: 2px 10px;
    border-radius: 999px;
    background: #e7edfd;
    color: #2f6fed;
    font-size: 0.72rem;
    font-weight: 600;
}

.transaction-details {
    margin: 0 0 16px;
    padding-top: 12px;
    border-top: 1px solid #f0efe9;
}

.transaction-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.85rem;
}

.transaction-detail-row dt {
    color: #6b7280;
}

.transaction-detail-row dd {
    margin: 0;
    font-weight: 600;
}

.transaction-amount {
    font-size: 1rem;
}

.transaction-progress {
    display: flex;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid #f0efe9;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.progress-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border: 2px solid #d8d5cd;
    color: #ffffff;
    background: #d8d5cd;
}

.progress-step.is-current .progress-dot {
    background: #ffffff;
    border-color: #2f6fed;
}

.progress-step.is-upcoming .progress-dot {
    background: #ffffff;
}

.progress-step.is-done .progress-dot {
    background: #2f6fed;
    border-color: #2f6fed;
}

.progress-label {
    font-size: 0.65rem;
    color: #6b7280;
    white-space: nowrap;
}

.progress-step.is-current .progress-label {
    color: #2f6fed;
    font-weight: 600;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: #ecebe5;
    margin: 0 4px 18px;
}

.progress-line.is-done {
    background: #2f6fed;
}

/* === 部屋番号表示 === */

.chat-intro-note {
    margin: 0 0 16px;
}

.chat-room-number {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: #6b7280;
}

.chat-intro-reassurance {
    margin: 0;
    padding: 10px 14px;
    background: #eef6f0;
    border: 1px solid #cfe8d6;
    border-radius: 10px;
    font-size: 0.8rem;
    color: #2f6b45;
    line-height: 1.6;
}

/* === メッセージ一覧（箱型デザイン） === */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 16px;
}

.chat-message {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 12px 16px;
}

.chat-message-customer {
    background: #fdece0;
}

.chat-message-admin {
    background: #ffffff;
}

.chat-message-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.chat-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1f2430;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-message-customer .chat-avatar {
    background: #ff9f43;
}

.chat-sender-name {
    font-size: 0.78rem;
    font-weight: 600;
}

.chat-timestamp {
    margin-left: auto;
    font-size: 0.68rem;
    color: #6b7280;
}

.chat-body {
    font-size: 0.88rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-attachment {
    display: inline-block;
    margin-top: 8px;
    text-decoration: none;
    color: inherit;
}

.chat-attachment-image img {
    max-width: 220px;
    max-height: 220px;
    border-radius: 8px;
    display: block;
}

.chat-attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    font-size: 0.82rem;
}

.chat-attachment-file svg {
    flex-shrink: 0;
    color: #6b7280;
}

.chat-payment-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 12px 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, #3a7bf0, #1c4fc4);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(28, 79, 196, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-payment-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(28, 79, 196, 0.45);
}

.chat-payment-btn-icon {
    font-size: 1rem;
}

.chat-read-status {
    margin-top: 6px;
    font-size: 0.7rem;
    color: #6b7280;
    text-align: right;
}

.chat-closed-note {
    position: sticky;
    bottom: 0;
    margin: 0 -28px;
    padding: 14px 28px 20px;
    background: #f7f5f0;
    border-top: 1px solid #e5e2da;
    color: #6b7280;
    font-size: 0.85rem;
    text-align: center;
}

/* === 入力フォーム === */

.chat-form {
    position: sticky;
    bottom: 0;
    margin: 0 -28px;
    background: #f7f5f0;
    border-top: 1px solid #e5e2da;
    padding: 14px 28px 20px;
}

.chat-form textarea {
    width: 100%;
    resize: none;
    min-height: 60px;
    max-height: 200px;
    overflow-y: hidden;
    transition: height 0.1s ease;
    padding: 12px 14px;
    border: 1px solid #e5e2da;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.chat-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e5e2da;
    color: #6b7280;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.chat-file-label:hover {
    color: #2f6fed;
    border-color: #2f6fed;
}

.chat-file-label input {
    display: none;
}

.chat-file-name {
    flex: 1;
    font-size: 0.78rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-form-actions button {
    margin-left: auto;
    padding: 0 22px;
    height: 38px;
    border: none;
    border-radius: 999px;
    background: #1f2430;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.chat-form-actions button:hover {
    background: #2f6fed;
}
