/* Red Door — the Agent OS handset. Colours are Views/OS/Theme.swift exactly; type sizes are iOS Dynamic Type
   defaults (Large); "mono" = .monospaced design (SF Mono via ui-monospace on Apple devices). */
:root {
  --bg: #000;
  --panel: rgb(18, 23, 20);          /* Theme.panel      (0.07, 0.09, 0.08) */
  --panel-light: rgb(31, 38, 33);    /* Theme.panelLight (0.12, 0.15, 0.13) */
  --accent: rgb(64, 255, 140);       /* Theme.accent     (0.25, 1.0, 0.55) */
  --warning: rgb(255, 115, 89);      /* Theme.warning    (1.0, 0.45, 0.35) */
  --text: rgb(240, 240, 240);        /* Theme.textPrimary   white 0.94 */
  --text2: rgb(140, 140, 140);       /* Theme.textSecondary white 0.55 */
  --tint: rgb(254, 47, 76);          /* AccentColor asset — the default control tint (nav back, toolbar items) */
  --separator: rgba(84, 84, 88, 0.6);
  --grouped: #1c1c1e;                /* secondarySystemGroupedBackground (dark) */
  --fill3: rgba(118, 118, 128, 0.24);/* tertiarySystemFill (search field) */
  --chevron: rgba(235, 235, 245, 0.3);
  --sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --rounded: ui-rounded, "SF Pro Rounded", var(--sys);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #050605; color: var(--text); font-family: var(--sys); font-size: 17px; line-height: 1.29; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body { overflow: hidden; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
button:disabled { opacity: 0.35; cursor: default; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-title:focus { outline: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the device: full-bleed on phones, a phone-width column on desktop ---------- */
.device { position: fixed; inset: 0; margin: 0 auto; background: var(--bg); overflow: hidden; isolation: isolate; contain: layout paint; }
@media (min-width: 600px) {
  body { background: radial-gradient(ellipse at 50% 30%, #0d1310 0%, #030403 70%); }
  .device { width: 430px; top: 50%; bottom: auto; height: min(932px, calc(100dvh - 32px)); transform: translateY(-50%); border-radius: 44px;
    box-shadow: 0 0 0 1px rgba(64, 255, 140, 0.08), 0 0 0 10px #0b0d0c, 0 0 0 11px #1d221f, 0 30px 80px rgba(0, 0, 0, 0.7); --sat: 18px; --sab: 14px; }
}
#root, #screens, #sheets, #banners { position: absolute; inset: 0; }
#screens { pointer-events: none; }
#screens > * { pointer-events: auto; }
#sheets { pointer-events: none; z-index: 20; }
#sheets > * { pointer-events: auto; }
#banners { pointer-events: none; z-index: 30; bottom: auto; }
.covered { visibility: hidden; }
body.sheet-large #root, body.sheet-large #screens { transform: scale(0.94) translateY(calc(var(--sat) * 0.3)); border-radius: 12px; overflow: hidden; transition: transform 0.4s var(--ease); filter: brightness(0.7); }
#root, #screens { transition: transform 0.4s var(--ease), filter 0.4s var(--ease); transform-origin: 50% 0; }
.splash { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text2); font: 700 11px/1 var(--mono); letter-spacing: 4px; transition: opacity 0.3s; }
.device.ready .splash { opacity: 0; pointer-events: none; }

/* ---------- Theme fonts (Theme.mono(style, weight:)) ---------- */
.t-largeTitle { font-size: 34px; line-height: 41px; }
.t-title { font-size: 28px; line-height: 34px; }
.t-title2 { font-size: 22px; line-height: 28px; }
.t-title3 { font-size: 20px; line-height: 25px; }
.t-headline { font-size: 17px; line-height: 22px; font-weight: 600; }
.t-body { font-size: 17px; line-height: 22px; }
.t-callout { font-size: 16px; line-height: 21px; }
.t-subheadline { font-size: 15px; line-height: 20px; }
.t-footnote { font-size: 13px; line-height: 18px; }
.t-caption { font-size: 12px; line-height: 16px; }
.t-caption2 { font-size: 11px; line-height: 13px; }
.mono { font-family: var(--mono); }
.rounded { font-family: var(--rounded); }
.w-regular { font-weight: 400; } .w-medium { font-weight: 500; } .w-semibold { font-weight: 600; } .w-bold { font-weight: 700; } .w-heavy { font-weight: 800; }
.c-accent { color: var(--accent); } .c-text { color: var(--text); } .c-text2 { color: var(--text2); } .c-warning { color: var(--warning); } .c-tint { color: var(--tint); }
.tint-accent { --tint: var(--accent); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.selectable { user-select: text; -webkit-user-select: text; }
.center { text-align: center; } .center-items { align-items: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.vstack { display: flex; flex-direction: column; align-items: stretch; }
.vstack.center-items, .hstack.center-items { align-items: center; }
.hstack { display: flex; align-items: center; gap: 8px; }
.hstack.baseline { align-items: baseline; }
.grow { flex: 1 1 auto; min-width: 0; }
.pad { padding: 16px; }
.spacer { flex: 1 1 0; }
.sf { display: inline-block; vertical-align: -0.125em; flex: none; overflow: visible; }
.label { display: inline-flex; align-items: center; gap: 5px; }
.label > .sf { font-size: 1em; }
.divider { border: 0; border-top: 0.5px solid var(--separator); margin: 0; width: 100%; }
.plain-btn { display: block; width: 100%; }

/* ---------- buttons (Theme.swift button styles) ---------- */
.os-primary, .os-secondary { --btn: var(--accent); display: block; width: 100%; padding: 12px 16px; border-radius: 12px; font: 800 17px/22px var(--mono); color: var(--btn); text-align: center; }
.os-primary { background: color-mix(in srgb, var(--btn) 20%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--btn) 60%, transparent); }
.os-primary:active { background: color-mix(in srgb, var(--btn) 12%, transparent); }
.os-secondary { font-weight: 700; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--btn) 50%, transparent); }
.os-secondary:active { opacity: 0.7; }
.text-btn { padding: 4px 0; min-height: 30px; }
.text-btn:active, .nav-item:active, .nav-back:active, .icon-btn:active { opacity: 0.4; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; font-size: 17px; }
.prominent { display: block; width: calc(100% - 120px); margin: 0 60px; padding: 12px; border-radius: 12px; background: var(--accent); color: #000; text-align: center; }
.prominent:active { filter: brightness(0.85); }
.pill-btn { min-height: 40px; padding: 0 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.plain-pill { min-height: 40px; padding: 0 12px; }

/* ---------- lock screen ---------- */
.lock, .home { position: absolute; inset: 0; background: var(--bg); }
.lock-scroll { position: absolute; inset: 0; overflow-y: auto; padding-top: var(--sat); padding-bottom: var(--sab); }
.lock-col { min-height: calc(100% - 0px); display: flex; flex-direction: column; align-items: center; gap: 28px; padding-top: 12px; }
.status-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0 24px; color: var(--text2); }
.lock-glyph { font-size: 36px; line-height: 1; padding: 4px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.lock-prompt { margin: 0; padding: 0 36px; text-align: center; }
.lock-offline { letter-spacing: 1.2px; color: rgba(140, 140, 140, 0.8); }
.lock-field { width: 180px; padding: 12px 8px; text-align: center; background: var(--panel); color: var(--text); border: 0; border-radius: 10px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); outline: none; }
.lock-field::placeholder { color: rgba(235, 235, 245, 0.3); font-weight: 700; letter-spacing: 0; }
.lock-field.error { box-shadow: inset 0 0 0 1px var(--warning); }
.lock-field:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
.lock .prominent { width: auto; align-self: stretch; }

/* ---------- home screen ---------- */
.home { display: flex; flex-direction: column; padding-top: var(--sat); }
.home-bg { position: absolute; inset: 0; background: var(--bg) center / cover no-repeat; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.home-bg.photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.9) 50%, rgba(0, 0, 0, 0.97)); }
.home-header { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.home-header > * { pointer-events: auto; }
.home-header .status-row { padding: 12px 20px 0; }
.home-bell { display: grid; place-items: center; width: 36px; height: 36px; margin: -11px -8px -11px 0; font-size: 13px; }
.agent-os { margin-top: 24px; letter-spacing: 4px; color: var(--text2); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; padding-left: 4px; }
.case-status { text-align: center; padding: 0 16px; }
.home-scroll { position: relative; flex: 1 1 auto; overflow-y: auto; scrollbar-width: none; pointer-events: none; }
.home-scroll::-webkit-scrollbar { display: none; }
.home-col { display: flex; flex-direction: column; padding-bottom: 12px; pointer-events: none; }
.home-col > * { pointer-events: auto; }
.home-card, .home-panel { margin: 0 20px 22px; padding: 16px; border-radius: 16px; background: var(--panel); text-align: left; display: flex; gap: 12px; align-items: flex-start; }
.home-card:active, .board-hero:active { filter: brightness(1.3); }
.card-glyph { width: 24px; font-size: 17px; display: grid; place-items: center; padding-top: 1px; }
.card-chevron { color: var(--text2); font-size: 12px; align-self: center; }
.orientation { flex-direction: column; align-items: stretch; gap: 12px; }
.orientation .hstack { gap: 0; }
.board-hero { padding: 14px; gap: 14px; align-items: center; }
.cork { width: 64px; height: 64px; flex: none; display: block; }
.icon-grid { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 24px; row-gap: 26px; padding: 0 32px; }
.app-icon { display: flex; flex-direction: column; align-items: center; gap: 8px; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.icon-tile { position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; font-size: 24px; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.app-icon:active .icon-tile { filter: brightness(1.4); }
.icon-label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.badge { position: absolute; background: var(--warning); color: #fff; }
.badge.count { top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; font: 700 9px/18px var(--rounded); text-align: center; }
.badge.dot { top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; }
.badge.count.in-dock { top: -4px; right: -4px; min-width: 17px; height: 17px; font-size: 8px; line-height: 17px; }
.badge.dot.in-dock { top: -3px; right: -3px; width: 11px; height: 11px; }
.easter-egg { text-align: center; padding: 28px 40px 0; animation: fade 0.35s ease; }
@keyframes fade { from { opacity: 0; } }
.dock { position: relative; align-self: center; display: flex; gap: 18px; padding: 12px 18px; margin: 12px 28px calc(8px + var(--sab)); border-radius: 24px;
  background: rgba(40, 44, 42, 0.55); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); box-shadow: inset 0 0 0 1px rgba(31, 38, 33, 0.7); }
.dock-icon { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: var(--panel-light); color: var(--text); font-size: 22px; }
.dock-icon .sf { stroke-width: 2.1; }
.dock-icon:active { filter: brightness(1.4); }
.context-scrim { position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: fade 0.25s ease; }
.icon-tile.lifted { position: absolute; z-index: 41; pointer-events: none; background: color-mix(in srgb, var(--accent) 18%, #000); }

/* ---------- menus (Menu, .contextMenu) ---------- */
.menu-scrim { position: absolute; inset: 0; z-index: 40; }
.menu { position: absolute; z-index: 42; min-width: 250px; max-width: 290px; border-radius: 13px; overflow: hidden; transform-origin: top right;
  background: rgba(37, 37, 37, 0.82); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 11px 16px; font-size: 17px; color: var(--text); }
.menu-item + .menu-item { border-top: 0.5px solid var(--separator); }
.menu-item:active, .menu-item:focus-visible { background: rgba(255, 255, 255, 0.1); outline: none; }
.menu-item.destructive { color: #ff453a; }

/* ---------- screens + navigation bar (NavigationStack, inline titles) ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); padding-top: var(--sat); will-change: transform; }
.screen.in-sheet { padding-top: 0; }
.navbar { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(min-content, 1fr) minmax(0, auto) minmax(min-content, 1fr); align-items: center; min-height: 44px; padding: 0 8px; flex: none; transition: background 0.2s; }
.navbar.scrolled { background: rgba(18, 18, 18, 0.82); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8); box-shadow: 0 0.5px 0 var(--separator); }
.nav-title { grid-column: 2; margin: 0; max-width: 220px; min-width: 0; font: 600 17px/22px var(--sys); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-leading { grid-column: 1; display: flex; align-items: center; justify-self: start; }
.nav-trailing { grid-column: 3; display: flex; align-items: center; justify-self: end; gap: 4px; }
.nav-back { display: flex; align-items: center; gap: 3px; min-height: 44px; padding: 0 8px 0 0; font-size: 17px; max-width: 120px; }
.nav-back .sf { font-size: 22px; margin-left: -2px; }
.nav-back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item { min-height: 44px; padding: 0 8px; font-size: 17px; white-space: nowrap; }
.nav-item.nav-icon { font-size: 20px; min-width: 40px; display: grid; place-items: center; }
.nav-search { padding: 4px 16px 8px; flex: none; }
.screen-inset { flex: none; }
.screen-body { position: relative; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: var(--sab); }
.screen.in-sheet .screen-body { padding-bottom: calc(var(--sab) + 8px); }

/* ---------- search field (.searchable) ---------- */
.search-field { position: relative; display: flex; align-items: center; height: 36px; border-radius: 10px; background: var(--fill3); padding: 0 8px; gap: 6px; color: rgba(235, 235, 245, 0.6); }
.search-glass { font-size: 15px; }
.search-input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 17px; color: var(--text); -webkit-appearance: none; appearance: none; }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-input::placeholder { color: rgba(235, 235, 245, 0.6); }
.search-clear { font-size: 15px; color: rgba(235, 235, 245, 0.6); display: grid; place-items: center; width: 24px; height: 24px; }

/* ---------- List(.plain) ---------- */
.list.plain { padding-bottom: 24px; }
.list-section + .list-section { margin-top: 0; }
.list-header { position: sticky; top: 0; z-index: 1; padding: 14px 20px 6px; background: var(--bg); font: 600 15px/20px var(--sys); color: var(--text2); }
.list-row { --sep-inset: 20px; position: relative; display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 20px; text-align: left; background: var(--bg); color: var(--text); }
button.list-row:active { background: #1c1c1e; }
.list-row::after { content: ""; position: absolute; left: var(--sep-inset); right: 0; bottom: 0; border-bottom: 0.5px solid var(--separator); }
.list-rows > .list-row:last-child::after { display: none; }
.list-section:not(:last-child) .list-rows > .list-row:last-child::after { display: block; left: 0; }
.row-content { flex: 1 1 auto; min-width: 0; padding: 11px 0; }
.row-chevron { color: var(--chevron); font-size: 13px; margin-left: 10px; }
.row-chevron .sf { stroke-width: 3; }

/* ---------- Form (grouped) ---------- */
.form { padding: 0 16px 24px; }
.form-section { margin-top: 20px; }
.form-header { padding: 0 16px 7px; font-size: 13px; line-height: 18px; color: var(--text2); text-transform: uppercase; }
.form-footer { padding: 7px 16px 0; font-size: 13px; color: var(--text2); }
.form-rows { border-radius: 10px; background: var(--grouped); overflow: hidden; }
.form-row { position: relative; display: flex; align-items: center; min-height: 44px; padding: 11px 16px; width: 100%; text-align: left; }
.form-row.hstack { gap: 12px; }
.form-row + .form-row::before, .form-dynamic > .form-row::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; border-top: 0.5px solid var(--separator); }
.form-input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 17px; padding: 0; }
.form-input::placeholder, .form-editor::placeholder { color: rgba(235, 235, 245, 0.3); }
.form-editor { width: 100%; min-height: 150px; resize: vertical; background: none; border: 0; outline: none; font-size: 17px; line-height: 22px; padding: 0; }
.suggestion:active { background: rgba(255, 255, 255, 0.06); }
.toggle-row { justify-content: space-between; gap: 12px; }
.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; background: rgba(120, 120, 128, 0.32); position: relative; flex: none; transition: background 0.2s; margin: 0; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15); transition: transform 0.25s var(--ease); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }

/* ---------- segmented Picker ---------- */
.segmented { display: flex; padding: 2px; border-radius: 9px; background: rgba(118, 118, 128, 0.24); }
.segmented button { flex: 1; min-height: 28px; padding: 3px 8px; border-radius: 7px; font-size: 13px; font-weight: 500; text-align: center; }
.segmented button.on { background: #636366; font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12); }

/* ---------- misc shared views ---------- */
.text-field { display: block; width: 100%; padding: 16px; border: 0; border-radius: 0; background: var(--panel); outline: none; color: var(--text); }
.text-field::placeholder { color: rgba(235, 235, 245, 0.3); }
.unavailable { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px; text-align: center; }
.unavailable-icon { font-size: 44px; color: var(--text2); margin-bottom: 6px; }
.avatar { position: relative; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-mono { background: linear-gradient(135deg, rgba(64, 255, 140, 0.25), var(--panel-light)); color: var(--accent); }
.avatar-glyph { display: grid; place-items: center; font-weight: 500; }
.avatar-initials { font-family: var(--rounded); font-weight: 600; letter-spacing: 0.5px; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--panel); color: var(--text2); white-space: nowrap; }
.chip.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }

/* ---------- case desk (InvestigationViews.swift) ---------- */
.case-shelf { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; background: var(--panel); color: var(--accent); text-align: left; }
.case-shelf:active { filter: brightness(1.3); }
.shelf-icon { font-size: 17px; }
.shelf-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.shelf-chevron { font-size: 14px; }
.source-card { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 12px; background: var(--panel); color: var(--accent); text-align: left; }
.source-card > .vstack { flex: 1; min-width: 0; }
.source-mark { font-size: 17px; }
.panel-field { background: var(--panel); }
.briefing-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 14px; background: var(--panel); }
.briefing-card .text-btn { align-self: flex-start; text-align: left; }
.choice-panel { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--panel); align-self: stretch; }
.timeline-item { display: flex; gap: 12px; background: var(--panel); border-radius: 12px; padding-left: 0; }
.timeline-item > .vstack { padding: 16px 16px 16px 0; }
.timeline-rail { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 21px 0 0 0; width: 9px; margin-left: 0; }
.timeline-rail .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.timeline-rail .line { width: 1px; height: 52px; background: rgba(64, 255, 140, 0.35); }
.timeline-item .text-btn { align-self: flex-start; text-align: left; }

/* ---------- Messages ---------- */
.inbox-row { display: flex; align-items: flex-start; gap: 12px; padding: 0; }
.list-row .row-content:has(.inbox-row) { padding: 10px 0; }
.avatar-wrap { position: relative; flex: none; display: inline-block; line-height: 0; }
.unread-dot { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.draft-row { gap: 8px; padding: 7px 0; }
.chat .bubble-row { gap: 0; }
.bubble-row { display: flex; align-items: flex-end; gap: 8px; }
.bubble-row.mine { justify-content: flex-end; padding-left: 28px; }
.bubble-row:not(.mine) { padding-right: 28px; }
.case-bubble { display: flex; flex-direction: column; gap: 5px; padding: 12px; border-radius: 14px; background: var(--panel); max-width: 100%; }
.case-bubble.mine { background: rgba(64, 255, 140, 0.15); }
.quick-replies { gap: 16px; }
.thread { align-items: center; }
.thread > .bubble-row { align-self: stretch; }
.thread-head { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; }
.thread-row.mine { padding-left: 32px; }
.thread-bubble { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 18px; background: var(--panel); color: var(--text); min-width: 0; }
.thread-bubble.mine { background: rgba(64, 255, 140, 0.17); }
.reply-btn { display: flex; align-items: center; gap: 8px; padding: 14px; border-radius: 14px; background: var(--panel); color: var(--accent); width: 100%; }
.reply-btn .sf { font-size: 17px; }

/* ---------- placeholder (apps not yet ported) ---------- */
.installing { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 72px 36px; }
.icon-tile.big { width: 88px; height: 88px; border-radius: 22px; font-size: 34px; }
.install-bar { width: 160px; height: 4px; border-radius: 2px; background: var(--panel-light); overflow: hidden; }
.install-bar span { display: block; width: 40%; height: 100%; background: var(--accent); border-radius: 2px; animation: install 1.6s var(--ease) infinite; }
@keyframes install { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---------- sheets ---------- */
.sheet-wrap { position: absolute; inset: 0; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; background: var(--bg); border-radius: 12px 12px 0 0; overflow: hidden;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.06); transition: top 0.4s var(--ease); top: calc(var(--sat) + 10px); }
.sheet[data-detent="medium"] { top: 50%; }
.sheet-grabber { position: absolute; top: 5px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: rgba(127, 127, 127, 0.5); z-index: 3; }
.sheet-stack { position: relative; flex: 1; }
.sheet .navbar { padding-top: 6px; min-height: 52px; cursor: grab; }
.cover { position: absolute; inset: 0; background: var(--bg); }

/* ---------- alerts ---------- */
.alert-wrap { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.45); z-index: 50; }
.alert { width: 270px; border-radius: 14px; overflow: hidden; background: rgba(40, 40, 40, 0.9); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); text-align: center; }
.alert-text { padding: 19px 16px 16px; }
.alert-title { font-weight: 600; font-size: 17px; }
.alert-message { font-size: 13px; margin-top: 4px; }
.alert-buttons { display: flex; flex-direction: column; border-top: 0.5px solid var(--separator); }
.alert-buttons.two { flex-direction: row-reverse; }
.alert-btn { flex: 1; min-height: 44px; color: var(--tint); font-size: 17px; text-align: center; }
.alert-buttons.two .alert-btn + .alert-btn { border-right: 0.5px solid var(--separator); }
.alert-buttons:not(.two) .alert-btn + .alert-btn { border-top: 0.5px solid var(--separator); }
.alert-btn.cancel { font-weight: 600; }
.alert-btn.destructive { color: #ff453a; }

/* ---------- banners ---------- */
.banner { pointer-events: auto; display: flex; align-items: center; gap: 10px; margin: calc(var(--sat) + 12px) 12px 0; padding: 12px; border-radius: 20px; background: var(--panel-light); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); touch-action: pan-x; }
.banner-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; color: var(--text); }
.banner-symbol { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent); font-size: 20px; flex: none; }
.banner-x { flex: none; }

/* ---------- overlays ---------- */
.handler-waiting { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 100%; padding: 32px; text-align: center; }
.oddity-detail { gap: 24px; padding: 24px; }
.case-closed { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(64, 255, 140, 0.35) 0, #000 46%, #000 100%); cursor: pointer; }
.case-closed-scroll { position: absolute; inset: 0; overflow-y: auto; padding-top: var(--sat); }
.case-closed-col { min-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.stamp { margin-top: 24px; padding: 12px 24px; color: var(--accent); border: 4px solid var(--accent); border-radius: 6px; transform: rotate(-6deg); }
.stats { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 14px; background: var(--panel); align-self: stretch; margin: 0 32px; }
.closed-findings { gap: 12px; padding: 0 28px; align-self: stretch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
