@import url("./inboxTemplates.css");
@import url("./providerSetup.css");

:root {
  color-scheme: light;
  --canvas: #f3f6f4;
  --surface: #ffffff;
  --surface-subtle: #edf2ef;
  --surface-raised: #ffffff;
  --ink: #15201b;
  --ink-strong: #0c1511;
  --muted: #5d6c65;
  --muted-strong: #43534b;
  --border: #d7e0db;
  --border-strong: #bcc9c2;
  --accent: #147d64;
  --accent-strong: #0b604b;
  --accent-soft: #dff3eb;
  --blue: #285fca;
  --blue-soft: #e7efff;
  --coral: #b9483e;
  --coral-ink: #b9483e;
  --coral-soft: #fff0ee;
  --amber: #8c620e;
  --amber-soft: #fff5d8;
  --success: #18704e;
  --success-soft: #e2f4ea;
  --brand-ink: #11231c;
  --brand-paper: #f7fbf9;
  --account-band: #ffffff;
  --account-session: #f1f3f5;
  --account-tool: #edf4f7;
  --account-tool-border: #9abecb;
  --account-action: #e7e4f4;
  --account-action-ink: #42366b;
  --account-border: #d7dce2;
  --account-muted: #5d6878;
  --shadow-small: 0 2px 10px rgba(15, 37, 28, 0.07);
  --shadow-large: 0 18px 50px rgba(15, 37, 28, 0.12);
  --page-gap: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  background: var(--canvas);
  color: var(--ink);
  overflow: hidden;
}

button,
select,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a,
select,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.mobile-icon {
  display: block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

#epic-mobile-root {
  --accent: #147d64;
  --accent-strong: #0b604b;
  --accent-soft: #dff3eb;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding-top: env(safe-area-inset-top);
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
}

#epic-mobile-root[data-mobile-accent="blue"] {
  --accent: #285fca;
  --accent-strong: #1f4da9;
  --accent-soft: #e7efff;
}

#epic-mobile-root[data-mobile-accent="coral"] {
  --accent: #b9483e;
  --accent-strong: #93372f;
  --accent-soft: #fff0ee;
}

#epic-mobile-root[data-mobile-density="compact"] {
  --page-gap: 18px;
}

#epic-mobile-root[data-mobile-appearance="dark"] {
  color-scheme: dark;
  --canvas: #101613;
  --surface: #171f1b;
  --surface-subtle: #1c2822;
  --surface-raised: #202b25;
  --ink: #edf4f0;
  --ink-strong: #ffffff;
  --muted: #a5b3ab;
  --muted-strong: #c2cec7;
  --border: #334139;
  --border-strong: #46564d;
  --accent-strong: #69d9b6;
  --accent-soft: #173d31;
  --blue: #8db3ff;
  --blue-soft: #1d3158;
  --coral-ink: #ff9b92;
  --coral-soft: #4a2522;
  --amber: #f0c76a;
  --amber-soft: #3d331b;
  --success: #62d9a2;
  --success-soft: #173b2d;
  --brand-ink: #e7f6ee;
  --brand-paper: #10231b;
  --account-band: #181a20;
  --account-session: #20232b;
  --account-tool: #1c3038;
  --account-tool-border: #385865;
  --account-action: #35334e;
  --account-action-ink: #f0edf9;
  --account-border: #353941;
  --account-muted: #b0b9c5;
  --shadow-small: 0 2px 10px rgba(0, 0, 0, 0.2);
  --shadow-large: 0 18px 50px rgba(0, 0, 0, 0.34);
}

#epic-mobile-root[data-mobile-appearance="dark"][data-mobile-accent="blue"] {
  --accent-strong: #8db3ff;
  --accent-soft: #1d3158;
}

#epic-mobile-root[data-mobile-appearance="dark"][data-mobile-accent="coral"] {
  --accent-strong: #ff9b92;
  --accent-soft: #4a2522;
}

#epic-mobile-root > * {
  min-width: 0;
}

.app-header {
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
}

.brand-mark img,
.auth-panel__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.brand-copy strong {
  color: var(--ink-strong);
  font-size: 0.98rem;
  font-weight: 850;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 650;
}

.app-header__account {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
  width: min(240px, 58vw);
}

.account-chip {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.account-chip__avatar,
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 850;
}

.account-chip__avatar {
  width: 30px;
  height: 30px;
  font-size: 0.67rem;
}

.account-chip__copy {
  display: grid;
  min-width: 0;
}

.account-chip__copy small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.account-chip__copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-main {
  min-height: 0;
}

.mobile-main--stack {
  display: grid;
  align-content: start;
  gap: var(--page-gap);
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 22px 16px 34px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.mobile-main--center {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  place-items: center;
  width: 100%;
  padding: 24px 16px;
  overflow-x: hidden;
  overflow-y: auto;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  color: var(--ink-strong);
  line-height: 1.16;
  letter-spacing: 0;
}

h1 {
  font-size: 1.72rem;
}

h2 {
  font-size: 1.12rem;
}

p {
  line-height: 1.52;
}

.account-overview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 2px 24px;
  border-bottom: 1px solid var(--border);
}

.account-overview h1 {
  max-width: 680px;
  font-size: 2rem;
}

.account-overview__body {
  max-width: 620px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 780;
  white-space: nowrap;
}

.status-pill > span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill--success {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill--warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill--accent {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.content-section {
  display: grid;
  gap: 14px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.content-section:last-child {
  border-bottom: 0;
}

.section-heading,
.screen-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-heading > div,
.screen-heading > div {
  min-width: 0;
}

.section-heading p:not(.eyebrow),
.screen-heading p:not(.eyebrow) {
  max-width: 620px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.screen-heading {
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.screen-heading h1 {
  font-size: 1.65rem;
}

.icon-button,
.back-button,
.history-button,
.text-link,
.mobile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.icon-button {
  flex: 0 0 auto;
  width: 44px;
  padding: 0;
  border-color: var(--border);
  background: var(--surface);
  color: var(--muted-strong);
  box-shadow: var(--shadow-small);
}

.mobile-button {
  padding: 0 15px;
  background: var(--accent);
  color: #ffffff;
}

.mobile-button--secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--ink);
}

.mobile-button--danger {
  border-color: var(--coral);
  background: var(--coral);
  color: #ffffff;
}

.mobile-button--wide {
  width: 100%;
}

.text-link {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 4px;
  background: transparent;
  color: var(--blue);
  font-size: 0.82rem;
}

.text-link .mobile-icon {
  width: 17px;
  height: 17px;
}

.connection-banner {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--border));
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--amber);
}

