.safechat { color: #261c18; --rust: #a32e0b; --rust-dark: #7b2208; --ink-muted: #64564f; --outline: #e4d9d2; --surface: #fffdfa; background: #f7f3ef; }
.safechat *, .safechat *::before, .safechat *::after { box-sizing: border-box; }
.safechat [hidden] { display: none !important; }
.safechat :focus-visible { outline: 3px solid #a32e0b; outline-offset: 4px; }
.chat-page { width: min(100%, 790px); margin: 0 auto; padding: clamp(28px, 5vw, 59px) clamp(15px, 4vw, 30px) 42px; }
.chat-intro { margin-bottom: 24px; }
.chat-eyebrow { margin: 0 0 8px; color: var(--rust-dark); font-size: .75rem; font-weight: 780; letter-spacing: .1em; }
.chat-eyebrow span { margin-inline: 6px; color: #8d7469; }
.safechat h1 { margin: 0; font-size: clamp(2.75rem, 9vw, 5rem); font-weight: 500; line-height: 1.02; letter-spacing: -.048em; }
.chat-intro > p:not(.chat-eyebrow) { max-width: 52ch; margin: 12px 0 18px; color: var(--ink-muted); font-size: clamp(1rem, 2.5vw, 1.18rem); line-height: 1.5; }
.steps { display: flex; flex-wrap: wrap; gap: 8px 17px; margin: 0; padding: 0; list-style: none; color: var(--ink-muted); font-size: .85rem; }
.steps li { display: flex; gap: 6px; align-items: center; }
.steps b { display: grid; place-items: center; width: 23px; height: 23px; font-size: .76rem; border-radius: 50%; background: #eee5df; }
.steps li[aria-current] { color: var(--rust-dark); font-weight: 700; }
.steps li[aria-current] b { color: #fff; background: var(--rust); }
.chat-panel { margin-bottom: 15px; border: 1px solid var(--outline); border-radius: 18px; background: var(--surface); box-shadow: 0 12px 32px #4826130a; }
#intro-panel, .review-panel { padding: clamp(17px, 5vw, 32px); }
.start-mark, .avatar { display: grid; place-items: center; color: var(--rust); background: #f4e6df; flex-shrink: 0; }
.start-mark { width: 75px; height: 75px; border-radius: 17px; margin-bottom: 15px; }
.safechat h2 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.35rem); line-height: 1.13; font-weight: 500; }
.chat-panel p { line-height: 1.5; }
#intro-panel > p, .review-panel > p { margin: 8px 0 16px; }
#intro-panel > p { max-width: 55ch; }
.chat-panel form > label, #chat-inputs > label { display: block; margin-bottom: 7px; font-weight: 700; }
.start-field, .composer-input { display: flex; align-items: stretch; gap: 8px; }
.safechat input, .safechat button { font: inherit; }
.safechat input[type="text"] { display: block; width: 100%; min-width: 0; min-height: 46px; padding: 9px 13px; border: 1px solid #bca99e; border-radius: 9px; color: inherit; background: #fff; }
.safechat button { cursor: pointer; }
.safechat button:disabled, .safechat input:disabled { opacity: .68; cursor: wait; }
.safechat .chat-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; white-space: nowrap; background: var(--rust); color: #fff; font-weight: 720; }
.safechat .chat-button:hover { background: var(--rust-dark); }
.safechat .chat-button-secondary { margin-top: 14px; border-color: #c7927d; background: #fff; color: var(--rust-dark); white-space: normal; }
.safechat .chat-button-secondary:hover { background: #f7eee8; }
.chat-hint { margin: 8px 0 0; color: var(--ink-muted); font-size: .85rem; font-weight: 400; }
.chat-top { display: flex; align-items: center; gap: 12px; padding: 15px clamp(15px, 4vw, 22px) 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; font-weight: 800; }
.speaker .chat-hint { margin: 0 0 3px; font-size: .68rem; letter-spacing: .07em; }
.speaker h2 { font-size: clamp(1.12rem, 3vw, 1.45rem); }
.chat-count { flex-shrink: 0; margin-left: auto; padding: 3px 9px; border-radius: 20px; background: #f4e6df; color: var(--rust-dark); font-size: .8rem; font-variant-numeric: tabular-nums; font-weight: 700; }
#chat-progress { display: block; width: 100%; height: 3px; border: 0; background: #ecdfd7; color: var(--rust); appearance: none; }
#chat-progress::-webkit-progress-bar { background: #ecdfd7; }
#chat-progress::-webkit-progress-value { background: var(--rust); }
#chat-progress::-moz-progress-bar { background: var(--rust); }
.transcript { display: grid; gap: 10px; max-height: min(42vh, 325px); min-height: 113px; overflow: auto; margin: 0; padding: 16px clamp(11px, 4vw, 22px); list-style: none; background: #fffaf6; overscroll-behavior: contain; }
.bubble { width: fit-content; max-width: min(88%, 59ch); padding: 10px 13px; border: 1px solid #e7dbd3; border-radius: 12px 12px 12px 3px; background: #f5ede7; overflow-wrap: anywhere; }
.bubble.mine { justify-self: end; background: #f7e5df; border-color: #e9cec1; border-radius: 12px 12px 3px 12px; }
.bubble b { display: block; margin: 0 0 4px; color: #703f2e; font-size: .73rem; }
.bubble p { margin: 0; font-size: .97rem; }
.bubble:target, .bubble:focus { outline: 2px solid var(--rust); outline-offset: 2px; }
.composer { padding: 13px clamp(13px, 4vw, 22px) 17px; border-top: 1px solid var(--outline); }
.composer label span { color: var(--ink-muted); font-size: .83rem; font-weight: 400; }
#chat-limit-note { margin: 0 0 14px; }
#clarification-hint { color: var(--rust-dark); }
#clarification-hint:empty { margin: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.quick button { min-height: 34px; padding: 4px 9px; border: 1px solid #d8c5b8; border-radius: 7px; color: #6b321e; background: #fff; font-size: .83rem; }
.quick button:hover { background: #f7eee8; }
.small-link { margin: 8px 15px 15px; padding: 5px; color: var(--rust-dark); background: transparent; border: 0; text-decoration: underline; }
.review-panel fieldset { min-width: 0; margin: 20px 0; padding: 0; border: 0; }
.review-panel legend { margin-bottom: 5px; font-weight: 750; }
.review-panel fieldset .chat-hint { margin-top: 0; }
.choice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 7px; }
.choice { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 7px 9px; border: 1px solid #d8c5b8; border-radius: 8px; background: #fff; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--rust); background: #f8ece7; }
.choice input { margin: 0; width: 17px; height: 17px; flex: 0 0 17px; accent-color: var(--rust); }
.review-submit { margin-top: 15px; }
.clue-results { display: grid; gap: 7px; margin: 0 0 17px; padding: 0; list-style: none; }
.clue-results li, .your-reason { background: #f8f0ea; border-radius: 9px; padding: 9px 12px; }
.clue-results a { color: var(--rust-dark); text-underline-offset: 3px; }
.clue-results p { margin: 3px 0 0; }
.clue-results small { margin-left: 8px; color: var(--ink-muted); }
.result-score { color: var(--rust-dark); font-weight: 700; }
.safe-next { padding: 12px; margin: 15px 0; border-radius: 9px; background: #e9f3e9; color: #243b2c; }
.safe-next h3 { margin: 0 0 4px; font-size: 1.16rem; }
.safe-next p { margin: 0; }
.chat-status { margin: 8px 0; color: var(--rust-dark); font-size: .91rem; }
.chat-status:empty { margin: 0; }
.privacy { margin: 14px 0 0; color: var(--ink-muted); font-size: .8rem; line-height: 1.45; }
@media (max-width: 540px) {
  .choice-list { grid-template-columns: 1fr; }
  .bubble { max-width: 94%; }
  .safechat .chat-button { padding-inline: 12px; }
}
@media (max-width: 370px) {
  .start-field, .composer-input { flex-direction: column; }
}
.safechat .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
