/**
 * Txtrol (smstrol) /app: suite theme parity (2026-06-10).
 * Class prefix: st-  ·  list rows: st-thread-card / st-msg-bubble
 */

html, body {
  background-color: var(--surface-base, #141c14);
  color: var(--text-strong, #d9e8c8);
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--family-bright, #86efac); text-decoration: none; }
a:hover { color: var(--family, #22c55e); text-decoration: underline; }
code { font-family: var(--font-mono, ui-monospace, Consolas, monospace); font-size: 0.92em; }
h1, h2, h3 { font-family: var(--font-heading, var(--font-body, system-ui)); }

/* === Backdrop continuity: one continuous surface under sidebar + main === */
html[data-trol-island-texture] body.st-app,
html[data-trol-texture] body.st-app {
  background-color: transparent !important;
  background-image: none !important;
}
html[data-trol-island-texture] .st-sidebar,
html[data-trol-island-texture] .st-shell,
html[data-trol-island-texture] .st-wrap,
html[data-trol-texture] .st-sidebar,
html[data-trol-texture] .st-shell,
html[data-trol-texture] .st-wrap {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}
html[data-trol-island-texture] .st-sidebar-nav,
html[data-trol-island-texture] .st-sidebar-foot,
html[data-trol-texture] .st-sidebar-nav,
html[data-trol-texture] .st-sidebar-foot {
  background: transparent !important;
  background-color: transparent !important;
}

/* === Sign-in header (no session) === */
.st-app-header {
  display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  background: var(--surface-card); border-bottom: 1px solid var(--border-soft);
  box-shadow: var(--shadow-elev); position: sticky; top: 0; z-index: 20;
}
.st-app-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.st-app-logo:hover { text-decoration: none; }
.st-app-logo img { height: 56px; width: auto; display: block; }
.st-app-wordmark {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text-strong); line-height: 1;
}
.st-app-wordmark::first-letter { color: var(--family-bright); }
.st-app-user { margin-left: auto; font-size: 12.5px; color: var(--text-muted); }
.st-app-suite { font-style: italic; }

/* === Sidebar shell === */
.st-shell { min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.st-sidebar {
  display: none; width: 220px; background: transparent; border-right: none;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 120;
  flex-direction: column; padding: 12px 10px 14px; box-sizing: border-box;
}
.st-sidebar-brand {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  text-decoration: none; margin-bottom: 10px;
}
.st-sidebar-brand:hover { text-decoration: none; transform: scale(1.03); }
.st-sidebar-wordmark { font-size: 18px; font-weight: 700; color: var(--text-strong); }
.st-sidebar-wordmark::first-letter { color: var(--family-bright); }
.st-sidebar-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0;
  display: flex; flex-direction: column; gap: 10px;
  background: transparent; scrollbar-width: thin;
}
.st-sidebar-link {
  display: block; padding: 9px 12px; color: var(--text-muted);
  font-size: 13.5px; font-weight: 600; text-decoration: none; border-radius: 8px;
}
.st-sidebar-link:hover { color: var(--family-bright); text-decoration: none; box-shadow: none; }
.st-sidebar-link.is-active {
  color: var(--family-bright);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--family) 30%, transparent);
}
.trol-island-folder__body > .st-sidebar-link:hover,
.trol-island-folder__body > .st-sidebar-link.is-active {
  border: none; border-radius: 0; background: transparent; box-shadow: none;
}
.st-sidebar-foot { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.st-sidebar-user { padding: 10px 12px; }
.st-sidebar-tenant { font-size: 12.5px; font-weight: 600; color: var(--text-strong); }
.st-sidebar-theme-trigger {
  width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--family) 25%, transparent);
  color: var(--text-muted); font-size: 12.5px; font-weight: 600;
  font-family: inherit; cursor: pointer; background: transparent;
}
.st-sidebar-theme-trigger:hover {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--family-bright) 28%, transparent);
}
.st-sidebar-logout {
  display: block; padding: 10px 12px; border-radius: 10px; text-align: center;
  color: var(--family-bright); font-size: 12.5px; font-weight: 600; text-decoration: none;
}
.st-sidebar-logout:hover { text-decoration: none; }
.st-sidebar-island {
  background: var(--surface-card); border: 1px solid var(--border-soft);
  border-radius: var(--trol-panel-radius, 12px); box-shadow: var(--trol-island-shadow, var(--shadow-elev));
  position: relative; isolation: isolate;
}
.st-topbar {
  display: none; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft); background: color-mix(in srgb, var(--surface-card) 70%, transparent);
  position: sticky; top: 0; z-index: 30;
}
.st-hamburger {
  width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.st-hamburger span { display: block; width: 20px; height: 2px; background: var(--text-strong); border-radius: 1px; }
.st-topbar-title { font-size: 15px; font-weight: 700; color: var(--text-strong); }
.st-nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 110; }
body.st-has-sidebar .st-sidebar { display: flex; }
body.st-has-sidebar .st-shell { margin-left: 220px; width: calc(100% - 220px); }
.st-wrap { padding: 28px 18px 100px; max-width: 960px; margin: 0 auto; box-sizing: border-box; }