.connection-banner strong {
  font-size: 0.86rem;
}

.connection-banner p {
  margin: 2px 0 0;
  color: var(--muted-strong);
  font-size: 0.78rem;
}

.conversation-list {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.conversation-list--preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-small);
}

.conversation-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 86px;
  padding: 12px 13px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.conversation-row:last-child {
  border-bottom: 0;
}

.conversation-row.is-selected {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.conversation-row--compact {
  min-height: 76px;
}

.conversation-row__content {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.conversation-row__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.conversation-row__heading strong,
.conversation-row__preview,
.conversation-row__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-row__heading strong {
  min-width: 0;
  color: var(--ink-strong);
  font-size: 0.91rem;
  font-weight: 790;
}

.conversation-row__heading time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
}

.conversation-row__preview {
  color: var(--muted-strong);
  font-size: 0.83rem;
}

.conversation-row__meta {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  gap: 5px 10px;
  color: var(--muted);
  font-size: 0.69rem;
}

.conversation-row__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.conversation-row__meta .mobile-icon {
  width: 13px;
  height: 13px;
}

.avatar--photo {
  overflow: hidden;
  background: var(--surface-subtle);
}

.avatar--photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--warning {
  border-color: color-mix(in srgb, var(--amber) 35%, var(--border));
  background: var(--amber-soft);
  color: var(--amber);
}

.avatar--warning .mobile-icon {
  width: 19px;
  height: 19px;
}

.conversation-row__preview.is-deleted {
  color: var(--muted);
  font-style: italic;
}

.conversation-row__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.conversation-row__labels span,
.conversation-signal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted-strong);
  font-size: 0.66rem;
  font-weight: 700;
}

.conversation-row__labels .mobile-icon {
  width: 12px;
  height: 12px;
}

.conversation-row--review {
  cursor: default;
}

.row-status {
  display: inline-flex;
  justify-content: flex-end;
  color: var(--amber);
}

.row-status .mobile-icon {
  width: 17px;
  height: 17px;
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--coral);
  color: #ffffff;
  font-size: 0.69rem;
  font-weight: 820;
}

.row-chevron {
  display: inline-flex;
  justify-content: flex-end;
  color: var(--muted);
}

.row-chevron .mobile-icon {
  width: 17px;
  height: 17px;
}

.tool-grid {
  display: grid;
  gap: 10px;
}

.tool-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-small);
  text-align: left;
}

button.tool-card {
  cursor: pointer;
}

.tool-card__icon,
.state-panel__icon,
.session-actions__icon,
.feature-placeholder__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--muted-strong);
}

.tool-card--accent .tool-card__icon {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tool-card--warning .tool-card__icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.tool-card--success .tool-card__icon {
  background: var(--success-soft);
  color: var(--success);
}

.tool-card__copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.tool-card__copy strong {
  color: var(--ink-strong);
  font-size: 0.94rem;
}

.tool-card__copy > span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.tool-card__status {
  color: var(--accent-strong);
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tool-card__arrow {
  color: var(--muted);
}

.tool-card__arrow .mobile-icon {
  width: 18px;
  height: 18px;
}

.state-panel,
.empty-state,
.thread-placeholder,
.inline-empty,
.loading-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.state-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.state-panel--error {
  border-color: color-mix(in srgb, var(--coral) 30%, var(--border));
  background: var(--coral-soft);
}

.state-panel--error .state-panel__icon {
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
  color: var(--coral-ink);
}

.state-panel h2,
.empty-state h2,
.thread-placeholder h2 {
  font-size: 1rem;
}

.state-panel p,
.inline-empty p,
.loading-panel p {
  max-width: 420px;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.inline-empty {
  min-height: 112px;
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
}

.inline-empty > span,
.empty-state > span,
.thread-placeholder > span {
  color: var(--muted);
}

.mobile-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 760ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.skeleton-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.skeleton-row:last-child {
  border-bottom: 0;
}

.skeleton-row__body {
  display: grid;
  gap: 8px;
}

.skeleton {
  display: block;
  border-radius: 6px;
  background: var(--surface-subtle);
  animation: pulse 1.25s ease-in-out infinite alternate;
}

.skeleton--avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.skeleton--line {
  width: 76%;
  height: 11px;
}

.skeleton--short {
  width: 48%;
}

@keyframes pulse {
  to {
    opacity: 0.48;
  }
}

.mobile-main--inbox {
  display: block;
  width: 100%;
  max-width: 1180px;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  background: var(--surface);
}

.inbox-pane {
  height: 100%;
  min-width: 0;
  padding: 18px 14px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.inbox-pane--detail {
  display: none;
  padding: 0;
  overflow: hidden;
}

.mobile-main--inbox.has-thread .inbox-pane--list {
  display: none;
}

.mobile-main--inbox.has-thread .inbox-pane--detail {
  display: block;
}

.conversation-list-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.inbox-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
}

.inbox-list-toolbar > span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 680;
}

.inbox-filter-button {
  position: relative;
  flex: 0 0 auto;
}

.inbox-list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inbox-list-actions .icon-button {
  flex: 0 0 44px;
}

.inbox-filter-button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.66rem;
}

.inbox-filter-layer {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  align-items: end;
}

.inbox-filter-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(7, 12, 10, 0.62);
}

.inbox-filter-sheet {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  max-height: min(84dvh, 760px);
  padding-bottom: env(safe-area-inset-bottom);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--surface-raised);
  box-shadow: var(--shadow-large);
}

.inbox-filter-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.inbox-filter-sheet__header h2 {
  font-size: 1.08rem;
}

.inbox-filter-form {
  display: grid;
  gap: 18px;
  min-height: 0;
  padding: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.inbox-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.inbox-search-control {
  position: relative;
  display: block;
}

.inbox-search-control > .mobile-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.settings-field .inbox-search-control input {
  padding-left: 38px;
}

.inbox-filter-group {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.inbox-filter-group legend {
  margin-bottom: 7px;
  color: var(--ink-strong);
  font-size: 0.8rem;
  font-weight: 760;
}

.inbox-choice-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.inbox-choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-size: 0.79rem;
  cursor: pointer;
}

.inbox-choice:last-child {
  border-bottom: 0;
}

.inbox-choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.inbox-choice span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.inbox-choice span .mobile-icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.inbox-choice strong {
  color: var(--muted);
  font-size: 0.71rem;
}

.inbox-filter-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

div.inbox-filter-state {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.inbox-filter-actions {
  position: sticky;
  bottom: -16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 0 16px;
  background: var(--surface-raised);
}

.thread-placeholder {
  align-content: center;
  min-height: 100%;
  padding: 40px;
}

.thread-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--surface-subtle);
}

