/* V1 shell recovery: Team sidecard and the single contextual toolbar.
   Imported after home.css by the integration owner. */

#tx-shell {
  --tx-sidecard-width: 288px;
  --tx-context-height: 64px;
}

#tx-suite-rail,
#tx-shell[data-workspace-panel-expanded="false"] #tx-suite-rail,
#tx-shell[data-workspace-panel-expanded="true"] #tx-suite-rail {
  width: var(--tx-sidecard-width);
  flex-basis: var(--tx-sidecard-width);
  visibility: visible;
  padding: 16px 12px;
  border-inline-end: 1px solid var(--stax-border);
  background: var(--stax-surface);
}

#tx-suite-rail .tx-workspace-panel-toggle { display: none; }
#tx-suite-rail .tx-workspace-panel-name { display: block; }
#tx-suite-rail .tx-workspace-panel-scroll { gap: 12px; }
#tx-suite-rail .tx-workspace-panel-footer { margin-block-start: auto; }
#tx-suite-rail .tx-workspace-signout {
  justify-content: flex-start;
  padding-inline: 12px;
}
#tx-suite-rail .tx-workspace-signout span { display: inline; }

.tx-v1-team { gap: 4px; }
.tx-v1-team > h2 {
  margin: 8px 10px 4px;
  color: var(--stax-text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tx-workspace-team,
.tx-v1-stax-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
}
.tx-workspace-team > button[data-workspace-artist-select],
.tx-v1-stax-row > button[data-v1-team-stax] {
  display: grid;
  width: 100%;
  min-height: 48px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  padding: 5px 8px;
  background: transparent;
  color: var(--stax-text-dim);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.tx-workspace-team > button[data-workspace-artist-select]:hover,
.tx-workspace-team > button[data-workspace-artist-select]:focus-visible,
.tx-v1-stax-row > button[data-v1-team-stax]:hover,
.tx-v1-stax-row > button[data-v1-team-stax]:focus-visible {
  background: var(--stax-surface-2);
  color: var(--stax-text);
}
.tx-v1-stax-row > button[data-v1-team-stax][aria-current="page"] {
  border-inline-start: 3px solid var(--stax-accent-stax);
  background: color-mix(in srgb, var(--stax-accent-stax) 13%, var(--stax-surface));
  color: var(--stax-text);
  font-weight: 800;
}
.tx-workspace-team > button[data-workspace-artist-select][aria-pressed="true"] {
  background: var(--stax-surface-2);
  box-shadow: inset 0 0 0 1px var(--stax-border);
  color: var(--stax-text);
  font-weight: 750;
}
.tx-workspace-team > button[data-workspace-artist-select] > span:nth-child(2),
.tx-v1-stax-row > button[data-v1-team-stax] > span:nth-child(2) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.tx-workspace-team-avatar--photo { overflow: hidden; }
.tx-workspace-team-avatar--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tx-v1-stax-avatar {
  color: var(--stax-accent-stax);
  background: color-mix(in srgb, var(--stax-accent-stax) 12%, var(--stax-surface));
}
.tx-v1-stax-avatar svg,
.tx-v1-stax-details svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.tx-v1-stax-toggle {
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--stax-text-dim);
  cursor: pointer;
}
.tx-v1-stax-toggle:hover,
.tx-v1-stax-toggle:focus-visible {
  background: var(--stax-surface-2);
  color: var(--stax-text);
}
.tx-v1-stax-toggle[aria-expanded="true"] .tx-workspace-team-chevron { transform: rotate(225deg); }
.tx-v1-stax-details {
  display: grid;
  grid-column: 1 / -1;
  gap: 2px;
  margin: 2px 8px 8px 44px;
  border-inline-start: 2px solid var(--stax-border);
  padding: 6px 0 6px 10px;
}
.tx-v1-stax-details[hidden] { display: none; }
.tx-v1-stax-details > button {
  display: grid;
  min-height: 44px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 9px;
  padding: 6px 10px;
  background: transparent;
  color: var(--stax-text-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
}
.tx-v1-stax-details > button:hover,
.tx-v1-stax-details > button:focus-visible {
  background: var(--stax-surface-2);
  color: var(--stax-text);
}
.tx-v1-stax-details > button:first-child { color: var(--stax-accent-stax); }

.tx-workspace-team-detail {
  grid-column: 1 / -1;
  margin: 2px 8px 8px 44px;
  border-inline-start: 2px solid var(--stax-border);
  padding: 6px 0 6px 10px;
}
.tx-v1-artist-readonly { display: grid; gap: 8px; }
.tx-v1-artist-readonly p {
  display: grid;
  gap: 2px;
  margin: 0;
  color: var(--stax-text-dim);
  font-size: 12px;
}
.tx-v1-artist-readonly strong { color: var(--stax-text); }
.tx-v1-artist-problem {
  grid-column: 1 / -1;
  padding: 2px 10px 8px 44px;
  color: var(--stax-danger);
  font-size: 12px;
}

.tx-v1-sidecard-sections {
  display: grid;
  gap: 4px;
  border-block-start: 1px solid var(--stax-border);
  padding-block-start: 12px;
}
.tx-v1-sidecard-section { display: grid; }
.tx-v1-section-toggle,
.tx-v1-section-app {
  display: grid;
  width: 100%;
  min-height: 44px;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  padding: 6px 10px;
  background: transparent;
  color: var(--stax-text-dim);
  font: inherit;
  font-weight: 750;
  text-align: start;
  cursor: pointer;
}
.tx-v1-section-toggle:hover,
.tx-v1-section-toggle:focus-visible,
.tx-v1-section-app:hover,
.tx-v1-section-app:focus-visible {
  background: var(--stax-surface-2);
  color: var(--stax-text);
}
.tx-v1-section-toggle .tx-suite-icon svg,
.tx-v1-section-app .tx-suite-icon svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
  stroke: none;
}
.tx-v1-section-toggle .tx-workspace-team-chevron { justify-self: center; }
.tx-v1-section-toggle[aria-expanded="true"] .tx-workspace-team-chevron { transform: rotate(225deg); }
.tx-v1-section-items {
  display: grid;
  gap: 2px;
  margin-inline-start: 22px;
  border-inline-start: 2px solid var(--stax-border);
  padding-inline-start: 8px;
}
.tx-v1-section-items[hidden] { display: none; }
.tx-v1-section-app {
  grid-template-columns: 24px minmax(0, 1fr);
  font-size: 13px;
  font-weight: 650;
}
.settings-sms-group {
  --os-surface: var(--stax-surface);
  --os-text: var(--stax-text);
  --os-border: var(--stax-border);
  --os-text-muted: var(--stax-text-dim);
  --os-text-secondary: var(--stax-text-dim);
  --os-text-inverse: var(--stax-on-accent);
  --os-radius-sm: var(--stax-radius-sm);
  margin-block: 18px 24px;
  padding-block-start: 2px;
  color: var(--stax-text);
  overflow-wrap: anywhere;
}
.settings-sms-group + .settings-sms-group {
  border-block-start: 1px solid var(--stax-border);
  padding-block-start: 22px;
}
.settings-sms-group > h4 {
  margin: 0 0 4px;
  color: var(--stax-text);
  font-size: 16px;
}
.settings-sms-group-copy {
  margin-block-end: 12px;
}
.settings-sms-intro { --os-text-muted: var(--stax-text-dim); }
.settings-sms-intro,
.settings-sms-group .text-sm { font-size: var(--stax-fs-sm); }

.settings-sms-group .card {
  background: var(--stax-surface-2);
  color: var(--stax-text);
  border-color: var(--stax-border);
  border-radius: var(--stax-radius-lg);
}
.settings-sms-group :is(button, input, select, summary) {
  min-height: var(--app-target);
}
.settings-sms-group .input {
  min-width: 0;
  max-width: 100%;
}
.settings-sms-group :is(.btn, .stax-btn) {
  max-width: 100%;
  white-space: normal;
}
.settings-sms-group .stax-chip {
  max-width: 100%;
  flex-wrap: wrap;
}
.settings-sms-group button:disabled {
  opacity: 0.55;
  cursor: default;
}

#tx-workspace-main { position: relative; }
#tx-shell:not(.app-keyboard-open):not(.tx-workspace-legacy) {
  --tx-bottom-reserve: calc(var(--tx-context-height) + var(--app-safe-bottom));
}
/* V1 keeps the context toolbar on desktop too. Apps without the shared
   assistant must reserve its space just as narrow app layouts already do. */
