@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&display=swap');

:root { font-family: 'Noto Sans JP', system-ui, -apple-system, 'Segoe UI', sans-serif; color: #202b2a; background: #e9eeec; font-synthesis: none; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overscroll-behavior-x: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid #087e41; outline-offset: 2px; }
.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; }
.app-shell { display: flex; width: min(1400px, calc(100% - 64px)); height: min(880px, calc(100dvh - 64px)); min-height: 570px; margin: 32px auto; overflow: hidden; border: 1px solid #d8e0dd; border-radius: 13px; background: #fff; box-shadow: 0 22px 70px rgba(36,65,58,.14), 0 2px 8px rgba(36,65,58,.06); }
.rail { width: 66px; flex: 0 0 66px; background: #30453e; display: flex; flex-direction: column; align-items: center; padding: 22px 0 16px; gap: 24px; color: #fff; }
.rail-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #d9e7d8; color: #46644f; font-size: 17px; font-weight: 700; }
.rail-button { border: 0; color: #c3d2ca; background: transparent; height: 44px; width: 46px; border-radius: 10px; display: grid; place-items: center; }
.rail-button.active { color: #fff; background: rgba(255,255,255,.14); position: relative; }
.rail-button.active::before { content: ''; position: absolute; height: 26px; width: 3px; border-radius: 2px; background: #06c755; left: -10px; }
.rail-button:hover, .header-reset:hover { background: rgba(255,255,255,.18); }
.rail-button svg, .header-reset svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail-spacer { flex: 1; }
.conversation-list { flex: 0 0 305px; border-right: 1px solid #e5e9e7; background: #fff; }
.list-heading { height: 80px; display: flex; align-items: center; gap: 10px; padding: 0 25px; }
.list-heading h1 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.04em; }
.list-count { font-size: 12px; color: #6e7b75; background: #f0f3f1; padding: 2px 7px; border-radius: 10px; }
.list-search { margin: 0 18px 20px; height: 37px; border-radius: 8px; background: #f4f6f5; color: #9aa5a1; display: flex; gap: 9px; align-items: center; padding: 0 12px; font-size: 13px; }
.list-search svg { height: 16px; width: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.list-section { color: #60736a; font-size: 13px; font-weight: 700; padding: 0 25px 12px; border-bottom: 1px solid #eef1ef; }
.conversation-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 82px; padding: 12px 17px; background: #fff; border: 0; border-left: 3px solid transparent; border-bottom: 1px solid #edf1ee; text-align: left; color: inherit; touch-action: manipulation; }
.conversation-item[aria-current="true"] { background: #eaf7ee; border-left-color: #06c755; }
.mobile-tabbar,.back-button { display: none; }
.avatar { border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#e9ab95,#ba6e79); font-weight: 700; box-shadow: inset 0 1px 2px rgba(255,255,255,.2); }
.avatar-small { height: 48px; width: 48px; font-size: 19px; }
.conversation-summary { min-width: 0; flex: 1; }
.conversation-title { display: block; font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.conversation-preview { display: block; color: #65736e; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-side { align-self: stretch; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; min-width: 25px; }
.conversation-time { color: #87958f; font-size: 11px; margin-top: 5px; }
.unread-badge { display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 12px; background: #06c755; color: #fff; font-size: 12px; font-weight: 700; line-height: 1; }
.unread-badge[hidden] { display: none; }
.chat-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #b8cbd8; }
.chat-header { height: 76px; flex: 0 0 76px; background: #fff; border-bottom: 1px solid #e8ece9; display: flex; align-items: center; justify-content: space-between; padding: 0 29px; z-index: 1; }
.header-person { display: flex; align-items: center; gap: 12px; }
.avatar-header { width: 43px; height: 43px; font-size: 18px; }
.contact-name { font-size: 17px; font-weight: 700; line-height: 1.35; }
.contact-caption { color: #91a09a; font-size: 12px; margin-top: 2px; }
.header-reset { color: #64746b; background: transparent; border: 0; display: flex; align-items: center; gap: 7px; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.header-reset:hover { background: #f0f3f1; }
.header-reset svg { width: 19px; height: 19px; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; background-color: #b8cbd8; background-image: radial-gradient(rgba(255,255,255,.15) .7px,transparent .7px); background-size: 18px 18px; scrollbar-color: rgba(66,93,105,.3) transparent; }
.chat-content { max-width: 880px; margin: 0 auto; min-height: 100%; padding: 27px 36px 34px; }
.date-label { margin: 0 auto 31px; width: fit-content; color: #fff; background: rgba(62,87,99,.29); border-radius: 13px; padding: 4px 13px; font-size: 12px; font-weight: 600; }
.empty-prompt { margin: min(22vh,150px) auto 0; width: fit-content; max-width: 85%; padding: 8px 14px; border-radius: 14px; color: #536e77; background: rgba(255,255,255,.44); font-size: 13px; text-align: center; }
.message-row { display: flex; align-items: flex-end; gap: 9px; margin-top: 16px; animation: rise .22s ease-out both; }
.message-row.mine { justify-content: flex-end; }
.message-avatar { width: 35px; height: 35px; font-size: 15px; align-self: flex-start; }
.bubble { max-width: min(70%, 480px); padding: 10px 14px; border-radius: 17px; background: #fff; font-size: 15px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(38,62,73,.08); }
.message-row.theirs .bubble { border-top-left-radius: 5px; }
.message-row.mine .bubble { background: #a9ee8e; border-top-right-radius: 5px; }
.message-meta { color: #4e6874; font-size: 11px; white-space: nowrap; line-height: 1.4; margin-bottom: 2px; }
.message-row.mine .message-meta { text-align: right; }
.typing .bubble { display: flex; align-items: center; gap: 4px; height: 38px; min-width: 52px; }
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: #8eaaa4; animation: pulse 1s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: .14s; }.typing-dot:nth-child(3) { animation-delay: .28s; }
.picker-backdrop { position: fixed; inset: 0; z-index: 2; background: rgba(31,48,46,.16); }
.picker-backdrop[hidden],.choice-panel[hidden] { display: none; }
.composer { position: relative; z-index: 3; flex: none; background: #fff; border-top: 1px solid #e0e9e9; padding: 17px 24px 20px; box-shadow: 0 -3px 12px rgba(66,87,94,.04); }
.choice-panel { position: absolute; bottom: calc(100% + 9px); left: 24px; right: 24px; max-height: min(50dvh,360px); overflow-y: auto; padding: 16px; background: #fff; border: 1px solid #e4ebe7; border-radius: 15px; box-shadow: 0 12px 42px rgba(23,52,45,.19); }
.suggestion-heading { display: flex; justify-content: space-between; color: #63756e; font-size: 13px; font-weight: 700; margin: 0 2px 12px; }
.suggestions { display: flex; flex-direction: column; gap: 7px; }
.suggestion { width: 100%; border-radius: 9px; padding: 11px 13px; min-height: 44px; border: 1px solid #e2ede6; background: #f4fbf6; color: #266c44; font-size: 14px; font-weight: 600; text-align: left; transition: background .15s; }
.suggestion:not(:disabled):hover { background: #dcf7e4; }
.input-row { display: flex; align-items: center; gap: 12px; border: 1px solid #e5eae7; background: #f8faf9; border-radius: 24px; min-height: 46px; padding: 3px 5px 3px 17px; }
.input-row:focus-within { background: #fff; border-color: #72c996; box-shadow: 0 0 0 3px rgba(6,199,85,.09); }
.input-row input { border: 0; outline: none; background: transparent; color: #26342d; width: 100%; min-width: 0; font-size: 16px; cursor: text; }
.input-row input[readonly] { cursor: pointer; caret-color: transparent; }
.input-row input::placeholder { color: #a2afa9; }
.input-row input:disabled { cursor: default; }
.input-row input:focus-visible { outline: none; }
.send-button { border: none; display: grid; place-items: center; flex: 0 0 37px; height: 37px; border-radius: 50%; background: #06c755; color: white; transition: background .15s; }
.send-button:hover:not(:disabled) { background: #05ac4a; }
.send-button:disabled { background: #dfe8e2; color: #aabbb0; cursor: default; }
.send-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linejoin: round; stroke-linecap: round; stroke-width: 1.9; }
.notice { position: fixed; z-index: 5; left: 50%; bottom: 26px; transform: translate(-50%,12px); max-width: min(90vw,440px); background: #253c32; color: #fff; border-radius: 9px; padding: 11px 16px; font-size: 13px; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.notice.visible { opacity: 1; transform: translate(-50%,0); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,60%,100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 950px) { .app-shell { width: 100%; height: 100dvh; min-height: 0; margin: 0; border: 0; border-radius: 0; } .conversation-list { flex-basis: 260px; } }
@media (max-width: 700px) {
  html,body { overflow: hidden; }
  .app-shell { position: fixed; top: var(--visual-top,0px); left: 0; width: 100%; height: var(--visual-height,100dvh); margin: 0; }
  .rail { display: none; }
  .conversation-list { display: flex; flex-direction: column; flex: 1 1 100%; min-width: 0; border: 0; }
  .chat-panel { display: none; }
  .app-shell.mobile-chat-open .conversation-list { display: none; }
  .app-shell.mobile-chat-open .chat-panel { display: flex; }
  .list-heading { height: 76px; padding: 0 22px; }
  .list-heading h1 { font-size: 27px; }
  .list-search { margin: 0 16px 18px; }
  .list-section { padding: 0 22px 12px; }
  .conversation-item, .conversation-item[aria-current="true"] { background: #fff; border-left: 0; border-bottom: 1px solid #edf1ee; padding: 14px 20px; }
  .mobile-tabbar { margin-top: auto; min-height: 65px; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid #e9eeeb; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; color: #08ad50; font-size: 11px; font-weight: 700; }
  .mobile-tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
  .chat-header { height: 66px; flex-basis: 66px; padding: 0 14px 0 7px; justify-content: flex-start; }
  .back-button { display: grid; place-items: center; width: 37px; height: 42px; margin-right: 4px; padding: 0; border: 0; background: transparent; color: #354a41; }
  .back-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .chat-header .header-reset { margin-left: auto; }
  .chat-content { padding: 23px 15px 30px; }
  .composer { padding: 12px 13px max(13px, env(safe-area-inset-bottom)); }
  .app-shell.keyboard-open .composer { padding-bottom: 10px; }
  .choice-panel { left: 10px; right: 10px; bottom: calc(100% + 6px); max-height: min(55dvh,450px); }
  .bubble { max-width: min(79%, 480px); font-size: 15px; }
  .header-reset span { display: none; }
  .header-reset { padding: 8px; }
}
@media (hover: hover) and (pointer: fine) {
  .conversation-item:hover { background: #dff4e6; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