.back-button {
  align-self: flex-start;
  min-height: 44px;
  margin: 10px 12px 0;
  padding: 0 6px;
  background: transparent;
  color: var(--blue);
  font-size: 0.8rem;
}

.back-button .mobile-icon {
  width: 18px;
  height: 18px;
}

.thread-header {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 11px;
  padding: 12px 16px 15px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.avatar--large {
  width: 52px;
  height: 52px;
  font-size: 0.88rem;
}

.thread-header__identity {
  min-width: 0;
}

.thread-header__identity h1 {
  overflow: hidden;
  font-size: 1.18rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-header__identity p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-header__status {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 6px;
}

.thread-header__status span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted-strong);
  font-size: 0.67rem;
  font-weight: 680;
}

.thread-header__status .mobile-icon {
  width: 13px;
  height: 13px;
}

.thread-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 14px 12px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior-y: contain;
}

.history-button {
  align-self: center;
  min-height: 44px;
  padding: 0 10px;
  border-color: var(--border);
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 0.73rem;
  box-shadow: var(--shadow-small);
}

.history-button .mobile-icon {
  width: 15px;
  height: 15px;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 680;
}

.date-divider span {
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.message-row {
  display: flex;
  justify-content: flex-start;
}

.message-row--outbound {
  justify-content: flex-end;
}

.message-row--system {
  justify-content: center;
}

.message-bubble {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 5px;
  max-width: min(84%, 620px);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 37, 28, 0.04);
}

.message-bubble:has(.inbox-template) { width: 346px; }

.message-row--outbound .message-bubble {
  border-color: color-mix(in srgb, var(--blue) 20%, var(--border));
  background: var(--blue-soft);
}

.message-row--system .message-bubble {
  max-width: min(92%, 660px);
  border-color: color-mix(in srgb, var(--amber) 24%, var(--border));
  background: var(--amber-soft);
}

.message-bubble__author {
  color: var(--muted-strong);
  font-size: 0.66rem;
  font-weight: 760;
}

.message-bubble p {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.47;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-bubble__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 0.64rem;
}

.message-template,
.message-attachments {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 4px 0;
  padding: 0;
  list-style: none;
}

.message-template button {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  opacity: 1;
  white-space: normal;
  overflow-wrap: anywhere;
}

.message-attachments li {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.message-attachments li > div { display: grid; gap: 3px; min-width: 0; }
.message-attachments strong { font-size: 0.8rem; overflow-wrap: anywhere; }
.message-attachments small,
.message-template small,
.message-template > span { color: var(--muted-strong); font-size: 0.72rem; overflow-wrap: anywhere; }
.message-attachments .message-attachment-preview {
  display: grid;
  align-items: stretch;
  gap: 6px;
  overflow: hidden;
  padding-top: 8px;
}
.message-attachment-preview :is(img, video) {
  display: block;
  width: 100%;
  max-height: min(52vh, 520px);
  border-radius: 6px;
  background: #090d11;
  object-fit: contain;
}
.message-attachment-preview audio { display: block; width: 100%; }
.message-attachment-preview__fallback { display: none; }
.inbox-media-preview.is-unavailable :is(img, video, audio) { display: none; }
.inbox-media-preview.is-unavailable .message-attachment-preview__fallback { display: block; }
.message-reactions { display: flex; flex-wrap: wrap; gap: 8px; overflow-wrap: anywhere; }
.thread-history { display: grid; gap: 4px; text-align: center; color: var(--muted-strong); font-size: 0.75rem; margin-bottom: 8px; }
.thread-history-error { color: var(--danger); font-size: 0.8rem; overflow-wrap: anywhere; }

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.attachment-list span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--muted-strong);
  font-size: 0.67rem;
}

.attachment-list .mobile-icon {
  width: 14px;
  height: 14px;
}

.inbox-draft-review {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, var(--accent-soft));
}

.inbox-contact-context {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.inbox-contact-context--loading {
  display: grid;
  gap: 7px;
  padding: 12px 16px;
}

.inbox-contact-context > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 16px;
  color: var(--muted-strong);
  cursor: pointer;
  list-style: none;
}

.inbox-contact-context > summary::-webkit-details-marker {
  display: none;
}

.inbox-contact-context > summary > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink-strong);
  font-size: 0.78rem;
}

.inbox-contact-context > summary > span:nth-child(2) {
  overflow: hidden;
  font-size: 0.68rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-contact-context > summary .mobile-icon {
  width: 16px;
  height: 16px;
}

.inbox-contact-context > summary > .mobile-icon:last-child {
  transition: transform 140ms ease;
}

.inbox-contact-context[open] > summary > .mobile-icon:last-child {
  transform: rotate(180deg);
}

.inbox-contact-context__body {
  display: grid;
  gap: 12px;
  padding: 2px 16px 14px;
  border-top: 1px solid var(--border);
}

.inbox-contact-context__body dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
  margin: 0;
}

.inbox-contact-context__body dl > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.inbox-contact-context__body dt,
.inbox-contact-context__body dd,
.inbox-contact-context__notice,
.inbox-contact-context__body p {
  margin: 0;
}

.inbox-contact-context__body dt {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 680;
}

.inbox-contact-context__body dd {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.73rem;
  font-weight: 700;
}

.inbox-contact-context__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inbox-contact-context__tags span {
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--amber) 55%, var(--border));
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.65rem;
  font-weight: 700;
}

.inbox-contact-context__body p {
  display: grid;
  gap: 4px;
  color: var(--muted-strong);
  font-size: 0.72rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.inbox-contact-context__body p strong {
  color: var(--ink-strong);
  font-size: 0.68rem;
}

.inbox-contact-context__notice {
  padding: 0 16px 13px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.inbox-draft-review__header {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.inbox-draft-review__header .eyebrow,
.inbox-draft-review__header h2 {
  margin: 0;
}

.inbox-draft-review__header h2 {
  margin-top: 2px;
  color: var(--ink-strong);
  font-size: 0.9rem;
  line-height: 1.25;
}

.inbox-draft-review__icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--amber) 62%, var(--border));
  border-radius: 7px;
  background: var(--amber-soft);
  color: var(--amber);
}