body:not(.tx-conversation-active) #tx-shell:not(.app-keyboard-open):not(.tx-workspace-legacy) #tx-app-view {
  padding-block-end: var(--tx-bottom-reserve);
}
#tx-mobile-nav.tx-context-toolbar {
  position: absolute;
  inset: auto 0 0;
  z-index: var(--z-app-rail);
  display: grid;
  grid-template-columns: repeat(var(--tx-context-count), minmax(0, 1fr));
  min-height: calc(var(--tx-context-height) + var(--app-safe-bottom));
  padding: 0 max(8px, env(safe-area-inset-right)) var(--app-safe-bottom) max(8px, env(safe-area-inset-left));
  border-block-start: 1px solid var(--stax-border);
  background: color-mix(in srgb, var(--stax-surface) 96%, transparent);
  box-shadow: 0 -8px 22px color-mix(in srgb, #000 8%, transparent);
  backdrop-filter: blur(14px);
}
.tx-context-action {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 56px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 10px;
  padding: 4px 3px;
  background: transparent;
  color: var(--stax-text-dim);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.tx-context-action:hover,
.tx-context-action:focus-visible {
  background: var(--stax-surface-2);
  color: var(--stax-text);
}
.tx-context-action.active {
  color: var(--stax-text);
  font-weight: 850;
}
.tx-context-action.active::before {
  content: "";
  position: absolute;
  inset: 0 28% auto;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--stax-accent-stax);
}
.tx-context-icon {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
}
.tx-context-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: none;
}
.tx-context-action[data-context-action="stax"] .tx-context-icon { color: var(--stax-accent-stax); }
/* Line-drawn icons (sliders, list, calendar day, people, link, palette) carry
   data-line; filled-only styling left the Mode/General slots blank. */
