/* ===================================================================
   Trendex WA Portal v5 — design system
   Light, airy SaaS console: fixed sidebar, soft cards, emerald accent.
   =================================================================== */

:root {
	/* Light theme = the Trendex green palette. */
	--tp-bg:          #EAF5F0;
	--tp-panel:       #FFFFFF;
	--tp-panel-2:     #F4FBF7;
	--tp-line:        #D3E9DE;
	--tp-line-soft:   #E6F4EC;
	--tp-ink:         #0B2119;
	--tp-ink-2:       #3B5A4D;
	--tp-muted:       #789185;
	--tp-accent:      #0F9D76;
	--tp-accent-ink:  #086047;
	--tp-accent-soft: #D5F1E5;
	--tp-dark:        #0B3D2E;
	--tp-blue:        #2E7CF6;
	--tp-blue-soft:   #E8F0FE;
	--tp-violet:      #7C5CFF;
	--tp-violet-soft: #EEEAFE;
	--tp-amber:       #F0A32B;
	--tp-amber-soft:  #FDF2DE;
	--tp-rose:        #E8536B;
	--tp-rose-soft:   #FDE9EC;
	--tp-radius:      16px;
	--tp-radius-sm:   11px;
	--tp-shadow:      0 1px 2px rgba(17,27,24,.04), 0 8px 24px rgba(17,27,24,.05);
	--tp-shadow-lg:   0 24px 60px rgba(17,27,24,.16);
	--tp-sidebar:     264px;
	--tp-font:        'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}



/* Section tabs (Bots: message bots / automations / builders) */
.tp-tabs {
	display: flex; gap: 4px; padding: 4px; margin-bottom: 16px;
	background: var(--tp-panel); border: 1px solid var(--tp-line);
	border-radius: 999px; box-shadow: var(--tp-shadow); overflow-x: auto;
}
.tp-tab {
	flex: 1; min-width: 110px; border: 0; background: transparent; border-radius: 999px;
	padding: 9px 16px; font-size: 13px; font-weight: 700; color: var(--tp-ink-2); white-space: nowrap;
}
.tp-tab:hover { background: var(--tp-line-soft); }
.tp-tab.on { background: var(--tp-accent-soft); color: var(--tp-accent-ink); }

.tp-builders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tp-builder {
	border: 1px solid var(--tp-line); border-radius: var(--tp-radius); padding: 20px;
	background: var(--tp-panel-2); display: flex; flex-direction: column; gap: 9px;
	transition: border-color .15s, transform .12s;
}
.tp-builder:hover { border-color: var(--tp-accent); transform: translateY(-2px); }
.tp-builder-ico {
	width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
	background: var(--tp-accent-soft); color: var(--tp-accent-ink); font-size: 20px; font-weight: 800;
}
.tp-builder h3 { margin: 4px 0 0; font-size: 15px; font-weight: 800; }
.tp-builder p { margin: 0 0 6px; font-size: 12.5px; color: var(--tp-muted); flex: 1; }
.tp-builder .tp-btn { align-self: flex-start; }

/* -------------------------------------------------------------------
   Themes. The attribute sits on <html> so modals and toasts (which are
   appended to <body>, outside the app mount) inherit the same palette.
   ------------------------------------------------------------------- */

/* The portal lives inside whatever WordPress page/theme embeds it, so a
   theme's own global h1/h2/h3 rules (color, font-family) can otherwise leak
   in and override these headings entirely. This selector's specificity
   (#twa-app.tp h1) beats a theme's plain "h1 { color: ... }" regardless of
   stylesheet order, so the app's own headings are never at the mercy of the
   surrounding page's theme. */
#twa-app.tp h1, #twa-app.tp h2, #twa-app.tp h3, #twa-app.tp h4 {
	color: var(--tp-ink); font-family: var(--tp-font); font-style: normal;
}

html[data-twa-theme="dark"] {
	--tp-bg:          #0D1512;
	--tp-panel:       #151F1B;
	--tp-panel-2:     #111A17;
	--tp-line:        #24322C;
	--tp-line-soft:   #1C2823;
	--tp-ink:         #E9F1ED;
	--tp-ink-2:       #AFC0B8;
	--tp-muted:       #7E9188;
	--tp-accent:      #22C08E;
	--tp-accent-ink:  #63E0B6;
	--tp-accent-soft: #14332A;
	--tp-dark:        #22C08E;
	--tp-blue-soft:   #16283F;
	--tp-violet-soft: #221E3D;
	--tp-amber-soft:  #33280F;
	--tp-rose-soft:   #3A1B21;
	--tp-shadow:      0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
	--tp-shadow-lg:   0 24px 60px rgba(0,0,0,.5);
}