.inbox-draft-review__icon .mobile-icon {
  width: 17px;
  height: 17px;
}

.inbox-draft-review > label:not(.inbox-draft-review__confirmation) {
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 740;
}

.inbox-draft-review textarea,
.inbox-draft-review select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-subtle);
  color: var(--ink);
}

.inbox-draft-review textarea {
  min-height: 104px;
  max-height: 220px;
  resize: vertical;
  padding: 10px 11px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.inbox-draft-review textarea[readonly] {
  color: var(--muted-strong);
}

.inbox-draft-review select {
  min-height: 42px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.inbox-draft-review__body,
.inbox-draft-review__meta,
.inbox-draft-review__status,
.inbox-draft-review__boundary {
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.42;
}

.inbox-draft-review__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.inbox-draft-review__status {
  min-height: 1em;
}

.inbox-draft-review__status.is-error {
  color: var(--coral-ink);
}

.inbox-draft-review__approved-text {
  margin: 0;
  padding: 11px;
  border-left: 3px solid var(--accent-strong);
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.inbox-draft-review__confirmation {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--ink);
  font-size: 0.74rem;
  line-height: 1.4;
}

.inbox-draft-review__confirmation input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.inbox-draft-review__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.inbox-draft-review__actions--end {
  grid-template-columns: minmax(0, 1fr);
}

.inbox-draft-review__actions .mobile-button {
  width: 100%;
  min-width: 0;
}

.inbox-draft-review__actions .mobile-icon {
  width: 16px;
  height: 16px;
}

.inbox-composer {
  display: grid;
  gap: 10px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.inbox-composer__modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: min(240px, 100%);
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-subtle);
}

.inbox-composer__modes button {
  min-height: 34px;
  padding: 5px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-strong);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 720;
}

.inbox-composer__modes button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink-strong);
  box-shadow: var(--shadow-small);
}

.inbox-composer__modes button:disabled {
  color: var(--muted);
  opacity: 0.62;
}

.inbox-composer textarea {
  width: 100%;
  min-height: 76px;
  max-height: 180px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-subtle);
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.45;
}

