/* G案: スポットライト（ミントグリーン）。チャット専用のため認証・管理画面に影響しない。 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;600;700&display=swap');

:root {
  --color-bg: #f7fbfa;
  --color-surface: #fff;
  --color-surface-muted: #e8f6f2;
  --color-text: #0c1f1b;
  --color-text-muted: #5d746e;
  --color-accent: #0b8069;
  --color-accent-hover: #086654;
  --color-accent-bright: #17a58a;
  --color-mint: #7fe0c4;
  --color-sky: #9fd8f0;
  --color-border: #e0ece8;
  --color-control-border: #7a948b;
  --color-focus: #17a58a;
  --color-danger: #a33f32;
  --text: var(--color-text);
  --text-muted: var(--color-text-muted);
  --surface: var(--color-surface);
  --border: var(--color-border);
  --header-height: 80px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--color-bg); color: var(--color-text); font: 400 16px/1.8 Inter, 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif; -webkit-font-smoothing: antialiased; position: relative; overflow-x: hidden; }
/* 背景のミント／水色のやわらかい光 */
body::before { content: ''; position: fixed; inset: -20% -10% auto; height: 70vh; background: radial-gradient(ellipse 40% 50% at 30% 40%, rgba(127,224,196,.5), transparent), radial-gradient(ellipse 35% 45% at 70% 30%, rgba(159,216,240,.5), transparent); filter: blur(30px); z-index: 0; pointer-events: none; }
.main, .site-footer { position: relative; z-index: 1; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, summary, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--color-accent); text-underline-offset: 4px; overflow-wrap: anywhere; }
a:hover { color: var(--color-accent-hover); }
button { transition: background-color 150ms, color 150ms, border-color 150ms; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.icon { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 500; padding: 12px 20px; background: white; }
.skip-link:focus { top: 12px; }

/* Navigation */
.site-header { height: var(--header-height); padding: 0 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; position: relative; z-index: 30; flex-shrink: 0; }
.brand-lockup { display: flex; align-items: center; flex-shrink: 0; gap: 22px; }
.logo { font-size: 24px; font-weight: 700; letter-spacing: -.01em; color: var(--color-text); text-decoration: none; white-space: nowrap; }
.brand-description { border-left: 1px solid var(--color-control-border); padding-left: 22px; font-size: 15px; font-weight: 500; white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,.7); border: 1px solid var(--color-border); border-radius: 99px; padding: 4px 4px 4px 8px; backdrop-filter: blur(10px); }
.site-nav > a, .nav-tab { display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 44px; padding: 4px 14px; border-radius: 99px; font-size: 15px; font-weight: 400; white-space: nowrap; border: 0; background: transparent; color: var(--color-text); text-decoration: none; }
.site-nav > a:hover, .nav-tab:hover { color: var(--color-accent); background: var(--color-surface-muted); }
.nav-tab[aria-current="page"] { color: var(--color-text); background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.auth-actions { border-left: 1px solid var(--color-border); padding-left: 8px; margin-left: 4px; display: flex; align-items: center; }
.btn-outline, .btn-primary, .btn-secondary, .btn-danger { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 20px; border-radius: 12px; border: 1px solid var(--color-control-border); background: transparent; text-decoration: none; font-size: 15px; line-height: 1.6; }
.btn-outline { color: var(--color-accent); border-color: var(--color-accent); }
.btn-outline:hover, .btn-secondary:hover { background: var(--color-surface-muted); }
.btn-primary { color: white; background: linear-gradient(135deg, var(--color-accent), #0f9a82); border-color: var(--color-accent); }
.btn-primary:hover { background: var(--color-accent-hover); }
.btn-danger { color: var(--color-danger); border: 0; padding: 8px 0; }
.btn-danger:hover { text-decoration: underline; text-underline-offset: 4px; }
.menu-toggle, .menu-backdrop { display: none; }
.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--color-accent); }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-links { position: absolute; right: 0; top: calc(100% + 12px); min-width: 200px; border: 1px solid var(--color-border); border-radius: 8px; padding: 8px; background: white; box-shadow: 0 4px 20px #2f332c0d; }
.account-links a, .account-links button { display: flex; align-items: center; min-height: 44px; width: 100%; padding: 8px 12px; border: 0; background: transparent; color: var(--color-text); text-decoration: none; text-align: left; }
.account-links a:hover, .account-links button:hover { background: var(--color-surface-muted); }

/* Welcome and composer */
.main { flex: 1; min-width: 0; }
.main:focus { outline: none; }
.tab-content { display: none; }
.tab-content.active { display: block; }
body.is-history #tab-history.active { width: 100%; }
.chat-container { max-width: 856px; margin: 0 auto; padding: 96px 48px 72px; }
.welcome .eyebrow, .eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--color-accent); font-size: 13px; font-weight: 600; letter-spacing: .04em; margin-bottom: 16px; }
.welcome .eyebrow { background: rgba(255,255,255,.75); border: 1px solid var(--color-border); border-radius: 99px; padding: 2px 14px; }
.welcome .eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent-bright); box-shadow: 0 0 0 4px rgba(23,165,138,.2); }
.welcome h1 { font-size: 48px; font-weight: 700; line-height: 1.3; letter-spacing: -.03em; background: linear-gradient(90deg, var(--color-text) 35%, var(--color-accent-bright)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome-description { font-size: 18px; color: var(--color-text-muted); line-height: 1.8; margin-top: 16px; }
.welcome-sub { font-size: 14px; color: var(--color-text-muted); margin-top: 12px; }
.welcome-sub:empty { display: none; }
.input-area { margin-top: 40px; }
.input-container { display: flex; align-items: flex-end; gap: 12px; border: 1px solid #fff; border-radius: 20px; padding: 9px 9px 9px 22px; background: rgba(255,255,255,.88); backdrop-filter: blur(16px); min-height: 76px; box-shadow: 0 0 0 1px var(--color-border), 0 20px 50px -12px rgba(23,120,100,.25); }
.input-container:focus-within { box-shadow: 0 0 0 2px var(--color-focus), 0 20px 50px -12px rgba(23,120,100,.3); }
.question-input { flex: 1; min-width: 0; min-height: 56px; max-height: 160px; resize: none; border: 0; background: transparent; outline: none; padding: 13px 0; font-size: 16px; line-height: 1.8; }
.question-input::placeholder { color: var(--color-text-muted); opacity: 1; }
.send-btn { width: 56px; height: 56px; flex-shrink: 0; border: 0; border-radius: 14px; display: grid; place-items: center; color: white; background: linear-gradient(135deg, #0f9a82, #1fb7a0); }
.send-btn:hover:not(:disabled) { background: linear-gradient(135deg, #0b8069, #17a58a); }
.send-btn:disabled { background: var(--color-surface-muted); color: var(--color-text-muted); }
.send-btn .icon { width: 25px; height: 25px; }
.input-hints:has(span:empty) { display: none; }
.input-hints { font-size: 13px; color: var(--color-text-muted); margin: 8px 0; }
.limit-banner { font-size: 14px; color: var(--color-danger); padding: 0 0 16px; overflow-wrap: anywhere; }
.limit-banner.guest-notice { color: var(--color-text-muted); font-size: 13px; }
.limit-banner a { white-space: nowrap; }
.usage-note { margin: 6px 0 0; font-size: 11px; line-height: 1.6; color: var(--color-text-muted); text-align: center; overflow-wrap: anywhere; }
.welcome-prompts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.welcome-prompt { display: flex; align-items: center; gap: 18px; text-align: left; border: 1px solid var(--color-border); border-radius: 16px; padding: 16px 18px; min-height: 76px; background: rgba(255,255,255,.8); font-size: 16px; transition: transform 150ms, box-shadow 150ms, border-color 150ms; }
.welcome-prompt .icon { color: var(--color-accent); width: 40px; height: 40px; padding: 10px; border-radius: 12px; background: var(--color-surface-muted); }
.welcome-prompt .prompt-arrow { margin-left: auto; width: 20px; height: 20px; padding: 0; background: none; color: var(--color-text-muted); }
.welcome-prompt:hover { border-color: #9ddccb; background: #fff; transform: translateY(-2px); box-shadow: 0 12px 24px -14px rgba(23,120,100,.4); }
.welcome-prompt:hover .prompt-arrow { color: var(--color-accent); }

/* Conversation: one scrolling thread, composer stays visible. */
body.is-conversation .main { display: flex; min-height: 0; }
body.is-conversation #tab-chat.active { flex: 1; min-width: 0; display: flex; }
body.is-conversation:not(.is-history) { height: 100vh; height: 100dvh; }
body.is-conversation:not(.is-history) .main { overflow: hidden; }
body.is-conversation .chat-container { display: flex; flex-direction: column; width: 100%; padding-top: 16px; padding-bottom: 12px; min-height: 0; }
body.is-conversation .messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 4px 24px; scrollbar-gutter: stable; }
body.is-conversation .input-area { flex-shrink: 0; margin-top: 16px; }
body.is-conversation .welcome-prompts { display: none; }
body.is-conversation .site-footer { padding-top: 8px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.message { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 32px; overflow-wrap: anywhere; }
.message > div:not(.avatar) { min-width: 0; flex: 1; }
.avatar { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; color: var(--color-accent); font-size: 13px; margin-top: 4px; border-radius: 10px; background: var(--color-surface-muted); }
.message.user { justify-content: flex-end; }
.message.user .avatar { display: none; }
.message.user > div:not(.avatar) { flex: 0 1 auto; max-width: 90%; }
.bubble { font-size: 16px; line-height: 1.8; overflow-wrap: anywhere; }
.message.user .bubble { padding: 12px 20px; background: var(--color-text); color: #fff; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; }
.message:not(.user) .bubble { background: rgba(255,255,255,.88); border: 1px solid var(--color-border); border-radius: 20px; padding: 18px 24px; backdrop-filter: blur(10px); }
.bubble p, .history-response p { margin: 0 0 16px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble h1, .bubble h2, .bubble h3 { font-size: 20px; font-weight: 600; line-height: 1.6; margin: 24px 0 12px; }
.bubble h3 { font-size: 18px; }
.bubble ul, .bubble ol { padding-left: 24px; margin: 12px 0 16px; }
.bubble pre, .history-response pre { overflow-x: auto; background: var(--color-surface-muted); padding: 16px; border-radius: 12px; white-space: pre; max-width: 100%; }
.bubble code { font-size: .9em; background: var(--color-surface-muted); }
.bubble-meta, .feedback-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; color: var(--color-text-muted); font-size: 13px; }
.message.user .bubble-meta { justify-content: flex-end; }
.copy-btn, .fb-btn, .history-expand-btn { min-height: 44px; border: 0; border-radius: 6px; background: transparent; padding: 6px 8px; color: var(--color-accent); font-size: 14px; }
.copy-btn:hover, .fb-btn:hover:not(:disabled), .history-expand-btn:hover { background: var(--color-surface-muted); }
.fb-btn { border: 1px solid var(--color-border); padding: 6px 12px; }
.fb-btn.selected-good { border-color: var(--color-accent); background: var(--color-surface-muted); }
.fb-btn.selected-bad { border-color: var(--color-danger); color: var(--color-danger); }
.fb-btn:disabled { opacity: .7; }
.fb-thanks { color: var(--color-accent); }
.inquiry-link-box { font-size: 14px; border-top: 1px solid var(--color-border); margin-top: 24px; padding-top: 12px; }
.thinking { display: flex; align-items: center; gap: 12px; color: var(--color-text-muted); min-height: 44px; font-size: 14px; }
.thinking-dots { display: flex; gap: 4px; }
.thinking-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--color-accent); animation: pulse 1.2s infinite; }
.thinking-dots span:nth-child(2) { animation-delay: .2s; }
.thinking-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 50% { opacity: .25; } }
.error-bubble { padding: 16px; border-left: 2px solid var(--color-danger); color: var(--color-danger); }
.error-bubble a { color: inherit; }
.retry-btn { margin-top: 12px; }
.survey-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-top: 1px solid var(--color-border); padding: 16px 0; font-size: 14px; }
.survey-nudge button { min-width: 44px; min-height: 44px; margin-left: auto; background: transparent; border: 0; }

/* Follow-up questions and related products */
.clarify-card { border: 1px solid var(--color-border); border-radius: 20px; padding: 20px; background: rgba(255,255,255,.88); }
.clarify-title { font-weight: 500; margin-bottom: 20px; }
.clarify-question + .clarify-question { margin-top: 24px; }
.clarify-q-text { margin-bottom: 12px; }
.clarify-options { display: flex; flex-wrap: wrap; gap: 8px; }
.clarify-opt-btn, .clarify-free-btn { min-height: 44px; background: white; border: 1px solid var(--color-control-border); border-radius: 99px; padding: 8px 12px; font-size: 14px; }
.clarify-opt-btn:hover:not(:disabled) { background: var(--color-surface-muted); }
.clarify-free-input { display: flex; gap: 8px; margin-top: 12px; }
.clarify-text-input { min-width: 0; width: 100%; border: 1px solid var(--color-control-border); border-radius: 6px; padding: 8px 12px; font-size: 16px; }
.clarify-free-btn { color: white; background: var(--color-accent); }
.clarify-answered { opacity: .65; }
.product-reco { margin-top: 24px; border-top: 1px solid var(--color-border); padding-top: 16px; }
.product-reco-head { font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.product-reco-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.product-card { border: 1px solid var(--color-border); border-radius: 16px; overflow: hidden; background: white; text-decoration: none; color: var(--color-text); display: flex; flex-direction: column; }
.product-card:hover { border-color: var(--color-accent); }
.product-card-img { height: 150px; padding: 12px; }
.product-card-img img { width: 100%; height: 100%; object-fit: contain; }
.product-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card-name { font-size: 15px; font-weight: 500; }
.product-card-cat, .product-card-desc, .product-reco-note { font-size: 13px; color: var(--color-text-muted); }
.product-card-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-foot { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--color-accent); }
.product-reco-note { margin-top: 12px; }

/* History */
.history-container { max-width: 856px; margin: 0 auto; padding: 64px 48px 72px; }
.history-header, .history-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.history-header h1 { font-size: 28px; font-weight: 600; }
.history-header .eyebrow { margin-bottom: 8px; }
.history-toolbar { margin: 32px 0 16px; justify-content: flex-start; }
.history-toolbar .btn-danger { margin-left: auto; }
.setting-select { min-height: 44px; border: 1px solid var(--color-control-border); border-radius: 6px; padding: 8px 12px; background: transparent; font-size: 14px; max-width: 100%; }
.btn-mypage { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; font-size: 14px; }
.history-card { border-bottom: 1px solid var(--color-border); padding: 24px 0; }
.history-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.history-question { font-weight: 500; overflow-wrap: anywhere; }
.history-meta { color: var(--color-text-muted); font-size: 13px; flex-shrink: 0; }
.history-response { color: var(--color-text-muted); font-size: 15px; overflow-wrap: anywhere; max-height: 110px; overflow: hidden; }
.history-response.expanded { max-height: none; }
.empty-state { padding: 64px 0; text-align: center; color: var(--color-text-muted); }
.empty-state .btn-outline { margin-top: 20px; }

/* Footer and usage notice */
.site-footer { margin: 0 48px; padding: 24px 0; border-top: 1px solid var(--color-border); display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; flex-shrink: 0; color: var(--color-text-muted); font-size: 13px; }
.footer-company { padding-top: 10px; }
.disclaimer { margin-left: auto; max-width: 760px; }
.disclaimer summary { min-height: 44px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; cursor: pointer; list-style: none; }
.disclaimer summary::-webkit-details-marker { display: none; }
.disclaimer summary .icon { width: 16px; height: 16px; }
.disclaimer[open] summary .icon { transform: rotate(180deg); }
.disclaimer-text { padding-top: 12px; font-size: 14px; line-height: 1.8; }
.disclaimer-text strong { color: var(--color-text); }
body.is-conversation:not(.is-history) .disclaimer[open] .disclaimer-text { max-height: 25vh; overflow-y: auto; }

/* Feedback dialog */
.modal-overlay { display: none; position: fixed; inset: 0; background: #0c1f1b66; z-index: 100; padding: 24px; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { width: 100%; max-width: 760px; max-height: 88vh; max-height: 88dvh; background: white; border: 1px solid var(--color-border); border-radius: 20px; box-shadow: 0 8px 32px #0c1f1b1f; display: flex; flex-direction: column; }
.modal-sm { max-width: 460px; }
.modal-header { padding: 16px 24px; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-header h3 { font-size: 18px; font-weight: 500; }
.modal-close { width: 44px; height: 44px; border: 0; border-radius: 6px; background: transparent; flex-shrink: 0; }
.modal-close:hover { background: var(--color-surface-muted); }
.modal-body { padding: 24px; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.feedback-label { font-size: 14px; }
.feedback-textarea { width: 100%; padding: 12px; border: 1px solid var(--color-control-border); border-radius: 6px; resize: vertical; font-size: 16px; }
.feedback-modal-actions { display: flex; justify-content: flex-end; gap: 12px; }
.toast { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); right: 24px; left: auto; max-width: calc(100vw - 48px); background: var(--color-text); color: white; padding: 12px 20px; border-radius: 6px; font-size: 14px; z-index: 200; opacity: 0; pointer-events: none; transition: opacity 150ms; }
.toast.show { opacity: 1; }
body.has-modal { overflow: hidden; }

@media (max-height: 800px) and (min-width: 768px) {
  .chat-container { padding-top: 64px; padding-bottom: 48px; }
}
@media (max-width: 1199px) {
  .site-header { padding: 0 24px; }
  .brand-description { font-size: 14px; }
  .menu-toggle { display: grid; place-items: center; width: 44px; height: 44px; background: transparent; border: 1px solid var(--color-control-border); border-radius: 6px; }
  .site-nav { display: none; position: absolute; top: calc(100% - 4px); right: 24px; min-width: 280px; max-width: calc(100vw - 48px); background: white; border: 1px solid var(--color-border); border-radius: 20px; padding: 16px; box-shadow: 0 4px 20px #2f332c0d; align-items: stretch; gap: 4px; }
  .site-nav.open { display: flex; flex-direction: column; }
  .site-nav > a, .nav-tab { padding: 8px 12px; border-radius: 12px; }
  .auth-actions { border-left: 0; border-top: 1px solid var(--color-border); padding: 12px 0 0; margin-top: 8px; }
  .account-menu { width: 100%; }
  .account-menu summary { padding: 0 12px; }
  .account-links { position: static; margin-top: 8px; border: 0; padding: 0; box-shadow: none; }
  .menu-backdrop.active { display: block; position: fixed; inset: 0; z-index: 20; background: #2f332c22; }
  .chat-container, .history-container { max-width: 808px; padding-left: 24px; padding-right: 24px; }
  .site-footer { margin-left: 24px; margin-right: 24px; }
}
@media (max-width: 767px) {
  :root { --header-height: 64px; }
  .site-header { padding: 0 20px; gap: 12px; }
  .logo { font-size: 20px; }
  .brand-lockup { gap: 12px; }
  .brand-description { font-size: 12px; padding-left: 12px; }
  .site-nav { right: 20px; max-width: calc(100vw - 40px); min-width: 260px; max-height: calc(100dvh - 84px); overflow-y: auto; }
  .chat-container { padding: 48px 20px 48px; }
  .welcome h1 { font-size: 32px; line-height: 1.35; letter-spacing: -.025em; }
  .welcome-description { font-size: 16px; margin-top: 16px; }
  .welcome .eyebrow { font-size: 13px; margin-bottom: 12px; }
  .input-area { margin-top: 32px; }
  .input-container { gap: 8px; padding: 8px 8px 8px 14px; min-height: 72px; }
  .question-input { min-height: 54px; padding: 12px 0; }
  .send-btn { width: 48px; height: 54px; border-radius: 12px; }
  .welcome-prompts { grid-template-columns: 1fr; margin-top: 24px; }
  .welcome-prompt { min-height: 72px; padding: 16px 8px; }
  .welcome-prompt .icon { width: 40px; height: 40px; }
  .welcome-prompt .prompt-arrow { width: 20px; height: 20px; }
  .site-footer { margin: 0 20px; padding: 16px 0 max(20px, env(safe-area-inset-bottom)); gap: 4px; }
  .footer-company { font-size: 13px; }
  .disclaimer { max-width: 100%; }
  .disclaimer-text { font-size: 14px; }
  body.is-conversation .chat-container { padding-top: 0; padding-left: 20px; padding-right: 20px; }
  body.is-conversation .messages { padding-top: 20px; padding-right: 0; }
  .message { gap: 8px; margin-bottom: 24px; }
  .avatar { width: 22px; flex-basis: 22px; }
  .message.user > div:not(.avatar) { max-width: 95%; }
  .message.user .bubble { padding: 12px 16px; }
  .clarify-card { padding: 14px; }
  .clarify-free-input { flex-wrap: wrap; }
  .history-container { padding: 40px 20px; }
  .history-header h1 { font-size: 24px; }
  .history-header .btn-outline { padding: 8px 12px; }
  .history-card-header { flex-direction: column; gap: 8px; }
  .history-toolbar { gap: 8px 16px; }
  .history-toolbar .btn-danger { margin-left: 0; }
  .modal-overlay { padding: 12px; }
  .modal-header { padding: 12px 16px; }
  .modal-body { padding: 16px; }
}
@media (max-width: 359px) {
  .brand-description { display: none; }
  .site-footer { flex-direction: column; }
  .disclaimer { margin-left: 0; width: 100%; }
  .disclaimer summary { justify-content: flex-start; }
}
/* Wix 埋め込み（/?embed=1）: widget.js の小窓（幅 400px 前後）向けのコンパクト表示。
   右上にはウィジェット側の閉じるボタンが重なるため、ヘッダー右側を空けておく。 */
html.embed { --header-height: 56px; }
html.embed .site-header { padding: 0 60px 0 16px; gap: 8px; }
html.embed .logo { font-size: 18px; }
html.embed .brand-lockup { gap: 10px; }
html.embed .brand-description { font-size: 12px; padding-left: 10px; }
html.embed .menu-toggle { width: 40px; height: 40px; }
html.embed .site-nav { right: 16px; min-width: 240px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 64px); overflow-y: auto; }
html.embed .chat-container { padding: 20px 16px 24px; }
html.embed .welcome .eyebrow { margin-bottom: 10px; }
html.embed .welcome h1 { font-size: 26px; }
html.embed .welcome-description { font-size: 14px; margin-top: 8px; }
html.embed .input-area { margin-top: 20px; }
html.embed .input-container { min-height: 64px; }
html.embed .question-input { min-height: 46px; padding: 9px 0; }
html.embed .send-btn { width: 46px; height: 46px; }
html.embed .welcome-prompts { grid-template-columns: 1fr; gap: 8px; margin-top: 16px; }
html.embed .welcome-prompt { min-height: 56px; padding: 8px 12px; gap: 12px; font-size: 15px; }
html.embed .welcome-prompt .icon { width: 36px; height: 36px; padding: 8px; }
html.embed .welcome-prompt .prompt-arrow { width: 18px; height: 18px; padding: 0; }
/* 会話欄を広く取るため、入力欄より下は最小限にする。
   小窓は常に未ログインのため、ログインユーザー向けの回数の注意書きは出さない。 */
html.embed .usage-note, html.embed .footer-company { display: none; }
html.embed .limit-banner { padding-bottom: 8px; font-size: 12px; line-height: 1.6; }
html.embed .site-footer { margin: 0 16px; padding: 0 0 max(4px, env(safe-area-inset-bottom)); border-top: 0; gap: 0; flex-direction: column; font-size: 12px; }
html.embed .disclaimer { margin-left: 0; width: 100%; }
html.embed .disclaimer summary { min-height: 30px; justify-content: center; }
html.embed .disclaimer-text { font-size: 12px; line-height: 1.7; }
html.embed body.is-conversation .chat-container { padding: 0 14px 4px; }
html.embed body.is-conversation .messages { padding: 12px 0; }
html.embed body.is-conversation .input-area { margin-top: 4px; }
html.embed body.is-conversation .input-container { min-height: 56px; padding: 5px 5px 5px 16px; border-radius: 16px; }
html.embed body.is-conversation .question-input { min-height: 44px; padding: 8px 0; font-size: 15px; }
html.embed body.is-conversation .send-btn { width: 44px; height: 44px; border-radius: 12px; }
html.embed .message { gap: 8px; margin-bottom: 20px; }
html.embed .bubble { font-size: 15px; line-height: 1.75; }
html.embed .message.user > div:not(.avatar) { max-width: 92%; }
html.embed .message.user .bubble { padding: 10px 16px; border-radius: 16px 16px 4px 16px; }
html.embed .message:not(.user) .bubble { padding: 14px 16px; border-radius: 16px; }
html.embed .bubble h1, html.embed .bubble h2 { font-size: 17px; margin: 18px 0 8px; }
html.embed .bubble h3 { font-size: 16px; margin: 16px 0 8px; }
html.embed .bubble ul, html.embed .bubble ol { padding-left: 20px; }
/* 小窓は常に未ログイン扱い（Cookie が届かない）なので、履歴タブは出さない */
html.embed .nav-tab[data-tab="history"] { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