.tx-context-icon svg[data-line] { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#tx-shell.tx-focused-dock #tx-mobile-nav.tx-context-toolbar,
#tx-shell.app-keyboard-open #tx-mobile-nav.tx-context-toolbar { display: none; }
#tx-shell.tx-focused-dock:not(.app-keyboard-open):not(.tx-workspace-legacy) {
  --tx-bottom-reserve: var(--app-safe-bottom);
}

@media (max-width: 63.999rem) {
  #tx-suite-rail,
  #tx-shell[data-workspace-panel-expanded="false"] #tx-suite-rail,
  #tx-shell[data-workspace-panel-expanded="true"] #tx-suite-rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: calc(var(--z-app-rail) + 2);
    display: flex;
    width: min(320px, calc(100vw - 28px));
    max-width: none;
    height: 100dvh;
    flex-basis: auto;
    padding: 14px 12px max(14px, env(safe-area-inset-bottom));
    visibility: hidden;
    transform: translateX(-102%);
    box-shadow: var(--stax-shadow-float);
  }
  #tx-shell.workspace-panel-open #tx-suite-rail {
    visibility: visible;
    transform: translateX(0);
  }
  #tx-suite-rail .tx-workspace-panel-close { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  #tx-suite-rail,
  #tx-shell[data-workspace-panel-expanded="false"] #tx-suite-rail,
  #tx-shell[data-workspace-panel-expanded="true"] #tx-suite-rail,
  .tx-workspace-team-chevron { transition: none; }
}


