.blocky { --blocky-bottom: 18px; position: fixed; z-index: 90; right: max(18px, env(safe-area-inset-right)); bottom: calc(var(--blocky-bottom) + env(safe-area-inset-bottom)); font: 15px/1.5 var(--sans); color: var(--ink); }
.blocky button, .blocky textarea { font: inherit; }
.blocky button { cursor: pointer; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; color: var(--ink); background: var(--surface); }
.blocky button:disabled { cursor: wait; opacity: .65; }
.blocky .blocky-launch { display: inline-flex; align-items: center; gap: 10px; background: var(--paper); color: var(--ink); border-color: var(--accent); border-radius: 18px; font-weight: 600; padding: 6px 16px 6px 6px; box-shadow: var(--shadow); }
.bloci-portrait { position: relative; display: block; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; overflow: hidden; background: #f5f0e5; }
.bloci-portrait img { position: absolute; width: 140%; height: 140%; max-width: none; left: -20%; top: -10%; object-fit: cover; }
.bloci-identity { display: flex; align-items: center; gap: 9px; margin-right: auto; min-width: 0; }
.bloci-identity .bloci-portrait { width: 38px; height: 38px; border-radius: 10px; }
.bloci-identity p { margin: 2px 0 0; font-size: 11px; line-height: 1.3; color: var(--muted); }
.blocky-panel { width: min(410px, calc(100vw - 32px)); height: min(640px, calc(var(--blocky-visible-height, 100dvh) - var(--blocky-cookie-height, 0px) - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.blocky-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.blocky-header h2 { font: 400 25px/1.2 var(--serif); letter-spacing: -.02em; margin: 0 auto 0 0; }
.bloci-name { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.bloci-name h2 { margin: 0; }
.bloci-pronunciation { font: 400 11px/1.3 var(--sans); color: var(--muted); }
.bloci-pronunciation strong { color: var(--accent); font-weight: 700; }
.blocky-phone { display: none; }
.blocky svg { width: 20px; height: 20px; }
.blocky-header button { padding: 7px 10px; font-size: 13px; background: transparent; }
.blocky-context { margin: 0; padding: 9px 16px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; flex-shrink: 0; }
.blocky-conversation { padding: 18px 16px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1; scrollbar-gutter: stable; }
.blocky-welcome h3 { font: 400 26px/1.2 var(--serif); margin: 0 0 10px; }
.blocky-welcome > p { margin-bottom: 16px; color: var(--muted); }
.blocky-prompts { display: grid; gap: 8px; }
.blocky-prompts button { text-align: left; }
.blocky-message { padding-block: 14px; border-bottom: 1px solid var(--line); }
.blocky-message:first-child { padding-top: 0; }
.blocky-speaker { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
.blocky-message p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.blocky-message[data-role="user"] { color: var(--accent); }
.blocky-links { list-style: none; margin: 12px 0 0; padding: 0; }
.blocky-links a { display: block; padding-block: 8px; min-height: 44px; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; overflow-wrap: anywhere; }
.blocky-compose { padding: 12px 16px 16px; border-top: 1px solid var(--line); flex-shrink: 0; }
.blocky-compose label { display: block; font-weight: 600; margin-bottom: 6px; }
.blocky-input-row { display: flex; gap: 8px; align-items: end; }
.blocky textarea { width: 100%; min-width: 0; height: 66px; min-height: 44px; max-height: 110px; resize: vertical; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 16px; caret-color: var(--accent); }
.blocky textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.blocky .blocky-send { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.blocky-disclosure { font-size: 12px; line-height: 1.4; margin: 9px 0 0; color: var(--muted); }
.blocky-disclosure a { text-decoration: underline; text-underline-offset: 3px; }
.blocky-status { font-size: 13px; color: var(--muted); margin: 0; padding: 0 16px 8px; }
.blocky-status:empty { display: none; }
@media (max-width: 600px) {
  .blocky { right: 12px; --blocky-bottom: 12px; }
  .blocky-panel { width: calc(100vw - 24px); height: min(600px, calc(var(--blocky-visible-height, 100dvh) - var(--blocky-cookie-height, 0px) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); }
}
@media (max-width: 600px), (max-height: 500px) {
  .blocky-wide { display: none; }
  .blocky-phone { display: inline; }
  .blocky-header { padding: 4px 8px 4px 14px; gap: 4px; }
  .blocky-header h2 { font-size: 22px; }
  .blocky .blocky-launch { padding: 5px 13px 5px 5px; gap: 8px; border-radius: 16px; }
  .blocky-launch .bloci-portrait { width: 38px; height: 38px; border-radius: 11px; }
  .bloci-identity { gap: 7px; }
  .bloci-identity .bloci-portrait { width: 32px; height: 32px; border-radius: 9px; }
  .bloci-identity p { display: none; }
  .blocky-header button { border-color: transparent; padding: 8px; min-width: 44px; }
  .blocky-context { font-size: 11px; padding: 5px 14px; }
  .blocky-conversation { padding: 14px; }
  .blocky-welcome h3 { font-size: 22px; margin-bottom: 8px; }
  .blocky-welcome > p { margin-bottom: 12px; }
  .blocky-prompts { gap: 6px; }
  .blocky-message { padding-block: 12px; }
  .blocky-compose { padding: 8px 10px 4px; }
  .blocky-compose label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .blocky-input-row { gap: 8px; }
  .blocky textarea { height: 44px; max-height: 96px; padding: 9px 10px; line-height: 24px; resize: none; }
  .blocky .blocky-send { width: 44px; height: 44px; flex: 0 0 44px; padding: 0; display: grid; place-items: center; }
  .blocky-disclosure { display: flex; align-items: center; gap: 10px; margin-top: 3px; font-size: 11px; line-height: 1.4; }
  .blocky-disclosure > .blocky-phone { flex: 1; }
  .blocky-disclosure a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; font-size: 12px; }
}
.blocky[data-compact] .blocky-context { display: none; }
.blocky[data-compact] .blocky-welcome h3 { display: none; }
.blocky[data-compact] .blocky-conversation { padding-block: 10px; }
