*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; background: #f0f4f8; color: #333; line-height: 1.6; -webkit-text-size-adjust: 100%; }
.app { max-width: 600px; margin: 0 auto; background: #fff; height: 100dvh; display: flex; flex-direction: column; box-shadow: 0 0 20px rgba(0,0,0,.05); }

.header { background: linear-gradient(135deg, #005088 0%, #00335c 100%); color: #fff; padding: 14px 16px; border-bottom: 3px solid #0ea5e9; position: relative; }
.header h1 { margin: 0; font-size: 16px; font-weight: bold; text-align: center; padding-right: 70px; }
.header p { margin: 4px 0 0; font-size: 11px; color: #bae6fd; text-align: center; }
.reset-btn { position: absolute; top: 8px; right: 10px; background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.4); padding: 5px 10px; border-radius: 16px; font-size: 11px; cursor: pointer; line-height: 1; white-space: nowrap; }
.reset-btn:hover { background: rgba(255,255,255,.3); }

.chat-area { flex: 1; overflow-y: auto; padding: 16px; background: #f8fafc; -webkit-overflow-scrolling: touch; }

.msg { margin-bottom: 12px; display: flex; }
.msg.bot { justify-content: flex-start; }
.msg.user { justify-content: flex-end; }
.bubble { padding: 10px 14px; border-radius: 16px; font-size: 14px; max-width: 85%; word-wrap: break-word; box-shadow: 0 1px 2px rgba(0,0,0,.05); white-space: pre-wrap; line-height: 1.7; }
.msg.bot .bubble { background: #fff; color: #1e293b; border-bottom-left-radius: 4px; border: 1px solid #e2e8f0; }
.msg.bot .bubble a { color: #0ea5e9; text-decoration: underline; word-break: break-all; }
.msg.user .bubble { background: #0ea5e9; color: #fff; border-bottom-right-radius: 4px; }

.cat-tag { display: inline-block; background: #e0f2fe; color: #075985; font-size: 11px; font-weight: bold; padding: 3px 10px; border-radius: 10px; margin-bottom: 6px; border: 1px solid #bae6fd; }

.options { margin: 10px 0 16px; display: flex; flex-direction: column; gap: 8px; max-width: 85%; width: 100%; }
.opt-btn { background: #fff; border: 2px solid #005088; color: #005088; padding: 11px 16px; border-radius: 20px; font-size: 14px; font-weight: bold; cursor: pointer; text-align: left; transition: all .2s; box-shadow: 0 2px 4px rgba(0,0,0,.05); -webkit-tap-highlight-color: transparent; }
.opt-btn:hover { background: #005088; color: #fff; }
.opt-btn:active { background: #003d68; color: #fff; transform: scale(.98); }

.faq-list { margin: 10px 0 16px; display: flex; flex-direction: column; gap: 6px; max-width: 85%; width: 100%; }
.faq-item { background: #f0f9ff; border: 1px solid #bae6fd; color: #075985; padding: 10px 14px; border-radius: 12px; font-size: 13px; cursor: pointer; text-align: left; transition: all .2s; }
.faq-item:hover { background: #e0f2fe; border-color: #7dd3fc; }

.action-row { display: flex; gap: 8px; margin: 5px 0 12px; flex-wrap: wrap; }
.a-btn { padding: 9px 16px; border-radius: 18px; font-size: 13px; font-weight: bold; cursor: pointer; border: none; transition: transform .1s; }
.a-btn:active { transform: scale(.96); }
.btn-back { background: #fff; color: #64748b; border: 1.5px solid #cbd5e1; font-size: 12px; padding: 8px 12px; }
.btn-back:hover { background: #f1f5f9; }
.btn-contact { background: #6366f1; color: #fff; font-size: 12px; padding: 8px 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; border-radius: 18px; font-weight: bold; border: none; cursor: pointer; }
.btn-contact:hover { background: #4f46e5; }

.divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 16px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #cbd5e1; }
.divider span { font-size: 11px; color: #94a3b8; white-space: nowrap; }

.contact-card { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 12px; padding: 14px 16px; margin: 10px 0 12px; max-width: 85%; box-shadow: 0 2px 4px rgba(0,0,0,.05); }
.contact-card .cc-title { font-size: 14px; font-weight: bold; color: #075985; margin-bottom: 8px; }
.contact-card .cc-desc { font-size: 12px; color: #475569; line-height: 1.6; margin-bottom: 10px; }
.contact-card .cc-link { display: block; width: 100%; background: #6366f1; color: #fff; border: none; padding: 10px 0; border-radius: 20px; font-size: 14px; font-weight: bold; cursor: pointer; text-align: center; text-decoration: none; }
.contact-card .cc-link:hover { background: #4f46e5; }

.footer { padding: 10px 12px; background: #fff; border-top: 1px solid #e2e8f0; }
.input-row { display: flex; gap: 8px; align-items: center; }
#user-input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 24px; font-size: 16px; outline: none; -webkit-appearance: none; }
#user-input:focus { border-color: #005088; box-shadow: 0 0 0 2px rgba(0,80,136,.15); }
#user-input:disabled { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }
#send-btn { flex-shrink: 0; width: 56px; height: 42px; background: #005088; color: #fff; border: none; border-radius: 24px; font-size: 14px; font-weight: bold; cursor: pointer; }
#send-btn:disabled { background: #94a3b8; cursor: not-allowed; }
.hint { margin-top: 4px; font-size: 11px; color: #64748b; text-align: center; min-height: 14px; }

.typing { display: flex; gap: 4px; padding: 10px 14px; }
.typing span { width: 8px; height: 8px; background: #94a3b8; border-radius: 50%; animation: bounce .6s infinite alternate; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { to { transform: translateY(-6px); opacity: .4; } }

.ai-badge { display: inline-block; background: #fef3c7; color: #92400e; font-size: 10px; font-weight: bold; padding: 2px 8px; border-radius: 8px; margin-bottom: 4px; border: 1px solid #fde68a; }
.privacy-notice { margin: 8px 0 12px; padding: 8px 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 11px; color: #64748b; line-height: 1.6; }
.privacy-notice a { color: #0ea5e9; text-decoration: underline; }

.inquiry-form-container { background: #fff; border: 1px solid #cbd5e1; border-radius: 12px; padding: 16px; margin: 10px 0 15px; clear: both; float: left; width: 100%; max-width: 90%; box-shadow: 0 2px 4px rgba(0,0,0,.05); box-sizing: border-box; }
.inquiry-form-container h3 { margin: 0 0 12px; font-size: 15px; color: #005088; border-bottom: 2px solid #0ea5e9; padding-bottom: 6px; }
.inquiry-form-container .form-note { font-size: 11px; color: #64748b; margin-bottom: 12px; line-height: 1.5; white-space: pre-line; }
.inquiry-form-container .form-related-faq { background: #f0f9ff; border-left: 3px solid #0ea5e9; padding: 8px 10px; margin-bottom: 12px; font-size: 11px; color: #075985; border-radius: 4px; }
/* 楽天市場ガイドライン(※4)の指定文言。目立つように枠付きで常時表示する */
.inquiry-form-container .rakuten-notice { background: #fff7ed; border: 1px solid #fdba74; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 11px; color: #7c2d12; line-height: 1.6; white-space: pre-line; }
.form-field { margin-bottom: 12px; }
.form-field label { display: block; font-size: 13px; font-weight: bold; color: #334155; margin-bottom: 4px; }
.form-field label .required { color: #ef4444; margin-left: 2px; }
.form-field label .optional { color: #94a3b8; font-weight: normal; font-size: 11px; margin-left: 4px; }
.form-field input, .form-field textarea { width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; box-sizing: border-box; -webkit-appearance: none; }
.form-field input:focus, .form-field textarea:focus { border-color: #005088; box-shadow: 0 0 0 2px rgba(0,80,136,.15); outline: none; }
.form-field .field-hint { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.form-error { font-size: 12px; color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; white-space: pre-line; display: none; }
.form-error.show { display: block; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.form-cancel-btn { background: #fff; color: #64748b; border: 1.5px solid #cbd5e1; padding: 8px 16px; border-radius: 18px; font-size: 13px; cursor: pointer; }
.form-cancel-btn:hover { background: #f1f5f9; }
.form-submit-btn { background: #005088; color: #fff; border: none; padding: 8px 20px; border-radius: 18px; font-size: 13px; font-weight: bold; cursor: pointer; }
.form-submit-btn:hover { background: #003d68; }
.form-submit-btn:disabled, .form-cancel-btn:disabled { opacity: .5; cursor: not-allowed; }
.form-submitting input, .form-submitting textarea { background: #f1f5f9; pointer-events: none; }
.form-loading { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; margin-top: 10px; }
.form-loading .spinner { width: 18px; height: 18px; border: 2.5px solid #bfdbfe; border-top-color: #005088; border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-loading .loading-text { font-size: 13px; color: #1e40af; line-height: 1.5; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