/* Approved warm, quiet Stax composition. The font stack stays offline: Georgia
   provides the display character until a qualified Newsreader asset ships. */
:root[data-theme="light"] #tx-shell {
  --stax-ink: #f4f2ec;
  --stax-surface: #ffffff;
  --stax-surface-2: #f1eee7;
  --stax-border: #d9d4c8;
  --stax-text: #1b1a17;
  --stax-text-dim: #55524b;
  --stax-text-faint: #77736a;
  --stax-agent: #146e68;
  --stax-accent-stax: #146e68;
}
:root:not([data-theme="light"]) #tx-shell {
  --stax-ink: #0c0c0e;
  --stax-surface: #121214;
  --stax-surface-2: #18181b;
  --stax-border: #2a2a2e;
  --stax-text: #e8e4dc;
  --stax-text-dim: #9a9aa0;
  --stax-text-faint: #797980;
  --stax-agent: #5cbcae;
  --stax-accent-stax: #5cbcae;
}

#tx-home,
#tx-app-view,
#tx-workspace-main {
  background: var(--stax-ink);
}
.tx-home-header {
  min-height: 64px;
  border-block-end-color: color-mix(in srgb, var(--stax-border) 72%, transparent);
  padding-inline: clamp(16px, 3vw, 36px);
  background: color-mix(in srgb, var(--stax-ink) 94%, transparent);
}
.tx-stax-start {
  width: min(760px, calc(100% - 40px));
  padding-block-start: clamp(72px, 15vh, 148px);
}
.tx-stax-quiet-start { gap: 2px; }
.tx-stax-quiet-start h1 {
  max-width: 15ch;
  margin-block: 20px 8px;
  color: var(--stax-text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.5vw, 3.15rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.025em;
}
.tx-stax-quiet-start p {
  max-width: 44ch;
  color: var(--stax-text-dim);
  font-size: 15px;
  line-height: 1.6;
}

#tx-workspace-main:has(> #tx-home) > #tx-workspace-chat.chat-has-history {
  width: min(840px, calc(100% - 36px));
  margin-block-start: 16px;
}
#tx-workspace-chat.chat-has-history #tx-workspace-chat-reply {
  gap: 14px;
  padding: 18px clamp(8px, 3vw, 24px) 24px;
}
.tx-chat-message {
  max-width: min(88%, 680px);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: none;
}
.tx-chat-message[data-chat-role="assistant"] {
  border-color: transparent;
  border-inline-start-color: var(--stax-agent);
  background: transparent;
}
.tx-chat-message[data-chat-role="user"] {
  justify-self: end;
  border-color: var(--stax-border);
  border-inline-start-width: 1px;
  background: var(--stax-surface-2);
}
.tx-chat-message[data-chat-role="tool"],
.tx-chat-message[data-chat-role="system"] {
  max-width: 100%;
  background: var(--stax-surface);
}
#tx-workspace-chat-form {
  border-color: var(--stax-border);
  background: color-mix(in srgb, var(--stax-surface) 96%, transparent);
  box-shadow: none;
}
#tx-workspace-chat-form:focus-within {
  border-color: var(--stax-agent);
  box-shadow: inset 0 0 0 1px var(--stax-agent);
}
#tx-workspace-chat-input:focus-visible {
  outline-color: var(--stax-agent);
}
#tx-workspace-chat-send:focus-visible {
  outline-color: var(--stax-agent);
}
.tx-chat-send-glyph {
  background: var(--stax-agent);
  color: #ffffff;
}

