/* Reception keeps the site's palette, with one list or one full-screen room. */
#screen-reception {
  flex: 1;
  min-height: 0;
  padding: 14px 24px;
  overflow: hidden;
}
#screen-reception.active { display: flex; flex-direction: column; }
.rec-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0 18px; flex-shrink: 0; }
.rec-intro h1 { font: 26px var(--serif); margin: 0 0 5px; }
.rec-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.rec-actions { display: flex; gap: 8px; }
.rec-actions button { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-height: 42px; background: var(--paper); white-space: nowrap; }
.rec-layout { display: flex; min-height: 0; flex: 1; }
.rec-list { width: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); padding: 8px 16px 24px; }
.rec-list h2 { color: var(--muted); font-size: 12px; letter-spacing: 1px; margin: 22px 10px 8px; font-weight: 400; }
.rec-row { display: flex; align-items: center; gap: 14px; width: 100%; min-width: 0; min-height: 78px; padding: 14px 10px; text-align: left; border-radius: 10px; }
.rec-row:hover, .rec-contact-row:hover { background: var(--wood); }
.rec-contact-row { display: flex; align-items: center; border-radius: 10px; }
.rec-contact-row .rec-row { flex: 1; width: auto; }
.rec-contact-row .rec-row:hover { background: none; }
.rec-contact-settings { align-self: stretch; width: 42px; flex-shrink: 0; font-size: 20px; letter-spacing: 2px; color: var(--muted); border-radius: 10px; }
.rec-contact-settings:hover { background: #8b654914; }
.rec-row-main { flex: 1; min-width: 0; }
.rec-row-main strong { display: block; font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-row-main small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.5; }
.rec-chevron { color: var(--muted); font-size: 25px; padding-left: 6px; }
.rec-avatar { display: inline-flex; width: 46px; height: 46px; border-radius: 12px; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; background: var(--wood); color: var(--accent); font: 22px var(--serif); }
.rec-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rec-avatar .flower { transform: scale(.7); }
.rec-group-avatar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 3px; background: var(--line); }
.rec-group-avatar > .rec-avatar { width: 100%; height: 100%; min-width: 0; border-radius: 4px; font: 13px var(--sans); }
.rec-group-avatar .flower { transform: scale(.32); }
.rec-badge { color: var(--paper); background: var(--accent); border-radius: 12px; padding: 2px 6px; font-size: 11px; min-width: 18px; text-align: center; }
.rec-section-empty { margin: 0; padding: 12px 10px 16px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.rec-empty { color: var(--muted); font-size: 13px; line-height: 1.9; padding: 24px; text-align: center; margin: auto; max-width: 480px; overflow-wrap: anywhere; }
.rec-chat, .rec-members { display: none; }

/* The room owns the visual viewport, including when the soft keyboard opens. */
#screen-reception.active.rec-room-open {
  position: fixed;
  z-index: 70;
  inset: var(--aster-viewport-top, 0px) 0 auto;
  height: var(--aster-viewport-height, 100dvh);
  width: 100%;
  padding: 0;
  background: var(--paper);
}
.rec-room-open .rec-intro, .rec-room-open .rec-list { display: none; }
.rec-room-open .rec-layout { flex: 1; min-height: 0; }
.rec-room-open .rec-chat { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.app:has(#screen-reception.active.rec-room-open) > .sidebar,
.app:has(#screen-reception.active.rec-room-open) .topbar,
.app:has(#screen-reception.active.rec-room-open) .bottom-nav { visibility: hidden; pointer-events: none; }
.rec-toolbar { display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 18px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; background: var(--paper); min-height: 72px; }
.rec-toolbar button { min-height: 44px; border-radius: 9px; }
.rec-back { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px 0 0; font-size: 30px; flex-shrink: 0; }
.rec-back span { font-size: 14px; }
.rec-chat-identity { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; padding: 0; text-align: left; }
.rec-chat-heading { min-width: 0; }
.rec-chat-heading h2 { font: 18px var(--sans); font-weight: 500; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rec-chat-heading small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rec-title-avatar { display: flex; }
#rec-title-avatar .rec-avatar { width: 40px; height: 40px; border-radius: 11px; }
#rec-members-button { padding: 7px 10px; font-size: 13px; color: var(--accent); }
.rec-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px max(18px, calc((100% - 900px) / 2)); background: #f3efe8; scrollbar-width: thin; }
.rec-message { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; min-width: 0; }
.rec-message-human { flex-direction: row-reverse; }
.rec-message .rec-avatar { width: 38px; height: 38px; border-radius: 10px; font-size: 19px; margin-top: 2px; }
.rec-message .rec-avatar .flower { transform: scale(.56); }
.rec-message-body { min-width: 0; max-width: min(80%, 680px); }
.rec-message-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 10px; color: var(--muted); margin: 0 3px 5px; }
.rec-message-head strong { font-size: 11px; color: var(--ink); font-weight: 500; }
.rec-message-human .rec-message-head { justify-content: flex-end; }
.rec-text { margin: 0; padding: 11px 14px; border: 1px solid var(--line); border-radius: 4px 14px 14px; background: var(--paper); font-size: 16px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.rec-message-human .rec-text { background: #e6dbc8; border-color: #ded0bb; border-radius: 14px 4px 14px 14px; }
.rec-reply { color: var(--muted); font-size: 10px; line-height: 1.8; padding: 3px; overflow-wrap: anywhere; }
.rec-task { font-size: 11px; color: var(--muted); padding: 5px 2px 0; line-height: 1.6; overflow-wrap: anywhere; }
.rec-task button { color: var(--accent); text-decoration: underline; min-height: 36px; }
.rec-compose { flex-shrink: 0; padding: 10px max(14px, calc((100% - 900px) / 2)) max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
.rec-compose-line { display: flex; align-items: flex-end; gap: 10px; }
.rec-compose textarea { display: block; flex: 1; width: 100%; min-width: 0; min-height: 44px; max-height: 120px; resize: none; padding: 9px 12px; line-height: 1.6; font-size: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fffefa; overflow-y: auto; }
.rec-compose #rec-send { flex-shrink: 0; min-height: 44px; padding: 10px 18px; border-radius: 11px; font-size: 14px; }
.rec-compose-tools { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; padding-top: 8px; font-size: 12px; color: var(--muted); }
.rec-mention { display: flex; flex: 1; min-width: 0; flex-wrap: wrap; gap: 6px; }
.rec-mention label { display: flex; gap: 4px; align-items: center; padding: 5px 8px; border: 1px solid var(--line); border-radius: 16px; max-width: 100%; overflow-wrap: anywhere; }
.rec-compose[data-kind=direct] .rec-mention { display: none; }
.rec-compose select { max-width: 200px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--paper); font-size: 12px; }
.rec-status { color: var(--muted); font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
.rec-status:empty { display: none; }
.rec-status button { color: var(--accent); min-height: 36px; text-decoration: underline; }
.rec-compose .rec-status:not(:empty) { padding-top: 5px; }
.rec-room-open > #rec-connection:not(:empty) { position: absolute; top: 76px; left: 12px; right: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: 0 4px 15px #463c3210; }

.rec-dialog { width: min(520px, calc(100% - 28px)); max-height: min(85dvh, var(--aster-viewport-height, 85dvh)); overflow-y: auto; border: 1px solid var(--line); border-radius: 18px; padding: 22px; background: var(--paper); color: var(--ink); }
.rec-dialog::backdrop { background: #21190d55; backdrop-filter: blur(3px); }
.rec-dialog h2 { font: 23px var(--serif); margin: 0 0 14px; overflow-wrap: anywhere; }
.rec-dialog p { font-size: 12px; line-height: 1.9; color: var(--muted); overflow-wrap: anywhere; }
.rec-dialog input:not([type=checkbox]):not([type=file]), .rec-dialog select { width: 100%; margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); font-size: 16px; }
.rec-dialog label { display: block; margin: 10px 0; font-size: 13px; overflow-wrap: anywhere; }
.rec-dialog button { min-height: 42px; padding: 9px 12px; border-radius: 9px; }
.rec-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.rec-dialog-error { color: #ac6754 !important; }
.rec-dialog-error:empty { display: none; }
.rec-contact-profile { display: flex; align-items: center; gap: 15px; font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.rec-contact-profile .rec-avatar { width: 72px; height: 72px; border-radius: 18px; font-size: 30px; }
.rec-avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rec-secret { white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; border: 1px dashed var(--accent); padding: 15px; border-radius: 10px; max-height: 180px; overflow: auto; font-size: 12px; }
.bottom-nav .nav-item[data-tab=reception] { white-space: nowrap; }
@media (max-width: 700px) {
  #screen-reception { padding: 8px 12px; }
  .rec-intro { flex-wrap: wrap; gap: 10px; padding-bottom: 12px; }
  .rec-intro h1 { font-size: 23px; }
  .rec-intro p { font-size: 11px; }
  .rec-actions { margin-left: auto; }
  .rec-actions button { font-size: 12px; min-height: 38px; padding: 8px 10px; }
  .rec-list { border-radius: 12px; padding-inline: 8px; }
  .rec-row { min-height: 76px; gap: 12px; }
  .rec-toolbar { padding-inline: 12px; gap: 7px; }
  .rec-back { padding-right: 4px; }
  .rec-back span { display: none; }
  .rec-chat-heading h2 { font-size: 16px; }
  .rec-log { padding: 12px; }
  .rec-message-body { max-width: calc(100% - 52px); }
  .rec-message { gap: 8px; }
  .rec-text { padding: 10px 12px; }
  .rec-compose { padding-inline: 10px; }
  .bottom-nav .nav-item { gap: 5px; padding-inline: 7px; }
  .app:has(#screen-reception.active) { min-height: 0; height: var(--aster-viewport-height, 100dvh); }
}
@media (max-height: 500px) {
  .rec-toolbar { min-height: 54px; padding-block: 4px; }
  .rec-chat-heading small { display: none; }
  .rec-compose { padding-block: 6px; }
  .rec-message { padding-block: 6px; }
}
