.stc { color:var(--text); background:var(--bg); border:1px solid var(--line); border-radius:16px; padding:0; width:min(1200px,calc(100vw - 48px)); height:min(880px,calc(100dvh - 48px)); max-width:none; max-height:none; font-family:var(--sans); box-shadow:0 20px 80px #0005; }
.stc::backdrop { background:#0007; }
.stc[open] { display:flex; flex-direction:column; }
.stc * { box-sizing:border-box; }
.stc [hidden] { display:none!important; }
.stc-head { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 24px; border-bottom:1px solid var(--line); }
.stc h1 { font-size:22px; margin:0 0 4px; line-height:1.3; }
.stc h2 { font-size:19px; margin:0 0 6px; }
.stc p { margin:0; line-height:1.6; }
.stc-head p,.stc-meta { color:var(--text-2); font-size:13px; line-height:1.5; }
.stc-tools { display:flex; flex-wrap:wrap; gap:10px; padding:12px 24px; align-items:end; }
.stc label { font-size:13px; display:flex; flex-direction:column; gap:6px; color:var(--text-2); }
.stc input,.stc select,.stc textarea { background:var(--bg); color:var(--text); border:1px solid var(--line); border-radius:8px; min-height:44px; padding:10px; font:inherit; font-size:15px; }
.stc-tools label:has(input[type=search]) { flex:1; min-width:160px; }
.stc-button { min-height:44px; padding:9px 12px; border:1px solid var(--line); border-radius:8px; background:var(--bg); color:var(--text); font:inherit; font-size:14px; cursor:pointer; }
.stc-button:hover { background:var(--surface-2,var(--bg)); border-color:var(--text-2); }
.stc-button:disabled { opacity:.6; cursor:default; }
.stc-folders { display:flex; flex-wrap:wrap; gap:8px; padding:12px 24px 0; }
.stc-folders .stc-button { border-color:transparent; background:transparent; }
.stc-folders .stc-button[aria-pressed="true"] { background:color-mix(in oklch,var(--text) 8%,var(--bg)); border-color:var(--line); font-weight:600; }
.stc :focus-visible { outline:2px solid var(--text); outline-offset:2px; }
.stc-status { padding:0 24px 12px; color:var(--text-2); font-size:13px; }
.stc-workspace { display:grid; grid-template-columns:320px minmax(0,1fr); flex:1; min-height:0; border-top:1px solid var(--line); }
.stc-list { overflow-y:auto; border-right:1px solid var(--line); padding:8px; }
.stc-row { display:flex; flex-direction:column; text-align:left; width:100%; gap:6px; padding:16px; border:1px solid transparent; border-radius:10px; margin-bottom:4px; color:var(--text); background:transparent; }
.stc-row.selected { border-color:var(--line); background:color-mix(in oklch,var(--text) 7%,var(--bg)); }
.stc-row-title { display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.stc-row-title strong { overflow-wrap:anywhere; }
.stc-row-title time { flex-shrink:0; font-size:11px; }
.stc-more { position:relative; }
.stc-more summary { list-style:none; display:flex; align-items:center; }
.stc-more summary::-webkit-details-marker { display:none; }
.stc-more-menu { position:absolute; z-index:3; right:0; top:calc(100% + 6px); padding:8px; min-width:200px; background:var(--bg); border:1px solid var(--line); border-radius:12px; box-shadow:0 8px 24px #0003; }
.stc-more-menu .stc-button { display:block; width:100%; text-align:left; margin:4px 0; }
.stc-inbox-host { flex:1; min-height:0; display:flex; overflow:hidden; }
.stc.stc-embedded { display:flex; flex-direction:column; width:100%; height:100%; flex:1; border:0; border-radius:0; box-shadow:none; min-height:0; }
.stc-embedded .stc-head { padding:12px 16px 4px; border:0; }
.stc-embedded h1 { font-size:18px; }
.stc-sections { display:flex; gap:6px; padding:8px 16px; border-bottom:1px solid var(--line); }
.stc-sections button { flex:1; min-height:44px; border:1px solid var(--line); border-radius:8px; color:var(--text); background:var(--bg); font:inherit; }
.stc-sections button[aria-selected="true"] { background:var(--surface-2,var(--bg)); font-weight:600; border-color:var(--text-2); }
.stc-sections button:focus-visible { outline:2px solid var(--text); outline-offset:2px; }
.stc-mobile-sections .nx-seg { grid-template-columns:repeat(3,minmax(0,1fr)); grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); }
.stc-mobile-sections .nx-seg:not(:has(button:nth-child(3))) { grid-template-columns:repeat(2,minmax(0,1fr)); }
.stc-mobile-sections .nx-seg button { height:44px; min-width:0; font-size:13px; }
.stc-preview { overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; font-size:14px; line-height:1.5; }
.stc-detail { overflow-y:auto; min-width:0; padding:24px; }
.stc-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.stc-messages { padding:24px 0; display:flex; flex-direction:column; gap:16px; }
.stc-message { max-width:92%; border:1px solid var(--line); padding:14px 16px; border-radius:12px; }
.stc-message.outbound { align-self:flex-end; background:color-mix(in oklch,var(--text) 6%,var(--bg)); }
.stc-message p { white-space:pre-wrap; overflow-wrap:anywhere; font-size:16px; margin-top:6px; line-height:1.65; }
.stc-compose { display:flex; flex-direction:column; gap:10px; border-top:1px solid var(--line); padding-top:18px; }
.stc-reply-controls { display:flex; flex-wrap:wrap; gap:8px; }
.stc-control-state { flex-basis:100%; color:var(--text-2); font-size:14px; }
.stc .stc-primary { background:var(--text); color:var(--bg); border-color:var(--text); font-weight:600; }
.stc-review { padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2,var(--bg)); }
.stc-review h3 { margin:0 0 8px; font-size:16px; }
.stc-review p { margin-bottom:12px; }
.stc-review .stc-review-copy { padding:12px; border:1px solid var(--line); border-radius:8px; white-space:pre-wrap; overflow-wrap:anywhere; background:var(--bg); }
.stc-review button { margin-right:8px; margin-top:4px; }
.stc-image { display:block; max-width:min(100%,440px); max-height:320px; object-fit:contain; border-radius:10px; margin:10px 0; }
.stc-review select { min-height:44px; width:100%; margin-top:8px; }
.stc-empty { padding:24px; color:var(--text-2); font-size:15px; }
.stc-thread-head > .stc-button:first-child { display:none; }
.stc-notification { flex-direction:row!important; align-items:center; margin:20px 0; }
.stc-notification input { width:22px; }
[data-stc-open] { min-height:44px; cursor:pointer; }
/* Inbound occupies the same content tracks as Today. Sidebar and titlebar stay usable. */
#salestools-col { display:none; grid-column:2 / -1; grid-row:1; min-width:0; min-height:0; overflow:hidden; background:var(--bg); }
body.stc-workspace-open #salestools-col:not([hidden]) { display:flex; }
body.stc-workspace-open #thread-col,
body.stc-workspace-open #canvas-col,
body.stc-workspace-open #today-col,
body.stc-workspace-open #tasks-col,
body.stc-workspace-open #nxReceipts { display:none!important; }
body.stc-workspace-open #body { grid-template-columns:var(--sidebar-w,280px) minmax(0,1fr) 0!important; }
body.stc-workspace-open.sidebar-collapsed #body { grid-template-columns:0 minmax(0,1fr) 0!important; }
#salestools-col .stc-head { padding:20px 24px 12px; border-bottom:1px solid var(--line); }
#salestools-col .stc-head h1 { font-size:20px; }
#salestools-col .stc-workspace { grid-template-columns:minmax(220px,30%) minmax(0,1fr); }
@media(max-width:1000px) {
  #salestools-col .stc-workspace { display:block; position:relative; }
  #salestools-col .stc-list { height:100%; border:0; }
  #salestools-col .stc-detail { display:none; height:100%; }
  #salestools-col .stc-reading .stc-list { display:none; }
  #salestools-col .stc-reading .stc-detail { display:block; }
  #salestools-col .stc-thread-head > .stc-button:first-child { display:block; margin-bottom:16px; }
}
@media(max-width:700px) {
  .stc { width:100vw; height:100dvh; border-radius:0; border:0; }
  .stc-head { padding:max(16px,env(safe-area-inset-top)) 16px 12px; }
  .stc-tools { padding:8px 16px; gap:8px; }
  .stc-folders { padding:8px 16px 0; gap:4px; }
  .stc-folders .stc-button { flex:1; padding:8px 6px; font-size:13px; }
  .stc-tools label:first-child { flex-basis:100%; }
  .stc-tools label { flex:1; }
  .stc-status { padding:0 16px 10px; }
  .stc-workspace { display:block; position:relative; }
  .stc-list { height:100%; border:0; }
  .stc-detail { display:none; height:100%; padding:16px 16px max(24px,env(safe-area-inset-bottom)); }
  .stc-reading .stc-list { display:none; }
  .stc-reading .stc-detail { display:block; }
  .stc-thread-head > .stc-button:first-child { display:block; margin-bottom:16px; }
  .stc-embedded .stc-head { padding:10px 16px 0; }
  .stc-embedded .stc-head p { display:none; }
  .stc-embedded:has(.stc-reading) .stc-head,
  .stc-embedded:has(.stc-reading) .stc-folders,
  .stc-embedded:has(.stc-reading) .stc-tools { display:none; }
  .stc-embedded .stc-tools { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px auto; }
  .stc-embedded .stc-tools label:first-child { grid-column:1 / -1; }
  .stc-embedded .stc-tools label:nth-child(2) { grid-column:1 / -1; }
  .stc-embedded .stc-tools label { min-width:0; }
  .stc-embedded .stc-tools select { width:100%; font-size:13px; }
  .stc-embedded .stc-tools > .stc-button { font-size:0; padding:8px; }
  .stc-embedded .stc-tools > .stc-button::after { content:'↻'; font-size:22px; }
  .stc-embedded .stc-status { font-size:11px; padding-bottom:6px; }
  .stc-embedded .stc-row { padding:14px 8px; border-bottom:1px solid var(--line); border-radius:0; }
}
