/* Consultation A — a quiet reading space with persistent conversation controls. */
.consultation-page { --text: #243f32; --text-light: #606d59; --text-muted: #697560; --primary-light: #4d7159; --accent-dark: #36563e; --border: #cfd9c7; --border-light: #e1e6d9; --bg: #f5f4ec; }
.cq-heading { padding-top: 22px; padding-bottom: 24px; }
.cq-breadcrumb { display: flex; gap: 12px; font-size: 12px; color: #6a7561; margin-bottom: 14px; }
.cq-heading .home-eyebrow { font-size: 12px; margin-bottom: 8px; }
.consultation-page .cq-heading h1 { font-size: 42px; letter-spacing: .02em; margin-bottom: 9px; }
.cq-subtitle { color: #5a6a53; font-size: 15px; }
.cq-section { padding-bottom: 40px; }
.cq-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.consultation-page #consultation-main:focus { outline: none; }
.consultation-page .chat-wrap { max-width: none; margin: 0; }
.cq-workspace { display: grid; grid-template-columns: 250px minmax(0,1fr); height: clamp(610px, calc(100dvh - 270px), 880px); border: 1px solid #cbd7c1; border-radius: 18px; overflow: hidden; background: #fffdf8; }
.cq-sidebar { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #f0f3e9; border-right: 1px solid #d2dcc9; padding: 22px 18px; }
.cq-sidebar-actions { display: flex; gap: 12px; align-items: center; padding-bottom: 20px; border-bottom: 1px solid #d6dfcd; }
.consultation-page .chat-new-btn { width: 100%; border: 0; border-radius: 13px; background: #4d7159; color: white; min-height: 48px; font-size: 15px; }
.consultation-page .chat-new-btn::before { content: '+'; font-size: 24px; margin-right: 10px; font-weight: 300; vertical-align: -1px; }
.consultation-page .chat-new-btn:hover { background: #3c5f45; color: #fff; }
.cq-history-close, .cq-mobile-actions { display: none; }
.consultation-page .chat-history { padding: 20px 0 0; }
.consultation-page .chat-history-head { align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 15px; }
.consultation-page .chat-history-title { font-size: 17px; letter-spacing: 0; margin: 0; }
.consultation-page .chat-history-count { font-size: 11px; }
.consultation-page .chat-history .msg-empty { padding: 64px 8px 20px; font-size: 13px; color: #6b775e; }
.chat-history .msg-empty svg { display: block; width: 112px; height: 112px; margin: 0 auto 16px; }
.chat-history .msg-empty strong { display: block; color: #4e6445; font-size: 15px; font-weight: 500; margin-bottom: 5px; }
.consultation-page .chat-history .ai-sess-item { display: block; padding: 14px 10px; margin-bottom: 7px; border: 1px solid #d6dfcc; border-radius: 11px; background: #fbfcf5; }
.consultation-page .chat-history .ai-sess-item:hover { background: #e9efdf; }
.consultation-page .chat-history .ai-sess-title { font-size: 14px; font-weight: 550; line-height: 1.65; overflow-wrap: anywhere; }
.consultation-page .chat-history .ai-sess-meta { font-size: 11px; }
.consultation-page .chat-history .ai-sess-actions { margin-top: 8px; gap: 8px; justify-content: space-between; }
.consultation-page .chat-history .ai-sess-actions button { min-height: 40px; font-size: 12px; padding: 6px 12px; }
.consultation-page .chat-history .ai-continue-btn { background: #eff4e8; color: #49643e; border-color: #afbe9e; }
.consultation-page .chat-history .ai-continue-btn:hover { background: #dde8d1; }
.consultation-page .chat-history .ai-del-btn { background: transparent; color: #727963; }
.consultation-page #chat-history-more, #cq-history-retry { min-height: 44px; padding: 8px 16px; border: 1px solid #a7b697; background: transparent; border-radius: 22px; color: #49643e; font: inherit; font-size: 13px; cursor: pointer; }
.cq-history-error { padding: 24px 6px; font-size: 13px; color: #67735b; }
.cq-history-error p { margin-bottom: 12px; }
.consultation-page .chat-window { height: auto; min-width: 0; min-height: 0; border: 0; border-radius: 0; background: #fffdf8; box-shadow: none; }
.cq-chat-header { padding: 20px 22px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; border-bottom: 1px solid #e9ecdf; }
.cq-assistant { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.cq-assistant > svg { width: 31px; height: 31px; flex-shrink: 0; }
.consultation-page .cq-assistant h2 { font-size: 19px; letter-spacing: 0; margin: 0; line-height: 1.45; }
.cq-assistant p { max-width: 360px; font-size: 11px; color: #6a765f; margin-top: 3px; }
.consultation-page .chat-role-bar { gap: 6px; }
.consultation-page .chat-role-hint { font-size: 11px; color: #66765a; }
.consultation-page .chat-role-btn { padding: 8px 12px; min-height: 40px; font-size: 12px; color: #566a4a; border-color: #cad7bf; background: transparent; border-radius: 24px; }
.consultation-page .chat-role-btn.active { background: #e0ead6; color: #345737; border-color: #a3b794; }
.cq-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.cq-welcome { display: none; }
.consultation-page .chat-messages { min-height: 0; padding: 24px; gap: 20px; overscroll-behavior: contain; }
.consultation-page .chat-msg { max-width: 94%; min-width: 0; animation: none; }
.consultation-page .chat-avatar { width: 30px; height: 30px; font-size: 11px; background: #dfe8d5; color: #46683c; }
.consultation-page .chat-msg.user .chat-avatar { background: #668360; color: #fff; }
.consultation-page .chat-bubble { font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.consultation-page .chat-msg.ai .chat-bubble { background: #f0f3e8; color: #354c2d; }
.consultation-page .chat-msg.user .chat-bubble { background: #4d7159; color: #fff; }
.consultation-page .chat-bubble ul { list-style: disc; }
.consultation-page .chat-hints { display: none; }
.chat-window.is-empty .cq-stage { overflow-y: auto; padding: 24px 28px; }
.chat-window.is-empty .cq-welcome { display: block; text-align: center; margin-top: auto; }
.cq-welcome svg { width: 105px; height: 90px; display: block; margin: 0 auto 12px; }
.consultation-page .cq-welcome h2 { font-size: 26px; letter-spacing: 0; margin-bottom: 10px; }
.chat-window.is-empty .chat-messages { flex: none; overflow: visible; padding: 0; }
.chat-window.is-empty .chat-msg { max-width: 100%; align-self: stretch; display: block; }
.chat-window.is-empty .chat-avatar { display: none; }
.chat-window.is-empty #ai-greeting { background: transparent; text-align: center; padding: 0; color: #647159; font-size: 14px; line-height: 1.85; }
.chat-window:not(.is-empty) .chat-msg:has(#ai-greeting) { display: none; }
.chat-window.is-empty .chat-hints { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 16px; width: 100%; max-width: 650px; margin: 20px auto auto; padding-bottom: 6px; }
.cq-hints-title { grid-column: 1/-1; font-size: 13px; color: #526749; }
.cq-hints-title::before { content: ''; display: inline-block; width: 3px; height: 12px; margin-right: 8px; background: #b87546; border-radius: 2px; }
.consultation-page .chat-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; min-height: 44px; padding: 9px 14px; background: transparent; font: inherit; font-size: 13px; line-height: 1.5; text-align: left; color: #526749; border-color: #cbd7c0; border-radius: 12px; }
.consultation-page .chat-hint::after { content: '→'; flex-shrink: 0; }
.consultation-page .chat-hint:hover { background: #edf2e4; border-color: #9caf8d; }
.consultation-page .chat-input-bar { flex-shrink: 0; padding: 12px 22px 16px; background: #fffdf8; border-color: #e0e6d8; gap: 9px; }
.consultation-page .chat-mode { background: transparent; border: 1px solid #cbd7c2; border-radius: 24px; padding: 0; align-self: auto; }
.consultation-page .mode-btn { min-height: 36px; color: #65775a; padding: 7px 17px; font-size: 12px; }
.consultation-page .mode-btn.active { background: #e0ead7; color: #3f6135; box-shadow: none; }
#cq-input-count { font-size: 11px; color: #6f7c63; white-space: nowrap; }
.consultation-page .chat-input-row { padding: 8px; border: 1px solid #b5c6a7; border-radius: 15px; gap: 6px; background: #fffefa; align-items: center; }
.consultation-page .chat-input-row:focus-within { outline: 2px solid #a9bb97; outline-offset: 2px; }
.consultation-page .chat-input-row input { min-width: 0; width: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 16px; color: #3f5536; padding: 10px 8px; }
.consultation-page .chat-input-row input:focus { box-shadow: none; }
.consultation-page #chat-send { min-height: 44px; padding: 10px 22px; border-radius: 12px; font-size: 14px; flex-shrink: 0; }
.consultation-page #chat-send::after { content: '→'; margin-left: 5px; }
.consultation-page #chat-send:disabled { opacity: .6; cursor: wait; }
.consultation-page .chat-note { font-size: 11px; line-height: 1.65; color: #6a765f; margin: 0; }
.consultation-page .login-prompt { max-width: 700px; padding: 50px 36px; border: 1px solid #d2dcc8; border-radius: 20px; background: #fffdf8; box-shadow: none; }
.consultation-page .login-prompt h2 { font-size: 25px; letter-spacing: 0; }
.consultation-page .login-prompt a.btn { color: #fff; background: #4d7159; border-radius: 26px; }
.consultation-page .login-prompt > svg { display: block; width: 110px; height: 100px; margin: 0 auto 20px; }
.is-guest .cq-workspace { display: none; }
.is-guest { padding-block: 25px 45px; }
@media (max-width: 1200px) {
  .cq-workspace { grid-template-columns: 225px minmax(0,1fr); }
  .cq-chat-header { padding: 16px 20px; }
  .cq-assistant p { max-width: none; }
  .chat-window.is-empty .cq-stage { padding: 20px; }
}
@media (max-width: 960px) {
  .cq-workspace { display: block; height: auto; position: relative; }
  .consultation-page .chat-window { height: max(650px, calc(100dvh - 255px)); }
  .cq-sidebar { display: none; position: fixed; inset: 86px 20px 20px; z-index: 1100; border: 1px solid #bdccb0; border-radius: 18px; box-shadow: 0 15px 60px #1e3d2a40; }
  .history-open .cq-sidebar { display: flex; }
  .history-open::before { content: ''; position: fixed; inset: 0; background: #1c372d55; z-index: 1050; }
  .cq-history-close { display: block; min-height: 44px; padding: 8px 16px; border: 1px solid #abbc9c; border-radius: 24px; color: #4e6744; background: transparent; font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; }
  .cq-mobile-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
  .cq-mobile-new, .consultation-page .chat-history-btn { min-height: 44px; padding: 6px 13px; border-radius: 24px; color: #4c6842; border: 1px solid #cad6bf; background: transparent; font: inherit; font-size: 12px; cursor: pointer; }
  .cq-mobile-new { background: #4d7159; color: #fff; border-color: #4d7159; }
  .cq-chat-header { justify-content: flex-start; gap: 12px; }
  .cq-assistant p { display: none; }
  .consultation-page .chat-role-bar { flex-basis: 100%; }
  .consultation-page .chat-history .msg-empty { padding-top: 35px; }
}
@media (max-width: 540px) {
  .consultation-page .home-header { height: 64px; }
  .consultation-page .home-nav { top: 64px; max-height: calc(100dvh - 64px); }
  .consultation-page .home-brand { font-size: 20px; gap: 8px; }
  .consultation-page .home-brand-mark { width: 33px; height: 33px; }
  .cq-heading { padding-block: 16px 20px; }
  .cq-breadcrumb { font-size: 11px; margin-bottom: 10px; }
  .cq-heading .home-eyebrow { font-size: 11px; margin-bottom: 6px; }
  .consultation-page .cq-heading h1 { font-size: 32px; margin-bottom: 6px; }
  .cq-subtitle { font-size: 13px; }
  .cq-section { width: calc(100% - 24px); padding-bottom: 24px; }
  .cq-workspace { border-radius: 15px; }
  .consultation-page .chat-window { height: max(650px, calc(100dvh - 230px)); }
  .consultation-page .chat-window.is-empty { height: auto; min-height: 650px; }
  .chat-window.is-empty .cq-stage { flex: none; overflow: visible; }
  .cq-chat-header { padding: 14px; gap: 12px 6px; }
  .cq-assistant { gap: 4px; align-items: center; }
  .cq-assistant > svg { width: 24px; height: 24px; }
  .consultation-page .cq-assistant h2 { font-size: 16px; }
  .cq-mobile-actions { gap: 5px; }
  .cq-mobile-new, .consultation-page .chat-history-btn { padding: 6px 9px; font-size: 11px; }
  .consultation-page .chat-role-bar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; width: 100%; }
  .consultation-page .chat-role-hint { grid-column: 1/-1; margin: 0; font-size: 12px; }
  .consultation-page .chat-role-btn { border-radius: 10px; min-height: 40px; font-size: 13px; }
  .chat-window.is-empty .cq-stage { padding: 20px 16px; }
  .cq-welcome svg { width: 82px; height: 68px; margin-bottom: 10px; }
  .consultation-page .cq-welcome h2 { font-size: 20px; line-height: 1.5; margin-bottom: 8px; }
  .chat-window.is-empty #ai-greeting { font-size: 13px; }
  .chat-window.is-empty .chat-hints { gap: 8px; margin-top: 16px; }
  .consultation-page .chat-hint { font-size: 12px; padding: 9px 10px; gap: 5px; }
  .consultation-page .chat-input-bar { padding: 10px 12px 12px; gap: 8px; }
  .consultation-page .mode-btn { min-height: 40px; padding-inline: 13px; }
  .consultation-page .chat-input-row { padding: 5px; gap: 0; }
  .consultation-page #chat-send { padding-inline: 14px; }
  .consultation-page #chat-send::after { display: none; }
  .consultation-page .chat-note { font-size: 10px; }
  .consultation-page .chat-messages { padding: 18px 12px; gap: 17px; }
  .consultation-page .chat-msg { gap: 6px; max-width: 100%; }
  .consultation-page .chat-bubble { font-size: 14px; padding: 10px 13px; }
  .cq-sidebar { inset: 74px 12px max(12px, env(safe-area-inset-bottom)); padding: 18px; }
  .consultation-page:has(.has-conversation) .cq-heading { display: none; }
  .has-conversation .chat-window { height: max(390px, calc(var(--cq-viewport-height, 100dvh) - 66px)); }
  .has-conversation .cq-chat-header { gap: 8px; padding-block: 10px; }
  .has-conversation .chat-role-bar { display: flex; flex-wrap: wrap; gap: 5px; }
  .has-conversation .chat-role-hint { display: none; }
  .has-conversation .chat-role-btn { font-size: 11px; padding: 5px 9px; min-height: 36px; border-radius: 22px; }
  .consultation-page .login-prompt { padding: 32px 22px; }
  .consultation-page .login-prompt h2 { font-size: 23px; }
  html[lang="en"] .cq-mobile-actions { margin-left: 0; }
}