.inbox-composer__footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.inbox-composer__footer > span,
.inbox-composer__status,
.inbox-composer__boundary {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.inbox-composer__status.is-error {
  color: var(--coral-ink);
}

.inbox-composer__footer .mobile-button {
  min-height: 40px;
  white-space: nowrap;
}

.inbox-composer__footer .mobile-icon {
  width: 16px;
  height: 16px;
}

.reply-boundary {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.reply-boundary > span {
  color: var(--amber);
}

.reply-boundary strong {
  display: block;
  color: var(--ink-strong);
  font-size: 0.8rem;
}

.reply-boundary p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.42;
}

.thread-loading {
  padding: 16px;
}

.feature-placeholder {
  display: grid;
  justify-items: start;
  align-content: center;
  min-height: min(540px, 68vh);
  max-width: 620px;
  padding: 38px 4px;
}

.feature-placeholder__icon {
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.feature-placeholder__icon .mobile-icon {
  width: 26px;
  height: 26px;
}

.feature-placeholder--warning .feature-placeholder__icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.feature-placeholder h1 {
  font-size: 2rem;
}

.feature-placeholder > p:not(.eyebrow) {
  max-width: 520px;
  margin: 10px 0 18px;
  color: var(--muted);
}

.wctek-workspace {
  display: grid;
  grid-template-rows: auto auto minmax(84px, 1fr) auto;
  gap: 14px;
  min-height: 0;
  height: 100%;
}

.wctek-guest-allowance {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.wctek-workspace[data-guest-chat] {
  grid-template-areas: "header" "allowance" "conversation" "composer";
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
}

[data-guest-chat] .wctek-header { grid-area: header; padding-bottom: 8px; }
[data-guest-chat] .wctek-guest-allowance { grid-area: allowance; }
[data-guest-chat] .wctek-conversation { grid-area: conversation; min-height: 0; }
[data-guest-chat] .wctek-composer { grid-area: composer; }

.mobile-main--wctek {
  align-content: stretch;
  padding-bottom: 18px;
  overflow-y: hidden;
}

.wctek-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.wctek-header h1 {
  font-size: 1.8rem;
}

.wctek-header p:not(.eyebrow) {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.wctek-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill--accent {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.wctek-sessions {
  min-width: 0;
}

.wctek-session-list {
  display: flex;
  gap: 8px;
  padding: 2px 2px 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.wctek-session {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  flex: 0 0 190px;
  min-width: 0;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.wctek-session > span:first-child {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--muted-strong);
}

.wctek-session > span:last-child {
  display: grid;
  min-width: 0;
}

.wctek-session strong,
.wctek-session small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wctek-session strong {
  font-size: 0.78rem;
}

.wctek-session small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.67rem;
}

.wctek-session[aria-current="true"] {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background: var(--accent-soft);
}

.wctek-sessions__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  margin: 0;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.wctek-sessions__status.is-error {
  color: var(--coral-ink);
}

.wctek-conversation {
  min-width: 0;
  min-height: 84px;
  max-height: none;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.wctek-message-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wctek-message {
  display: flex;
  min-width: 0;
}

.wctek-message--user {
  justify-content: flex-end;
}

.wctek-message__bubble {
  min-width: 0;
  max-width: min(82%, 620px);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.wctek-message--user .wctek-message__bubble {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: var(--accent-soft);
}

.wctek-message.is-pending .wctek-message__bubble {
  opacity: 0.72;
}

.wctek-message__bubble header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.wctek-message__bubble header strong {
  color: var(--ink-strong);
  font-size: 0.75rem;
}

.wctek-message__bubble header span,
.wctek-message__bubble time {
  color: var(--muted);
  font-size: 0.66rem;
}

.wctek-message__bubble p {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 0.88rem;
  white-space: pre-wrap;
}

.wctek-message__bubble time {
  display: block;
  margin-top: 8px;
  text-align: right;
}

.wctek-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 208px;
  color: var(--muted);
  text-align: center;
}

.wctek-empty > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.wctek-empty h2 {
  max-width: 360px;
  color: var(--muted-strong);
  font-size: 0.92rem;
}

.wctek-composer {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.wctek-composer textarea {
  width: 100%;
  min-height: 72px;
  max-height: 180px;
  padding: 8px 9px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.45;
}

.wctek-composer textarea::placeholder {
  color: var(--muted);
}

.wctek-composer__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.wctek-composer__status {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.wctek-composer__status.is-error {
  color: var(--coral-ink);
}

.wctek-composer__count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.68rem;
}

.icon-button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.icon-button:disabled,
.mobile-button:disabled,
.wctek-session:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.mobile-main--account {
  --border: var(--account-border);
  --muted: var(--account-muted);
  gap: 0;
  max-width: 1080px;
  padding: 0 0 32px;
  background: var(--account-band);
}

.account-page__toolbar,
.account-page__toolbar > div,
.account-page__section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-page__toolbar {
  padding: 12px 24px;
  color: var(--muted);
  font-weight: 600;
}

.account-page__identity {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 16px 24px 28px;
}

.account-page__avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 700;
}

.account-page__avatar img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-page__name h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.account-page__name p {
  margin: 12px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.account-page__type {
  font-size: 0.9rem;
}

.account-page__bio {
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.account-page__section {
  padding: 24px;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.account-page__section h2,
.account-page__session h2 {
  margin: 0 0 14px;
  font-size: 1.125rem;
  line-height: 1.35;
}

.account-page__section-heading {
  margin-bottom: 14px;
}

.account-page__section-heading h2 {
  margin: 0;
}

.account-page__empty,
.account-page__section .u-muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.account-page__session {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 24px;
  gap: 24px;
  border-top: 1px solid var(--border);
  background: var(--account-session);
}

.account-page__session > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-page__session > div + div {
  padding-left: 24px;
  border-left: 1px solid var(--border);
}

.account-page__session p { margin: 10px 0 0; }
.account-page__session-detail { color: var(--muted); }

.account-page__companion-tool {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--account-tool-border);
  border-radius: 8px;
  background: var(--account-tool);
}

.account-page__companion-tool > div { min-width: 0; }

.account-page__companion-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.account-page__companion-name {
  margin: 0;
  overflow-wrap: anywhere;
}

.account-page__companion a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--account-tool-border);
  border-radius: 6px;
  background: var(--account-action);
  color: var(--account-action-ink);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.account-page__notice {
  padding: 16px 24px;
  color: var(--coral-ink);
}

.account-page__loading { padding: 16px 24px; color: var(--muted); }

.account-page__items {
  padding: 0;
  margin: 0;
  list-style: none;
}

.account-page__items li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.account-page__section .u-social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 12px;
}

.account-page__section .u-social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--account-session);
  color: var(--ink);
  text-decoration: none;
}

.account-page__section .u-social-link span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-page__section .u-social-link__icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex: 0 0 auto;
}

.account-page__section .u-social-link--large { min-height: 96px; }
.account-page__section .u-social-link--large .u-social-link__icon { width: 48px; height: 48px; }
.account-page__section .u-social-link--small { min-height: 48px; }
.account-page__section .u-social-link--small .u-social-link__icon { width: 24px; height: 24px; }

@media (max-width: 600px) {
  .account-page__toolbar { padding: 10px 18px; }
  .account-page__identity {
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    padding: 12px 18px 24px;
  }
  .account-page__avatar { width: 96px; height: 96px; }
  .account-page__name h1 { font-size: 1.375rem; }
  .account-page__section,
  .account-page__session { padding: 22px 18px; }
  .account-page__session { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .account-page__session > div + div {
    padding: 20px 0 0;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .account-page__companion-tool { flex-direction: column; align-items: stretch; gap: 16px; }
}

.profile-summary {
  display: grid;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.profile-summary__heading {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.avatar--profile {
  width: 64px;
  height: 64px;
  font-size: 1rem;
}

.profile-summary__heading p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.profile-tool,
.profile-panel-heading,
.settings-form,
.settings-group,
.social-link-row,
.review-editor,
.provider-card {
  min-width: 0;
}

.profile-tool {
  display: grid;
  gap: 22px;
}

.profile-panel-heading {
  display: grid;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.profile-panel-heading .back-button {
  justify-self: start;
}

.profile-panel-heading h1 {
  font-size: 1.55rem;
}

.profile-panel-heading p:not(.eyebrow) {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-form--divided {
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.settings-form--divided h2 {
  font-size: 1rem;
}

.settings-form--divided > div > p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.settings-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--ink-strong);
  font-size: 0.8rem;
  font-weight: 730;
}

.settings-field input,
.settings-field select,
.settings-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.45;
}

.settings-field textarea {
  min-height: 156px;
  resize: vertical;
}

.settings-field--compact input {
  min-width: 132px;
}

.settings-toolbar,
.settings-inline,
.settings-form__footer,
.provider-card__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-toolbar,
.settings-form__footer {
  justify-content: space-between;
}

.settings-inline > .settings-field {
  flex: 1 1 auto;
}

.settings-inline > .mobile-button {
  align-self: end;
}

.settings-form__status {
  flex: 1 1 auto;
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.settings-form__status.is-error {
  color: var(--coral-ink);
}

.settings-form__footer .mobile-button:disabled,
.settings-toolbar .mobile-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.toggle-field {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 680;
  line-height: 1.5;
}

.toggle-field input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.social-link-row,
.settings-group {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.social-link-row {
  grid-template-columns: minmax(0, 1fr);
}

.social-link-row legend,
.settings-group legend {
  max-width: calc(100% - 8px);
  padding: 0 4px;
  color: var(--ink-strong);
  font-size: 0.83rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.social-link-row__toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.icon-button--danger {
  color: var(--coral-ink);
}

.checkin-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 0.42fr);
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.checkin-slot:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.review-layout {
  display: grid;
  gap: 18px;
}

.review-draft-list {
  display: grid;
  gap: 8px;
}

.review-draft-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.review-draft-row.is-selected {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--accent-soft);
}

.review-draft-row:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.review-draft-row > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.review-draft-row > span:last-child {
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  color: var(--muted);
  text-align: right;
}

.review-draft-row strong {
  overflow-wrap: anywhere;
  color: var(--ink-strong);
  font-size: 0.82rem;
}

.review-draft-row small {
  color: var(--muted);
  font-size: 0.7rem;
}

.review-editor blockquote {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--surface-subtle);
  color: var(--muted-strong);
  font-size: 0.79rem;
  line-height: 1.5;
}

.review-editor blockquote span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
}

.safety-note {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--muted-strong);
}

.safety-note p {
  margin: 0;
  font-size: 0.76rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
}

.metric-grid > div {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 13px;
  background: var(--surface);
}

.metric-grid dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.metric-grid dd {
  margin: 0;
  color: var(--ink-strong);
  font-size: 0.86rem;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.file-picker {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 92px;
  padding: 16px;
  overflow: hidden;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.file-picker > span {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
}

.file-picker strong {
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}

.file-picker input {
  position: absolute;
  inset: 0;
  cursor: pointer;
  opacity: 0;
}

.provider-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.provider-card > header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.provider-card > header h2 {
  font-size: 0.96rem;
}

.provider-card > header p:not(.eyebrow),
.provider-card__message,
.panel-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.provider-indicators {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--border);
}

.provider-indicators > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.provider-indicators dt,
.provider-indicators dd {
  margin: 0;
  font-size: 0.75rem;
}

.provider-indicators dt {
  color: var(--muted);
}

.provider-indicators dd {
  color: var(--ink-strong);
  font-weight: 720;
  text-align: right;
}

.provider-card__actions {
  flex-wrap: wrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.companion-settings {
  display: grid;
  gap: 20px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.companion-form,
.companion-form__fields {
  display: grid;
  gap: 18px;
}

.companion-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.companion-field__label {
  color: var(--ink-strong);
  font-size: 0.82rem;
  font-weight: 760;
}

.companion-field input,
.companion-field select,
.companion-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.45;
}

.companion-field select {
  padding-right: 34px;
}

.companion-field textarea {
  min-height: 116px;
  resize: vertical;
}

.companion-field input::placeholder,
.companion-field textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.companion-field small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.companion-policy {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 2px 0 0;
  padding: 18px 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.companion-policy legend {
  padding: 0;
  color: var(--ink-strong);
  font-size: 0.9rem;
  font-weight: 800;
}

.companion-policy__status {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.companion-policy__status--success {
  color: var(--success);
}

.companion-policy__status--warning {
  color: var(--amber);
}

.companion-policy__documents {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.companion-policy__documents a,
.companion-policy__documents span {
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 690;
}

.companion-policy__documents a {
  color: var(--blue);
}

.companion-policy__accept {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.5;
}

.companion-policy__accept input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.companion-form__actions {
  display: grid;
  gap: 10px;
}

.companion-form__actions .mobile-button {
  width: 100%;
}

.companion-form__actions .mobile-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.companion-form__status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.companion-form__status.is-error {
  color: var(--coral-ink);
}

.profile-facts {
  display: grid;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.profile-facts > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.42fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
}

.profile-facts > div:last-child {
  border-bottom: 0;
}

.profile-facts dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 690;
}

.profile-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-strong);
  font-size: 0.84rem;
  font-weight: 720;
  text-align: right;
}

.session-actions {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.session-actions__icon {
  background: var(--success-soft);
  color: var(--success);
}

.session-actions__copy p:not(.eyebrow) {
  max-width: 560px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.session-actions__buttons {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.session-actions__buttons .mobile-button {
  flex: 1 1 180px;
  width: 100%;
}

.auth-panel {
  display: grid;
  justify-items: start;
  width: 100%;
  min-width: 0;
  max-width: 420px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-large);
}

.auth-panel > * {
  min-width: 0;
  max-width: 100%;
}

.auth-panel__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-panel__identity > strong {
  color: var(--ink-strong);
  font-size: 1.05rem;
  font-weight: 850;
}

.auth-panel__mark {
  display: block;
  width: 72px;
  height: 72px;
}

.auth-panel h1 {
  font-size: 1.8rem;
}

.auth-panel > p:not(.eyebrow) {
  margin: 9px 0 22px;
  color: var(--muted);
}

.auth-panel .state-panel__icon {
  margin-bottom: 20px;
  background: var(--amber-soft);
  color: var(--amber);
}

.auth-form {
  display: grid;
  gap: 15px;
  width: 100%;
}

.auth-field {
  display: grid;
  gap: 7px;
  width: 100%;
  color: var(--ink-strong);
  font-size: 0.82rem;
  font-weight: 760;
}

.auth-field > input,
.auth-password-control > input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: 0;
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 1rem;
}

.auth-field input::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.auth-password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.auth-password-control > input {
  border-radius: 8px 0 0 8px;
}

.auth-password-control > button {
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: var(--surface-raised);
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 760;
  cursor: pointer;
}

.auth-password-control > button .mobile-icon {
  width: 19px;
  height: 19px;
  margin: auto;
}

.auth-form__error {
  width: 100%;
  margin: -2px 0 0;
  padding: 10px 11px;
  border-left: 3px solid var(--coral);
  background: var(--coral-soft);
  color: var(--coral-ink);
  font-size: 0.78rem;
  line-height: 1.45;
}

.auth-divider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: var(--border);
  content: "";
}

.auth-form__provider-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.mobile-spinner--small {
  width: 18px;
  height: 18px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.42);
  border-top-color: #ffffff;
}

#epic-mobile-root[data-mobile-session-state="unauthenticated"][data-mobile-appearance] {
  color-scheme: dark;
  --canvas: #0f1117;
  --surface: #171a23;
  --surface-subtle: #1d202a;
  --surface-raised: #1f222d;
  --ink: #f4f3f7;
  --ink-strong: #ffffff;
  --muted: #a8a7b2;
  --muted-strong: #d2d0d8;
  --border: #303440;
  --border-strong: #474c5b;
  --accent: #6f3cc3;
  --accent-strong: #d6a63b;
  --accent-soft: #2a203d;
  --brand-ink: #0f1015;
  --brand-paper: #f5f2fa;
  --shadow-large: 0 18px 50px rgba(0, 0, 0, 0.34);
}

#epic-mobile-root[data-mobile-session-state="unauthenticated"] .app-header {
  background: rgba(15, 17, 23, 0.96);
}

#epic-mobile-root[data-mobile-session-state="unauthenticated"] .auth-panel {
  border-color: #303440;
  background: #171a23;
}

#epic-mobile-root[data-mobile-session-state="unauthenticated"] .auth-panel .eyebrow {
  color: #d6a63b;
}

#epic-mobile-root[data-mobile-session-state="unauthenticated"] .auth-panel .mobile-button {
  border-color: #8251cf;
  background: #6f3cc3;
  color: #ffffff;
}

#epic-mobile-root[data-mobile-session-state="unauthenticated"] .auth-panel .mobile-button--secondary {
  border-color: #4b405f;
  background: #1d202a;
  color: #f4f3f7;
}

