/* Red Door phase B, batch 1: in-world app styles (see js/README.md §7).
   Contacts · Phone · Mail · Calendar (js/apps/contacts.js, phone.js, mail.js, calendar.js, batch-1-kit.js).
   Every class is prefixed b1- so the four parallel batches never collide. Sizes are the SwiftUI values. */

/* ---------- kit: context-menu lift, large titles, search row, ContentUnavailable overlay, action sheet ---------- */
.b1-lifted { transform: scale(0.97); transition: transform 0.2s var(--ease); filter: brightness(1.25); }
.b1-large-title { margin: 0; padding: 2px 16px 8px; font: 700 34px/41px var(--sys); letter-spacing: 0.37px; }
.b1-search { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 10px; background: var(--panel); width: 100%; }
.b1-search-glass { font-size: 17px; display: grid; place-items: center; }
.b1-search-input { flex: 1; min-width: 0; height: 40px; border: 0; outline: none; background: none; font-size: 17px; color: var(--text); padding: 0; }
.b1-search-input::placeholder { color: rgba(235, 235, 245, 0.3); }
.b1-search-clear { display: grid; place-items: center; width: 28px; height: 28px; font-size: 17px; }
.b1-search-row .row-content { padding: 6px 0; }
.b1-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.b1-mini-chevron { font-size: 12px; display: grid; place-items: center; }
.b1-mini-chevron .sf { stroke-width: 2.6; }
.b1-sheet-col { padding: 24px; align-items: flex-start; }
.b1-sheet-col > .divider, .b1-sheet-col > .os-primary, .b1-sheet-col > .selectable, .b1-sheet-col > .hstack { align-self: stretch; }
.b1-picker { padding: 16px; }

.b1-action-wrap { position: absolute; inset: 0; z-index: 45; }
.b1-action-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); }
.b1-action-sheet { position: absolute; left: 8px; right: 8px; bottom: calc(8px + var(--sab)); display: flex; flex-direction: column; gap: 8px; }
.b1-action-group { border-radius: 14px; overflow: hidden; background: rgba(40, 40, 40, 0.86); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8); }
.b1-action-head { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; text-align: center; }
.b1-action { display: block; width: 100%; min-height: 57px; font-size: 20px; text-align: center; color: var(--tint); border-top: 0.5px solid var(--separator); }
.b1-action-group > .b1-action:first-child { border-top: 0; }
.b1-action.destructive { color: #ff453a; }
.b1-action.cancel { font-weight: 600; background: rgba(44, 44, 46, 0.96); }
.b1-action:active { background: rgba(255, 255, 255, 0.1); }

/* ---------- Contacts: inset-grouped List with Theme.panel row backgrounds ---------- */
.b1-grouped { padding: 0 16px 28px; }
.b1-gsection { margin-top: 22px; }
.b1-gsection:first-child { margin-top: 12px; }
.b1-gheader { padding: 0 16px 7px; font-size: 13px; line-height: 18px; color: var(--text2); text-transform: uppercase; }
.b1-gheader .label { gap: 6px; }
.b1-gfooter { padding: 7px 16px 0; font-size: 13px; line-height: 18px; color: var(--text2); }
.b1-grows { border-radius: 10px; overflow: hidden; background: var(--grouped); }
.b1-grow-row { position: relative; display: flex; align-items: center; width: 100%; min-height: 44px; padding: 11px 16px; text-align: left; color: var(--text); }
.b1-panel-row { background: var(--panel); padding: 6px 16px; }
button.b1-grow-row:active { filter: brightness(1.6); }
.b1-grows > .b1-grow-row + .b1-grow-row::before { content: ""; position: absolute; left: 78px; right: 0; top: 0; border-top: 0.5px solid var(--separator); }
.b1-contact-row { flex: 1; min-width: 0; gap: 14px; padding: 6px 0; }
.b1-new-capsule { margin-left: 0; padding: 4px 7px; border-radius: 999px; color: var(--accent); background: rgba(64, 255, 140, 0.12); }
.b1-grow-row .row-chevron { margin-left: 10px; }

.b1-contact-detail { gap: 20px; padding: 20px; align-items: center; }
.b1-contact-detail > .os-primary, .b1-contact-detail > .b1-bordered-row, .b1-contact-detail > .b1-copy-row, .b1-contact-detail > .b1-notes-card { align-self: stretch; }
.b1-fav { min-height: 30px; }
.b1-fav:active, .b1-copy-row:active, .b1-bordered:active { opacity: 0.6; }
.b1-bordered-row { gap: 10px; }
.b1-bordered { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; min-height: 34px; padding: 7px 12px; border-radius: 8px; color: var(--accent); background: rgba(64, 255, 140, 0.15); font-size: 17px; }
.b1-bordered .label { gap: 6px; white-space: nowrap; }
.b1-copy-row { display: flex; align-items: center; gap: 8px; padding: 18px; border-radius: 16px; background: var(--panel); text-align: left; }
.b1-notes-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 18px; background: var(--panel); text-align: left; }