@media (max-width: 768px) {
  body.st-has-sidebar .st-sidebar {
    transform: translateX(-110%); transition: transform .2s ease;
    background: var(--surface-card); box-shadow: var(--shadow-elev);
  }
  body.st-sidebar-open .st-sidebar { transform: translateX(0); }
  body.st-sidebar-open .st-nav-overlay { display: block; }
  body.st-has-sidebar .st-shell { margin-left: 0; width: 100%; }
  .st-topbar { display: flex; }
  body.st-scroll-locked { overflow: hidden; }
}

/* === Page chrome === */
.st-pagetitle {
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px;
  color: var(--text-strong);
}
.st-sub { color: var(--text-muted); margin: 0 0 22px; font-size: 14px; }
.st-back-row { margin: 0 0 8px; }
.st-back-link { font-size: 13px; font-weight: 600; color: var(--family-bright); }
.st-card, .st-inbox-panel, .st-thread-panel {
  background: var(--surface-card); border: 1px solid var(--border-soft);
  border-radius: var(--trol-panel-radius, 14px); padding: 16px 18px; margin-bottom: 18px;
  box-shadow: var(--trol-island-shadow, var(--shadow-elev));
  position: relative; isolation: isolate;
}
.st-card-title, .st-list-title {
  margin: 0 0 12px; font-size: 16px; font-weight: 700;
  color: var(--ts-float-listRow-title-color, var(--text-strong));
}
.st-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.st-list-meta { font-size: 12px; color: var(--ts-float-listRow-subtitle-color, var(--text-muted)); }
.st-empty { color: var(--ts-float-listRow-subtitle-color, var(--text-muted)); font-style: italic; margin: 0; }

.st-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.st-stat { padding: 14px 16px; }
.st-stat-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ts-float-listRow-subtitle-color, var(--text-muted)); font-weight: 700; margin-bottom: 4px;
}
.st-stat-value {
  font-size: 26px; font-weight: 800; color: var(--ts-float-listRow-title-color, var(--text-strong));
  line-height: 1.1;
}