@media (max-width: 47.999rem) {
  .tx-home-header { min-height: 56px; }
  .tx-stax-start {
    width: calc(100% - 32px);
    padding-block-start: clamp(42px, 9vh, 80px);
  }
  .tx-stax-quiet-start h1 {
    max-width: 13ch;
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }
  #tx-workspace-main:has(> #tx-home) > #tx-workspace-chat.chat-has-history {
    width: calc(100% - 20px);
    margin-block-start: 8px;
  }
  #tx-workspace-chat.chat-has-history #tx-workspace-chat-reply {
    padding-inline: 4px;
  }
  .tx-chat-message { max-width: 94%; }
}

/* Independent Stax settings avatar, chat selection and disclosure. */
.tx-v1-stax-row { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.tx-v1-stax-row > button[data-v1-team-stax] { grid-template-columns: minmax(0, 1fr); }
.tx-v1-stax-avatar-action { display: grid; place-items: center; min-width: 44px; min-height: 48px; padding: 5px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.tx-v1-stax-avatar-action:hover, .tx-v1-stax-avatar-action:focus-visible { background: var(--stax-surface-2); }
.tx-v1-member-row > button, .tx-v1-member-message { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 10px; background: var(--stax-surface-2); color: var(--stax-text); font: inherit; cursor: pointer; }
.tx-v1-member-row > button { width: 100%; text-align: start; }
.tx-v1-member-row > div { padding: 4px 12px; }
.tx-chat-history-filter { display: flex; gap: 12px; align-items: center; padding: 8px 16px; }
.tx-chat-history-filter select { min-height: 44px; max-width: 100%; color: var(--stax-text); background: var(--stax-surface); border: 1px solid var(--stax-border); border-radius: 10px; font: inherit; }

/* Shared phone setup only. No global font or preference changes. */
.stax-phone-setup {
  --os-surface: var(--stax-surface);
  --os-text: var(--stax-text);
  --os-border: var(--stax-border);
  --os-text-secondary: var(--stax-text-dim);
  --os-text-muted: var(--stax-text-dim);
  padding: var(--stax-space-4);
  border: 1px solid var(--stax-border);
  border-radius: var(--stax-radius-lg);
  background: var(--stax-surface-2);
  color: var(--stax-text);
  font: inherit;
  font-size: var(--stax-fs-base);
  overflow-wrap: anywhere;
  max-width: 100%;
}
.stax-phone-setup h4 { margin: 0 0 var(--stax-space-2); font-size: var(--stax-fs-md); }
.stax-phone-setup p { margin: 0 0 var(--stax-space-3); }
.stax-phone-setup-actions { display: flex; flex-wrap: wrap; gap: var(--stax-space-2); }
.stax-phone-setup :is(button, select) { min-height: var(--app-target); max-width: 100%; }
.stax-phone-setup button { white-space: normal; }
.stax-phone-setup button:disabled { opacity: .55; cursor: default; }
.stax-phone-setup label { display: block; color: var(--stax-text-dim); margin-block: var(--stax-space-2) var(--stax-space-1); }
.stax-phone-setup select {
  display: block;
  width: 100%;
  min-width: 0;
  margin-bottom: var(--stax-space-3);
  padding: var(--stax-space-2);
  border: 1px solid var(--stax-border);
  border-radius: var(--stax-radius-sm);
  background: var(--stax-surface);
  color: var(--stax-text);
  font: inherit;
}

/* One offline notice for every screen (ink-stax state inventory, 2026-10-21). */
.tx-offline-notice { position: fixed; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(420px, calc(100vw - 32px)); box-sizing: border-box; padding: 8px 8px 8px 14px; border-radius: 14px;
  background: var(--stax-elevated, #1d1d1f); color: var(--stax-text, #f2f2f2); border: 1px solid var(--stax-border, #333);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); font-size: 13px; line-height: 1.35; }
.tx-offline-notice[hidden] { display: none; }
.tx-offline-notice button { flex: 0 0 auto; min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--stax-border, #444); background: transparent; color: inherit; font-weight: 650; }