/* ---------- Phone ---------- */
.b1-phone .screen-body { padding-bottom: calc(var(--sab) + 12px); }
.b1-call-row { gap: 12px; padding: 8px 0; }
.list-row .row-content:has(.b1-call-row) { padding: 0; }
.b1-fav-row { padding: 7px 0; }
.b1-keypad { align-items: center; gap: 18px; padding: 16px 0 0; }
.b1-digits { width: 100%; min-height: 52px; padding: 0 16px; text-align: center; white-space: nowrap; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.b1-key-row { gap: 18px; }
.b1-key { display: grid; place-items: center; width: 72px; height: 58px; color: var(--text); }
.b1-key-face { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--panel); }
.b1-key:active .b1-key-face { background: var(--panel-light); }
.b1-key:active { opacity: 0.6; }
.b1-call-bar { gap: 28px; }
.b1-key-gap { width: 58px; height: 58px; }
.b1-call { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: #000; font-size: 22px; }
.b1-call:active { opacity: 0.6; }
.b1-delete { display: grid; place-items: center; width: 58px; height: 58px; font-size: 20px; }
.b1-delete:active { opacity: 0.4; }
.b1-keypad > .c-warning { padding: 0 16px; }

/* ---------- Mail ---------- */
.b1-mail-top .b1-mail-search { width: auto; min-height: 42px; margin: 0 16px 8px; padding: 0 12px; border-radius: 12px; }
.b1-mail-search .b1-search-input { height: 42px; }
.b1-mail-row { align-items: flex-start; gap: 12px; padding: 9px 0; }
.list-row .row-content:has(.b1-mail-row) { padding: 0; }
.b1-mail-row .hstack { gap: 8px; }
.b1-sender { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex: none; background: var(--panel-light); }
.b1-sender.person { background: rgba(64, 255, 140, 0.22); }
.b1-sender img { width: 100%; height: 100%; object-fit: cover; display: block; }
.b1-draft { gap: 5px; padding: 8px 0; }
.b1-flag-btn { display: grid; place-items: center; min-width: 30px; min-height: 30px; }
.b1-flag-btn:active, .b1-attachment:active { opacity: 0.6; }
.b1-attachment { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--panel); text-align: left; align-self: stretch; }
.b1-attach-col { padding: 22px; }
.b1-attach-photo { position: relative; min-height: 260px; border-radius: 18px; overflow: hidden; background: var(--panel); }
.b1-attach-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.b1-attach-shade { position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.72)); }
.b1-attach-caption { position: absolute; left: 14px; right: 14px; bottom: 14px; color: #fff; }
.b1-doc-preview { gap: 12px; padding: 18px; border-radius: 16px; background: var(--panel); }
.b1-compose { gap: 12px; padding: 4px 20px 20px; }
.b1-rounded-field { display: block; width: 100%; padding: 6px 8px; font-size: 17px; line-height: 22px; border-radius: 5px; border: 0.5px solid rgba(84, 84, 88, 0.65); background: #1c1c1e; color: var(--text); outline: none; }
.b1-rounded-field::placeholder, .b1-compose-editor::placeholder { color: rgba(235, 235, 245, 0.3); }
.b1-compose-editor { display: block; width: 100%; min-height: 196px; padding: 8px 13px; border: 0; border-radius: 12px; background: var(--panel); color: var(--text); font-size: 17px; line-height: 22px; resize: none; outline: none; }

/* ---------- Calendar ---------- */
.b1-calendar { gap: 20px; padding: 18px; }
.b1-month-head { gap: 0; }
.b1-month-btn { display: grid; place-items: center; width: 44px; height: 44px; font-size: 20px; }
.b1-month-btn:active, .b1-add:active { opacity: 0.4; }
.b1-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 6px; column-gap: 0; }
.b1-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 44px; border-radius: 12px; color: var(--text); }
.b1-day.selected { background: rgba(64, 255, 140, 0.22); }
.b1-day:active { opacity: 0.5; }
.b1-day-empty { height: 44px; }
.b1-day-dot { width: 4px; height: 4px; border-radius: 50%; }
.b1-day-dot.on { background: var(--accent); }
.b1-today { min-height: 44px; }
.b1-add { display: grid; place-items: center; min-width: 30px; min-height: 44px; font-size: 20px; }
.b1-event-row { display: flex; align-items: stretch; gap: 14px; padding: 16px; border-radius: 14px; background: var(--panel); text-align: left; color: var(--text); }
.b1-event-row > .b1-mini-chevron { align-self: center; }
.b1-event-row:active { filter: brightness(1.4); }
.b1-event-bar { width: 3px; flex: none; }
.b1-event-bar.accent { background: var(--accent); }
.b1-event-bar.warning { background: var(--warning); }
.b1-date-pill { padding: 6px 11px; border: 0; border-radius: 6px; background: rgba(118, 118, 128, 0.24); color: var(--text); font-size: 17px; line-height: 22px; outline: none; color-scheme: dark; }
.b1-date-pill::-webkit-calendar-picker-indicator { display: none; }