/* === Conversation list (Theme Studio listRow typography) === */
.st-thread-scroll {
  list-style: none; margin: 0; padding: 2px 4px 6px;
  display: flex; flex-direction: column; gap: 10px;
  background: transparent; border: none; box-shadow: none;
}
.st-thread-item { margin: 0; padding: 0; }
.st-thread-card {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start;
  padding: 14px 16px; text-decoration: none; color: inherit;
  background: var(--surface-card); border: 1px solid var(--border-soft);
  border-radius: var(--trol-panel-radius, 12px);
  box-shadow: var(--trol-island-shadow, var(--shadow-elev));
  position: relative; isolation: isolate;
  transition: border-color .12s, box-shadow .12s;
}
.st-thread-card:hover {
  border-color: color-mix(in srgb, var(--family-bright, #86efac) 60%, var(--border-soft));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--family-bright, #86efac) 35%, transparent);
  text-decoration: none;
  transform: none;
}
.st-thread-unread { border-left: 3px solid var(--family-bright); }
.st-thread-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, var(--family, #22c55e) 22%, transparent);
  color: var(--ts-float-listRow-title-color, var(--text-strong));
  font-size: 14px; font-weight: 800;
  border: 1px solid color-mix(in srgb, var(--family, #22c55e) 35%, transparent);
}
.st-thread-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-thread-line1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.st-thread-name {
  font-size: 15px; font-weight: 700; line-height: 1.35;
  color: var(--ts-float-listRow-title-color, var(--text-strong));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
}
.st-thread-when {
  font-size: 11.5px; font-weight: 500; white-space: nowrap; flex-shrink: 0;
  color: var(--ts-float-listRow-subtitle-color, var(--text-muted));
}
.st-thread-line2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.st-thread-preview {
  font-size: 13.5px; line-height: 1.35; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ts-float-listRow-subtitle-color, var(--text-muted));
}
.st-thread-unread .st-thread-preview { font-weight: 600; }
.st-thread-meta {
  font-size: 11.5px; line-height: 1.35;
  color: var(--ts-float-listRow-subtitle-color, var(--text-muted));
}
.st-thread-badge {
  flex-shrink: 0; min-width: 22px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-align: center;
  background: var(--family); color: color-mix(in srgb, var(--surface-base, #141c14) 15%, #fff);
}

/* === Message thread bubbles === */
.st-msg-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.st-msg-item { margin: 0; display: flex; }
.st-msg-item .st-msg-out { margin-left: auto; }
.st-msg-bubble {
  max-width: min(100%, 640px); padding: 12px 14px;
  background: var(--surface-card); border: 1px solid var(--border-soft);
  border-radius: var(--trol-panel-radius, 12px);
  box-shadow: var(--trol-island-shadow, var(--shadow-elev));
  position: relative; isolation: isolate;
}
.st-msg-out { border-color: color-mix(in srgb, var(--family) 35%, var(--border-soft)); }
.st-msg-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.st-msg-sender {
  font-size: 14px; font-weight: 700;
  color: var(--ts-float-listRow-title-color, var(--text-strong));
}
.st-msg-when {
  font-size: 11px; font-weight: 500;
  color: var(--ts-float-listRow-subtitle-color, var(--text-muted));
}
.st-msg-body {
  margin: 0 0 8px; font-size: 14px; line-height: 1.45; white-space: pre-wrap;
  color: var(--ts-float-listRow-subtitle-color, var(--text-muted));
}
.st-msg-meta {
  font-size: 11px;
  color: var(--ts-float-listRow-subtitle-color, var(--text-muted));
}

.st-plain-list { margin: 0; padding-left: 18px; color: var(--ts-float-listRow-subtitle-color, var(--text-muted)); }
.st-plain-list li { margin-bottom: 6px; }

/* === Login === */
.st-login-card { max-width: 520px; }
.st-login-form { display: flex; flex-direction: column; gap: 10px; }
.st-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.st-input {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-soft);
  background: var(--surface-elev); color: var(--text-strong); font: inherit;
}
.st-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border-soft);
  background: transparent; color: var(--text-strong); font: inherit; font-weight: 600; cursor: pointer;
}
.st-btn-primary { background: var(--family); color: color-mix(in srgb, var(--surface-base, #141c14) 10%, #fff); border-color: transparent; }
.st-btn-primary:hover { background: var(--family-bright); }

/* Legacy theme sheet classes (Contactrol picker compat) */
.ct-bottom-sheet {
  position: fixed; inset: auto 0 0 0; max-height: 85vh;
  background: var(--surface-elev); color: var(--text-strong);
  border-radius: 16px 16px 0 0; box-shadow: var(--shadow-elev);
  z-index: 200; overflow: auto; padding: 12px 16px 24px;
}
.ct-bottom-sheet[hidden] { display: none !important; }
.ct-sheet-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ct-sheet-title { margin: 0; font-size: 1rem; color: var(--text-strong); }
.ct-sheet-close { border: 0; background: transparent; color: var(--text-strong); font-size: 1.4rem; cursor: pointer; }
.ct-sheet-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin: 12px 0 6px;
}
.ct-sheet-theme-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 8px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-strong);
  cursor: pointer; text-align: left; font: inherit;
}
.ct-sheet-theme-row--active { background: var(--family-soft); }
.st-theme-toast, .ct-theme-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 10px 16px; background: var(--surface-elev); color: var(--text-strong);
  border-radius: 8px; box-shadow: var(--shadow-elev); z-index: 300; opacity: 0; transition: opacity .2s;
}
.st-theme-toast.is-visible, .ct-theme-toast.is-visible { opacity: 1; }

/* Shared brand hard-refresh hover/lightbox (Contactrol parity). */
.trol-brand-hover-pop {
  position: absolute; z-index: 9998;
  background: rgba(20, 16, 12, 0.96);
  border: 1px solid rgba(212,165,116,0.35);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.55);
  opacity: 0; transform: translateY(-6px) scale(0.96);
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}
.trol-brand-hover-pop.is-open { opacity: 1; transform: translateY(0) scale(1); }
.trol-brand-hover-pop img {
  display: block; width: 320px; height: 320px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}
.trol-brand-lightbox {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; transition: opacity 0.18s ease;
  cursor: zoom-out;
}
.trol-brand-lightbox.is-open { opacity: 1; }
.trol-brand-lightbox img {
  max-width: min(92vw, 900px); max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transform: scale(0.96); transition: transform 0.18s ease;
}
.trol-brand-lightbox.is-open img { transform: scale(1); }
.trol-brand-lightbox-close {
  position: absolute; top: 18px; right: 18px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: #fff; border: none;
  font-size: 24px; line-height: 1; cursor: pointer;
}
.trol-brand-lightbox-close:hover { background: rgba(255,255,255,0.22); }


/* === Suite wordmark unification (homogeneous treatment across all *trol apps; matches contactrol) === */
.st-app-wordmark, .st-sidebar-wordmark {
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif) !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}
.st-app-wordmark::first-letter, .st-sidebar-wordmark::first-letter {
  color: inherit !important;
}
