/* Crosscut Hub — unified Inbox (one thread per person). Builds on app.css + hub-proposals.css tokens. */
.ix { display: grid; grid-template-columns: 1fr; height: calc(100dvh - var(--nav-h) - var(--tab-h) - 32px); min-height: 480px; gap: 0; background: var(--paper); border-radius: var(--px-r); box-shadow: var(--px-shadow); overflow: hidden; }
@media (min-width: 900px) { .ix { grid-template-columns: minmax(300px, 360px) 1fr; height: calc(100dvh - var(--nav-h) - 48px); } }
@media (min-width: 1280px) { .ix.ctx-on { grid-template-columns: 360px 1fr 320px; } }
.ix-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.ix-top { padding: 14px 14px 10px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.ix-top .row1 { display: flex; gap: 8px; align-items: center; }
.ix-top h1 { margin: 0 auto 0 0; }
.ix-search { position: relative; } .ix-search input { padding-left: 34px; } .ix-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.ix-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; } .ix-filters::-webkit-scrollbar { display: none; }
.ix-filters button { border: 0; border-radius: 999px; padding: 7px 12px; font: 600 13px/1 var(--text); background: var(--ground); color: var(--ink); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.ix-filters button[aria-pressed="true"] { background: var(--charcoal); color: #fff; }
.ix-filters button b { font-weight: 700; background: var(--orange); color: var(--charcoal); border-radius: 9px; padding: 1px 6px; font-size: 11px; }
.ix-filters button[aria-pressed="true"] b { background: #fff; }
.ix-chans { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; } .ix-chans::-webkit-scrollbar { display: none; }
.ix-chans button { border: 0; background: none; padding: 5px 8px; border-radius: 8px; font: 500 12.5px/1 var(--text); color: var(--muted); cursor: pointer; white-space: nowrap; }
.ix-chans button[aria-pressed="true"] { background: var(--ground); color: var(--charcoal); }
.ix-rows { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.ix-row { position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; background: var(--paper); transition: background .15s, transform .25s var(--px-ease); touch-action: pan-y; }
.ix-row:hover { background: #faf8f4; } .ix-row.on { background: #f3efe7; } .ix-row.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--orange); }
.ix-row .av { position: relative; width: 44px; height: 44px; border-radius: 50%; background: #efece6; display: grid; place-items: center; font: 600 14px/1 var(--label); color: var(--charcoal); }
.ix-row .av .ch { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; font-size: 11px; box-shadow: 0 0 0 2px var(--paper); }
.ix-row .nm { display: flex; gap: 6px; align-items: baseline; min-width: 0; } .ix-row .nm span { font-weight: 500; color: var(--charcoal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-row.unread .nm span { font-weight: 700; } .ix-row.unread .pv { color: var(--charcoal); }
.ix-row .pv { font-size: 13.5px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.ix-row .tags { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; } .ix-row .tags .px-state { padding: 4px 8px; font-size: 11.5px; }
.ix-row .rt { display: grid; gap: 6px; justify-items: end; align-content: start; } .ix-row time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ix-row .cnt { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--px-blue); color: #fff; font: 700 11.5px/20px var(--text); text-align: center; }
.ix-row .nr { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); }
.ix-row .swipe { position: absolute; inset: 0 0 0 auto; width: 100%; display: flex; align-items: center; justify-content: flex-end; padding-right: 22px; background: var(--px-live); color: #fff; font-weight: 700; z-index: -1; }
.ix-more { text-align: center; padding: 14px; }
.ix-empty { padding: 60px 24px; text-align: center; color: var(--muted); } .ix-empty b { display: block; color: var(--charcoal); font-size: 17px; margin-bottom: 6px; }

/* thread */
.ix-thread { display: none; flex-direction: column; min-width: 0; min-height: 0; background: #fbfaf7; }
@media (min-width: 900px) { .ix-thread { display: flex; } }
.ix-thread.empty { display: none; } @media (min-width: 900px) { .ix-thread.empty { display: grid; place-items: center; color: var(--muted); } }
.ix-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--paper); min-height: 62px; }
.ix-head .who { flex: 1; min-width: 0; cursor: pointer; } .ix-head .who b { display: block; color: var(--charcoal); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ix-head .who span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ix-head .back { display: none; } .ix-ibtn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--ground); display: grid; place-items: center; cursor: pointer; color: var(--charcoal); text-decoration: none; flex: none; }
.ix-ibtn:hover { background: #e7e3db; } .ix-ibtn svg { width: 18px; height: 18px; } .ix-ibtn.ok { background: var(--px-live); color: #fff; }
.ix-msgs { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 3px; }
.ix-day { align-self: center; font: 600 11px/1 var(--label); letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; }
.ix-chan { font: 600 11px/1 var(--text); color: var(--muted); margin: 10px 4px 3px; } .ix-chan.out { align-self: flex-end; }
.ix-b { max-width: min(78%, 560px); padding: 9px 13px; border-radius: 18px; font-size: 15px; line-height: 1.42; white-space: pre-wrap; word-wrap: break-word; position: relative; }
.ix-b.in { align-self: flex-start; background: var(--paper); color: var(--charcoal); box-shadow: 0 0 0 1px var(--line); border-bottom-left-radius: 6px; }
.ix-b.out { align-self: flex-end; background: var(--charcoal); color: #fff; border-bottom-right-radius: 6px; }
.ix-b.out.email { background: #34495e; } .ix-b.out.pending { background: #6f6a63; }
.ix-b .subj { display: block; font-weight: 700; margin-bottom: 3px; }
.ix-b audio { display: block; margin-top: 6px; max-width: 240px; } .ix-b a { color: inherit; }
.ix-meta { font-size: 11.5px; color: var(--muted); margin: 2px 6px 6px; } .ix-meta.out { align-self: flex-end; } .ix-meta.in { align-self: flex-start; } .ix-meta .bad { color: var(--red); }
.ix-sys { align-self: center; max-width: 88%; text-align: center; font-size: 13px; color: var(--ink); background: #efece6; border-radius: 12px; padding: 7px 12px; margin: 6px 0; }
.ix-sys.win { background: rgba(31,157,85,.14); color: var(--px-live); font-weight: 600; } .ix-sys.hot { background: rgba(232,89,12,.12); color: var(--px-hot); } .ix-sys.live { background: rgba(47,111,214,.1); color: var(--px-blue); }
.ix-note { align-self: stretch; margin: 6px 8% 6px 0; background: #fff6d6; border-radius: 12px; padding: 9px 12px; font-size: 14px; color: #5a4a12; white-space: pre-wrap; } .ix-note small { display: block; font-size: 11.5px; color: #8b7a3a; margin-top: 3px; }
.ix-call { align-self: flex-start; display: flex; gap: 10px; align-items: center; background: var(--paper); box-shadow: 0 0 0 1px var(--line); border-radius: 14px; padding: 10px 13px; font-size: 14px; margin: 4px 0; max-width: 88%; flex-wrap: wrap; } .ix-call.missed { color: var(--red); } .ix-call audio { max-width: 240px; height: 34px; }
.ix-lead { align-self: flex-start; background: var(--paper); box-shadow: 0 0 0 1px var(--line); border-left: 4px solid var(--orange); border-radius: 12px; padding: 11px 13px; font-size: 14px; max-width: min(88%, 560px); margin: 6px 0; }
.ix-lead b { display: block; color: var(--charcoal); margin-bottom: 4px; } .ix-lead dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; } .ix-lead dt { color: var(--muted); } .ix-lead dd { margin: 0; color: var(--charcoal); }

/* composer */
.ix-comp { border-top: 1px solid var(--line); background: var(--paper); padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
.ix-chanpick { display: flex; gap: 4px; margin-bottom: 7px; flex-wrap: wrap; align-items: center; }
.ix-chanpick button { border: 0; border-radius: 999px; padding: 6px 11px; font: 600 12.5px/1 var(--text); background: var(--ground); color: var(--ink); cursor: pointer; }
.ix-chanpick button[aria-pressed="true"] { background: var(--charcoal); color: #fff; } .ix-chanpick button[aria-pressed="true"].note { background: #f2d45c; color: #3d3308; }
.ix-chanpick button:disabled { opacity: .4; cursor: not-allowed; } .ix-chanpick .hint { font-size: 12px; color: var(--muted); margin-left: 4px; }
.ix-warn { font-size: 12.5px; background: #fff4e5; color: #8a4b00; border-radius: 9px; padding: 7px 10px; margin-bottom: 7px; }
.ix-inrow { display: flex; gap: 8px; align-items: flex-end; } .ix-inrow textarea { flex: 1; resize: none; min-height: 42px; max-height: 180px; border-radius: 20px; padding: 10px 14px; line-height: 1.4; }
.ix-inrow textarea.note { background: #fffbe8; } .ix-subj { margin-bottom: 7px; }
.ix-send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--orange); color: var(--charcoal); display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .12s, opacity .2s; } .ix-send:disabled { opacity: .35; } .ix-send:active { transform: scale(.92); } .ix-send svg { width: 19px; height: 19px; }
.ix-snips { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 6px); background: var(--paper); border-radius: 14px; box-shadow: 0 16px 44px rgba(0,0,0,.2), 0 0 0 .5px rgba(0,0,0,.08); max-height: 260px; overflow: auto; padding: 6px; z-index: 5; }
.ix-snips button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 9px; cursor: pointer; font: inherit; color: inherit; } .ix-snips button[aria-selected="true"], .ix-snips button:hover { background: var(--ground); }
.ix-snips b { display: block; font-size: 13.5px; color: var(--charcoal); } .ix-snips span { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* context */
.ix-ctx { display: none; border-left: 1px solid var(--line); overflow-y: auto; padding: 14px; background: var(--paper); }
@media (min-width: 1280px) { .ix.ctx-on .ix-ctx { display: block; } }
.ix-ctx section { padding: 12px 0; border-bottom: 1px solid var(--line); } .ix-ctx section:first-child { padding-top: 0; } .ix-ctx section:last-child { border-bottom: 0; }
.ix-ctx h4 { margin: 0 0 8px; font: 600 11px/1 var(--label); letter-spacing: 1.3px; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ix-ctx h4 a, .ix-ctx h4 button { margin-left: auto; font: 600 12px/1 var(--text); letter-spacing: 0; text-transform: none; color: var(--orange-2); background: none; border: 0; cursor: pointer; text-decoration: none; padding: 0; }
.ix-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13.5px; } .ix-kv span { color: var(--muted); } .ix-kv b { font-weight: 500; color: var(--charcoal); word-break: break-word; }
.ix-prop { display: grid; grid-template-columns: 1fr auto; gap: 4px; padding: 9px 10px; border-radius: 10px; background: var(--ground); margin-bottom: 6px; text-decoration: none; color: inherit; font-size: 13.5px; } .ix-prop b { color: var(--charcoal); } .ix-prop .px-state { justify-self: end; }

/* phone: the thread takes the screen */
@media (max-width: 899px) {
  .main:has(.ix) { padding: 0; padding-bottom: var(--tab-h); }
  .ix { border-radius: 0; box-shadow: none; height: calc(100dvh - var(--nav-h) - var(--tab-h)); }
  .ix.open .ix-thread { display: flex; position: fixed; inset: 0; z-index: 40; } .ix.open .ix-head { padding-top: calc(10px + env(safe-area-inset-top)); }
  .ix-head .back { display: grid; }
}
@media (prefers-reduced-motion: reduce) { .ix-row { transition: none; } }

@media (max-width: 599px) { .ix-head .wide-only { display: none; } .ix-head { gap: 8px; } }