#epic-mobile-root[data-mobile-session-state="unauthenticated"] .auth-field > input,
#epic-mobile-root[data-mobile-session-state="unauthenticated"] .auth-password-control > input,
#epic-mobile-root[data-mobile-session-state="unauthenticated"] .auth-password-control > button {
  border-color: #3c4050;
  background: #1d202a;
}

#epic-mobile-root[data-mobile-session-state="unauthenticated"] .auth-form__error {
  background: #2f1e25;
  color: #ffb7b0;
}

.mobile-toast {
  position: fixed;
  right: 14px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 60;
  width: min(360px, calc(100vw - 28px));
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--brand-paper) 18%, transparent);
  border-radius: 8px;
  background: var(--brand-ink);
  color: var(--brand-paper);
  box-shadow: var(--shadow-large);
  font-size: 0.8rem;
  line-height: 1.4;
}

.bottom-navigation {
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  min-height: 68px;
  padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(18px);
}

.nav-item {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 54px;
  padding: 4px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.nav-item .mobile-icon {
  width: 20px;
  height: 20px;
}

.nav-item span {
  max-width: 100%;
  overflow: visible;
  font-size: 0.64rem;
  font-weight: 720;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.nav-item[aria-current="page"] {
  color: var(--accent-strong);
}

.nav-item[aria-current="page"]::before {
  position: absolute;
  top: 2px;
  width: 26px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.brand-lockup:focus-visible,
.icon-button:focus-visible,
.mobile-button:focus-visible,
.text-link:focus-visible,
.conversation-row:focus-visible,
.wctek-session:focus-visible,
.wctek-composer textarea:focus-visible,
.tool-card:focus-visible,
.back-button:focus-visible,
.history-button:focus-visible,
.nav-item:focus-visible,
.auth-field input:focus-visible,
.auth-password-control > button:focus-visible,
.companion-field input:focus-visible,
.companion-field select:focus-visible,
.companion-field textarea:focus-visible,
.companion-policy__accept input:focus-visible,
.companion-policy__documents a:focus-visible,
.settings-field input:focus-visible,
.settings-field select:focus-visible,
.settings-field textarea:focus-visible,
.inbox-choice input:focus-visible,
.inbox-filter-backdrop:focus-visible,
.toggle-field input:focus-visible,
.review-draft-row:focus-visible,
.file-picker:focus-within {
  outline: 3px solid color-mix(in srgb, var(--blue) 42%, transparent);
  outline-offset: 2px;
}

@media (hover: hover) {
  .conversation-row:hover,
  .inbox-choice:hover,
  .wctek-session:hover,
  .tool-card:hover,
  .review-draft-row:hover,
  .file-picker:hover,
  .icon-button:hover,
  .mobile-button--secondary:hover {
    border-color: var(--border-strong);
    background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface));
  }

  .nav-item:hover,
  .text-link:hover,
  .back-button:hover {
    color: var(--accent-strong);
  }
}

@media (min-width: 620px) {
  .tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-card {
    grid-template-columns: 40px minmax(0, 1fr);
    align-content: start;
    min-height: 174px;
  }

  .tool-card__arrow {
    display: none;
  }

  .content-section--profile-hub .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .social-link-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .social-link-row legend,
  .social-link-row__toolbar,
  .social-link-row .settings-field--wide {
    grid-column: 1 / -1;
  }
}

@media (min-width: 760px) {
  #epic-mobile-root {
    padding-bottom: 12px;
  }

  .app-header {
    padding-right: 24px;
    padding-left: 24px;
  }

  .mobile-main--stack {
    padding: 30px 26px 40px;
  }

  .mobile-main--inbox {
    display: grid;
    grid-template-columns: minmax(310px, 0.82fr) minmax(400px, 1.18fr);
    border-right: 1px solid var(--border);
    border-left: 1px solid var(--border);
  }

  .inbox-pane {
    display: block;
    padding: 22px 18px 30px;
  }

  .inbox-pane--list,
  .mobile-main--inbox.has-thread .inbox-pane--list {
    display: block;
    border-right: 1px solid var(--border);
  }

  .inbox-pane--detail,
  .mobile-main--inbox.has-thread .inbox-pane--detail {
    display: block;
    padding: 0;
  }

  .inbox-filter-layer {
    justify-items: end;
    align-items: stretch;
  }

  .inbox-filter-sheet {
    width: min(430px, 92vw);
    max-height: none;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
  }

  .thread-view > .back-button {
    display: none;
  }

  .thread-header {
    padding-top: 18px;
  }

  .thread-body {
    padding: 18px 18px 24px;
  }

  .bottom-navigation {
    justify-self: center;
    width: min(640px, calc(100% - 48px));
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-large);
  }

  .session-actions {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
  }

  .session-actions__buttons {
    grid-column: auto;
    justify-content: flex-end;
  }

  .session-actions__buttons .mobile-button {
    flex: 0 0 auto;
    width: auto;
  }

  .companion-form__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .companion-field--base-personality,
  .companion-field--hard-refusals,
  .companion-field--soft-boundaries {
    grid-column: 1 / -1;
  }

  .companion-form__actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .companion-form__actions .mobile-button {
    width: auto;
  }

  .wctek-workspace {
    grid-template-areas:
      "header header"
      "sessions conversation"
      "sessions composer";
    grid-template-columns: minmax(190px, 0.34fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(300px, 1fr) auto;
  }

  .wctek-header {
    grid-area: header;
  }

  .wctek-sessions {
    grid-area: sessions;
    padding-right: 12px;
    border-right: 1px solid var(--border);
  }

  .wctek-session-list {
    display: grid;
    overflow: visible;
  }

  .wctek-session {
    width: 100%;
  }

  .wctek-conversation {
    grid-area: conversation;
    max-height: none;
  }

  .wctek-composer {
    grid-area: composer;
  }

  .review-layout {
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
    align-items: start;
  }
}