/* Dark needs its own chat canvas — the light WhatsApp wallpaper glares. */
html[data-twa-theme="dark"] .tp-thread { background: #0A1310; background-image: none; }
html[data-twa-theme="dark"] .tp-bubble { background: #1D2A25; color: var(--tp-ink); box-shadow: none; }
html[data-twa-theme="dark"] .tp-msg.out .tp-bubble { background: #10553F; }
html[data-twa-theme="dark"] .tp-bmeta { color: #8FA79C; }
html[data-twa-theme="dark"] .tp-daysep { background: #1D2A25; color: #9FB3AA; }
html[data-twa-theme="dark"] .tp-btn.ghost { background: var(--tp-panel-2); }
html[data-twa-theme="dark"] .tp-btn.green,
html[data-twa-theme="dark"] .tp-btn:not(.ghost):not(.danger) { color: #08221A; }
html[data-twa-theme="dark"] .tp-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237E9188' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
html[data-twa-theme="dark"] .tp-modal,
html[data-twa-theme="dark"] .tp-toast { color: var(--tp-ink); }

/* Header theme switcher */
.tp-theme {
	display: flex; gap: 2px; padding: 3px; border-radius: 999px;
	background: var(--tp-line-soft); border: 1px solid var(--tp-line);
}
.tp-theme button {
	width: 30px; height: 28px; border: 0; border-radius: 999px; background: transparent;
	color: var(--tp-muted); display: grid; place-items: center; transition: background .15s, color .15s;
}
.tp-theme button:hover { color: var(--tp-ink); }
.tp-theme button.on { background: var(--tp-panel); color: var(--tp-accent); box-shadow: var(--tp-shadow); }
.tp-theme button svg { width: 15px; height: 15px; }
#twa-app.tp .tp-theme button svg { width: 15px; height: 15px; }


/* -------------------------------------------------------------------
   Icon sizing. Inline <svg> with only a viewBox falls back to 300x150,
   which is what pushed buttons out of shape and overlapped the header
   on phones. One default here, explicit overrides per context below.
   All overrides carry the #twa-app.tp prefix so they beat the default.
   ------------------------------------------------------------------- */
#twa-app.tp svg { width: 16px; height: 16px; flex: 0 0 auto; }
#twa-app.tp .tp-btn svg { width: 14px; height: 14px; }
#twa-app.tp .tp-btn.sm svg { width: 13px; height: 13px; }
#twa-app.tp .tp-iconbtn svg { width: 17px; height: 17px; }
#twa-app.tp .tp-navitem .tp-ico svg { width: 15px; height: 15px; }
#twa-app.tp .tp-quick .tp-qi svg { width: 20px; height: 20px; }
#twa-app.tp .tp-stat-ico svg { width: 17px; height: 17px; }
#twa-app.tp .tp-avatar svg { width: 18px; height: 18px; }
#twa-app.tp .tp-info-hero .tp-avatar svg { width: 30px; height: 30px; }
#twa-app.tp .tp-send svg { width: 18px; height: 18px; }
#twa-app.tp .tp-search svg { width: 14px; height: 14px; }
#twa-app.tp .tp-info-row svg { width: 15px; height: 15px; }
#twa-app.tp .tp-acc-head .tp-ico svg { width: 15px; height: 15px; }
#twa-app.tp .tp-tick svg { width: 15px; height: 11px; }
#twa-app.tp .tp-block-btn svg { width: 15px; height: 15px; }
#twa-app.tp .tp-copy button svg { width: 15px; height: 15px; }


/* -------------------------------------------------------------------
   Horizontal-overflow guards. A long unbroken string (the welcome
   email on the dashboard) was stretching the grid and forcing the
   whole page to scroll sideways on phones.
   ------------------------------------------------------------------- */
#twa-app.tp .tp-scroll { overflow-x: hidden; }
#twa-app.tp .tp-wrap { min-width: 0; max-width: 1280px; }
#twa-app.tp .tp-hero h2,
#twa-app.tp .tp-hero p { overflow-wrap: anywhere; word-break: break-word; }
#twa-app.tp .tp-stats > *,
#twa-app.tp .tp-two > *,
#twa-app.tp .tp-quick > *,
#twa-app.tp .tp-metrics > *,
#twa-app.tp .tp-builders > *,
#twa-app.tp .tp-grid2 > *,
#twa-app.tp .tp-grid3 > * { min-width: 0; }
#twa-app.tp .tp-stat .tp-stat-num,
#twa-app.tp .tp-list-row b,
#twa-app.tp .tp-list-row small { overflow-wrap: anywhere; }
#twa-app.tp .tp-quick b,
#twa-app.tp .tp-quick small { overflow-wrap: anywhere; }

/* Take over the page — the portal is a full application, not a widget. */
body.twa-portal-open { overflow: hidden; }
#twa-app.tp {
	/* Height is driven by --tp-vh, which JS keeps in sync with the visual
	   viewport. Without that the on-screen keyboard covers the composer on
	   Android, because the layout viewport does not shrink. */
	position: fixed; left: 0; right: 0; top: var(--tp-vt, 0px);
	height: var(--tp-vh, 100%); z-index: 9999;
	display: flex; background: var(--tp-bg);
	font-family: var(--tp-font); color: var(--tp-ink);
	font-size: 14px; line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
#twa-app.tp *, #twa-app.tp *::before, #twa-app.tp *::after { box-sizing: border-box; }
#twa-app.tp button { font-family: inherit; cursor: pointer; }
#twa-app.tp input, #twa-app.tp select, #twa-app.tp textarea { font-family: inherit; font-size: 14px; }
#twa-app.tp a { color: inherit; text-decoration: none; }

/* ------------------------------------------------------------------ */
/*  Sidebar                                                            */
/* ------------------------------------------------------------------ */

.tp-side {
	width: var(--tp-sidebar); flex: 0 0 var(--tp-sidebar);
	height: 100%; min-height: 0;
	background: var(--tp-panel); border-right: 1px solid var(--tp-line);
	display: flex; flex-direction: column; padding: 18px 14px 12px;
	transition: transform .22s ease;
}
.tp-brand { flex: none; display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.tp-brand-mark {
	width: 34px; height: 34px; border-radius: 11px; flex: 0 0 34px;
	background: var(--tp-accent-soft); color: var(--tp-accent-ink);
	display: grid; place-items: center; font-weight: 800; font-size: 15px;
	border: 1px solid #CFEBE0;
}
.tp-brand-mark img { width: 100%; height: 100%; border-radius: 11px; object-fit: contain !important; object-position: center; display:block; background:var(--tp-sidebar,#064f40); }
.tp-org {
	flex: none;
	font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
	color: var(--tp-muted); padding: 0 10px 10px;
}
.tp-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.tp-nav::-webkit-scrollbar { width: 5px; }
.tp-nav::-webkit-scrollbar-thumb { background: var(--tp-line); border-radius: 4px; }

.tp-navitem {
	display: flex; align-items: center; gap: 12px; width: 100%;
	padding: 10px 12px; border: 0; background: transparent; border-radius: 11px;
	font-size: 14px; font-weight: 600; color: var(--tp-ink-2); text-align: left;
	transition: background .15s ease, color .15s ease;
}
.tp-navitem:hover { background: var(--tp-line-soft); color: var(--tp-ink); }
.tp-navitem.on { background: var(--tp-accent-soft); color: var(--tp-accent-ink); font-weight: 700; }
.tp-navitem .tp-ico {
	width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px;
	display: grid; place-items: center; background: var(--tp-line-soft); color: var(--tp-ink-2);
}
.tp-navitem.on .tp-ico { background: #fff; color: var(--tp-accent); }
.tp-navitem .tp-ico svg { width: 15px; height: 15px; }
.tp-navitem .tp-caret { margin-left: auto; font-size: 11px; color: var(--tp-muted); transition: transform .18s ease; }
.tp-navitem.open .tp-caret { transform: rotate(90deg); }
.tp-navitem .tp-badge {
	margin-left: auto; background: var(--tp-accent); color: #fff;
	border-radius: 999px; font-size: 10px; font-weight: 800; padding: 2px 7px; min-width: 20px; text-align: center;
}
.tp-subnav { display: none; padding: 2px 0 6px 38px; flex-direction: column; gap: 1px; }
.tp-subnav.open { display: flex; }
.tp-subitem {
	border: 0; background: transparent; text-align: left; padding: 8px 12px; border-radius: 9px;
	font-size: 13.5px; font-weight: 500; color: var(--tp-ink-2);
}
.tp-subitem:hover { background: var(--tp-line-soft); }
.tp-subitem.on { color: var(--tp-accent-ink); font-weight: 700; background: var(--tp-accent-soft); }

.tp-side-foot { flex: none; border-top: 1px solid var(--tp-line); padding-top: 12px; margin-top: 8px; }
.tp-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.tp-user-av {
	width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
	background: var(--tp-violet); color: #fff; display: grid; place-items: center;
	font-weight: 800; font-size: 13px;
}
.tp-user-meta { min-width: 0; }
.tp-user-meta b { display: block; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-user-meta small { color: var(--tp-muted); font-size: 11px; }

/* ------------------------------------------------------------------ */
/*  Main region                                                        */
/* ------------------------------------------------------------------ */

.tp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tp-topbar {
	min-height: 60px; flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
	padding: 10px 22px; background: var(--tp-panel); border-bottom: 1px solid var(--tp-line);
}
.tp-topbar .tp-title { min-width: 0; }
.tp-topbar h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-burger { display: none; border: 0; background: transparent; font-size: 20px; padding: 6px; border-radius: 9px; }
.tp-topbar h1 { font-size: 17px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.tp-topbar .tp-sub { font-size: 12px; color: var(--tp-muted); font-weight: 500; }
.tp-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tp-topbar .tp-btn { white-space: nowrap; }
.tp-iconbtn {
	width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--tp-line);
	background: var(--tp-panel); display: grid; place-items: center; color: var(--tp-ink-2);
}
.tp-iconbtn:hover { background: var(--tp-line-soft); }

.tp-scroll { flex: 1; overflow-y: auto; padding: 22px; }
.tp-scroll.flush { padding: 0; overflow: hidden; }
.tp-wrap { max-width: 1280px; margin: 0 auto; }

/* ------------------------------------------------------------------ */
/*  Cards, buttons, forms                                              */
/* ------------------------------------------------------------------ */

.tp-card {
	background: var(--tp-panel); border: 1px solid var(--tp-line);
	border-radius: var(--tp-radius); box-shadow: var(--tp-shadow); padding: 18px;
}
.tp-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.tp-card-head h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.tp-card-head p { margin: 3px 0 0; font-size: 13px; color: var(--tp-muted); }
.tp-card-head .tp-ha { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.tp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	border: 1px solid transparent; border-radius: 999px; padding: 9px 18px;
	font-size: 13px; font-weight: 700; background: var(--tp-dark); color: #fff;
	transition: opacity .15s ease, transform .1s ease;
}
.tp-btn:hover { opacity: .9; }
.tp-btn:active { transform: translateY(1px); }
.tp-btn[disabled] { opacity: .5; pointer-events: none; }
.tp-btn.green { background: var(--tp-accent-ink); }
.tp-btn.blue { background: var(--tp-accent-ink); } /* brand green — kept the .blue class name so existing call sites don't need to change */
.tp-btn.ghost { background: var(--tp-panel); color: var(--tp-ink); border-color: var(--tp-line); }
.tp-btn.ghost:hover { background: var(--tp-line-soft); }
.tp-btn.danger { background: var(--tp-panel); color: var(--tp-rose); border-color: #F6C9D1; }
.tp-btn.sm { padding: 6px 13px; font-size: 12px; }

.tp-field { display: block; margin-bottom: 14px; }
.tp-field > span { display: block; font-size: 12px; font-weight: 700; color: var(--tp-ink-2); margin-bottom: 6px; }
.tp-field small { display: block; font-size: 11.5px; color: var(--tp-muted); margin-top: 5px; }
.tp-input, .tp-select, .tp-textarea {
	width: 100%; padding: 11px 13px; border: 1px solid var(--tp-line); border-radius: var(--tp-radius-sm);
	background: var(--tp-panel); color: var(--tp-ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.tp-input:focus, .tp-select:focus, .tp-textarea:focus {
	border-color: var(--tp-accent); box-shadow: 0 0 0 3px var(--tp-accent-soft);
}
.tp-textarea { min-height: 110px; resize: vertical; }
.tp-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A9791' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 11px; padding-right: 34px; }
.tp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tp-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.tp-switch { position: relative; width: 40px; height: 22px; flex: 0 0 40px; }
.tp-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.tp-switch i {
	position: absolute; inset: 0; border-radius: 999px; background: #D6DEDA; transition: background .18s ease;
}
.tp-switch i::after {
	content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
	border-radius: 50%; background: #fff; transition: transform .18s ease; box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.tp-switch input:checked + i { background: var(--tp-accent); }
.tp-switch input:checked + i::after { transform: translateX(18px); }
.tp-switch.violet input:checked + i { background: var(--tp-violet); }

.tp-chip {
	display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
	padding: 3px 10px; font-size: 11px; font-weight: 700;
	background: var(--tp-line-soft); color: var(--tp-ink-2);
}
.tp-chip.green  { background: var(--tp-accent-soft); color: var(--tp-accent-ink); }
.tp-chip.blue   { background: var(--tp-blue-soft);   color: #1B5FCB; }
.tp-chip.violet { background: var(--tp-violet-soft); color: #5B3FD6; }
.tp-chip.amber  { background: var(--tp-amber-soft);  color: #A66A05; }
.tp-chip.rose   { background: var(--tp-rose-soft);   color: #C0293F; }

/* ------------------------------------------------------------------ */
/*  Dashboard                                                          */
/* ------------------------------------------------------------------ */

.tp-hero {
	background: linear-gradient(180deg, #FFFFFF 0%, #FAFDFB 100%);
	border: 1px solid var(--tp-line); border-radius: 20px; padding: 24px; margin-bottom: 18px;
	box-shadow: var(--tp-shadow);
}
.tp-hero h2 { margin: 0 0 4px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.tp-hero h2 em { font-style: normal; color: var(--tp-accent); text-transform: uppercase; }
.tp-hero p { margin: 0 0 18px; color: var(--tp-muted); font-size: 13.5px; }
.tp-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tp-quick button {
	display: flex; align-items: center; gap: 14px; text-align: left;
	background: var(--tp-panel-2); border: 1px solid var(--tp-line); border-radius: var(--tp-radius);
	padding: 15px 17px; transition: border-color .15s, transform .12s, box-shadow .15s;
}
.tp-quick button:hover { border-color: #CFE6DC; transform: translateY(-1px); box-shadow: var(--tp-shadow); }
.tp-quick .tp-qi {
	width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
	background: var(--tp-line-soft); display: grid; place-items: center; color: var(--tp-ink);
}
.tp-quick b { display: block; font-size: 14px; font-weight: 700; }
.tp-quick small { color: var(--tp-muted); font-size: 12px; }

.tp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.tp-stat {
	background: var(--tp-panel); border: 1px solid var(--tp-line); border-radius: var(--tp-radius);
	padding: 16px; box-shadow: var(--tp-shadow); position: relative; min-height: 108px;
}
/* The icon used to be absolutely positioned, which let long labels and the
   badge slide underneath it on narrow cards. It is a flex sibling now, so
   nothing can ever overlap it. */
.tp-stat .tp-stat-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.tp-stat .tp-stat-meta { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tp-stat .tp-stat-label {
	font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
	color: var(--tp-muted); overflow-wrap: anywhere;
}
.tp-stat .tp-stat-ico {
	flex: 0 0 34px; width: 34px; height: 34px; border-radius: 11px;
	display: grid; place-items: center; background: var(--tp-accent-soft); color: var(--tp-accent-ink);
}
.tp-stat.b .tp-stat-ico { background: var(--tp-blue-soft);   color: #1B5FCB; }
.tp-stat.v .tp-stat-ico { background: var(--tp-violet-soft); color: #5B3FD6; }
.tp-stat.a .tp-stat-ico { background: var(--tp-amber-soft);  color: #A66A05; }
.tp-stat .tp-stat-num { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.tp-stat .tp-stat-foot { margin-top: 8px; font-size: 12px; color: var(--tp-muted); }

.tp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tp-list-row {
	display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--tp-line-soft);
}
.tp-list-row:last-child { border-bottom: 0; }
.tp-list-row .tp-lr-main { flex: 1; min-width: 0; }
.tp-list-row b { display: block; font-size: 13.5px; font-weight: 700; }
.tp-list-row small { color: var(--tp-muted); font-size: 12px; }
.tp-avatar {
	width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; display: grid; place-items: center;
	color: #fff; font-weight: 800; font-size: 13px; background: var(--tp-accent);
}

/* ------------------------------------------------------------------ */
/*  Tables                                                             */
/* ------------------------------------------------------------------ */

.tp-table { width: 100%; border-collapse: collapse; }
.tp-table th {
	text-align: left; font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
	color: var(--tp-muted); padding: 0 14px 12px; border-bottom: 1px solid var(--tp-line);
}
.tp-table td { padding: 14px; border-bottom: 1px solid var(--tp-line-soft); font-size: 13.5px; vertical-align: middle; }
.tp-table tr:last-child td { border-bottom: 0; }
.tp-table tbody tr:hover { background: var(--tp-panel-2); }
.tp-table .tp-name { font-weight: 700; }
.tp-table .tp-actions { text-align: right; white-space: nowrap; }
.tp-tablewrap { overflow-x: auto; }

.tp-empty { text-align: center; padding: 46px 20px; color: var(--tp-muted); }
.tp-empty b { display: block; color: var(--tp-ink); font-size: 15px; margin-bottom: 5px; }
.tp-loading { padding: 34px; text-align: center; color: var(--tp-muted); font-size: 13px; }

/* ------------------------------------------------------------------ */
/*  Campaign rows                                                      */
/* ------------------------------------------------------------------ */

.tp-camp { border-bottom: 1px solid var(--tp-line-soft); }
.tp-camp:last-child { border-bottom: 0; }
.tp-camp-head { display: flex; align-items: center; gap: 12px; padding: 15px 4px; }
.tp-camp-thumb { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; background: var(--tp-line-soft); }
.tp-camp-main { flex: 1; min-width: 0; }
.tp-camp-main b { font-size: 14px; font-weight: 700; margin-right: 8px; }
.tp-camp-main div { font-size: 12px; color: var(--tp-muted); margin-top: 3px; }
.tp-camp-pills { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.tp-camp-body { display: none; padding: 4px 4px 18px; }
.tp-camp.open .tp-camp-body { display: block; }
.tp-banner {
	display: flex; align-items: center; gap: 10px; background: var(--tp-accent-soft); color: var(--tp-accent-ink);
	border-radius: 12px; padding: 12px 15px; font-size: 13px; font-weight: 600; margin-bottom: 14px;
}
.tp-banner.warn { background: var(--tp-amber-soft); color: #A66A05; }
.tp-banner.err  { background: var(--tp-rose-soft);  color: #C0293F; }
.tp-metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.tp-metric { border: 1px solid var(--tp-line); border-radius: 13px; padding: 13px; }
.tp-metric .tp-m-label { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tp-muted); }
.tp-metric .tp-m-num { font-size: 22px; font-weight: 800; margin: 6px 0 3px; }
.tp-metric small { font-size: 11px; color: var(--tp-muted); }
.tp-bar { height: 3px; border-radius: 3px; background: var(--tp-line); margin-top: 9px; overflow: hidden; }
.tp-bar i { display: block; height: 100%; background: var(--tp-accent); border-radius: 3px; }
.tp-bar.b i { background: var(--tp-blue); }
.tp-bar.v i { background: var(--tp-violet); }

/* ------------------------------------------------------------------ */
/*  Chat                                                               */
/* ------------------------------------------------------------------ */

.tp-chat { display: flex; height: 100%; background: var(--tp-panel); }
.tp-chat-list {
	width: 330px; flex: 0 0 330px; border-right: 1px solid var(--tp-line);
	display: flex; flex-direction: column; background: var(--tp-panel);
}
.tp-chat-list-head { padding: 15px 16px 12px; border-bottom: 1px solid var(--tp-line); }
.tp-chat-list-head .tp-clh-top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.tp-chat-list-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.tp-search { position: relative; }
.tp-search input { width: 100%; padding: 10px 13px 10px 36px; border-radius: 999px; border: 1px solid var(--tp-line); background: var(--tp-panel-2); outline: none; }
.tp-search input:focus { border-color: var(--tp-accent); background: var(--tp-panel); }
.tp-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--tp-muted); }
.tp-threads { flex: 1; overflow-y: auto; }
.tp-thread-item {
	display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 15px;
	border: 0; background: transparent; text-align: left; border-bottom: 1px solid var(--tp-line-soft);
}
.tp-thread-item:hover { background: var(--tp-panel-2); }
.tp-thread-item.on { background: var(--tp-accent-soft); }
.tp-thread-main { flex: 1; min-width: 0; }
.tp-thread-main b { display: block; font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-thread-main small { display: block; color: var(--tp-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-thread-meta { text-align: right; flex: 0 0 auto; }
.tp-thread-meta time { font-size: 11px; color: var(--tp-muted); display: block; }
.tp-unread { display: inline-block; margin-top: 5px; background: var(--tp-accent); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 800; padding: 1px 6px; }

.tp-conv { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tp-conv-head { display: flex; align-items: center; gap: 11px; padding: 12px 18px; border-bottom: 1px solid var(--tp-line); background: var(--tp-panel); }
.tp-conv-head .tp-ch-main { flex: 1; min-width: 0; }
.tp-conv-head b { display: block; font-size: 14.5px; font-weight: 700; }
.tp-conv-head small { color: var(--tp-muted); font-size: 12px; }
.tp-conv-head .tp-ch-actions { display: flex; gap: 7px; align-items: center; }

.tp-thread {
	flex: 1; overflow-y: auto; padding: 20px 26px; background: #EFEAE2;
	background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1px);
	background-size: 18px 18px;
	display: flex; flex-direction: column; gap: 3px;
}
.tp-msg { max-width: 68%; align-self: flex-start; }
.tp-msg.out { align-self: flex-end; }
/* A handoff/assignment notice — centered, quiet, not a chat bubble. */
.tp-sysnote { align-self: center; max-width: 86%; margin: 4px 0; text-align: center; }
.tp-sysnote span {
	display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
	background: rgba(0,0,0,.08); color: var(--tp-ink-2); line-height: 1.4;
}
html[data-twa-theme="dark"] .tp-sysnote span { background: rgba(255,255,255,.08); color: var(--tp-muted); }
.tp-bubble {
	background: #fff; border-radius: 9px 9px 9px 2px; padding: 7px 10px 5px;
	box-shadow: 0 1px 1px rgba(11,20,26,.13); font-size: 14px; word-break: break-word;
}
.tp-msg.out .tp-bubble { background: #D9FDD3; border-radius: 9px 9px 2px 9px; }
.tp-bubble .tp-quote {
	border-left: 3px solid var(--tp-accent); background: rgba(0,0,0,.05);
	border-radius: 5px; padding: 5px 8px; margin-bottom: 5px; font-size: 12.5px; color: var(--tp-ink-2);
}
.tp-bubble img, .tp-bubble video { max-width: 100%; border-radius: 6px; display: block; margin-bottom: 5px; }
.tp-bubble audio { width: 220px; }
.tp-bmeta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 10.5px; color: #667781; margin-top: 2px; }
.tp-tick { color: #8696A0; display: inline-flex; }
.tp-tick.read { color: #53BDEB; }
.tp-tick svg { width: 15px; height: 11px; }
.tp-daysep { align-self: center; background: rgba(255,255,255,.85); border-radius: 999px; padding: 4px 12px; font-size: 11px; color: #54656F; font-weight: 600; margin: 10px 0; }

.tp-composer { border-top: 1px solid var(--tp-line); background: var(--tp-panel); padding: 10px 16px; }
.tp-replybar { display: none; align-items: center; gap: 10px; background: var(--tp-panel-2); border-left: 3px solid var(--tp-accent); border-radius: 8px; padding: 8px 11px; margin-bottom: 8px; }
.tp-replybar.on { display: flex; }
.tp-replybar span { flex: 1; min-width: 0; font-size: 12.5px; color: var(--tp-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-composer-row { display: flex; align-items: flex-end; gap: 9px; }
.tp-composer textarea {
	flex: 1; border: 1px solid var(--tp-line); border-radius: 20px; padding: 11px 15px;
	resize: none; max-height: 120px; outline: none; background: var(--tp-panel-2);
}
.tp-composer textarea:focus { border-color: var(--tp-accent); background: var(--tp-panel); }
.tp-send {
	width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; border: 0;
	background: var(--tp-accent); color: #fff; display: grid; place-items: center;
}
.tp-window-warn { font-size: 12px; color: #A66A05; background: var(--tp-amber-soft); border-radius: 9px; padding: 8px 12px; margin-bottom: 8px; }

.tp-info {
	width: 310px; flex: 0 0 310px; border-left: 1px solid var(--tp-line);
	overflow-y: auto; background: var(--tp-panel); padding: 20px 18px;
	display: none;
}
/* Only meaningful once a conversation is open. */
#twa-app.tp.in-conv .tp-info { display: block; }
.tp-info-hero { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--tp-line-soft); }
.tp-info-hero .tp-avatar { width: 74px; height: 74px; flex: none; margin: 0 auto 10px; font-size: 26px; }
.tp-info-hero b { display: block; font-size: 16px; font-weight: 800; }
.tp-info-hero small { color: var(--tp-muted); }
.tp-info-hero .tp-wa-name { display: block; color: var(--tp-accent); font-size: 12px; margin-top: 4px; font-weight: 600; }
.tp-info-sec { padding: 16px 0; border-bottom: 1px solid var(--tp-line-soft); }
.tp-info-sec:last-child { border-bottom: 0; }
.tp-info-title { font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--tp-muted); margin-bottom: 11px; }
.tp-info-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.tp-info-row svg { width: 15px; height: 15px; color: var(--tp-muted); flex: 0 0 15px; }
.tp-auto-row {
	display: flex; align-items: center; gap: 12px; background: var(--tp-panel-2);
	border: 1px solid var(--tp-line); border-radius: 12px; padding: 11px 13px; margin-bottom: 9px;
}
.tp-auto-row div { flex: 1; }
.tp-auto-row b { display: block; font-size: 13px; font-weight: 700; }
.tp-auto-row small { color: var(--tp-muted); font-size: 11.5px; }
.tp-block-btn {
	width: 100%; margin-top: 8px; border-radius: 12px; padding: 12px; border: 0;
	background: var(--tp-rose); color: #fff; font-weight: 700; font-size: 13px;
	display: flex; align-items: center; justify-content: center; gap: 8px;
}
.tp-block-btn.on { background: var(--tp-accent-ink); }

/* ------------------------------------------------------------------ */
/*  Modal                                                              */
/* ------------------------------------------------------------------ */

.tp-modal-bg {
	position: fixed; inset: 0; z-index: 100000; background: rgba(14,26,22,.42);
	display: flex; align-items: center; justify-content: center; padding: 22px;
	backdrop-filter: blur(2px); animation: tpFade .16s ease;
}
@keyframes tpFade { from { opacity: 0 } to { opacity: 1 } }
.tp-modal {
	background: var(--tp-panel); border-radius: 22px; box-shadow: var(--tp-shadow-lg);
	width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column;
	animation: tpUp .2s cubic-bezier(.2,.8,.3,1);
}
@keyframes tpUp { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
.tp-modal.wide { max-width: 1000px; }
.tp-modal-head { padding: 22px 24px 14px; display: flex; align-items: flex-start; gap: 12px; }
.tp-modal-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.tp-modal-head p { margin: 4px 0 0; font-size: 13px; color: var(--tp-muted); }
.tp-modal-x { margin-left: auto; border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--tp-muted); padding: 2px 6px; border-radius: 8px; }
.tp-modal-x:hover { background: var(--tp-line-soft); color: var(--tp-ink); }
.tp-modal-body { padding: 4px 24px 18px; overflow-y: auto; flex: 1; }
.tp-modal-foot { padding: 14px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--tp-line-soft); }

.tp-note {
	display: flex; flex-direction: column; gap: 4px; background: #F6F7FA; color: #475569;
	border-radius: 0 10px 10px 0; border-left: 3px solid #94A3B8;
	padding: 11px 15px; font-size: 12.5px; font-weight: 600; margin-bottom: 18px; line-height: 1.6;
}
.tp-note.info { background: #F1F8F7; color: #2F6F62; border-left-color: #5FAE9C; }
.tp-note b { font-weight: 800; }
.tp-preview {
	background: var(--tp-panel-2); border: 1px solid var(--tp-line); border-radius: 14px; padding: 15px;
}
.tp-preview .tp-pv-name { font-weight: 800; font-size: 14px; }
.tp-preview .tp-pv-meta { font-size: 11.5px; color: var(--tp-muted); margin-bottom: 12px; }
.tp-preview .tp-pv-body { background: #fff; border-radius: 10px; padding: 12px; font-size: 13.5px; white-space: pre-wrap; min-height: 60px; }

.tp-radio-grid { display: grid; gap: 8px; }
.tp-radio {
	display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--tp-line);
	border-radius: 13px; padding: 12px 14px; cursor: pointer; transition: border-color .15s, background .15s;
}
.tp-radio:hover { background: var(--tp-panel-2); }
.tp-radio.on { border-color: var(--tp-accent); background: var(--tp-accent-soft); }
.tp-radio input { margin-top: 3px; accent-color: var(--tp-accent); }
.tp-radio b { display: block; font-size: 13.5px; font-weight: 700; }
.tp-radio small { color: var(--tp-muted); font-size: 12px; }

.tp-drop {
	border: 1px dashed var(--tp-line); border-radius: 13px; padding: 14px; text-align: center;
}
.tp-drop b { display: block; font-size: 13px; margin-bottom: 8px; }
.tp-file-label {
	display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--tp-line);
	border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 700; cursor: pointer; background: var(--tp-panel);
}
.tp-file-label input { display: none; }
.tp-file-name { display: block; font-size: 11.5px; color: var(--tp-accent-ink); margin-top: 7px; font-weight: 600; }

.tp-acc { border: 1px solid var(--tp-line); border-radius: 13px; margin-bottom: 9px; overflow: hidden; }
.tp-acc-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: var(--tp-panel); text-align: left; }
.tp-acc-head .tp-ico { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; background: var(--tp-blue-soft); color: #1B5FCB; display: grid; place-items: center; }
.tp-acc-head b { display: block; font-size: 13.5px; font-weight: 700; }
.tp-acc-head small { color: var(--tp-muted); font-size: 12px; }
.tp-acc-head .tp-caret { margin-left: auto; color: var(--tp-muted); transition: transform .18s; }
.tp-acc.open .tp-acc-head .tp-caret { transform: rotate(180deg); }
.tp-acc-body { display: none; padding: 0 16px 16px; font-size: 13px; color: var(--tp-ink-2); }
.tp-acc.open .tp-acc-body { display: block; }

.tp-copy { display: flex; align-items: center; gap: 8px; border: 1px solid var(--tp-line); border-radius: 11px; padding: 10px 12px; background: var(--tp-panel-2); }
.tp-copy code { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tp-copy button { border: 0; background: transparent; color: var(--tp-muted); padding: 3px; border-radius: 6px; }
.tp-copy button:hover { color: var(--tp-accent); }

.tp-steps { counter-reset: tpstep; margin: 0; padding: 0; list-style: none; }
.tp-steps li { position: relative; padding: 0 0 16px 34px; font-size: 13px; color: var(--tp-ink-2); }
.tp-steps li::before {
	counter-increment: tpstep; content: ''; position: absolute; left: 3px; top: 4px;
	width: 15px; height: 15px; border-radius: 50%; background: #0E9AA7;
}
.tp-steps li:not(:last-child)::after { content: ''; position: absolute; left: 10px; top: 22px; bottom: 4px; width: 1px; background: var(--tp-line); }

.tp-number-card {
	border: 1.5px solid var(--tp-accent); border-radius: 15px; padding: 15px 17px; background: var(--tp-panel);
	min-width: 230px;
}
.tp-number-card.plain { border-color: var(--tp-line); }
.tp-number-card .tp-nc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.tp-number-card b { font-size: 15px; font-weight: 800; }
.tp-number-card .tp-nc-id { font-size: 12px; color: var(--tp-muted); font-family: ui-monospace, Menlo, monospace; }
.tp-number-card .tp-nc-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-top: 1px solid var(--tp-line-soft); font-size: 12.5px; margin-top: 10px; }

.tp-toast {
	position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
	background: var(--tp-dark); color: #fff; border-radius: 999px; padding: 11px 22px;
	font-size: 13px; font-weight: 600; z-index: 100001; box-shadow: var(--tp-shadow-lg);
	animation: tpUp .2s ease;
}

/* ------------------------------------------------------------------ */
/*  Responsive — phone first                                           */
/* ------------------------------------------------------------------ */

.tp-backdrop { display: none; }

@media (max-width: 1100px) {
	#twa-app.tp.in-conv .tp-info { display: none; }
	#twa-app.tp.in-conv .tp-info.show {
		display: block; position: absolute; right: 0; top: 0; bottom: 0; width: 310px;
		z-index: 20; box-shadow: var(--tp-shadow-lg);
	}
	.tp-chat { position: relative; }
	.tp-metrics { grid-template-columns: repeat(3, 1fr); }
	.tp-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
	.tp-side {
		position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
		transform: translateX(-100%); box-shadow: var(--tp-shadow-lg);
	}
	#twa-app.tp.nav-open .tp-side { transform: none; }
	#twa-app.tp.nav-open .tp-backdrop { display: block; position: fixed; inset: 0; background: rgba(14,26,22,.4); z-index: 150; }
	.tp-burger { display: grid; place-items: center; }
	.tp-topbar { padding: 9px 13px; gap: 9px; }
	.tp-topbar h1 { font-size: 15px; }
	.tp-topbar .tp-sub { display: none; }
	.tp-topbar .tp-btn { padding: 8px 13px; font-size: 12px; }
	.tp-theme button { width: 27px; height: 25px; }
	.tp-scroll { padding: 15px; }
	.tp-quick .tp-qi { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; }
	.tp-stat { min-height: 96px; padding: 14px; }
	.tp-stat .tp-stat-num { font-size: 25px; }
	.tp-stat .tp-stat-ico { flex: 0 0 30px; width: 30px; height: 30px; }
	.tp-stat .tp-chip { font-size: 10px; padding: 2px 8px; }
	.tp-card { padding: 15px; }
	.tp-card-head { flex-wrap: wrap; }
	.tp-card-head .tp-ha { margin-left: 0; width: 100%; }
	.tp-quick, .tp-two, .tp-grid2, .tp-grid3, .tp-builders { grid-template-columns: 1fr; }
	.tp-tab { min-width: 0; padding: 9px 12px; font-size: 12.5px; }
	.tp-hero { padding: 18px; }
	.tp-hero h2 { font-size: 19px; }

	/* Chat becomes a two-pane phone flow */
	.tp-chat-list { width: 100%; flex: 1 1 auto; }
	.tp-conv { display: none; }
	#twa-app.tp.in-conv .tp-chat-list { display: none; }
	#twa-app.tp.in-conv .tp-conv { display: flex; }
	.tp-msg { max-width: 84%; }
	.tp-thread { padding: 14px; }
}

@media (max-width: 520px) {
	.tp-stats, .tp-metrics { grid-template-columns: repeat(2, 1fr); }
	.tp-topbar { flex-wrap: wrap; }
	.tp-top-actions { width: 100%; margin-left: 0; justify-content: flex-start; }
	.tp-top-actions:empty { display: none; }
	.tp-hero h2 { font-size: 17px; }
	.tp-hero p { font-size: 12.5px; }
	.tp-quick button { padding: 13px 14px; gap: 11px; }
	.tp-info.show { width: 100% !important; }
	.tp-modal { max-height: 94vh; border-radius: 18px; }
	.tp-modal-head { padding: 18px 18px 12px; }
	.tp-modal-body { padding: 4px 18px 14px; }
	.tp-modal-foot { padding: 12px 18px 18px; }
}

/* ===================================================================
   Login / auth screen.
   Class names match the [trendex_wa_login] shortcode markup, so the
   PHP stays untouched — only the look moves onto the portal tokens.
   =================================================================== */

/* ===================================================================
   Sign-in page — an animated, always-dark "living chat" background
   (WhatsApp bubbles drifting up, slow aurora glow) behind a centered
   frosted-glass card. The background is a brand moment, like the old
   design's hero panel, so it never changes with the theme toggle —
   only the card's own tone (dark glass / light glass) does.
   =================================================================== */

/* ===================================================================
   Sign-in page — minimal / editorial: plain page background, a small
   wordmark, generous whitespace, underline-only fields that draw in on
   focus. No card, no imagery — restraint is the whole design language,
   so most rules below are typographic rather than decorative.
   =================================================================== */

.twa-auth-wrap {
	position: fixed; inset: 0; z-index: 9999; overflow-y: auto;
	background: var(--tp-bg); font-family: var(--tp-font); color: var(--tp-ink);
	display: flex; align-items: center; justify-content: center;
	padding: 40px 20px; padding-top: max(40px, env(safe-area-inset-top, 0px)); padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
	-webkit-font-smoothing: antialiased;
}
.twa-auth-wrap *, .twa-auth-wrap *::before, .twa-auth-wrap *::after { box-sizing: border-box; }

.twa-auth-frame { width: 100%; max-width: 400px; }

.twa-auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 52px; opacity: 0; animation: twaRise .6s .05s ease both; }
.twa-logo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tp-accent); position: relative; flex: none; }
.twa-logo-dot::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--tp-accent); opacity: .5; animation: twaRing 2.6s ease-out infinite; }
@keyframes twaRing { 0% { transform: scale(.4); opacity: .6; } 100% { transform: scale(2.6); opacity: 0; } }
.twa-logo-tile.dot { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; }
.twa-auth-brand b { font-size: 13px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.twa-auth-brand small { font-size: 11.5px; color: var(--tp-muted); margin-left: auto; text-align: right; }

.twa-auth-frame h2 {
	font-family: 'Fraunces', Georgia, serif; font-size: 34px; font-weight: 600; line-height: 1.15;
	margin: 0 0 10px; letter-spacing: -.01em; opacity: 0; animation: twaRise .6s .12s ease both;
}
.twa-auth-sub { margin: 0 0 38px; font-size: 14.5px; color: var(--tp-muted); line-height: 1.6; opacity: 0; animation: twaRise .6s .18s ease both; }
@keyframes twaRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.twa-auth-frame form { opacity: 0; animation: twaRise .6s .24s ease both; }

/* wp_login_form wraps each field in <p class="login-username|login-password">;
   that same element carries the animated underline. */
.twa-auth-frame form p,
.twa-auth-frame form > label { margin: 0 0 26px; position: relative; }
.twa-auth-frame label,
.twa-auth-frame form .login-username label,
.twa-auth-frame form .login-password label {
	display: block; font-size: 12px; font-weight: 600; color: var(--tp-muted); margin-bottom: 9px;
}
.twa-auth-frame input[type="text"],
.twa-auth-frame input[type="email"],
.twa-auth-frame input[type="password"] {
	width: 100%; padding: 4px 4px 12px; border: 0; border-bottom: 1.5px solid var(--tp-line);
	background: transparent; color: var(--tp-ink); font-size: 16px; font-family: inherit; outline: none;
}
.twa-auth-frame input::placeholder { color: var(--tp-muted); opacity: .7; }
.twa-auth-frame form .login-username::after,
.twa-auth-frame form .login-password::after {
	content: ''; position: absolute; left: 4px; right: 4px; bottom: -1.5px; height: 1.5px; background: var(--tp-ink);
	transform: scaleX(0); transform-origin: left; transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.twa-auth-frame form .login-username:focus-within::after,
.twa-auth-frame form .login-password:focus-within::after { transform: scaleX(1); }
/* register / lost-password screens: bare label+input, no <p> wrapper to
   animate, so a plain static underline stands in — still fits the look. */
.twa-auth-frame form > input[type="text"],
.twa-auth-frame form > input[type="email"] { margin-bottom: 22px; }

.twa-field-wrap { position: relative; }
.twa-field-wrap input { padding-right: 30px; }
.twa-pw-toggle {
	position: absolute; right: 0; bottom: 8px; width: 26px; height: 26px; border: 0; background: transparent;
	color: var(--tp-muted); cursor: pointer; padding: 0; display: grid; place-items: center;
}
.twa-pw-toggle:hover { color: var(--tp-ink); }
.twa-pw-toggle.on { color: var(--tp-accent-ink); }

.twa-auth-frame .forgetmenot { display: block; margin: 0; }
.twa-auth-row { display: flex; align-items: center; justify-content: space-between; margin: -8px 0 34px; font-size: 13px; }
.twa-auth-frame .login-remember label { display: flex; align-items: center; gap: 8px; color: var(--tp-muted); font-weight: 500; margin: 0; cursor: pointer; }
.twa-auth-frame .login-remember input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--tp-ink); margin: 0; }
.twa-forgot-link { color: var(--tp-ink); text-decoration: none; border-bottom: 1px solid var(--tp-line); padding-bottom: 1px; font-weight: 500; }
.twa-forgot-link:hover { border-color: var(--tp-ink); }

.twa-auth-frame .twa-btn,
.twa-auth-frame input[type="submit"],
.twa-auth-frame button[type="submit"] {
	width: 100%; padding: 15px; border: 1.5px solid var(--tp-ink); border-radius: 2px;
	background: var(--tp-ink); color: var(--tp-bg); font-size: 13.5px; font-weight: 600;
	letter-spacing: .04em; text-transform: uppercase; font-family: inherit; cursor: pointer;
	display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .2s, color .2s;
}
.twa-auth-frame .twa-btn:hover,
.twa-auth-frame input[type="submit"]:hover { background: transparent; color: var(--tp-ink); }
.twa-auth-frame .twa-btn svg { transition: transform .2s; }
.twa-auth-frame .twa-btn:hover svg { transform: translateX(3px); }
.twa-auth-frame .login-submit { margin-bottom: 0; }
.twa-auth-frame .twa-btn.is-busy,
.twa-auth-frame input[type="submit"].is-busy { opacity: .7; cursor: default; }

.twa-auth-or { display: flex; align-items: center; gap: 14px; margin: 30px 0; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--tp-muted); }
.twa-auth-or::before, .twa-auth-or::after { content: ''; flex: 1; height: 1px; background: var(--tp-line); }
.twa-oauth-btn, .twa-google-slot { width: 100%; min-height: 46px; }
.twa-oauth-btn {
	display: flex; align-items: center; justify-content: center; gap: 10px;
	padding: 13px; border: 1.5px solid var(--tp-line); border-radius: 2px; background: transparent; color: var(--tp-ink);
	font-size: 13.5px; font-weight: 500; cursor: pointer; font-family: inherit; transition: border-color .2s;
}
.twa-oauth-btn:hover { border-color: var(--tp-ink); }
.twa-google-slot { display: flex; justify-content: center; overflow: hidden; }

.twa-auth-meta-teaser {
	display: flex; gap: 12px; align-items: flex-start; background: var(--tp-panel-2);
	border: 1px solid var(--tp-line); border-radius: 12px; padding: 13px 15px; margin-bottom: 26px;
	opacity: 0; animation: twaRise .6s .2s ease both;
}
.twa-auth-meta-teaser b { display: block; font-size: 13px; font-weight: 700; }
.twa-auth-meta-teaser small { font-size: 12px; color: var(--tp-muted); line-height: 1.5; }
.twa-facebook-mark {
	width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; background: #1877F2; color: #fff;
	display: grid; place-items: center; font-weight: 800; font-size: 16px;
}

.twa-alt { margin: 36px 0 0; text-align: center; font-size: 13px; color: var(--tp-muted); opacity: 0; animation: twaRise .6s .3s ease both; }
.twa-alt a { color: var(--tp-ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--tp-ink); }

.twa-auth-error {
	display: flex; align-items: center; gap: 9px; background: var(--tp-rose-soft, #FDE9EC); color: #B3273F;
	border-radius: 10px; padding: 12px 14px; font-size: 13px; font-weight: 600; line-height: 1.5; margin-bottom: 22px;
}
.twa-auth-error::before { content: '!'; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; background: currentColor; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
#login_error, .twa-auth-frame .message {
	display: flex; align-items: center; gap: 9px; border-radius: 10px; padding: 12px 14px; font-size: 13px; font-weight: 600; line-height: 1.5; margin: 0 0 22px;
	background: var(--tp-rose-soft, #FDE9EC); color: #B3273F; border: 0;
}
.twa-auth-frame .message { background: var(--tp-accent-soft); color: var(--tp-accent-ink); }

.twa-auth-theme { position: fixed; top: 26px; right: 26px; z-index: 10; }
.twa-auth-theme .tp-theme { background: transparent; border: 1px solid var(--tp-line); border-radius: 20px; }
.twa-auth-theme .tp-theme button { color: var(--tp-muted); }
.twa-auth-theme .tp-theme button.on { background: var(--tp-ink); color: var(--tp-bg); }

@media (max-width: 480px) {
	.twa-auth-wrap { padding: 28px 20px; }
	.twa-auth-brand { margin-bottom: 40px; }
	.twa-auth-brand small { display: none; }
	.twa-auth-frame h2 { font-size: 28px; }
	.twa-auth-sub { margin-bottom: 30px; }
	.twa-auth-theme { top: 16px; right: 16px; }
	/* 16px inputs so iOS Safari never zooms in on focus; real 44px+ tap target on the button. */
	.twa-auth-frame .twa-btn, .twa-auth-frame input[type="submit"] { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.twa-auth-brand, .twa-auth-frame h2, .twa-auth-sub, .twa-auth-frame form, .twa-auth-meta-teaser, .twa-alt, .twa-logo-dot::after {
		animation: none !important; opacity: 1 !important; transform: none !important;
	}
}

html[data-twa-theme="light"] .twa-auth-theme .tp-theme button.on { background: var(--tp-ink); color: var(--tp-bg); }

/* ===================================================================
   Dark theme corrections.
   The base sheet carried hardcoded light values in a number of places
   (white hero gradient, white template preview, dark ink on the soft
   chip backgrounds). On dark those either vanished or turned into a
   white block. Everything below re-states just those cases.
   =================================================================== */

html[data-twa-theme="dark"] { color-scheme: dark; }

/* Native date / time / colour pickers follow the scheme */
html[data-twa-theme="dark"] input,
html[data-twa-theme="dark"] select,
html[data-twa-theme="dark"] textarea { color-scheme: dark; }

/* Dashboard hero was a hardcoded white gradient */
html[data-twa-theme="dark"] .tp-hero {
	background: linear-gradient(180deg, #17231E 0%, #131D19 100%);
	border-color: var(--tp-line);
}

/* Chips: the soft backgrounds go dark, so the inks must go light */
html[data-twa-theme="dark"] .tp-chip { background: #1E2B25; color: var(--tp-ink-2); }
html[data-twa-theme="dark"] .tp-chip.green  { background: #14332A; color: #63E0B6; }
html[data-twa-theme="dark"] .tp-chip.blue   { background: #16283F; color: #7FB4FF; }
html[data-twa-theme="dark"] .tp-chip.violet { background: #221E3D; color: #B4A2FF; }
html[data-twa-theme="dark"] .tp-chip.amber  { background: #33280F; color: #F5C46B; }
html[data-twa-theme="dark"] .tp-chip.rose   { background: #3A1B21; color: #FF9AAA; }

/* Stat + accordion icon tiles */
html[data-twa-theme="dark"] .tp-stat .tp-stat-ico { background: #14332A; color: #63E0B6; }
html[data-twa-theme="dark"] .tp-stat.b .tp-stat-ico { background: #16283F; color: #7FB4FF; }
html[data-twa-theme="dark"] .tp-stat.v .tp-stat-ico { background: #221E3D; color: #B4A2FF; }
html[data-twa-theme="dark"] .tp-stat.a .tp-stat-ico { background: #33280F; color: #F5C46B; }
html[data-twa-theme="dark"] .tp-acc-head .tp-ico { background: #16283F; color: #7FB4FF; }

/* Banners and notes */
html[data-twa-theme="dark"] .tp-banner { background: #14332A; color: #63E0B6; }
html[data-twa-theme="dark"] .tp-banner.warn { background: #33280F; color: #F5C46B; }
html[data-twa-theme="dark"] .tp-banner.err  { background: #3A1B21; color: #FF9AAA; }
html[data-twa-theme="dark"] .tp-note { background: #33280F; color: #F5C46B; }
html[data-twa-theme="dark"] .tp-note.info { background: #14332A; color: #63E0B6; }
html[data-twa-theme="dark"] .tp-window-warn { background: #33280F; color: #F5C46B; }

/* Template preview card had a hardcoded white message body */
html[data-twa-theme="dark"] .tp-preview .tp-pv-body { background: #0F1A16; color: var(--tp-ink); }

/* Sidebar active state used a white tile */
html[data-twa-theme="dark"] .tp-navitem.on .tp-ico { background: #0C1512; color: var(--tp-accent); }
html[data-twa-theme="dark"] .tp-brand-mark { background: #14332A; border-color: #24463A; color: #63E0B6; }

/* Borders that were pinned to light tints */
html[data-twa-theme="dark"] .tp-btn.danger { border-color: #59303A; color: #FF9AAA; background: var(--tp-panel-2); }
html[data-twa-theme="dark"] .tp-quick button:hover { border-color: var(--tp-accent); }
html[data-twa-theme="dark"] .tp-switch i { background: #33443C; }

/* Hover / selected rows need to lift, not darken, against a dark panel */
html[data-twa-theme="dark"] .tp-table tbody tr:hover { background: #1A2621; }
html[data-twa-theme="dark"] .tp-thread-item:hover { background: #1A2621; }
html[data-twa-theme="dark"] .tp-thread-item.on { background: #14332A; }
html[data-twa-theme="dark"] .tp-navitem:hover { background: #1A2621; }
html[data-twa-theme="dark"] .tp-subitem:hover { background: #1A2621; }
html[data-twa-theme="dark"] .tp-btn.ghost:hover { background: #1A2621; }
html[data-twa-theme="dark"] .tp-modal-x:hover { background: #1A2621; }
html[data-twa-theme="dark"] .tp-radio:hover { background: #1A2621; }
html[data-twa-theme="dark"] .tp-tab:hover { background: #1A2621; }
html[data-twa-theme="dark"] .tp-iconbtn:hover { background: #1A2621; }

/* Toast used --tp-dark, which is the accent green on this theme */
html[data-twa-theme="dark"] .tp-toast { background: #1E2B25; color: var(--tp-ink); border: 1px solid var(--tp-line); }

/* Modal overlay needs to be heavier so the dark card separates from the page */
html[data-twa-theme="dark"] .tp-modal-bg { background: rgba(0,0,0,.62); }

/* ===================================================================
   Shortcuts picker + tag editor
   =================================================================== */

.tp-sc-panel {
	position: absolute; left: 12px; right: 12px; bottom: 100%;
	margin-bottom: 8px; z-index: 30; max-height: 340px;
	background: var(--tp-panel); border: 1px solid var(--tp-line);
	border-radius: 16px; box-shadow: var(--tp-shadow-lg);
	display: none; flex-direction: column; overflow: hidden;
}
.tp-sc-panel.on { display: flex; }
.tp-composer { position: relative; }

.tp-sc-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--tp-line-soft); }
.tp-sc-head .tp-search { margin-bottom: 9px; }
.tp-sc-filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tp-sc-filters::-webkit-scrollbar { height: 0; }
.tp-sc-pill {
	border: 1px solid var(--tp-line); background: var(--tp-panel); border-radius: 999px;
	padding: 5px 12px; font-size: 11.5px; font-weight: 700; color: var(--tp-ink-2); white-space: nowrap;
}
.tp-sc-pill.on { background: var(--tp-accent-soft); color: var(--tp-accent-ink); border-color: var(--tp-accent); }

.tp-sc-list { flex: 1; overflow-y: auto; }
.tp-sc-item {
	display: flex; align-items: flex-start; gap: 11px; width: 100%; padding: 11px 14px;
	border: 0; background: transparent; text-align: left; border-bottom: 1px solid var(--tp-line-soft);
}
.tp-sc-item:last-child { border-bottom: 0; }
.tp-sc-item:hover, .tp-sc-item.cursor { background: var(--tp-panel-2); }
.tp-sc-item .tp-sc-main { flex: 1; min-width: 0; }
.tp-sc-item b { display: block; font-size: 13.5px; font-weight: 700; }
.tp-sc-item small { display: block; color: var(--tp-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-sc-code {
	flex: 0 0 auto; font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 700;
	background: var(--tp-line-soft); color: var(--tp-ink-2); border-radius: 6px; padding: 2px 7px;
}
.tp-sc-foot {
	padding: 9px 14px; border-top: 1px solid var(--tp-line-soft);
	display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--tp-muted);
}

/* Tag editor in the contact panel */
.tp-tagbox { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.tp-tag {
	display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
	padding: 4px 8px 4px 11px; font-size: 11.5px; font-weight: 700;
	background: var(--tp-accent-soft); color: var(--tp-accent-ink);
}
.tp-tag button {
	border: 0; background: transparent; color: inherit; opacity: .6;
	font-size: 14px; line-height: 1; padding: 0 1px; border-radius: 50%;
}
.tp-tag button:hover { opacity: 1; }
.tp-tag-empty { font-size: 12px; color: var(--tp-muted); margin-bottom: 9px; }

@media (max-width: 520px) {
	.tp-sc-panel { left: 8px; right: 8px; max-height: 52vh; }
}

/* ===================================================================
   24-hour window: chip on the chat row, countdown in the contact panel
   =================================================================== */

.tp-thread-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.tp-thread-tags:empty { display: none; }
.tp-thread-tags .tp-chip { font-size: 10px; padding: 1px 7px; }

.tp-win-box {
	border: 1px solid var(--tp-line); border-left: 3px solid var(--tp-accent);
	border-radius: 12px; padding: 12px 14px; background: var(--tp-panel-2);
}
.tp-win-box.soon   { border-left-color: var(--tp-amber); }
.tp-win-box.closed { border-left-color: var(--tp-rose); }
.tp-win-box b { display: block; font-size: 16px; font-weight: 800; margin-bottom: 3px; }
.tp-win-box.soon b   { color: var(--tp-amber); }
.tp-win-box.closed b { color: var(--tp-rose); }
.tp-win-box small { display: block; font-size: 11.5px; color: var(--tp-muted); line-height: 1.5; }
.tp-win-box .tp-bar { margin-top: 10px; }
.tp-win-box .tp-bar.a i { background: var(--tp-amber); }

#twa-app.tp #tp-chat-filters .tp-sc-pill b { font-weight: 800; opacity: .75; }

/* Voice note recording bar */
.tp-recbar {
	display: none; align-items: center; gap: 10px; margin-bottom: 8px;
	background: var(--tp-rose-soft); border-radius: 10px; padding: 9px 12px;
	font-size: 13px; font-weight: 700; color: var(--tp-rose);
}
.tp-recbar.on { display: flex; }
.tp-rec-dot {
	width: 9px; height: 9px; border-radius: 50%; background: var(--tp-rose);
	animation: tpPulse 1s ease-in-out infinite;
}
@keyframes tpPulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* Delivery failure reason under a message */
.tp-fail { display: none; }
.tp-msg.failed .tp-fail {
	display: block; margin-top: 4px; font-size: 11px; line-height: 1.45;
	color: var(--tp-rose); font-weight: 600; max-width: 100%; overflow-wrap: anywhere;
}
.tp-msg.failed .tp-bubble { box-shadow: 0 0 0 1px var(--tp-rose); }

/* Reply buttons attached to an outgoing message */
.tp-bbtns { margin: 6px -10px -5px; border-top: 1px solid rgba(0,0,0,.08); }
.tp-bbtns span {
	display: block; text-align: center; padding: 8px 6px; font-size: 13px;
	font-weight: 600; color: #027EB5; border-bottom: 1px solid rgba(0,0,0,.06);
}
.tp-bbtns span:last-child { border-bottom: 0; }
html[data-twa-theme="dark"] .tp-bbtns { border-top-color: rgba(255,255,255,.12); }
html[data-twa-theme="dark"] .tp-bbtns span { color: #53BDEB; border-bottom-color: rgba(255,255,255,.08); }

/* Universal Integration API */
.tp-code{background:var(--tp-panel-2,#111827);color:var(--tp-text,#e5e7eb);padding:14px 16px;border-radius:10px;font:12px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;overflow:auto;border:1px solid var(--tp-border,#e5e7eb22)}


/* WhatsApp composer / message improvements */
.tp-wa-body { white-space: normal; line-height: 1.45; }
.tp-wa-code, .tp-wa-code-inline {
\tdisplay: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
\tfont-size: .92em; background: rgba(0,0,0,.07); border-radius: 4px; padding: 1px 4px;
}
.tp-wa-code { display: block; white-space: pre-wrap; margin: 3px 0; }
.tp-chat-delete { color: var(--tp-rose); font-size: 18px; font-weight: 800; }
.tp-composer textarea { min-height: 42px; max-height: 220px; overflow-y: auto; line-height: 1.45; }
@media (max-width: 860px) {
\t.tp-composer textarea { max-height: 220px; }
}

/* v6.7.2 — workspace settings, inbox assignment and tag UX */
.tp-chat-scope{display:flex;align-items:center;gap:6px;margin-top:10px;padding:3px;background:var(--tp-panel-2,#f6f8f7);border:1px solid var(--tp-border,#e5e7eb);border-radius:10px;overflow:auto}
.tp-scope-label{font-size:11px;font-weight:800;color:var(--tp-muted);padding:0 7px;white-space:nowrap}
.tp-scope-pill{border:0;background:transparent;color:var(--tp-muted);font:inherit;font-size:12px;font-weight:700;padding:7px 10px;border-radius:7px;cursor:pointer;white-space:nowrap}
.tp-scope-pill:hover{color:var(--tp-ink)}
.tp-scope-pill.on{background:var(--tp-panel,#fff);color:var(--tp-accent-ink,var(--tp-accent));box-shadow:0 1px 3px rgba(0,0,0,.06)}
.tp-chat-tools{display:flex;align-items:center;gap:8px;margin-top:8px}
.tp-chat-tools .tp-sc-filters{flex:1;min-width:0}
.tp-chat-tag-select{width:125px;flex:0 0 125px;height:34px;font-size:12px}
.tp-assignee{display:inline-flex;align-items:center;gap:3px;margin-left:5px;font-size:10px;color:var(--tp-muted);max-width:105px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tp-assignee:before{content:'•';color:var(--tp-accent);font-size:14px;line-height:0}
.tp-mini-tag{display:inline-flex;margin-left:4px;padding:2px 5px;border-radius:5px;background:var(--tp-accent-soft,#eaf7f1);color:var(--tp-accent-ink,#087443);font-size:9px;font-weight:800;vertical-align:middle;max-width:70px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tp-copy>a{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--tp-accent-ink,var(--tp-accent));text-decoration:none;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace}
.tp-copy>a:hover{text-decoration:underline}
.tp-settings-page{max-width:1080px}
.tp-settings-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding:26px 28px;margin-bottom:16px;border:1px solid var(--tp-border,#e5e7eb);border-radius:16px;background:linear-gradient(135deg,var(--tp-panel,#fff),var(--tp-panel-2,#f5f8f7))}
.tp-settings-hero h2{font-size:28px;letter-spacing:-.03em;margin:4px 0 5px}
.tp-settings-hero p{margin:0;color:var(--tp-muted);max-width:700px}
.tp-eyebrow{font-size:10px;letter-spacing:.12em;font-weight:900;color:var(--tp-accent-ink,var(--tp-accent))}
.tp-settings-card{padding:20px;margin-bottom:14px;border:1px solid var(--tp-border,#e5e7eb);border-radius:14px;background:var(--tp-panel,#fff);box-shadow:0 2px 10px rgba(15,23,42,.03)}
.tp-settings-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:16px}
.tp-settings-head h3{margin:0 0 4px;font-size:17px}
.tp-settings-head p{margin:0;color:var(--tp-muted);font-size:12.5px}
.tp-status-dot{display:inline-flex;align-items:center;gap:7px;padding:6px 9px;border-radius:999px;background:var(--tp-panel-2,#f3f5f4);color:var(--tp-muted);font-size:11px;font-weight:800;white-space:nowrap}
.tp-status-dot i{width:7px;height:7px;border-radius:50%;background:#98a0a4;box-shadow:0 0 0 3px rgba(152,160,164,.12)}
.tp-status-dot.green{background:#eaf8f0;color:#087443}.tp-status-dot.green i{background:#12b76a;box-shadow:0 0 0 3px rgba(18,183,106,.13)}
.tp-settings-wa-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.tp-settings-wa-grid>div{padding:12px;border:1px solid var(--tp-border,#e5e7eb);border-radius:10px;background:var(--tp-panel-2,#f8faf9)}
.tp-settings-wa-grid small{display:block;color:var(--tp-muted);font-size:10px;margin-bottom:4px}.tp-settings-wa-grid b{display:block;font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tp-settings-linkrow{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:12px;color:var(--tp-muted);font-size:11.5px}
.tp-choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tp-choice{display:flex;gap:11px;align-items:flex-start;padding:14px;border:1px solid var(--tp-border,#e5e7eb);border-radius:11px;cursor:pointer;background:var(--tp-panel,#fff);transition:.15s ease}
.tp-choice:hover{border-color:var(--tp-accent)}.tp-choice.on{border-color:var(--tp-accent);background:var(--tp-accent-soft,#eef9f4)}
.tp-choice input{margin-top:3px;accent-color:var(--tp-accent)}.tp-choice b{display:block;font-size:13px;margin-bottom:3px}.tp-choice small{display:block;color:var(--tp-muted);line-height:1.45}
.tp-settings-actions{display:flex;align-items:center;gap:10px;margin-top:14px}.tp-settings-actions span{font-size:11px;color:var(--tp-muted)}
.tp-settings-mini{display:flex;gap:8px;flex-wrap:wrap}.tp-settings-mini span{padding:7px 10px;border-radius:8px;background:var(--tp-panel-2,#f6f8f7);border:1px solid var(--tp-border,#e5e7eb);font-size:11px;font-weight:700;color:var(--tp-muted)}
@media(max-width:760px){.tp-settings-wa-grid,.tp-choice-grid{grid-template-columns:1fr 1fr}.tp-settings-hero{padding:20px;align-items:flex-start}.tp-settings-head{flex-direction:column}.tp-chat-tools{align-items:stretch}.tp-chat-tag-select{width:100px;flex-basis:100px}}
@media(max-width:520px){.tp-settings-wa-grid,.tp-choice-grid{grid-template-columns:1fr}.tp-settings-hero h2{font-size:23px}}


/* v6.7.3 inbox workflow polish */
.tp-chat-scope{display:none!important}
.tp-chat-tools{display:flex;align-items:center;gap:8px;margin-top:10px}
.tp-chat-tools .tp-sc-filters{flex:1;min-width:0}
.tp-tag-filter{position:relative;flex:0 0 auto}
.tp-filter-btn{width:38px;height:38px;border-radius:10px}
.tp-filter-btn svg{width:17px;height:17px}
.tp-tag-popover{display:none;position:absolute;z-index:50;right:0;top:44px;width:210px;max-height:300px;overflow:auto;padding:6px;background:var(--tp-panel,#fff);border:1px solid var(--tp-border,#e5e7eb);border-radius:12px;box-shadow:0 14px 36px rgba(0,0,0,.16)}
.tp-tag-popover.on{display:flex;flex-direction:column;gap:2px}
.tp-tag-option{display:flex;align-items:center;justify-content:space-between;width:100%;border:0;background:transparent;color:var(--tp-ink);padding:9px 10px;border-radius:8px;font:inherit;font-size:12px;font-weight:700;text-align:left;cursor:pointer}
.tp-tag-option:hover,.tp-tag-option.on{background:var(--tp-accent-soft,#eaf7f1);color:var(--tp-accent-ink,#087443)}
.tp-tag-option small{color:var(--tp-muted);font-size:10px;font-weight:700}
.tp-viewonly,.tp-claim-hint{padding:8px 11px;margin-bottom:7px;border-radius:9px;font-size:11.5px;line-height:1.4}
.tp-viewonly{background:rgba(232,83,107,.08);border:1px solid rgba(232,83,107,.2);color:var(--tp-ink)}
.tp-claim-hint{background:var(--tp-accent-soft,#eaf7f1);border:1px solid rgba(20,180,120,.18);color:var(--tp-accent-ink,#087443)}
.tp-composer-viewonly{opacity:.96}
.tp-composer-viewonly .tp-composer-row{opacity:.62}
.tp-composer button:disabled,.tp-composer textarea:disabled{cursor:not-allowed}
.tp-composer-viewonly .tp-iconbtn{pointer-events:none}
.tp-thread-tags{align-items:center}
.tp-thread-tags .tp-assignee{font-size:10px;padding:2px 7px;border-radius:999px;background:var(--tp-panel-2,#eef2f0);color:var(--tp-muted);font-weight:700}
.tp-thread-tags .tp-mini-tag{margin-left:0}
.tp-subnav .tp-subitem:first-child{margin-top:2px}
@media(max-width:760px){.tp-tag-popover{right:-2px;width:190px}.tp-filter-btn{width:36px;height:36px}}

/* Automation Studio redesign */
.tp-builder-hero{display:flex;align-items:flex-start;gap:16px;padding:22px;border:1px solid var(--tp-line);border-radius:18px;background:linear-gradient(135deg,var(--tp-panel),var(--tp-panel-2));box-shadow:var(--tp-shadow);margin-bottom:16px}
.tp-builder-hero-icon{width:48px;height:48px;flex:0 0 48px;border-radius:15px;display:grid;place-items:center;background:var(--tp-accent-soft);color:var(--tp-accent-ink)}
.tp-builder-hero-icon svg{width:23px;height:23px}.tp-builder-hero h2{margin:0;font-size:21px;letter-spacing:-.02em}.tp-builder-hero p{margin:5px 0 0;color:var(--tp-muted);font-size:13px;line-height:1.55;max-width:760px}
.tp-builder-section-title{display:flex;align-items:center;justify-content:space-between;margin:0 0 10px;padding:0 2px}.tp-builder-section-title b{font-size:14px}.tp-builder-section-title span{display:block;color:var(--tp-muted);font-size:12px;margin-top:2px}
.tp-builder{min-height:225px;padding:18px}.tp-builder-top{display:flex;align-items:center;justify-content:space-between}.tp-builder-ico svg{width:21px;height:21px}.tp-builder-arrow{width:30px;height:30px;border:1px solid var(--tp-line);border-radius:9px;display:grid;place-items:center;color:var(--tp-muted);opacity:.8;transform:rotate(180deg)}.tp-builder-arrow svg{width:16px;height:16px}.tp-builder-copy h3{font-size:16px;margin:14px 0 5px}.tp-builder-copy p{font-size:12.5px;line-height:1.55;margin:0;color:var(--tp-muted);min-height:58px}.tp-builder-foot{margin-top:auto;padding-top:12px}.tp-builder-foot .tp-btn{width:100%;justify-content:center}
.tp-chat-delete svg{width:17px;height:17px}.tp-modal-x svg{width:17px;height:17px}.tp-replybar .tp-iconbtn svg{width:14px;height:14px}.tp-tag button svg{width:12px;height:12px}.tp-tag button{display:grid;place-items:center}
@media(max-width:760px){.tp-builder-hero{padding:17px;gap:12px}.tp-builder-hero-icon{width:42px;height:42px;flex-basis:42px}.tp-builder-hero h2{font-size:18px}.tp-builder-copy p{min-height:0}.tp-builder{min-height:0}}

/* AI & Bots settings cards */
.tp-settings-section{padding:14px 0;border-top:1px solid var(--tp-border)}
.tp-settings-section:first-child{border-top:0;padding-top:0}
.tp-settings-section .tp-info-title{margin-bottom:12px}
.tp-actions-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:16px}
.tp-ai-overview{position:relative;overflow:hidden}
.tp-ai-overview:before{content:"";position:absolute;inset:0 auto auto 0;width:100%;height:2px;background:var(--tp-accent,#14c995);opacity:.7}
.tp-ai-test{background:linear-gradient(180deg,var(--tp-accent-soft) 0%,var(--tp-panel) 140px)}
.tp-ai-test-row{display:flex;gap:8px;margin-top:6px}
.tp-ai-test-row .tp-input{flex:1}
.tp-ai-test-bubble{margin-top:14px;background:var(--tp-panel);border:1px solid var(--tp-border);border-radius:14px 14px 14px 4px;padding:12px 14px;max-width:520px;font-size:13px;line-height:1.5;box-shadow:var(--tp-shadow,0 2px 8px rgba(0,0,0,.06));white-space:pre-wrap}
.tp-ai-test-meta{margin-top:8px;font-size:11px;color:var(--tp-muted)}

/* v6.8 premium WhatsApp profile + media composer */
.tp-settings-whatsapp{overflow:hidden}
.tp-wa-profile-layout{display:grid;grid-template-columns:150px minmax(0,1fr);gap:24px;align-items:start}
.tp-wa-profile-side{display:flex;flex-direction:column;align-items:center;gap:9px;padding:6px 0}
.tp-wa-profile-side small{font-size:10px;line-height:1.45;color:var(--tp-muted);text-align:center}
.tp-wa-avatar{width:104px;height:104px;border-radius:28px;overflow:hidden;display:grid;place-items:center;background:linear-gradient(135deg,#00a884,#0f7c65);color:#fff;font-size:26px;font-weight:800;box-shadow:0 12px 28px rgba(0,168,132,.18);border:4px solid var(--tp-panel,#fff)}
.tp-wa-avatar img{width:100%;height:100%;object-fit:cover}
.tp-avatar-upload{position:relative;overflow:hidden;cursor:pointer}
.tp-avatar-upload input{position:absolute;inset:0;opacity:0;cursor:pointer}
.tp-wa-profile-form{min-width:0}
.tp-wa-meta-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:13px}
.tp-wa-meta-strip>div{padding:10px 11px;border:1px solid var(--tp-border,#e5e7eb);border-radius:10px;background:var(--tp-panel-2,#f8faf9);min-width:0}
.tp-wa-meta-strip small{display:block;color:var(--tp-muted);font-size:9px;margin-bottom:3px}
.tp-wa-meta-strip b{display:block;font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tp-settings-note{display:flex;gap:8px;flex-wrap:wrap;padding-top:13px;margin-top:14px;border-top:1px solid var(--tp-border,#e5e7eb);color:var(--tp-muted);font-size:10.5px}
.tp-settings-note span{padding:6px 9px;border-radius:8px;background:var(--tp-panel-2,#f6f8f7);border:1px solid var(--tp-border,#e5e7eb)}
.tp-media-compose{padding:2px 0}
.tp-media-preview-img{display:block;width:100%;max-height:280px;object-fit:contain;border-radius:12px;background:var(--tp-panel-2,#f6f8f7);margin-bottom:10px}
.tp-media-preview-icon{height:130px;border-radius:12px;background:var(--tp-panel-2,#f6f8f7);display:grid;place-items:center;font-size:42px;margin-bottom:10px}
.tp-media-meta{display:flex;flex-direction:column;gap:3px;margin-bottom:14px}
.tp-media-meta b{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tp-media-meta small{font-size:10px;color:var(--tp-muted)}
@media(max-width:760px){
  .tp-wa-profile-layout{grid-template-columns:1fr}
  .tp-wa-profile-side{flex-direction:row;justify-content:flex-start;align-items:center}
  .tp-wa-profile-side small{max-width:190px;text-align:left}
  .tp-wa-meta-strip{grid-template-columns:1fr 1fr}
}

/* Meta Tech Provider settings — clean SaaS control center */
.tp-settings-page{max-width:1160px;margin:0 auto;padding-bottom:32px}
.tp-settings-hero{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px 26px;margin-bottom:12px;border:1px solid var(--tp-line);border-radius:18px;background:var(--tp-panel);box-shadow:0 8px 28px rgba(17,27,24,.045)}
.tp-settings-hero h2{font-size:25px;letter-spacing:-.035em;margin:4px 0 4px;color:var(--tp-ink)}
.tp-settings-hero p{margin:0;color:var(--tp-muted);max-width:700px;font-size:12px}
.tp-settings-nav{position:sticky;top:8px;z-index:5;display:flex;gap:3px;padding:4px;margin:0 0 12px;background:var(--tp-panel);border:1px solid var(--tp-line);border-radius:13px;box-shadow:0 5px 18px rgba(17,27,24,.045);overflow:auto}
.tp-settings-nav button{display:flex;align-items:center;gap:7px;border:0;background:transparent;color:var(--tp-muted);padding:9px 13px;border-radius:9px;font:700 11.5px var(--tp-font);cursor:pointer;white-space:nowrap}
.tp-settings-nav button:hover{background:var(--tp-line-soft);color:var(--tp-ink)}
.tp-settings-nav button.on{background:var(--tp-ink);color:#fff}
.tp-settings-nav button svg{width:14px!important;height:14px!important}
.tp-settings-health{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 15px;margin-bottom:12px;background:var(--tp-panel);border:1px solid var(--tp-line);border-radius:13px}
.tp-settings-health-main,.tp-settings-health-stats{display:flex;align-items:center;gap:11px}.tp-settings-health-main small,.tp-settings-health-stats small{display:block;color:var(--tp-muted);font-size:9.5px}.tp-settings-health-main b{display:block;font-size:12.5px}.tp-settings-health-stats>span{padding-left:12px;border-left:1px solid var(--tp-line)}.tp-settings-health-stats b{display:block;font-size:11.5px}.tp-health-icon{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;background:var(--tp-line-soft);color:var(--tp-ink)}.tp-health-icon.green{background:var(--tp-accent-soft);color:var(--tp-accent)}.tp-health-icon svg{width:16px!important;height:16px!important}
.tp-settings-card{padding:20px;margin:0 0 12px;border:1px solid var(--tp-line);border-radius:15px;background:var(--tp-panel);box-shadow:0 5px 18px rgba(17,27,24,.035);scroll-margin-top:75px}
.tp-settings-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:16px}.tp-settings-head h3{margin:3px 0 3px;font-size:16px}.tp-settings-head p{margin:0;color:var(--tp-muted);font-size:11.5px}
.tp-wa-profile-layout{display:grid;grid-template-columns:170px minmax(0,1fr);gap:22px}.tp-wa-profile-side{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px}.tp-wa-profile-side small{font-size:10px;line-height:1.5;color:var(--tp-muted)}
.tp-wa-avatar{width:112px;height:112px;border-radius:50%;overflow:hidden;background:var(--tp-line-soft);border:4px solid var(--tp-panel);box-shadow:0 0 0 1px var(--tp-line),0 8px 24px rgba(17,27,24,.10);position:relative}.tp-wa-avatar img{width:100%;height:100%;object-fit:contain !important;object-position:center;display:block;background:var(--tp-panel,#fff)}.tp-wa-avatar-fallback{width:100%;height:100%;display:grid;place-items:center;background:linear-gradient(135deg,#0f9d76,#075d48);color:#fff;font-weight:800;font-size:27px}
.tp-wa-meta-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:14px}.tp-wa-meta-strip>div{padding:10px 11px;border:1px solid var(--tp-line);border-radius:10px;background:var(--tp-line-soft)}.tp-wa-meta-strip small{display:block;color:var(--tp-muted);font-size:9px;margin-bottom:3px}.tp-wa-meta-strip b{display:block;font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tp-settings-note{display:flex;gap:7px;flex-wrap:wrap;padding-top:12px;margin-top:14px;border-top:1px solid var(--tp-line);color:var(--tp-muted);font-size:10px}.tp-settings-note span{padding:6px 9px;border-radius:8px;background:var(--tp-line-soft);border:1px solid var(--tp-line)}
.tp-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:12px}.tp-settings-link-card{display:grid;grid-template-columns:38px 1fr auto;align-items:center;gap:12px;min-height:96px}.tp-settings-link-icon{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;background:var(--tp-line-soft);color:var(--tp-ink)}.tp-settings-link-icon svg{width:18px!important;height:18px!important}.tp-settings-link-card h2{margin:2px 0 3px;font-size:14px}.tp-settings-link-card p{margin:0;color:var(--tp-muted);font-size:11px}
.tp-settings-mini{display:flex;gap:7px;flex-wrap:wrap}.tp-settings-mini span{padding:6px 9px;border-radius:8px;background:var(--tp-line-soft);border:1px solid var(--tp-line);font-size:10px;font-weight:700;color:var(--tp-muted)}
.tp-avatar-upload{justify-content:center}
@media(max-width:760px){.tp-settings-hero{padding:19px;align-items:flex-start}.tp-settings-hero h2{font-size:22px}.tp-settings-health{align-items:flex-start;flex-direction:column}.tp-settings-health-stats{width:100%;justify-content:space-between}.tp-wa-profile-layout{grid-template-columns:1fr}.tp-wa-profile-side{flex-direction:row;text-align:left}.tp-wa-meta-strip{grid-template-columns:1fr 1fr}.tp-settings-grid{grid-template-columns:1fr}.tp-settings-link-card{grid-template-columns:38px 1fr}.tp-settings-link-card .tp-btn{grid-column:2;justify-self:start}}
@media(max-width:520px){.tp-wa-meta-strip{grid-template-columns:1fr}.tp-settings-nav{top:3px}.tp-settings-nav button{padding:8px 10px}}

/* Settings v3 — Sidebar + Card SaaS layout */
.tp-settings-page{max-width:1240px;margin:0 auto;padding:18px 18px 40px}
.tp-settings-hero{background:var(--tp-panel,#fff)!important;border:1px solid var(--tp-line,#e5ebe8)!important;border-radius:16px!important;box-shadow:0 6px 24px rgba(17,27,24,.045)!important;padding:20px 22px!important;margin-bottom:14px!important}
.tp-settings-shell{display:grid;grid-template-columns:220px minmax(0,1fr);gap:14px;align-items:start}
.tp-settings-sidebar{position:sticky;top:14px;background:var(--tp-panel,#fff);border:1px solid var(--tp-line,#e5ebe8);border-radius:15px;padding:9px;box-shadow:0 6px 24px rgba(17,27,24,.04)}
.tp-settings-sidebar-title{padding:8px 10px 7px;color:var(--tp-muted);font-size:9px;font-weight:800;letter-spacing:.09em;text-transform:uppercase}
.tp-settings-sidebar button{width:100%;display:flex;align-items:center;gap:10px;text-align:left;border:0;background:transparent;color:var(--tp-muted);padding:10px;border-radius:10px;cursor:pointer;font:inherit;margin:2px 0}
.tp-settings-sidebar button:hover{background:var(--tp-line-soft);color:var(--tp-ink)}
.tp-settings-sidebar button.on{background:#e9f8f1;color:#087b57}
.tp-settings-sidebar button>svg{width:17px!important;height:17px!important;flex:0 0 17px}
.tp-settings-sidebar button span{min-width:0;display:block}.tp-settings-sidebar button b{display:block;font-size:11.5px;line-height:1.25}.tp-settings-sidebar button small{display:block;font-size:9px;color:var(--tp-muted);margin-top:2px;font-weight:500}
.tp-settings-main{min-width:0}.tp-settings-main .tp-settings-health{margin-top:0}
.tp-settings-card{border-radius:15px!important;padding:20px!important;box-shadow:0 5px 20px rgba(17,27,24,.035)!important}
.tp-wa-profile-layout{display:grid;grid-template-columns:190px minmax(0,1fr);gap:22px;align-items:start}
.tp-wa-profile-side{display:flex;flex-direction:column;align-items:center;text-align:center;gap:9px;padding:15px 10px;background:var(--tp-line-soft);border:1px solid var(--tp-line);border-radius:13px}
.tp-wa-profile-side small{font-size:9.5px;color:var(--tp-muted);line-height:1.45}.tp-wa-avatar{position:relative;width:92px;height:92px;border-radius:22px;overflow:hidden;background:#dce9e4;display:grid;place-items:center;box-shadow:0 4px 15px rgba(0,0,0,.08)}
.tp-wa-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:2}.tp-wa-avatar.is-fallback img{display:none}.tp-wa-avatar-fallback{font-size:27px;font-weight:800;color:#087b57;z-index:1}
.tp-avatar-upload{white-space:nowrap}.tp-settings-health{box-shadow:none!important}
.tp-settings-main .tp-settings-grid{margin-bottom:12px}
@media(max-width:900px){.tp-settings-shell{grid-template-columns:1fr}.tp-settings-sidebar{position:static;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}.tp-settings-sidebar-title{grid-column:1/-1}.tp-settings-sidebar button{margin:0}.tp-settings-sidebar button small{display:none}}
@media(max-width:620px){.tp-settings-page{padding:10px 10px 28px}.tp-settings-hero{padding:16px!important}.tp-settings-sidebar{display:flex;overflow-x:auto}.tp-settings-sidebar-title{display:none}.tp-settings-sidebar button{flex:0 0 auto;width:auto;min-width:112px}.tp-settings-sidebar button span{white-space:nowrap}.tp-wa-profile-layout{grid-template-columns:1fr}.tp-wa-profile-side{flex-direction:row;text-align:left;align-items:center}.tp-wa-profile-side .tp-wa-avatar{width:68px;height:68px;border-radius:17px}.tp-settings-card{padding:15px!important}.tp-settings-health-stats{gap:7px}.tp-settings-health-stats>span{padding-left:7px}}
/* v6.8.12 — separate photo workflow: choose/preview/upload, independent of profile fields */
#twa-app.tp .tp-wa-profile-v2{display:grid;gap:16px}
#twa-app.tp .tp-wa-photo-card,#twa-app.tp .tp-wa-details-card{border:1px solid var(--tp-line);background:var(--tp-panel,#fff);border-radius:20px;padding:20px;box-shadow:0 8px 24px rgba(17,27,24,.05)}
#twa-app.tp .tp-wa-photo-title{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}
#twa-app.tp .tp-wa-photo-title h3{margin:3px 0 4px;font-size:19px}
#twa-app.tp .tp-wa-photo-title p{margin:0;color:var(--tp-muted);font-size:13px}
#twa-app.tp .tp-wa-photo-body{display:grid;gap:16px}
#twa-app.tp .tp-wa-photo-preview{display:flex;align-items:center;gap:18px;padding:16px;border-radius:16px;background:var(--tp-line-soft,#f5f8f7)}
#twa-app.tp .tp-wa-photo-preview .tp-wa-avatar{width:112px;height:112px;flex:0 0 112px}
#twa-app.tp .tp-wa-photo-meta{display:grid;gap:4px}.tp-wa-photo-meta b{font-size:16px}.tp-wa-photo-meta span{color:var(--tp-muted);font-size:13px}.tp-wa-photo-meta small{color:var(--tp-muted);font-size:11px;margin-top:5px}
#twa-app.tp .tp-wa-photo-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
#twa-app.tp .tp-wa-photo-actions button:disabled{opacity:.45;cursor:not-allowed}
#twa-app.tp .tp-wa-photo-status{font-size:12px;color:var(--tp-muted);padding:10px 12px;border-radius:10px;background:var(--tp-line-soft,#f5f8f7)}
#twa-app.tp .tp-wa-details-card .tp-settings-actions{margin-top:16px}
@media(max-width:620px){#twa-app.tp .tp-wa-photo-card,#twa-app.tp .tp-wa-details-card{padding:15px;border-radius:16px}#twa-app.tp .tp-wa-photo-preview{align-items:flex-start}.tp-wa-photo-actions{display:grid!important;grid-template-columns:1fr 1fr}.tp-wa-photo-actions .tp-btn{width:100%}.tp-wa-photo-actions .tp-btn:last-child{grid-column:1/-1}.tp-wa-photo-preview .tp-wa-avatar{width:82px!important;height:82px!important;flex-basis:82px!important}.tp-wa-photo-title{flex-direction:column}}

/* Trendex SaaS light theme: keep the branded dark sidebar like the reference UI. */
html[data-twa-theme="light"] #twa-app.tp .tp-side {
  background: #073b32;
  border-right-color: #0d5145;
  color: #eaf8f4;
}
html[data-twa-theme="light"] #twa-app.tp .tp-brand-mark {
  background: #0bc48a;
  color: #06362e;
  border-color: rgba(255,255,255,.14);
}
html[data-twa-theme="light"] #twa-app.tp .tp-org { color: #7fb9aa; }
html[data-twa-theme="light"] #twa-app.tp .tp-navitem { color: #b8d6ce; }
html[data-twa-theme="light"] #twa-app.tp .tp-navitem:hover { background: rgba(255,255,255,.07); color: #fff; }
html[data-twa-theme="light"] #twa-app.tp .tp-navitem.on { background: #0b5c4d; color: #fff; box-shadow: inset 3px 0 #13c997; }
html[data-twa-theme="light"] #twa-app.tp .tp-navitem .tp-ico { background: rgba(255,255,255,.07); color: #9cc9bd; }
html[data-twa-theme="light"] #twa-app.tp .tp-navitem.on .tp-ico { background: #fff; color: #07966f; }
html[data-twa-theme="light"] #twa-app.tp .tp-navitem .tp-caret,
html[data-twa-theme="light"] #twa-app.tp .tp-subitem { color: #86b5a8; }
html[data-twa-theme="light"] #twa-app.tp .tp-subitem:hover { background: rgba(255,255,255,.06); color: #fff; }
html[data-twa-theme="light"] #twa-app.tp .tp-subitem.on { background: rgba(19,201,151,.14); color: #bff7e7; }
html[data-twa-theme="light"] #twa-app.tp .tp-side-foot { border-top-color: rgba(255,255,255,.10); }
html[data-twa-theme="light"] #twa-app.tp .tp-user-meta b { color: #fff; }
html[data-twa-theme="light"] #twa-app.tp .tp-user-meta small { color: #83b6a8; }
html[data-twa-theme="light"] #twa-app.tp .tp-side-foot .tp-btn.ghost { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #d9eee9; }
html[data-twa-theme="light"] #twa-app.tp .tp-side-foot .tp-btn.ghost:hover { background: rgba(255,255,255,.11); color: #fff; }

/* Settings appearance selector — intentionally limited to Light + Dark for now. */
.tp-theme-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.tp-theme-option{position:relative;display:flex;align-items:center;gap:13px;text-align:left;width:100%;padding:14px 16px;border:1px solid var(--tp-line);background:var(--tp-panel-2);border-radius:14px;color:var(--tp-ink);cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .12s}
.tp-theme-option:hover{border-color:var(--tp-accent);transform:translateY(-1px)}
.tp-theme-option strong{display:block;font-size:13px;font-weight:800}.tp-theme-option small{display:block;color:var(--tp-muted);font-size:11px;line-height:1.45;margin-top:3px}
.tp-theme-option em{margin-left:auto;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;border:1px solid var(--tp-line);color:transparent;font-style:normal;font-size:12px;font-weight:900}
.tp-theme-option.on{border-color:var(--tp-accent);box-shadow:0 0 0 2px var(--tp-accent-soft)}
.tp-theme-option.on em{background:var(--tp-accent);border-color:var(--tp-accent);color:#fff}
.tp-theme-swatch{width:56px;height:38px;border-radius:9px;border:1px solid var(--tp-line);display:block;position:relative;overflow:hidden;flex:0 0 auto;background:#fff}
.tp-theme-swatch:before{content:"";position:absolute;left:0;top:0;bottom:0;width:17px;background:#0B3D2E}.tp-theme-swatch:after{content:"";position:absolute;left:22px;right:5px;top:6px;height:5px;border-radius:4px;background:#E7F0EC;box-shadow:0 10px 0 #E7F0EC,0 20px 0 #E7F0EC}
.tp-theme-swatch.dark{background:#151F1B;border-color:#24322C}.tp-theme-swatch.dark:before{background:#082D24}.tp-theme-swatch.dark:after{background:#2B3933;box-shadow:0 10px 0 #2B3933,0 20px 0 #2B3933}
.tp-theme-swatch i,.tp-theme-swatch b{display:none}
@media(max-width:700px){.tp-theme-options{grid-template-columns:1fr}}

/* retired: classic (white sidebar) theme removed from the theme switcher,
   Rabta Green is the default. Rules kept (harmless/unreachable) rather than
   risk a lossy edit across this block. */
html[data-twa-theme="classic"] #twa-app.tp .tp-side {
  background:#fff;
  border-right-color:#e2e9e6;
  color:#183129;
}
html[data-twa-theme="classic"] #twa-app.tp .tp-brand-mark { background:#0f9d76; color:#fff; border-color:rgba(15,157,118,.16); }
html[data-twa-theme="classic"] #twa-app.tp .tp-org { color:#6f8179; }
html[data-twa-theme="classic"] #twa-app.tp .tp-navitem { color:#60736b; }
html[data-twa-theme="classic"] #twa-app.tp .tp-navitem:hover { background:#f1f6f4; color:#17352b; }
html[data-twa-theme="classic"] #twa-app.tp .tp-navitem.on { background:#e9f8f1; color:#087b57; box-shadow:inset 3px 0 #13c997; }
html[data-twa-theme="classic"] #twa-app.tp .tp-navitem .tp-ico { background:#f1f6f4; color:#789087; }
html[data-twa-theme="classic"] #twa-app.tp .tp-navitem.on .tp-ico { background:#fff; color:#07966f; box-shadow:0 1px 4px rgba(15,157,118,.12); }
html[data-twa-theme="classic"] #twa-app.tp .tp-navitem .tp-caret,
html[data-twa-theme="classic"] #twa-app.tp .tp-subitem { color:#8a9a93; }
html[data-twa-theme="classic"] #twa-app.tp .tp-subitem:hover { background:#f5f8f7; color:#17352b; }
html[data-twa-theme="classic"] #twa-app.tp .tp-subitem.on { background:#e9f8f1; color:#087b57; }
html[data-twa-theme="classic"] #twa-app.tp .tp-side-foot { border-top-color:#e5ece9; }
html[data-twa-theme="classic"] #twa-app.tp .tp-user-meta b { color:#17352b; }
html[data-twa-theme="classic"] #twa-app.tp .tp-user-meta small { color:#8a9a93; }
html[data-twa-theme="classic"] #twa-app.tp .tp-side-foot .tp-btn.ghost { background:#f7faf9; border-color:#e1e9e5; color:#52665e; }
html[data-twa-theme="classic"] #twa-app.tp .tp-side-foot .tp-btn.ghost:hover { background:#eef5f2; color:#17352b; }

/* Two theme cards in Settings (classic/white removed). */
@media(max-width:700px){.tp-theme-options{grid-template-columns:1fr}}

/* v6.8.15 — WhatsApp Web inspired settings shell. */
.tp-wa-settings{display:grid;grid-template-columns:290px minmax(0,1fr);min-height:620px;border:1px solid var(--tp-line);border-radius:16px;overflow:hidden;background:var(--tp-panel);box-shadow:0 8px 28px rgba(17,27,24,.05)}
.tp-wa-settings-list{background:var(--tp-panel-2);border-right:1px solid var(--tp-line);padding:8px}
.tp-wa-settings-list .tp-wa-settings-title{padding:15px 14px 10px;font-size:20px;font-weight:800;color:var(--tp-ink)}
.tp-wa-settings-list .tp-wa-settings-sub{padding:0 14px 12px;color:var(--tp-muted);font-size:11px}
.tp-wa-setting-item{width:100%;display:flex;align-items:center;gap:12px;border:0;background:transparent;border-radius:10px;padding:11px 12px;text-align:left;color:var(--tp-ink-2);cursor:pointer;font:inherit;margin:2px 0}
.tp-wa-setting-item:hover{background:var(--tp-line-soft);color:var(--tp-ink)}
.tp-wa-setting-item.on{background:var(--tp-accent-soft);color:var(--tp-accent-ink)}
.tp-wa-setting-item .tp-wa-si{width:20px;display:grid;place-items:center;flex:0 0 20px}.tp-wa-setting-item .tp-wa-si svg{width:18px!important;height:18px!important}
.tp-wa-setting-item b{font-size:12px;display:block}.tp-wa-setting-item small{display:block;color:var(--tp-muted);font-size:9.5px;margin-top:2px}
.tp-wa-settings-main{min-width:0;padding:24px 28px;background:var(--tp-panel)}
.tp-wa-settings-section{max-width:760px}
.tp-wa-settings-section .tp-wa-section-title{font-size:18px;font-weight:800;margin:0 0 5px;color:var(--tp-ink)}
.tp-wa-settings-section .tp-wa-section-sub{font-size:11.5px;color:var(--tp-muted);margin:0 0 20px}
.tp-wa-profile-header{display:flex;align-items:flex-start;gap:16px;padding:0 0 16px;border-bottom:1px solid var(--tp-line);margin-bottom:18px}
.tp-wa-profile-avatar{width:104px;height:104px;border-radius:50%;overflow:hidden;background:var(--tp-line-soft);position:relative;flex:0 0 92px;display:grid;place-items:center;border:1px solid var(--tp-line)}
.tp-wa-profile-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.tp-wa-profile-avatar .tp-wa-avatar-fallback{font-size:27px}
.tp-wa-profile-info{min-width:0}.tp-wa-profile-info b{display:block;font-size:17px}.tp-wa-profile-info span{display:block;color:var(--tp-muted);font-size:11px;margin-top:3px}
.tp-wa-photo-menu{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.tp-wa-inline-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:15px 0;border-bottom:1px solid var(--tp-line)}
.tp-wa-inline-row:last-child{border-bottom:0}.tp-wa-inline-label b{display:block;font-size:12px}.tp-wa-inline-label small{display:block;color:var(--tp-muted);font-size:10px;margin-top:3px}
.tp-wa-connection-card{padding:15px;border:1px solid var(--tp-line);border-radius:12px;background:var(--tp-line-soft);margin-bottom:18px}
.tp-wa-connection-card b{font-size:12px}.tp-wa-connection-card p{margin:4px 0 12px;color:var(--tp-muted);font-size:10.5px;line-height:1.5}
.tp-wa-connect-actions{display:flex;gap:8px;flex-wrap:wrap}
.tp-wa-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.tp-wa-form-grid .full{grid-column:1/-1}
.tp-wa-danger{color:#b22f46!important}.tp-wa-note{font-size:10px;color:var(--tp-muted);margin-top:9px;line-height:1.5}
.tp-wa-status-line{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--tp-muted);margin-top:8px}.tp-wa-status-line .dot{width:7px;height:7px;border-radius:50%;background:#18a873}.tp-wa-status-line .dot.off{background:#d99b34}
@media(max-width:900px){.tp-wa-settings{grid-template-columns:1fr}.tp-wa-settings-list{border-right:0;border-bottom:1px solid var(--tp-line);display:flex;overflow-x:auto;gap:4px}.tp-wa-settings-list .tp-wa-settings-title,.tp-wa-settings-list .tp-wa-settings-sub{display:none}.tp-wa-setting-item{flex:0 0 auto;width:auto;min-width:130px}.tp-wa-setting-item small{display:none}}
@media(max-width:620px){.tp-wa-settings-main{padding:18px}.tp-wa-profile-header{align-items:flex-start}.tp-wa-profile-avatar{width:82px;height:82px;flex-basis:82px}.tp-wa-form-grid{grid-template-columns:1fr}.tp-wa-form-grid .full{grid-column:auto}}

/* v6.8.16 — settings behave like a real WhatsApp Web preferences panel. */
.tp-settings-page{height:calc(100vh - 92px);min-height:560px;overflow:hidden}
.tp-wa-settings{height:100%;min-height:0}
.tp-wa-settings-list{overflow-y:auto}
.tp-wa-settings-main{overflow:auto;min-height:0}
.tp-wa-settings-main>.tp-wa-settings-section{padding-bottom:28px}
.tp-wa-profile-avatar.has-photo .tp-wa-avatar-fallback{display:none}
@media(max-width:900px){.tp-settings-page{height:auto;min-height:0;overflow:visible}.tp-wa-settings{height:auto}.tp-wa-settings-main{overflow:visible}}

/* v6.8.24 — business profile image: never crop the uploaded artwork. */
#twa-app.tp .tp-wa-profile-avatar{width:112px;height:112px;flex-basis:112px;border-radius:16px;overflow:hidden;background:#fff;padding:6px;box-sizing:border-box;display:grid;place-items:center}
#twa-app.tp .tp-wa-profile-avatar img{position:absolute;inset:6px;width:calc(100% - 12px);height:calc(100% - 12px);object-fit:contain !important;object-position:center center !important;border-radius:10px;background:#fff;display:block}
#twa-app.tp .tp-wa-profile-avatar .tp-wa-avatar-fallback{border-radius:10px}
@media(max-width:620px){#twa-app.tp .tp-wa-profile-avatar{width:92px;height:92px;flex-basis:92px;padding:5px}#twa-app.tp .tp-wa-profile-avatar img{inset:5px;width:calc(100% - 10px);height:calc(100% - 10px);border-radius:9px}}

/* v6.8.26 — always show the complete business artwork in the settings preview. */
#twa-app.tp .tp-wa-profile-avatar{width:112px!important;height:112px!important;flex-basis:112px!important;border-radius:16px!important;overflow:hidden!important;background:#fff!important;padding:6px!important;box-sizing:border-box!important;display:grid!important;place-items:center!important}
#twa-app.tp .tp-wa-profile-avatar img{position:absolute!important;inset:6px!important;width:calc(100% - 12px)!important;height:calc(100% - 12px)!important;max-width:none!important;max-height:none!important;object-fit:contain!important;object-position:center center!important;border-radius:10px!important;background:#fff!important;display:block!important}
@media(max-width:620px){#twa-app.tp .tp-wa-profile-avatar{width:92px!important;height:92px!important;flex-basis:92px!important;padding:5px!important}#twa-app.tp .tp-wa-profile-avatar img{inset:5px!important;width:calc(100% - 10px)!important;height:calc(100% - 10px)!important;border-radius:9px!important}}


/* v6.8.30 — authoritative profile-photo positioning fix. */
#twa-app.tp .tp-brand{align-items:center;line-height:1}
#twa-app.tp .tp-brand-mark{position:relative!important;width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important;flex:0 0 50px!important;overflow:hidden!important;padding:0!important;margin:0!important;display:block!important;line-height:0!important;border-radius:12px!important;box-sizing:border-box!important}
#twa-app.tp .tp-brand-mark img{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:12px!important;display:block!important;object-fit:contain!important;object-position:center center!important;vertical-align:top!important;background:transparent!important}
#twa-app.tp .tp-brand-mark .tp-brand-fallback{position:absolute!important;inset:0!important;display:grid!important;place-items:center!important;width:100%!important;height:100%!important;line-height:1!important}
#twa-app.tp .tp-wa-profile-header{align-items:center!important}
#twa-app.tp .tp-wa-profile-avatar{position:relative!important;width:112px!important;height:112px!important;min-width:112px!important;min-height:112px!important;flex:0 0 112px!important;border-radius:16px!important;overflow:hidden!important;padding:0!important;margin:0!important;background:#fff!important;display:block!important;box-sizing:border-box!important;line-height:0!important}
#twa-app.tp .tp-wa-profile-avatar img{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:16px!important;object-fit:contain!important;object-position:center center!important;display:block!important;background:#fff!important;vertical-align:top!important}
#twa-app.tp .tp-wa-profile-avatar .tp-wa-avatar-fallback{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;border-radius:16px!important;display:grid!important;place-items:center!important;line-height:1!important}
@media(max-width:620px){#twa-app.tp .tp-brand-mark{width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;flex-basis:46px!important;border-radius:11px!important}#twa-app.tp .tp-brand-mark img{border-radius:11px!important}#twa-app.tp .tp-wa-profile-avatar{width:92px!important;height:92px!important;min-width:92px!important;min-height:92px!important;flex-basis:92px!important}#twa-app.tp .tp-wa-profile-avatar img,#twa-app.tp .tp-wa-profile-avatar .tp-wa-avatar-fallback{border-radius:13px!important}}

/* v6.8.35 — business-profile avatar fallback was painted above the real image.
 * The fallback used !important display:grid, so .has-photo could not hide it.
 * Keep the real Meta/WhatsApp image on top and hide the fallback once loaded. */
#twa-app.tp .tp-wa-profile-avatar.has-photo .tp-wa-avatar-fallback{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}
#twa-app.tp .tp-wa-profile-avatar img{z-index:2!important;visibility:visible!important;opacity:1!important}
#twa-app.tp .tp-wa-profile-avatar.is-fallback img{display:none!important}

/* v6.8.36 — CRM lead capture + task feed */
#twa-app.tp .tp-contact-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:-4px 0 14px}
#twa-app.tp .tp-contact-tabs .tp-chip{border:1px solid var(--tp-border);cursor:pointer;background:var(--tp-card);transition:.15s}
#twa-app.tp .tp-contact-tabs .tp-chip:hover{transform:translateY(-1px)}
#twa-app.tp .tp-contact-filters{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:16px;padding:12px;background:var(--tp-soft);border:1px solid var(--tp-border);border-radius:12px}
#twa-app.tp .tp-contact-filters .tp-search{min-width:260px;flex:1 1 260px}
#twa-app.tp .tp-contact-filters .tp-select{min-width:135px;flex:0 1 auto}
#twa-app.tp .tp-task-panel{margin-top:18px}
#twa-app.tp .tp-task-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:14px}
#twa-app.tp .tp-task-stats span{padding:12px 14px;border:1px solid var(--tp-border);border-radius:12px;background:var(--tp-soft);display:flex;flex-direction:column;gap:3px}
#twa-app.tp .tp-task-stats b{font-size:20px;line-height:1}
#twa-app.tp .tp-task-stats small{color:var(--tp-muted);font-size:11px}
#twa-app.tp .tp-task-feed{display:grid;gap:7px}
#twa-app.tp .tp-task-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--tp-border);border-radius:11px;background:var(--tp-card)}
#twa-app.tp .tp-task-row.overdue{border-color:color-mix(in srgb,#e8536b 45%,var(--tp-border));background:color-mix(in srgb,#e8536b 5%,var(--tp-card))}
#twa-app.tp .tp-task-check{width:28px;height:28px;border-radius:50%;border:1px solid var(--tp-border);background:var(--tp-soft);color:var(--tp-accent);font-weight:800;cursor:pointer;display:grid;place-items:center}
#twa-app.tp .tp-task-main{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}
#twa-app.tp .tp-task-main b{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#twa-app.tp .tp-task-main small{font-size:11px;color:var(--tp-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#twa-app.tp .tp-task-attention{margin-top:15px;padding-top:12px;border-top:1px solid var(--tp-border)}
#twa-app.tp .tp-chat-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
#twa-app.tp .tp-info-actions{display:flex;gap:8px}
@media(max-width:900px){#twa-app.tp .tp-task-stats{grid-template-columns:repeat(2,1fr)}}
@media(max-width:620px){#twa-app.tp .tp-contact-filters{padding:10px}.tp-contact-filters .tp-select,#twa-app.tp .tp-contact-filters .tp-search{min-width:100%;flex:1 1 100%}#twa-app.tp .tp-task-row{align-items:flex-start}#twa-app.tp .tp-task-row .tp-chip{margin-left:auto}}

/* v6.8.37 — Contacts / Leads CRM visual alignment with the portal design */
#twa-app.tp .tp-contacts-wrap{max-width:1320px}
#twa-app.tp .tp-leads-card{padding:20px}
#twa-app.tp .tp-leads-head{align-items:center;margin-bottom:16px}
#twa-app.tp .tp-leads-title .tp-page-kicker{font-size:10px;letter-spacing:.12em;font-weight:800;color:var(--tp-accent);margin-bottom:3px}
#twa-app.tp .tp-leads-title h2{font-size:20px;letter-spacing:-.025em}
#twa-app.tp .tp-contact-tabs{gap:8px;margin:4px 0 14px;overflow-x:auto;padding-bottom:2px}
#twa-app.tp .tp-filter-pill{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--tp-line);background:var(--tp-panel);color:var(--tp-ink-2);border-radius:999px;padding:8px 13px;font-size:12px;font-weight:700;white-space:nowrap;cursor:pointer}
#twa-app.tp .tp-filter-pill:hover{background:var(--tp-line-soft);color:var(--tp-ink)}
#twa-app.tp .tp-filter-pill.on{background:var(--tp-accent);border-color:var(--tp-accent);color:#fff}
#twa-app.tp .tp-contact-filters{display:grid;grid-template-columns:minmax(250px,1.65fr) repeat(5,minmax(115px,1fr)) auto;gap:9px;align-items:center;padding:10px;margin-bottom:10px;background:var(--tp-panel-2);border:1px solid var(--tp-line);border-radius:13px}
#twa-app.tp .tp-contact-filters .tp-search{min-width:0;width:auto}
#twa-app.tp .tp-contact-filters .tp-search input{height:42px;border-radius:11px;background:var(--tp-panel)}
#twa-app.tp .tp-contact-filters .tp-select{min-width:0;width:100%;height:42px;padding-top:9px;padding-bottom:9px}
#twa-app.tp .tp-table-meta{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:5px 4px 10px;color:var(--tp-muted);font-size:11.5px}
#twa-app.tp .tp-leads-table th{padding-top:6px}
#twa-app.tp .tp-leads-table td{padding:12px 10px}
#twa-app.tp .tp-leads-table tbody tr{transition:background .12s ease}
#twa-app.tp .tp-leads-table tbody tr:hover{background:var(--tp-panel-2)}
#twa-app.tp .tp-actions{display:flex;justify-content:flex-end;align-items:center;gap:5px}
@media(max-width:1180px){#twa-app.tp .tp-contact-filters{grid-template-columns:1.4fr repeat(3,1fr)}#twa-app.tp .tp-contact-filters .tp-search{grid-column:1/-1}}
@media(max-width:820px){#twa-app.tp .tp-leads-head{align-items:flex-start}#twa-app.tp .tp-contact-filters{grid-template-columns:1fr 1fr}#twa-app.tp .tp-contact-filters .tp-search{grid-column:1/-1}}
@media(max-width:620px){#twa-app.tp .tp-leads-card{padding:14px}#twa-app.tp .tp-leads-head .tp-ha{width:100%;display:grid;grid-template-columns:1fr 1fr}#twa-app.tp .tp-contact-filters{grid-template-columns:1fr;padding:9px}#twa-app.tp .tp-contact-filters .tp-search{grid-column:auto}#twa-app.tp .tp-table-meta{align-items:flex-start;flex-direction:column}}

/* v6.8.38 — dashboard My Day / Task Feed refinement */
#twa-app.tp .tp-task-dashboard{margin-top:4px;padding:0}
#twa-app.tp .tp-dashboard-stats{margin-top:26px}
#twa-app.tp .tp-section-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:0 0 12px}
#twa-app.tp .tp-section-heading h2{margin:2px 0 3px;font-size:20px;line-height:1.15;font-weight:800;letter-spacing:-.01em}
#twa-app.tp .tp-section-heading p{margin:0;color:var(--tp-muted);font-size:12.5px}
#twa-app.tp .tp-lead-action-sec .tp-info-lead-btn{width:100%;justify-content:center}
#twa-app.tp .tp-lead-status-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
#twa-app.tp .tp-lead-status-row .tp-info-muted{font-size:11.5px;color:var(--tp-muted);line-height:1.4}
#twa-app.tp .tp-task-headline{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:0 0 14px}
#twa-app.tp .tp-task-headline .tp-kicker{display:inline-block;font-size:10px;line-height:1;letter-spacing:.12em;text-transform:uppercase;font-weight:800;color:var(--tp-accent);margin-bottom:6px}
#twa-app.tp .tp-task-headline h2{margin:0;font-size:22px;font-weight:850;letter-spacing:-.03em}
#twa-app.tp .tp-task-headline p{margin:4px 0 0;font-size:12px;color:var(--tp-muted)}
#twa-app.tp .tp-task-head-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
#twa-app.tp .tp-task-head-actions .tp-btn svg{width:15px;height:15px}
#twa-app.tp .tp-task-stats-v2{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0 0 12px}
#twa-app.tp .tp-task-stat{min-width:0;display:flex;align-items:center;gap:12px;padding:14px;border:1px solid var(--tp-line);border-radius:14px;background:var(--tp-panel);box-shadow:var(--tp-shadow);position:relative;overflow:hidden}
#twa-app.tp .tp-task-stat:before{content:"";position:absolute;inset:0 auto 0 0;width:3px;background:var(--tp-accent)}
#twa-app.tp .tp-task-stat.stat-rose:before{background:var(--tp-rose)}
#twa-app.tp .tp-task-stat.stat-amber:before{background:var(--tp-amber)}
#twa-app.tp .tp-task-stat.stat-blue:before{background:var(--tp-blue)}
#twa-app.tp .tp-task-stat-ico{width:38px;height:38px;flex:0 0 38px;border-radius:11px;display:grid;place-items:center;background:var(--tp-accent-soft);color:var(--tp-accent-ink)}
#twa-app.tp .tp-task-stat-ico svg{width:18px;height:18px}
#twa-app.tp .stat-rose .tp-task-stat-ico{background:#FFF0F2;color:var(--tp-rose)}
#twa-app.tp .stat-amber .tp-task-stat-ico{background:#FFF6E7;color:#B87900}
#twa-app.tp .stat-blue .tp-task-stat-ico{background:#EEF5FF;color:var(--tp-blue)}
#twa-app.tp .tp-task-stat b{display:block;font-size:20px;line-height:1.1;font-weight:850}
#twa-app.tp .tp-task-stat small{display:block;margin-top:3px;color:var(--tp-muted);font-size:11px;font-weight:600}
#twa-app.tp .tp-task-grid{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(300px,.8fr);gap:12px}
#twa-app.tp .tp-task-card,#twa-app.tp .tp-task-side{min-width:0;margin:0}
#twa-app.tp .tp-task-card .tp-card-head,#twa-app.tp .tp-task-side .tp-card-head{align-items:center}
#twa-app.tp .tp-task-card .tp-card-head h2,#twa-app.tp .tp-task-side .tp-card-head h2{font-size:15px}
#twa-app.tp .tp-task-card .tp-card-head p,#twa-app.tp .tp-task-side .tp-card-head p{font-size:11px}
#twa-app.tp .tp-task-feed{gap:0;border-top:1px solid var(--tp-line)}
#twa-app.tp .tp-task-row{border:0;border-bottom:1px solid var(--tp-line);border-radius:0;background:transparent;padding:11px 2px;min-height:54px}
#twa-app.tp .tp-task-row:last-child{border-bottom:0}
#twa-app.tp .tp-task-row:hover{background:var(--tp-line-soft);margin:0 -8px;padding-left:10px;padding-right:10px;border-radius:10px}
#twa-app.tp .tp-task-ico{width:30px;height:30px;flex:0 0 30px;border-radius:9px;display:grid;place-items:center;background:var(--tp-accent-soft);color:var(--tp-accent-ink)}
#twa-app.tp .tp-task-ico svg{width:15px;height:15px}
#twa-app.tp .tp-task-ico.rose{background:#FFF0F2;color:var(--tp-rose)}
#twa-app.tp .tp-task-main{gap:2px}
#twa-app.tp .tp-task-main b{font-size:12.5px;font-weight:750}
#twa-app.tp .tp-task-main small{font-size:10.5px}
#twa-app.tp .tp-task-time{font-size:10.5px;color:var(--tp-muted);white-space:nowrap;margin-left:auto}
#twa-app.tp .tp-task-time.overdue{color:var(--tp-rose);font-weight:750}
#twa-app.tp .tp-task-more{width:30px;height:30px;flex:0 0 30px;border-radius:9px}
#twa-app.tp .tp-attention-list{display:grid;gap:4px}
#twa-app.tp .tp-attention-item{display:flex;align-items:center;gap:9px;width:100%;padding:9px 7px;border:0;background:transparent;border-radius:10px;text-align:left;cursor:pointer;color:inherit}
#twa-app.tp .tp-attention-item:hover{background:var(--tp-line-soft)}
#twa-app.tp .tp-attention-item .tp-avatar{width:31px;height:31px;flex-basis:31px;font-size:10px}
#twa-app.tp .tp-attention-item .tp-lr-main{min-width:0;flex:1}
#twa-app.tp .tp-attention-item .tp-lr-main b{font-size:12px}
#twa-app.tp .tp-attention-item .tp-lr-main small{font-size:10px}
#twa-app.tp .tp-attention-item .tp-chip{font-size:9.5px;padding:4px 7px}
#twa-app.tp .tp-task-check{width:24px;height:24px;flex:0 0 24px;font-size:11px}
@media(max-width:1000px){#twa-app.tp .tp-task-grid{grid-template-columns:1fr}#twa-app.tp .tp-task-stats-v2{grid-template-columns:repeat(2,1fr)}}
@media(max-width:620px){#twa-app.tp .tp-task-headline{align-items:flex-start;flex-direction:column}#twa-app.tp .tp-task-head-actions{width:100%;justify-content:flex-start}#twa-app.tp .tp-task-head-actions .tp-btn{flex:1}#twa-app.tp .tp-task-stats-v2{grid-template-columns:1fr 1fr;gap:8px}#twa-app.tp .tp-task-stat{padding:11px;gap:9px}#twa-app.tp .tp-task-stat-ico{width:32px;height:32px;flex-basis:32px}#twa-app.tp .tp-task-stat b{font-size:17px}#twa-app.tp .tp-task-time{display:none}#twa-app.tp .tp-task-row .tp-chip{margin-left:auto}}

/* v6.8.40 task/chat interaction polish */
#twa-app.tp .tp-task-clickable{cursor:pointer;transition:background .15s ease,transform .15s ease}
#twa-app.tp .tp-task-clickable:hover{background:var(--tp-line-soft);transform:translateY(-1px)}
#twa-app.tp .tp-task-clickable .tp-task-check,#twa-app.tp .tp-task-clickable .tp-task-more{position:relative;z-index:2}

/* v6.8.41 — compact inbox priority + mobile contact filters */
#twa-app.tp .tp-thread-tags{display:flex;align-items:center;gap:5px;min-height:15px;margin-top:3px}
#twa-app.tp .tp-priority-dot{display:inline-block;width:8px;height:8px;min-width:8px;border-radius:50%;vertical-align:middle;box-shadow:0 0 0 2px var(--tp-card,#fff);border:1px solid rgba(0,0,0,.08)}
#twa-app.tp .tp-priority-dot.high{background:#e34f5f}
#twa-app.tp .tp-priority-dot.medium{background:#f2b84b}
#twa-app.tp .tp-priority-dot.low{background:#2fb67b}
#twa-app.tp .tp-contact-filter-toggle{display:none;align-items:center;justify-content:center;gap:6px}
@media(max-width:620px){
  #twa-app.tp .tp-contact-filters{grid-template-columns:minmax(0,1fr) auto;padding:8px;gap:7px}
  #twa-app.tp .tp-contact-filters .tp-search{grid-column:1 / -1;min-width:0}
  #twa-app.tp .tp-contact-filter-toggle{display:inline-flex;grid-column:1 / -1;width:100%;height:38px}
  #twa-app.tp .tp-contact-filters .tp-select,#twa-app.tp .tp-contact-filters [data-contact-clear]{display:none}
  #twa-app.tp .tp-contact-filters.is-open .tp-select{display:block}
  #twa-app.tp .tp-contact-filters.is-open [data-contact-clear]{display:inline-flex}
  #twa-app.tp .tp-contact-filters.is-open{grid-template-columns:1fr}
  #twa-app.tp .tp-contact-filters.is-open .tp-contact-filter-toggle{grid-column:auto}
  #twa-app.tp .tp-contact-filters .tp-select{height:40px}
  #twa-app.tp .tp-leads-table{min-width:850px}
}

/* v6.8.42 — mobile contact filters as compact bottom sheet */
#twa-app.tp .tp-contact-filter-toggle .tp-filter-count{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--tp-accent);color:#fff;font-size:10px;line-height:1;font-weight:800}
#twa-app.tp .tp-contact-sheet-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
#twa-app.tp .tp-sheet-field{display:grid;gap:6px}
#twa-app.tp .tp-sheet-field>span{font-size:11px;font-weight:750;color:var(--tp-muted)}
#twa-app.tp .tp-sheet-field .tp-select{width:100%;min-width:0;height:42px}
#twa-app.tp .tp-sheet-clear{margin-top:14px}
@media(max-width:620px){
  #twa-app.tp .tp-contact-filters{display:grid;grid-template-columns:1fr auto;padding:0;gap:8px;background:transparent;border:0;margin-bottom:12px}
  #twa-app.tp .tp-contact-filters .tp-search{grid-column:1 / -1;min-width:0;width:100%;padding:0 12px;border:1px solid var(--tp-line);background:var(--tp-panel);border-radius:12px}
  #twa-app.tp .tp-contact-filters .tp-search input{height:42px;background:transparent;border:0}
  #twa-app.tp .tp-contact-filter-toggle{display:inline-flex;grid-column:auto;width:auto;min-width:108px;height:38px;padding:0 12px}
  #twa-app.tp .tp-contact-filters [data-contact-clear]{display:inline-flex;grid-column:auto;height:38px}
  #twa-app.tp .tp-contact-filters .tp-select{display:none!important}
  #twa-app.tp .tp-contact-sheet-grid{grid-template-columns:1fr;gap:10px}
  #twa-app.tp .tp-modal-bg{align-items:flex-end;padding:0}
  #twa-app.tp .tp-modal.tp-contact-filter-sheet{border-radius:20px 20px 0 0;max-height:82vh}
}
@media(min-width:621px){#twa-app.tp .tp-contact-filter-toggle{display:none!important}}

/* v6.8.43 — lean contact filters: keep only Stage, Priority and Date */
#twa-app.tp .tp-contact-filters{grid-template-columns:minmax(280px,1.8fr) repeat(3,minmax(145px,1fr)) auto}
#twa-app.tp .tp-contact-filters .tp-select{min-width:0}
@media(max-width:1180px){#twa-app.tp .tp-contact-filters{grid-template-columns:minmax(220px,1.5fr) repeat(3,minmax(125px,1fr)) auto}}
@media(max-width:820px){#twa-app.tp .tp-contact-filters{grid-template-columns:1fr 1fr 1fr;gap:7px;padding:8px}.tp-contact-filters .tp-search{grid-column:1/-1}.tp-contact-filters .tp-filter-stage,.tp-contact-filters .tp-filter-priority,.tp-contact-filters .tp-filter-added{height:38px;padding-left:9px;padding-right:25px;font-size:11px}.tp-contact-filters [data-contact-clear]{height:38px}}
@media(max-width:620px){#twa-app.tp .tp-contact-filters{display:grid;grid-template-columns:1fr 1fr 1fr;padding:7px;gap:6px;margin-bottom:9px;border-radius:11px}#twa-app.tp .tp-contact-filters .tp-search{grid-column:1/-1;height:40px}#twa-app.tp .tp-contact-filters .tp-search input{height:38px;font-size:12px}#twa-app.tp .tp-contact-filters .tp-filter-stage,#twa-app.tp .tp-contact-filters .tp-filter-priority,#twa-app.tp .tp-contact-filters .tp-filter-added{display:block!important;width:100%;height:36px;font-size:10.5px;border-radius:9px;padding-left:8px;padding-right:19px;background:var(--tp-panel)}#twa-app.tp .tp-contact-filters [data-contact-clear]{grid-column:1/-1;width:100%;height:32px;font-size:11px}}

/* v6.8.45 compact contact sidebar */
.tp-contact-compact{border-top:1px solid var(--tp-line-soft);}
.tp-compact-row{display:flex;gap:10px;align-items:flex-start;padding:11px 0;border-bottom:1px solid var(--tp-line-soft);}
.tp-compact-icon{width:30px;height:30px;flex:0 0 30px;border-radius:9px;background:var(--tp-soft);color:var(--tp-green);display:grid;place-items:center;}
.tp-compact-icon svg{width:15px;height:15px}.tp-priority-icon{font-size:13px;color:#e3a21a;line-height:1;}
.tp-compact-main{min-width:0;flex:1}.tp-compact-main>b{display:block;font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--tp-muted);margin:1px 0 6px;}
.tp-compact-select{height:36px;padding:7px 9px;margin:0}.tp-compact-main small{display:block;margin-top:5px;font-size:10px;line-height:1.35;color:var(--tp-muted);}
.tp-compact-input{height:36px;margin-top:7px}.tp-compact-note{padding:11px 0;border-bottom:1px solid var(--tp-line-soft)}
.tp-compact-note-head{display:flex;align-items:center;gap:9px;margin-bottom:8px}.tp-compact-note-head b{font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--tp-muted)}
@media(max-width:760px){.tp-compact-row{padding:9px 0}.tp-compact-icon{width:28px;height:28px;flex-basis:28px}.tp-compact-select{height:34px}.tp-compact-input{height:34px}}

/* v6.8.46 — compact contact sidebar refresh */
#twa-app.tp .tp-info { padding:14px 12px; }
#twa-app.tp .tp-info-hero-compact { display:flex; align-items:center; gap:11px; text-align:left; padding:4px 4px 13px; }
#twa-app.tp .tp-info-hero-compact .tp-avatar { width:48px; height:48px; margin:0; font-size:17px; }
#twa-app.tp .tp-info-hero-copy { min-width:0; }
#twa-app.tp .tp-info-hero-copy b { font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#twa-app.tp .tp-info-hero-copy small { display:block; font-size:11px; margin-top:2px; }
#twa-app.tp .tp-info-hero-copy .tp-wa-name { margin-top:2px; font-size:10px; }
#twa-app.tp .tp-info-compact-sec { padding:10px 0; }
#twa-app.tp .tp-info-row-head { display:flex; align-items:center; gap:8px; margin-bottom:7px; color:var(--tp-text); font-size:12px; font-weight:750; }
#twa-app.tp .tp-info-row-head svg { width:15px; height:15px; color:var(--tp-accent); flex:0 0 15px; }
#twa-app.tp .tp-info-compact-control { height:35px; padding:7px 10px; font-size:12px; }
#twa-app.tp .tp-info-hint { display:block; margin-top:5px; font-size:10px !important; line-height:1.35; color:var(--tp-muted); }
#twa-app.tp .tp-tags-sec #tp-tagbox { min-height:20px; }
#twa-app.tp .tp-tags-sec #tp-tag-input { height:34px; padding:7px 10px; font-size:11px; }
#twa-app.tp .tp-info-actions { padding:11px 0; }
#twa-app.tp .tp-quick-actions .tp-btn { width:100%; justify-content:center; height:35px; }
#twa-app.tp .tp-notes-sec { padding:12px 0; }
#twa-app.tp .tp-notes-sec .tp-textarea { min-height:72px !important; font-size:11.5px; }
#twa-app.tp .tp-notes-sec .tp-btn { width:100%; }
#twa-app.tp .tp-auto-row { padding:9px 10px; border-radius:9px; margin-bottom:7px; }

/* v6.8.46 — visual automation builder: clearer hierarchy and mobile-safe branches */
.reference-builder .funnel { width:min(1080px,100%); }
.reference-builder .node-card { border-radius:10px; transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease; }
.reference-builder .node-card:hover { transform:translateY(-1px); box-shadow:0 8px 24px rgba(31,41,55,.09); border-color:#cfd8e3; }
.reference-builder .node-head { min-height:58px; }
.reference-builder .node-title { letter-spacing:-.15px; }
.reference-builder .node-summary { color:#5d6874; }
.reference-builder .trigger-card,.reference-builder .condition-card { box-shadow:0 4px 14px rgba(31,41,55,.05); }
.reference-builder .add-action { border-style:dashed; background:rgba(255,255,255,.8); }
.reference-builder .branch-label { border-width:1px; font-weight:800; }
.reference-builder .multi-branches { align-items:start; }
.reference-builder .multi-branches .branch { min-width:0; }
.reference-builder .multi-branches .branch-label { background:#fff; }
.reference-builder .multi-branches .node-card { min-height:0; }
.reference-builder .multi-branches .node-summary { font-size:10.5px; }
.reference-builder .picker { border-radius:14px; }
.reference-builder .picker-grid .pick { min-height:54px; }
.reference-builder .inspector { width:min(450px,calc(100vw - 36px)); }
.reference-builder .ins-head { padding:13px 15px; }
.reference-builder .ins-body { padding:13px 15px; }
.reference-builder .ins-body .notice { border-left:3px solid var(--green); text-align:left; }
.reference-builder #multiBranches > div { background:var(--card); border-color:var(--line) !important; border-radius:10px !important; padding:11px !important; box-shadow:0 2px 7px rgba(31,41,55,.04); }
.reference-builder #multiBranches > div > b { display:flex; align-items:center; gap:7px; font-size:11px; color:var(--ink); }
.reference-builder #multiBranches > div > b::before { content:'↳'; color:var(--green2); font-size:13px; }
.reference-builder #addMultiBranch { width:100%; margin-top:8px; }
@media(max-width:760px){
  .reference-builder .shell { padding:16px 8px 90px; }
  .reference-builder .top { min-height:54px; }
  .reference-builder .funnel { width:100%; }
  .reference-builder .node-card { width:min(350px,calc(100vw - 28px)); }
  .reference-builder .branches { gap:9px; }
  .reference-builder .multi-branches {
    display:flex !important; flex-wrap:nowrap !important; overflow-x:auto !important; overflow-y:visible;
    gap:10px !important; padding:4px 4px 16px !important; margin:0 !important;
    scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch; scrollbar-width:none;
  }
  .reference-builder .multi-branches::-webkit-scrollbar { display:none; }
  .reference-builder .multi-branches .branch {
    flex:0 0 min(82vw,320px) !important; width:min(82vw,320px) !important;
    padding-top:38px !important; scroll-snap-align:start;
  }
  .reference-builder .multi-branches .branch::before { height:31px !important; }
  .reference-builder .multi-branches .branch::after { top:27px !important; }
  .reference-builder .multi-branches .branch-label { top:18px !important; max-width:88%; padding:5px 8px; }
  .reference-builder .multi-branches .node-card { width:100% !important; }
  .reference-builder .multi-branches .add-action { width:100% !important; }
  .reference-builder .multi-branches + .merge-connector { width:30% !important; height:30px !important; }
  .reference-builder .inspector { right:0; left:0; bottom:0; top:auto; width:100%; max-height:82vh; border-radius:16px 16px 0 0; }
  .reference-builder .inspector .ins-head { padding:12px 14px; }
  .reference-builder .picker { max-height:82vh; }
  .reference-builder .picker-grid { grid-template-columns:1fr; }
  .reference-builder .picker-grid .pick { min-height:48px; }
}

/* Integration instructions */
.tp-instructions{margin-top:18px;padding:16px 18px;border:1px solid var(--tp-border);border-radius:14px;background:var(--tp-bg-soft,rgba(16,185,129,.035))}.tp-instructions-title{font-size:14px;font-weight:800;margin-bottom:8px;color:var(--tp-ink)}.tp-instructions ol{margin:0;padding-left:22px;color:var(--tp-muted);line-height:1.65}.tp-instructions li{margin:4px 0}.tp-integration-card{overflow:hidden}

/* v6.8.66 — Modern integration cards: Shopify / WooCommerce / Website-CRM */
#twa-app.tp .tp-integration-modern{display:grid;grid-template-columns:minmax(0,1.55fr) 1px minmax(300px,.9fr);padding:0;overflow:hidden;border-radius:18px;box-shadow:0 8px 28px rgba(31,41,55,.06)}
#twa-app.tp .tp-integration-main{padding:24px 26px 22px;min-width:0}
#twa-app.tp .tp-integration-top{margin-bottom:18px}
#twa-app.tp .tp-brand-row{display:flex;gap:16px;align-items:flex-start;min-width:0}
#twa-app.tp .tp-brand-icon{width:58px;height:58px;flex:0 0 58px;border-radius:16px;display:grid;place-items:center;font-size:28px;font-weight:850;box-shadow:inset 0 0 0 1px rgba(255,255,255,.7)}
#twa-app.tp .tp-brand-shopify{background:#e8f8ed;color:#14804a}
#twa-app.tp .tp-brand-woocommerce{background:#eeeafd;color:#6957c8}
#twa-app.tp .tp-brand-custom{background:#eaf7f5;color:#087d6c}
#twa-app.tp .tp-brand-api{background:#edf2f7;color:#43566d}
#twa-app.tp .tp-brand-row>div:last-child{min-width:0;flex:1}
#twa-app.tp .tp-brand-title{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
#twa-app.tp .tp-brand-title h2{margin:0;font-size:21px;letter-spacing:-.25px;color:var(--tp-ink)}
#twa-app.tp .tp-brand-row p{margin:5px 0 3px;color:var(--tp-muted);font-size:13px;line-height:1.5}
#twa-app.tp .tp-brand-row small{display:block;color:var(--tp-muted);font-size:11px;line-height:1.45}
#twa-app.tp .tp-status{display:inline-flex;align-items:center;gap:6px;height:27px;padding:0 10px;border-radius:999px;background:#f2f4f5;color:#69747c;font-size:11px;font-weight:800}
#twa-app.tp .tp-status i{width:7px;height:7px;border-radius:50%;background:#aeb7bd;display:block}
#twa-app.tp .tp-status.ok{background:#dff6e9;color:#087443}.tp-status.ok i{background:#12a15c}
#twa-app.tp .tp-status.warn{background:#fff3d8;color:#9a6810}.tp-status.warn i{background:#e6a528}
#twa-app.tp .tp-integration-store{display:flex;align-items:center;gap:11px;margin:0 0 18px;padding:11px 14px;border:1px solid #dcefe6;background:linear-gradient(90deg,#f0fbf6,#f8fcfa);border-radius:12px}
#twa-app.tp .tp-store-icon{width:32px;height:32px;border-radius:9px;background:#d9f2e5;color:#087443;display:grid;place-items:center;font-size:14px;flex:0 0 32px}
#twa-app.tp .tp-integration-store div{min-width:0;flex:1}.tp-integration-store small{display:block;color:var(--tp-muted);font-size:10px;margin-bottom:2px}.tp-integration-store b{display:block;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--tp-ink)}
#twa-app.tp .tp-store-arrow{font-size:16px;color:#16845d}
#twa-app.tp .tp-integration-actions{display:flex;gap:10px;flex-wrap:wrap}
#twa-app.tp .tp-integration-actions .tp-btn{height:42px;border-radius:11px;padding:0 16px;font-weight:800}
#twa-app.tp .tp-btn.primary{background:#08795f;color:#fff;border:1px solid #08795f}.tp-btn.primary:hover{filter:brightness(.96)}
#twa-app.tp .tp-btn.danger-outline{background:#fff;color:#d64c4c;border:1px solid #f0bcbc}
#twa-app.tp .tp-integration-divider{width:1px;background:var(--tp-line-soft,#edf0f2);margin:20px 0}
#twa-app.tp .tp-integration-guide{padding:22px 22px 20px;background:#fbfcfc;min-width:0}
#twa-app.tp .tp-integration-guide .tp-instructions{margin:0;border:0;background:transparent;padding:0}
#twa-app.tp .tp-integration-guide .tp-instructions-title{display:flex;align-items:center;gap:9px;font-size:15px;margin-bottom:13px;color:var(--tp-ink)}
#twa-app.tp .tp-integration-guide .tp-instructions-title:before{content:'▤';width:28px;height:28px;border-radius:8px;background:#eef4f2;display:grid;place-items:center;color:#16845d;font-size:13px}
#twa-app.tp .tp-integration-guide .tp-instructions ol{list-style:none;padding:0;margin:0;counter-reset:steps;color:var(--tp-muted)}
#twa-app.tp .tp-integration-guide .tp-instructions li{position:relative;padding:4px 0 8px 39px;margin:0;line-height:1.45;font-size:11.5px;counter-increment:steps}
#twa-app.tp .tp-integration-guide .tp-instructions li:before{content:counter(steps);position:absolute;left:0;top:1px;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:#e8f8ef;color:#09825a;font-weight:850;font-size:11px}
#twa-app.tp .tp-custom-copy{margin:0 0 17px;padding:12px 14px;border:1px solid #e1ecea;background:#f7fbfa;border-radius:11px;color:var(--tp-muted);font-size:12px;line-height:1.5}
#twa-app.tp .tp-api-card .tp-integration-main{display:flex;align-items:center;gap:20px}.tp-api-card .tp-brand-row{flex:1}.tp-api-card .tp-integration-actions{flex:0 0 auto}
@media(max-width:900px){#twa-app.tp .tp-integration-modern{grid-template-columns:1fr}.tp-integration-divider{height:1px;width:auto!important;margin:0!important}.tp-integration-guide{padding:18px 22px 20px!important}.tp-api-card .tp-integration-main{display:block}.tp-api-card .tp-integration-actions{margin-top:16px}}
@media(max-width:620px){#twa-app.tp .tp-integration-main{padding:18px 16px}.tp-brand-icon{width:48px!important;height:48px!important;flex-basis:48px!important;border-radius:13px!important;font-size:23px!important}.tp-brand-title h2{font-size:18px!important}.tp-brand-row{gap:12px!important}.tp-integration-actions .tp-btn{width:100%;justify-content:center}.tp-integration-guide{padding:16px!important}.tp-integration-guide .tp-instructions li{padding-left:35px;font-size:11px}.tp-integration-guide .tp-instructions li:before{width:22px;height:22px}}
\n/* v6.8.67 — commerce order sheets + proper integration icons */\n#twa-app.tp .tp-brand-icon svg{width:32px;height:32px;display:block}\n#twa-app.tp .tp-commerce-orders{margin-top:14px;background:var(--tp-card,#fff);border:1px solid var(--tp-border,#dce9e4);border-radius:18px;box-shadow:0 8px 24px rgba(20,60,50,.05);overflow:hidden}\n#twa-app.tp .tp-commerce-orders-head{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:18px 20px;border-bottom:1px solid var(--tp-border,#dce9e4)}\n#twa-app.tp .tp-commerce-orders-head h3{margin:2px 0 3px;font-size:17px}\n#twa-app.tp .tp-commerce-orders-head p{margin:0;color:var(--tp-muted);font-size:12px}\n#twa-app.tp .tp-commerce-filters{display:flex;gap:8px;align-items:center}\n#twa-app.tp .tp-orders-body{min-height:64px}\n#twa-app.tp .tp-orders-table td,#twa-app.tp .tp-orders-table th{white-space:nowrap}\n@media(max-width:760px){#twa-app.tp .tp-commerce-orders-head{align-items:flex-start;flex-direction:column}#twa-app.tp .tp-commerce-filters{width:100%}#twa-app.tp .tp-commerce-filters .tp-select{flex:1}#twa-app.tp .tp-orders-body{overflow-x:auto}}\n
/* v6.8.68 — Design 2 gradient integration + order activity refresh */
#twa-app.tp .tp-integration-design2{display:block!important;padding:0!important;overflow:hidden;border-radius:20px;box-shadow:0 10px 30px rgba(20,60,50,.06)}
#twa-app.tp .tp-integration-design2 .tp-integration-banner{position:relative;min-height:158px;padding:25px 28px;display:flex;align-items:center;justify-content:space-between;overflow:hidden;color:#fff}
#twa-app.tp .tp-banner-shopify{background:linear-gradient(115deg,#08795f 0%,#15956f 62%,#42b889 100%)}
#twa-app.tp .tp-banner-woocommerce{background:linear-gradient(115deg,#5c48b8 0%,#7563d0 62%,#9a8ce4 100%)}
#twa-app.tp .tp-banner-custom{background:linear-gradient(115deg,#116b74 0%,#168b79 62%,#39b69a 100%)}
#twa-app.tp .tp-banner-brand{position:relative;z-index:2;display:flex;align-items:flex-start;gap:17px;min-width:0}
#twa-app.tp .tp-integration-design2 .tp-brand-icon{width:72px;height:72px;flex:0 0 72px;border-radius:17px;background:rgba(255,255,255,.96);color:#08795f;display:grid;place-items:center;box-shadow:0 8px 22px rgba(0,0,0,.08)}
#twa-app.tp .tp-integration-design2 .tp-brand-icon svg{width:42px;height:42px}
#twa-app.tp .tp-banner-woocommerce .tp-brand-icon{color:#6957c8}.tp-banner-custom .tp-brand-icon{color:#087d6c}
#twa-app.tp .tp-integration-design2 .tp-brand-title h2{color:#fff;font-size:24px}.tp-integration-design2 .tp-brand-row p,.tp-integration-design2 .tp-brand-title p{color:rgba(255,255,255,.88)}
#twa-app.tp .tp-integration-design2 .tp-banner-brand p{margin:6px 0 3px;color:rgba(255,255,255,.9);font-size:13px;line-height:1.45}.tp-integration-design2 .tp-banner-brand small{color:rgba(255,255,255,.78)}
#twa-app.tp .tp-integration-design2 .tp-status{background:rgba(255,255,255,.18);color:#fff;border:1px solid rgba(255,255,255,.2)}#twa-app.tp .tp-integration-design2 .tp-status i{background:#d6e4df}.tp-integration-design2 .tp-status.ok{background:#dff6e9;color:#087443;border-color:transparent}.tp-integration-design2 .tp-status.ok i{background:#12a15c}
#twa-app.tp .tp-banner-note{position:relative;z-index:2;color:rgba(255,255,255,.95);font-size:12px;line-height:1.45;text-align:center;transform:rotate(-4deg);margin-left:auto;margin-right:65px}
#twa-app.tp .tp-banner-watermark{position:absolute;right:-10px;bottom:-35px;width:175px;height:175px;opacity:.13;color:#fff;transform:rotate(-8deg)}#twa-app.tp .tp-banner-watermark svg{width:100%;height:100%}
#twa-app.tp .tp-integration-design2 .tp-integration-store{margin:14px 14px 0;padding:12px 15px;border-radius:13px;background:#f6faf9;border:1px solid #e0ebe7}
#twa-app.tp .tp-integration-design2 .tp-store-icon{background:#dff4e8;width:35px;height:35px}.tp-integration-design2 .tp-store-icon svg{width:22px;height:22px}
#twa-app.tp .tp-integration-design2 .tp-integration-actions{padding:14px;gap:10px}.tp-integration-design2 .tp-integration-actions .tp-btn{height:42px;border-radius:11px}
#twa-app.tp .tp-integration-design2 .tp-integration-guide{margin:0 14px 14px;padding:15px 16px;background:#f8fbfa;border:1px solid #e5efeb;border-radius:13px}
#twa-app.tp .tp-integration-design2 .tp-guide-collapsible .tp-instructions{margin:0;padding:0;border:0;background:transparent}.tp-integration-design2 .tp-integration-guide .tp-instructions-title{margin-bottom:10px}
#twa-app.tp .tp-commerce-orders.tp-orders-design2{margin-top:16px;border-radius:20px;background:#fff;box-shadow:0 10px 28px rgba(20,60,50,.055)}
#twa-app.tp .tp-orders-design2 .tp-commerce-orders-head{padding:18px 20px 10px;border:0}.tp-orders-design2 .tp-commerce-orders-head h3{font-size:18px}.tp-orders-design2 .tp-commerce-orders-head p{font-size:12px}
#twa-app.tp .tp-order-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;padding:0 20px 15px}.tp-order-stat{display:flex;align-items:center;gap:10px;padding:13px;border:1px solid #e5ece9;border-radius:13px;background:#fff}.tp-os-icon{width:32px;height:32px;border-radius:9px;display:grid;place-items:center}.tp-os-icon svg{width:17px;height:17px}.tp-os-icon.cart{background:#e8f1ff;color:#2375d8}.tp-os-icon.ok{background:#e2f7ea;color:#12955a}.tp-os-icon.pending{background:#fff4dc;color:#d08a16}.tp-os-icon.failed{background:#ffe7e7;color:#dc4b4b}.tp-order-stat b{display:block;font-size:18px;color:var(--tp-ink)}.tp-order-stat small{display:block;color:var(--tp-muted);font-size:10px;margin-top:2px}
#twa-app.tp .tp-orders-toolbar{display:flex;align-items:center;gap:12px;padding:0 20px 16px;flex-wrap:wrap}.tp-order-ranges{display:flex;gap:4px;padding:4px;background:#f2f7f5;border-radius:11px}.tp-order-ranges button{border:0;background:transparent;border-radius:8px;padding:8px 12px;font-weight:750;font-size:11px;color:var(--tp-muted);cursor:pointer}.tp-order-ranges button.on{background:#08795f;color:#fff}.tp-order-range-hidden{display:none!important}.tp-order-search{margin-left:auto;min-width:210px;height:36px;border:1px solid #dce8e4;border-radius:10px;display:flex;align-items:center;gap:7px;padding:0 10px;color:var(--tp-muted);background:#fff}.tp-order-search svg{width:15px;height:15px}.tp-order-search input{border:0;outline:0;width:100%;font:inherit;font-size:11px;background:transparent}.tp-orders-design2 .tp-orders-body{min-height:70px}.tp-orders-design2 .tp-orders-table td,.tp-orders-design2 .tp-orders-table th{padding:11px 13px}
@media(max-width:900px){#twa-app.tp .tp-order-stats{grid-template-columns:repeat(2,1fr)}#twa-app.tp .tp-banner-note{display:none}}
@media(max-width:620px){#twa-app.tp .tp-integration-design2 .tp-integration-banner{padding:20px;min-height:140px}.tp-integration-design2 .tp-brand-icon{width:58px!important;height:58px!important;flex-basis:58px!important}.tp-integration-design2 .tp-brand-title h2{font-size:20px!important}.tp-order-stats{padding-left:12px!important;padding-right:12px!important}.tp-orders-toolbar{padding-left:12px!important;padding-right:12px!important}.tp-order-ranges{width:100%;justify-content:space-between}.tp-order-ranges button{flex:1;padding:8px 5px}.tp-order-search{margin-left:0;width:100%;min-width:0}.tp-orders-design2 .tp-commerce-orders-head{padding-left:14px!important;padding-right:14px!important}.tp-integration-design2 .tp-integration-actions .tp-btn{width:100%;justify-content:center}}

/* v6.8.69 — Fix Design 2 layout: full-width banner/content, no legacy grid bleed */
#twa-app.tp .tp-integration-design2,
#twa-app.tp .tp-integration-design2.tp-integration-modern{display:block!important;grid-template-columns:none!important;grid-column:auto!important;width:100%!important;box-sizing:border-box!important;padding:0!important;overflow:hidden!important}
#twa-app.tp .tp-integration-design2 > .tp-integration-banner{display:flex!important;width:100%!important;box-sizing:border-box!important;grid-column:auto!important}
#twa-app.tp .tp-integration-design2 > .tp-integration-content{display:block!important;width:100%!important;box-sizing:border-box!important;grid-column:auto!important;min-width:0!important}
#twa-app.tp .tp-integration-design2 .tp-integration-store{width:auto!important;box-sizing:border-box!important}
#twa-app.tp .tp-integration-design2 .tp-integration-actions{display:flex!important;width:auto!important;box-sizing:border-box!important;align-items:center!important;flex-wrap:wrap!important}
#twa-app.tp .tp-integration-design2 .tp-integration-guide{width:auto!important;box-sizing:border-box!important;clear:both!important}
#twa-app.tp .tp-integration-design2 .tp-banner-brand{min-width:0!important;flex:1 1 auto!important}
#twa-app.tp .tp-integration-design2 .tp-banner-note{flex:0 0 auto!important}
@media(max-width:760px){#twa-app.tp .tp-integration-design2 .tp-integration-actions .tp-btn{flex:1 1 180px}}

/* ================================================================
   Template creator — clean three-column layout
   ================================================================ */
.tm-layout {
	display: grid;
	grid-template-columns: minmax(250px, .9fr) minmax(360px, 1.2fr) minmax(300px, .95fr);
	gap: 18px;
	align-items: start;
	margin-top: 16px;
}
.tm-col {
	min-width: 0;
}
.tm-details,
.tm-message,
.tm-preview-col {
	padding: 0;
}
.tm-details .tp-field,
.tm-message .tp-field { margin-bottom: 14px; }
.tm-variable-box {
	margin-top: 18px;
	padding: 14px;
	border: 1px solid var(--tp-line);
	border-radius: 14px;
	background: var(--tp-panel-2);
}
.tm-variable-title {
	font-size: 13px;
	font-weight: 800;
	color: var(--tp-ink-2);
	margin-bottom: 10px;
}
.tm-help {
	display: inline-grid;
	place-items: center;
	width: 16px;
	height: 16px;
	margin-left: 4px;
	border-radius: 50%;
	background: var(--tp-accent-soft);
	color: var(--tp-accent-ink);
	font-size: 10px;
	font-weight: 800;
	cursor: help;
}
.tm-variable-options {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 9px;
}
.tm-variable-option {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	padding: 11px 10px;
	border: 1px solid var(--tp-line);
	border-radius: 11px;
	background: var(--tp-panel);
	cursor: pointer;
	transition: border-color .15s, background .15s, box-shadow .15s;
}
.tm-variable-option:hover { border-color: var(--tp-accent); }
.tm-variable-option:has(input:checked) {
	border-color: var(--tp-accent);
	background: var(--tp-accent-soft);
	box-shadow: 0 0 0 2px rgba(11,114,86,.08);
}
.tm-variable-option input {
	margin: 3px 0 0;
	accent-color: var(--tp-accent);
	flex: 0 0 auto;
}
.tm-variable-option b { display: block; font-size: 12.5px; }
.tm-variable-option small {
	display: block;
	margin-top: 3px;
	font-size: 10.5px;
	line-height: 1.45;
	color: var(--tp-muted);
}
.tm-variable-note {
	margin-top: 10px;
	font-size: 11px;
	line-height: 1.5;
	color: var(--tp-muted);
}
.tm-body-editor {
	min-height: 150px;
	resize: vertical;
}
.tm-add-variable-row { position: relative; margin-top: -5px; margin-bottom: 14px; }
.tm-var-menu {
	display: none;
	position: absolute;
	z-index: 100;
	left: 0;
	top: calc(100% + 7px);
	width: 285px;
	max-height: 300px;
	overflow: auto;
	background: var(--tp-panel);
	border: 1px solid var(--tp-line);
	border-radius: 13px;
	box-shadow: var(--tp-shadow-lg);
	padding: 6px;
}
.tm-var-menu button {
	display: block;
	width: 100%;
	padding: 9px 10px;
	border: 0;
	background: transparent;
	border-radius: 9px;
	text-align: left;
	cursor: pointer;
	color: var(--tp-ink);
}
.tm-var-menu button:hover { background: var(--tp-line-soft); }
.tm-var-menu button b { display: block; font-size: 12px; }
.tm-var-menu button small { display: block; margin-top: 2px; color: var(--tp-muted); font-size: 10.5px; }
.tm-section {
	margin-top: 12px;
	padding-top: 14px;
	border-top: 1px solid var(--tp-line-soft);
}
.tm-helper { display: block; margin-top: 6px; color: var(--tp-muted); }
.tm-footer-field { margin-top: 14px; }
.tm-preview-col { position: sticky; top: 0; }
.tm-preview {
	padding: 16px;
	border-radius: 16px;
	background: linear-gradient(180deg, var(--tp-accent-soft), var(--tp-panel-2));
	border: 1px solid var(--tp-line);
}
.tm-preview-head { display: flex; align-items: center; gap: 10px; }
.tm-preview-avatar {
	width: 38px;
	height: 38px;
	border-radius: 11px;
	background: var(--tp-accent);
	color: #fff;
	display: grid;
	place-items: center;
	font-weight: 800;
}
.tm-preview-divider { height: 1px; background: var(--tp-line); margin: 13px 0; }
.tm-preview-buttons { margin-top: 10px; }
.tm-preview-buttons > div {
	padding: 8px 6px;
	border-top: 1px solid var(--tp-line);
	text-align: center;
	color: var(--tp-accent-ink);
	font-weight: 700;
	font-size: 12px;
}
.tm-preview-note {
	margin-top: 10px;
	padding: 10px 11px;
	border-radius: 10px;
	background: #EEF6FF;
	color: #27639A;
	font-size: 11px;
	line-height: 1.45;
}
.tm-before-submit {
	margin-top: 10px;
	padding: 12px 13px;
	border: 1px solid var(--tp-line);
	border-radius: 13px;
	background: var(--tp-panel-2);
	font-size: 11.5px;
	line-height: 1.7;
	color: var(--tp-ink-2);
}
.tm-before-submit b { display: block; margin-bottom: 4px; font-size: 12px; }

@media (max-width: 900px) {
	.tm-layout { grid-template-columns: 1fr 1fr; }
	.tm-preview-col { grid-column: 1 / -1; position: static; }
}
@media (max-width: 640px) {
	.tm-layout { grid-template-columns: 1fr; }
	.tm-preview-col { grid-column: auto; }
	.tm-variable-options { grid-template-columns: 1fr; }
}


/* v6.8.114 — safe typography polish; preserves the stable creator layout */
#twa-app.tp .tm-body-editor {
  font-family: var(--tp-font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif) !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
  letter-spacing: 0 !important;
}
#twa-app.tp .tm-variable-box {
  font-family: var(--tp-font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}
#twa-app.tp .tm-variable-option b { font-size: 14px; }
#twa-app.tp .tm-variable-option small { font-size: 12px; line-height: 1.45; }
#twa-app.tp .tm-variable-note { font-size: 12px; line-height: 1.5; }
#twa-app.tp .tm-helper,
#twa-app.tp .tm-message .tp-field > small { font-size: 12px; line-height: 1.5; }


/* ===================================================================
   v6.8.115 — Template creator studio
   Two-pane modal: guided numbered form + live WhatsApp preview.
   Replaces the older .tm-* creator styles.
   =================================================================== */

.tp-modal.tms-modal { max-width: 1140px; }
.tp-modal.tms-modal .tp-modal-head {
	padding: 22px 26px 18px;
	border-bottom: 1px solid var(--tp-line-soft);
}
.tp-modal.tms-modal .tp-modal-body { padding: 0; background: var(--tp-panel-2); }
.tp-modal.tms-modal .tp-modal-foot {
	padding: 14px 26px; background: var(--tp-panel);
	border-radius: 0 0 22px 22px;
}

.tms {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(330px, .82fr);
	align-items: start;
	gap: 0;
}
.tms-main { padding: 22px 24px 26px; min-width: 0; }

/* ---- sections ---- */
.tms-sec {
	background: var(--tp-panel);
	border: 1px solid var(--tp-line);
	border-radius: 16px;
	margin-bottom: 14px;
	overflow: hidden;
}
.tms-sec-h {
	display: flex; gap: 12px; align-items: flex-start;
	padding: 15px 18px;
	border-bottom: 1px solid var(--tp-line-soft);
	background: linear-gradient(180deg, var(--tp-panel), var(--tp-panel-2));
}
.tms-num {
	flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px;
	display: grid; place-items: center;
	background: var(--tp-accent-soft); color: var(--tp-accent-ink);
	font-size: 12px; font-weight: 800;
}
.tms-sec-h h3 { margin: 0; font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; color: var(--tp-ink); }
.tms-sec-h p { margin: 2px 0 0; font-size: 12px; color: var(--tp-muted); }
.tms-sec-b { padding: 16px 18px 18px; }

/* ---- fields ---- */
.tms-f { display: block; margin-bottom: 15px; }
.tms-f:last-child { margin-bottom: 0; }
.tms-lab {
	display: flex; align-items: center; gap: 7px;
	margin-bottom: 7px;
	font-size: 12px; font-weight: 700; color: var(--tp-ink-2);
	letter-spacing: .01em;
}
.tms-lab em {
	font-style: normal; font-size: 10px; font-weight: 700; text-transform: uppercase;
	letter-spacing: .05em; color: var(--tp-muted);
	background: var(--tp-line-soft); padding: 2px 6px; border-radius: 999px;
}
.tms-lab em.req { color: #A63248; background: var(--tp-rose-soft); }
.tms-lab code { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--tp-accent-ink); }
.tms-count { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--tp-muted); font-variant-numeric: tabular-nums; }

.tms-in {
	width: 100%; box-sizing: border-box;
	padding: 10px 13px;
	font-family: var(--tp-font);
	font-size: 13.5px; line-height: 1.5; color: var(--tp-ink);
	background: var(--tp-panel);
	border: 1px solid var(--tp-line);
	border-radius: 11px;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
}
.tms-in::placeholder { color: var(--tp-muted); }
.tms-in:hover { border-color: var(--tp-accent); }
.tms-in:focus { border-color: var(--tp-accent); box-shadow: 0 0 0 3px rgba(15,157,118,.14); }
.tms-ta { min-height: 132px; resize: vertical; }
.tms-sel {
	appearance: none; -webkit-appearance: none;
	padding-right: 34px; cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23789185' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 13px center; background-size: 11px;
}
.tms-hint { display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.5; color: var(--tp-muted); }
.tms-hint.inline { display: inline; margin: 0 0 0 10px; }
.tms-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---- chips ---- */
.tms-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tms-chips.sm { display: flex; flex-wrap: wrap; gap: 7px; }
.tms-chip {
	text-align: left; cursor: pointer;
	padding: 10px 12px;
	background: var(--tp-panel);
	border: 1px solid var(--tp-line);
	border-radius: 11px;
	color: var(--tp-ink);
	transition: border-color .15s, background .15s, box-shadow .15s;
}
.tms-chips.sm .tms-chip { padding: 7px 14px; border-radius: 999px; }
.tms-chip b { display: block; font-size: 12.5px; font-weight: 700; }
.tms-chip small { display: block; margin-top: 3px; font-size: 10.5px; line-height: 1.4; color: var(--tp-muted); }
.tms-chip:hover { border-color: var(--tp-accent); }
.tms-chip.on {
	border-color: var(--tp-accent); background: var(--tp-accent-soft);
	box-shadow: 0 0 0 3px rgba(15,157,118,.12);
}
.tms-chip.on b { color: var(--tp-accent-ink); }
.tms-chip.on small { color: var(--tp-accent-ink); opacity: .8; }

/* ---- radio option cards ---- */
.tms-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tms-opt {
	display: flex; gap: 10px; align-items: flex-start;
	padding: 12px 13px; cursor: pointer;
	background: var(--tp-panel);
	border: 1px solid var(--tp-line);
	border-radius: 12px;
	transition: border-color .15s, background .15s, box-shadow .15s;
}
.tms-opt:hover { border-color: var(--tp-accent); }
.tms-opt input { margin: 2px 0 0; accent-color: var(--tp-accent); flex: 0 0 auto; }
.tms-opt:has(input:checked) {
	border-color: var(--tp-accent); background: var(--tp-accent-soft);
	box-shadow: 0 0 0 3px rgba(15,157,118,.12);
}
.tms-opt-b b { display: block; font-size: 13px; font-weight: 800; }
.tms-opt-b small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.45; color: var(--tp-muted); }

/* ---- toolbar + variable menu ---- */
.tms-toolbar { position: relative; margin: -6px 0 15px; }
.tms-ghost {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 7px 13px; cursor: pointer;
	font-family: var(--tp-font); font-size: 12.5px; font-weight: 700;
	color: var(--tp-accent-ink);
	background: var(--tp-accent-soft);
	border: 1px solid transparent;
	border-radius: 999px;
	transition: border-color .15s, filter .15s;
}
.tms-ghost:hover { border-color: var(--tp-accent); }
.tms-plus { font-size: 14px; line-height: 1; }
.tms-caret { font-size: 10px; opacity: .7; }
.tms-varmenu {
	display: none; position: absolute; z-index: 120;
	left: 0; top: calc(100% + 8px); width: 290px; max-height: 300px; overflow: auto;
	padding: 6px;
	background: var(--tp-panel);
	border: 1px solid var(--tp-line);
	border-radius: 14px;
	box-shadow: var(--tp-shadow-lg);
}
.tms-varmenu.open { display: block; }
.tms-varmenu button {
	display: block; width: 100%; text-align: left; cursor: pointer;
	padding: 9px 11px; border: 0; background: transparent; border-radius: 9px; color: var(--tp-ink);
}
.tms-varmenu button:hover { background: var(--tp-accent-soft); }
.tms-varmenu button b { display: block; font-size: 12.5px; font-weight: 700; }
.tms-varmenu button small { display: block; margin-top: 2px; font-size: 11px; color: var(--tp-muted); font-family: ui-monospace, Menlo, monospace; }

/* ---- quick reply button rows ---- */
.tms-btnlist { margin-bottom: 9px; }
.tms-btnrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tms-btnrow-i {
	flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
	background: var(--tp-line-soft); color: var(--tp-ink-2); font-size: 11px; font-weight: 800;
}
.tms-btnrow .tms-in { flex: 1; }
.tms-x {
	flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
	display: grid; place-items: center;
	border: 1px solid var(--tp-line); background: var(--tp-panel);
	color: var(--tp-muted); font-size: 17px; line-height: 1;
	transition: color .15s, border-color .15s, background .15s;
}
.tms-x:hover { color: var(--tp-rose); border-color: var(--tp-rose); background: var(--tp-rose-soft); }

/* ---- right pane: live preview ---- */
.tms-side {
	position: sticky; top: 0;
	padding: 22px 24px 26px;
	border-left: 1px solid var(--tp-line);
	background: var(--tp-panel);
	min-width: 0;
}
.tms-side-h {
	display: flex; align-items: center; gap: 10px; margin-bottom: 13px;
	font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
	color: var(--tp-muted);
}
.tms-badge {
	margin-left: auto; padding: 4px 9px; border-radius: 999px;
	background: var(--tp-accent-soft); color: var(--tp-accent-ink);
	font-size: 10px; font-weight: 700; text-transform: none; letter-spacing: 0;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%;
}
.tms-phone {
	border: 1px solid var(--tp-line);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: var(--tp-shadow);
	background: var(--tp-panel);
}
.tms-phone-bar {
	display: flex; align-items: center; gap: 9px;
	padding: 11px 13px;
	background: var(--tp-dark); color: #fff;
}
.tms-back { font-size: 18px; line-height: 1; opacity: .8; }
.tms-av {
	width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
	background: rgba(255,255,255,.18); color: #fff; font-size: 13px; font-weight: 800;
}
.tms-who { min-width: 0; }
.tms-who b {
	display: block; font-size: 12.5px; font-weight: 700; color: #fff;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px;
}
.tms-who small { display: block; font-size: 10.5px; color: rgba(255,255,255,.7); }
.tms-canvas {
	padding: 16px 14px 20px;
	background-color: #E4DDD4;
	background-image:
		radial-gradient(circle at 20% 30%, rgba(255,255,255,.55) 0 2px, transparent 2px),
		radial-gradient(circle at 70% 70%, rgba(255,255,255,.45) 0 2px, transparent 2px);
	background-size: 46px 46px, 62px 62px;
	min-height: 180px;
}
.tms-bubble {
	position: relative;
	background: #fff;
	border-radius: 10px 10px 10px 3px;
	padding: 8px 10px 6px;
	box-shadow: 0 1px 1px rgba(0,0,0,.14);
	max-width: 100%;
}
.tms-pv-hdr { font-size: 13.5px; font-weight: 700; color: #111B21; margin-bottom: 5px; word-break: break-word; }
.tms-pv-hdr.media {
	display: grid; place-items: center; height: 92px; margin: -2px -4px 7px;
	border-radius: 8px; background: #D9E3DC; color: #5C6F66;
	font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.tms-pv-body { font-size: 13.5px; line-height: 1.5; color: #111B21; white-space: pre-wrap; word-break: break-word; }
.tms-pv-body.empty { color: #8696A0; font-style: italic; }
.tms-pv-foot { margin-top: 6px; font-size: 11.5px; color: #8696A0; word-break: break-word; }
.tms-pv-time { margin-top: 3px; text-align: right; font-size: 10.5px; color: #8696A0; }
.tms-ticks { margin-left: 4px; color: #53BDEB; }
.tms-pv-btns { margin-top: 3px; display: grid; gap: 3px; }
.tms-pv-btn {
	background: #fff; border-radius: 8px; padding: 9px 6px; text-align: center;
	font-size: 13px; font-weight: 600; color: #0B8AD1;
	box-shadow: 0 1px 1px rgba(0,0,0,.14);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tms-check {
	margin-top: 14px; padding: 14px 15px;
	border: 1px solid var(--tp-line); border-radius: 14px;
	background: var(--tp-panel-2);
}
.tms-check b { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 800; color: var(--tp-ink-2); }
.tms-check-i {
	position: relative; padding-left: 21px; margin-top: 6px;
	font-size: 11.5px; line-height: 1.5; color: var(--tp-muted);
}
.tms-check-i::before {
	content: "✓"; position: absolute; left: 0; top: 0;
	color: var(--tp-accent); font-weight: 800; font-size: 12px;
}

/* ---- dark theme tweaks ---- */
html[data-twa-theme="dark"] .tms-canvas { background-color: #0B1410; background-image: none; }
html[data-twa-theme="dark"] .tms-bubble { background: #1D2A25; box-shadow: none; }
html[data-twa-theme="dark"] .tms-pv-hdr,
html[data-twa-theme="dark"] .tms-pv-body { color: var(--tp-ink); }
html[data-twa-theme="dark"] .tms-pv-hdr.media { background: #24322C; color: #9FB3AA; }
html[data-twa-theme="dark"] .tms-pv-btn { background: #1D2A25; color: #63E0B6; box-shadow: none; }
html[data-twa-theme="dark"] .tms-phone-bar { background: #10231B; }

/* ---- responsive ---- */
@media (max-width: 1000px) {
	.tms { grid-template-columns: 1fr; }
	.tms-side { position: static; border-left: 0; border-top: 1px solid var(--tp-line); }
	.tms-phone { max-width: 420px; }
}
@media (max-width: 640px) {
	.tms-main, .tms-side { padding: 18px 16px 22px; }
	.tms-row2 { grid-template-columns: 1fr; }
	.tms-chips { grid-template-columns: 1fr; }
	.tms-opts { grid-template-columns: 1fr; }
	.tp-modal.tms-modal .tp-modal-head { padding: 18px 18px 14px; }
	.tp-modal.tms-modal .tp-modal-foot { padding: 12px 16px 18px; }
}