@media (min-width: 760px) and (max-height: 500px) {
  #epic-mobile-root {
    padding-bottom: 0;
  }

  .app-header {
    min-height: 64px;
  }

  .thread-header {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 14px 9px;
  }

  .avatar--large {
    width: 44px;
    height: 44px;
  }

  .thread-body {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .reply-boundary {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .bottom-navigation {
    min-height: 60px;
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .mobile-main--wctek {
    padding: 8px 16px;
  }

  .wctek-workspace {
    grid-template-areas:
      "header conversation"
      "sessions conversation"
      "sessions composer";
    grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px 14px;
  }

  .wctek-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-bottom: 8px;
  }

  .wctek-header .eyebrow,
  .wctek-header p:not(.eyebrow),
  .wctek-header__actions .status-pill {
    display: none;
  }

  .wctek-header h1 {
    align-self: center;
    font-size: 1.2rem;
  }

  .wctek-sessions {
    min-height: 0;
    overflow-y: auto;
  }

  .wctek-session-list {
    overflow-y: auto;
  }

  .wctek-conversation {
    min-height: 0;
    padding: 10px;
  }

  .wctek-composer {
    gap: 4px;
    padding: 7px;
  }

  .wctek-composer textarea {
    min-height: 44px;
    height: 44px;
    max-height: 72px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
}

@media (max-width: 420px) {
  .brand-copy small {
    display: none;
  }

  .app-header__account {
    width: min(210px, 60vw);
  }

  .account-overview {
    display: grid;
  }

  .account-overview .status-pill {
    justify-self: start;
  }

  .section-heading {
    align-items: center;
  }

  .section-heading p:not(.eyebrow) {
    display: none;
  }

  .inbox-list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .inbox-list-toolbar > span {
    min-height: 18px;
  }

  .inbox-filter-button {
    width: 100%;
  }

  .inbox-list-actions .inbox-filter-button {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .inbox-filter-grid,
  .inbox-filter-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .inbox-filter-actions .mobile-button {
    width: 100%;
  }

  .settings-inline,
  .settings-form__footer,
  .provider-card > header {
    align-items: stretch;
  }

  .settings-inline,
  .settings-form__footer {
    flex-direction: column;
  }

  .settings-inline > *,
  .settings-form__footer .mobile-button {
    width: 100%;
  }

  .provider-card > header {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .provider-card > header .status-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .wctek-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .wctek-header p:not(.eyebrow) {
    display: none;
  }

  .wctek-header__actions {
    justify-content: space-between;
  }

  .wctek-message__bubble {
    max-width: 92%;
  }

  .wctek-composer__footer .mobile-button {
    width: auto;
  }
}

@media (max-width: 340px) {
  .app-header {
    padding-right: 10px;
    padding-left: 10px;
  }

  .brand-copy {
    display: none;
  }

  .app-header__account {
    width: calc(100% - 48px);
  }

  .nav-item span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .bottom-navigation {
    min-height: 58px;
  }

  .nav-item {
    min-height: 46px;
  }

  .profile-facts > div {
    grid-template-columns: 1fr;
  }

  .profile-facts dd {
    text-align: left;
  }

  .metric-grid,
  .checkin-slot {
    grid-template-columns: 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  #epic-mobile-root[data-mobile-appearance="system"] {
    color-scheme: dark;
    --canvas: #101613;
    --surface: #171f1b;
    --surface-subtle: #1c2822;
    --surface-raised: #202b25;
    --ink: #edf4f0;
    --ink-strong: #ffffff;
    --muted: #a5b3ab;
    --muted-strong: #c2cec7;
    --border: #334139;
    --border-strong: #46564d;
    --accent-strong: #69d9b6;
    --accent-soft: #173d31;
    --blue: #8db3ff;
    --blue-soft: #1d3158;
    --coral-ink: #ff9b92;
    --coral-soft: #4a2522;
    --amber: #f0c76a;
    --amber-soft: #3d331b;
    --success: #62d9a2;
    --success-soft: #173b2d;
    --brand-ink: #e7f6ee;
    --brand-paper: #10231b;
    --account-band: #181a20;
    --account-session: #20232b;
    --account-tool: #1c3038;
    --account-tool-border: #385865;
    --account-action: #35334e;
    --account-action-ink: #f0edf9;
    --account-border: #353941;
    --account-muted: #b0b9c5;
    --shadow-small: 0 2px 10px rgba(0, 0, 0, 0.2);
    --shadow-large: 0 18px 50px rgba(0, 0, 0, 0.34);
  }

  #epic-mobile-root[data-mobile-appearance="system"][data-mobile-accent="blue"] {
    --accent-strong: #8db3ff;
    --accent-soft: #1d3158;
  }

  #epic-mobile-root[data-mobile-appearance="system"][data-mobile-accent="coral"] {
    --accent-strong: #ff9b92;
    --accent-soft: #4a2522;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
.sms-sync-dialog { color: var(--text, #f5f5f5); background: #181b20; border: 1px solid #41454d; border-radius: 8px; width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 20px; overflow: auto; box-sizing: border-box; }
.sms-sync-dialog::backdrop { background: rgb(0 0 0 / 70%); }
.sms-sync-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sms-sync-dialog h2 { font-size: 20px; color: #f5f5f5; margin: 0; }
.sms-sync-dialog header button { width: 44px; height: 44px; padding: 10px; flex: 0 0 44px; color: inherit; background: transparent; border: 1px solid #41454d; border-radius: 6px; }
.sms-sync-dialog svg { width: 20px; height: 20px; flex-shrink: 0; }
.sms-sync-dialog dl { margin: 16px 0; }
.sms-sync-dialog dl div { padding: 8px 0; border-bottom: 1px solid #41454d; }
.sms-sync-dialog dt { color: #b7c1cd; font-size: 12px; }
.sms-sync-dialog dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.sms-sync-dialog fieldset { border: 0; padding: 0; margin: 20px 0; min-width: 0; }
.sms-sync-dialog legend { font-size: 16px; font-weight: 700; }
.sms-sync-dialog label { display: grid; gap: 6px; margin-top: 14px; }
.sms-sync-dialog input:not([type=checkbox]), .sms-sync-dialog select, .sms-sync-dialog textarea { min-width: 0; width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px; border: 1px solid #51565d; border-radius: 6px; background: #22262c; color: #f5f5f5; font: inherit; color-scheme: dark; }
.sms-sync-dialog textarea { resize: vertical; margin-bottom: 16px; }
.sms-sync-dialog .sms-sync-consent { display: flex; align-items: start; gap: 12px; }
.sms-sync-consent input { flex-shrink: 0; width: 20px; height: 20px; }
.sms-sync-dialog p { line-height: 1.5; font-size: 13px; overflow-wrap: anywhere; }
.sms-sync-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.sms-sync-dialog .mobile-button { min-height: 44px; white-space: normal; font-size: 13px; }
.sms-sync-dialog .mobile-button--secondary { background: #24292f; color: #f5f5f5; border-color: #51565d; }
.sms-sync-dialog .is-error { color: #ffb4ab; }
[data-mobile-sms-open][hidden] { display: none; }
[data-mobile-sms-reply][hidden] { display: none; }
