.ti-open-template{border:0;background:transparent;color:inherit;font:inherit;font-weight:600;text-align:left;padding:4px 0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
#ti-page{position:fixed;inset:0;z-index:2100;overflow:auto;background:linear-gradient(125deg,#f4eaf0 0%,#e5eef9 55%,#e4f3ec 100%);color:#20303a;font:14px/1.5 'Segoe UI',Arial,sans-serif}
#ti-page[hidden],#ti-page [hidden]{display:none!important}
#ti-page *{box-sizing:border-box}
#ti-page .ti-shell{max-width:1700px;margin:auto;padding:24px 32px 48px}
#ti-page .ti-breadcrumb{display:flex;align-items:center;gap:12px;font-size:22px;font-weight:650;margin-bottom:38px}
#ti-page button,#ti-page input,#ti-page select{font:inherit;color:inherit}
#ti-page button{cursor:pointer}
#ti-page button:disabled{opacity:.5;cursor:default}
#ti-page :focus-visible{outline:3px solid #168a76;outline-offset:3px}
#ti-page .ti-back{border:0;background:transparent;padding:4px 0;color:#637078;font-weight:600}
#ti-page .ti-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;flex-wrap:wrap;margin-bottom:28px}
#ti-page .ti-identity{display:flex;gap:16px;align-items:center;min-width:0;flex:1}
#ti-page .ti-icon{display:grid;place-items:center;width:56px;height:56px;flex-shrink:0;background:#00816a;color:white;border-radius:8px;font-size:28px}
#ti-page h1{font-size:23px;line-height:1.4;margin:0 0 5px;overflow-wrap:anywhere}
#ti-page h2{font-size:21px;margin:0;font-weight:650}
#ti-page h3{font-size:17px;margin:0;font-weight:650}
#ti-page .ti-meta{display:flex;align-items:center;gap:7px;flex-wrap:wrap;color:#66757f}
#ti-page .ti-badge{font-size:12px;border-radius:20px;background:#eef4e9;border:1px solid #c7dfcc;color:#17674e;padding:1px 8px;font-weight:600}
#ti-page .ti-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#ti-page .ti-controls label{font-size:12px;display:flex;align-items:center;gap:5px}
#ti-page .ti-controls input,#ti-page select,#ti-page .ti-button{border:1px solid #a8b7c3;border-radius:5px;background:#ffffff50;padding:8px 10px;max-width:145px;color-scheme:light}
#ti-page .ti-controls .ti-button{max-width:none}
#ti-page .ti-copy{border:0;background:transparent;color:#436071;padding:2px 5px}
#ti-page .ti-layout{display:grid;grid-template-columns:minmax(280px,410px) minmax(0,1fr);align-items:start;gap:20px}
#ti-page .ti-panel,#ti-page .ti-money-card{background:white;border-radius:6px;overflow:hidden;box-shadow:0 1px 0 #163d5208}
#ti-page .ti-panel{margin-bottom:20px}
#ti-page .ti-panel-title{padding:20px 24px}
#ti-page .ti-preview-bg{background:#e8e4dc;padding:26px 22px;min-height:450px;background-image:radial-gradient(#c5c0b750 1px,transparent 1px);background-size:13px 13px}
#ti-page .ti-bubble{background:white;border-radius:8px;margin-bottom:6px;padding:13px 15px;box-shadow:0 1px 1px #0001;overflow-wrap:anywhere;white-space:pre-wrap;font-size:16px}
#ti-page .ti-footer{font-size:12px;color:#7c8388;margin-top:10px}
#ti-page .ti-media{position:relative;border-radius:6px;overflow:hidden;background:#cdd1d5;min-height:250px;display:grid;place-items:center;color:white;text-align:center}
#ti-page .ti-media img,#ti-page .ti-media video{width:100%;max-height:340px;object-fit:contain;display:block}
#ti-page .ti-media-placeholder{padding:45px 10px;color:#f9fafb;font-size:16px}
#ti-page .ti-media-placeholder span{display:block;font-size:54px;margin-bottom:8px}
#ti-page .ti-preview-button{color:#128260;text-align:center;padding:11px 8px;border-top:1px solid #e2e7ea;background:white;overflow-wrap:anywhere;font-size:15px}
#ti-page .ti-carousel{background:white;border-radius:8px;padding:4px;position:relative}
#ti-page .ti-carousel-nav{display:flex;align-items:center;justify-content:space-between;margin:10px 0;gap:8px}
#ti-page .ti-carousel-nav button{border:1px solid #c7d0d5;border-radius:50%;width:38px;height:38px;background:white;font-size:23px}
#ti-page .ti-preview-note{font-size:12px;color:#66757f;padding:12px 20px}
#ti-page .ti-money{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin-bottom:20px}
#ti-page .ti-money-card{padding:20px;min-height:112px}
#ti-page .ti-money-card strong{display:block;font-size:26px;margin-top:10px}
#ti-page .ti-performance-cards{display:flex;flex-wrap:wrap;gap:25px;padding:0 24px 12px}
#ti-page .ti-stat span{display:block;color:#647681;font-size:13px}
#ti-page .ti-stat strong{font-size:27px}
#ti-page .ti-chart-tools{padding:0 24px 8px;display:flex;justify-content:space-between;align-items:center;color:#647681;gap:12px}
#ti-page .ti-chart{padding:0 18px 20px}
#ti-page .ti-chart svg{width:100%;height:auto;display:block}
#ti-page .ti-empty{text-align:center;padding:35px 24px 40px}
#ti-page .ti-empty strong{display:block;font-size:22px;margin:10px 0 3px}
#ti-page .ti-empty p{margin:0}
#ti-page .ti-empty-icon{color:#acb6bd;font-size:28px}
#ti-page .ti-status{margin-bottom:18px;font-size:13px;color:#465d69}
#ti-page .ti-status.error{background:#fff1ee;border:1px solid #e7beb5;padding:12px;border-radius:6px;color:#842f22}
#ti-page details{background:#ffffff95;border:1px solid #d3dce1;border-radius:6px;padding:10px 14px;margin:0 0 20px;font-size:13px;overflow-wrap:anywhere}
#ti-page details summary{cursor:pointer;font-weight:600}
#ti-page details ul{margin:10px 0 0;padding-left:20px}
#ti-page .ti-click-row{padding:12px 24px;border-top:1px solid #e7ecef;display:flex;justify-content:space-between;gap:15px;overflow-wrap:anywhere}
#ti-page .ti-click-row small{display:block;color:#71818b}
#ti-page .ti-scope{font-size:12px;color:#607480;margin-top:8px}
/* Match the app-wide WhatsApp theme and follow its light/dark setting. */
#ti-page{--ti-bg:#0b141a;--ti-card:#111b21;--ti-raised:#202c33;--ti-border:#2a3942;--ti-text:#e9edef;--ti-muted:#8696a0;--ti-teal:#00a884;--ti-green:#25d366;background:var(--ti-bg);color:var(--ti-text);color-scheme:dark}
#ti-page .ti-back,#ti-page .ti-meta,#ti-page .ti-status,#ti-page .ti-stat span,#ti-page .ti-chart-tools,#ti-page .ti-preview-note,#ti-page .ti-scope,#ti-page .ti-click-row small{color:var(--ti-muted)}
#ti-page .ti-icon{background:var(--ti-teal)}
#ti-page :focus-visible{outline-color:var(--ti-teal)}
#ti-page .ti-controls input,#ti-page select,#ti-page .ti-button{background:var(--ti-raised);border-color:var(--ti-border);color:var(--ti-text);color-scheme:dark}
#ti-page .ti-copy,#ti-page .ti-preview-button{color:var(--ti-teal)}
#ti-page .ti-panel,#ti-page .ti-money-card{background:var(--ti-card);border:1px solid var(--ti-border);color:var(--ti-text);box-shadow:none}
#ti-page .ti-preview-bg{background-color:var(--ti-raised);background-image:radial-gradient(#8696a020 1px,transparent 1px)}
#ti-page .ti-bubble,#ti-page .ti-carousel{background:#202c33;color:var(--ti-text)}
#ti-page .ti-footer{color:var(--ti-muted)}
#ti-page .ti-media{background:#2a3942}
#ti-page .ti-preview-button,#ti-page .ti-click-row{border-color:var(--ti-border)}
#ti-page .ti-carousel-nav button{background:var(--ti-raised);border-color:var(--ti-border);color:var(--ti-text)}
#ti-page details{background:var(--ti-card);border-color:var(--ti-border)}
#ti-page .ti-badge{background:#00a88420;border-color:#00a88470;color:#55d6b4}
html[data-bs-theme="light"] #ti-page{--ti-bg:#f0f2f5;--ti-card:#fff;--ti-raised:#f7f9fa;--ti-border:#e9edef;--ti-text:#111b21;--ti-muted:#667781;background:var(--ti-bg);color:var(--ti-text);color-scheme:light}
html[data-bs-theme="light"] #ti-page .ti-controls input,html[data-bs-theme="light"] #ti-page select,html[data-bs-theme="light"] #ti-page .ti-button{background:#fff;border-color:var(--ti-border);color:var(--ti-text);color-scheme:light}
html[data-bs-theme="light"] #ti-page .ti-preview-bg{background-color:#f0f2f5;background-image:radial-gradient(#66778125 1px,transparent 1px)}
html[data-bs-theme="light"] #ti-page .ti-bubble,html[data-bs-theme="light"] #ti-page .ti-carousel{background:#fff;color:var(--ti-text)}
html[data-bs-theme="light"] #ti-page .ti-media{background:#dce1e5}
html[data-bs-theme="light"] #ti-page .ti-carousel-nav button{background:#fff;color:var(--ti-text)}
html[data-bs-theme="light"] #ti-page .ti-badge{background:#e8f5ee;border-color:#b7dec8;color:#17674e}
/* A WhatsApp-style template preview, using the surrounding app theme. */
#ti-page .ti-preview-bg{min-height:292px;padding:28px 24px;background-image:url('/assets/img/wa-doodle.svg');background-repeat:repeat;background-size:380px auto}
#ti-page .ti-chat{display:flex;flex-direction:column;align-items:flex-start;gap:12px;min-height:220px}
#ti-page .ti-message{position:relative;width:max-content;max-width:min(100%,355px)}
#ti-page .ti-bubble{position:relative;margin:0;padding:10px 11px 7px;border-radius:0 8px 8px 8px;font-size:14.5px;line-height:1.48;white-space:normal;overflow:visible;background:var(--ti-raised);color:var(--ti-text);box-shadow:0 1px 2px #0003}
#ti-page .ti-bubble::before{content:"";position:absolute;left:-9px;top:0;border-top:10px solid var(--ti-raised);border-left:10px solid transparent}
#ti-page .ti-msg-heading{font-size:15px;font-weight:700;margin-bottom:9px;white-space:pre-wrap;overflow-wrap:anywhere}
#ti-page .ti-msg-body{white-space:pre-wrap;overflow-wrap:anywhere}
#ti-page .ti-msg-footer{margin-top:8px;font-size:12.5px;color:var(--ti-muted);white-space:pre-wrap;overflow-wrap:anywhere}
#ti-page .ti-msg-time{text-align:right;font-size:10px;color:var(--ti-muted);margin-top:3px;line-height:1.2}
#ti-page .ti-message .ti-preview-button{background:var(--ti-raised);border-top:1px solid var(--ti-border);box-shadow:0 1px 2px #0002;font-size:14px;padding:9px 12px}
#ti-page .ti-message .ti-preview-button:last-child{border-radius:0 0 8px 8px}
#ti-page .ti-bubble:has(+ .ti-preview-button){border-radius:0 8px 0 0}
#ti-page .ti-bubble .ti-media{min-height:210px;margin:-5px -6px 8px;border-radius:5px}
#ti-page .ti-carousel{background:transparent;box-shadow:none;border:0;padding:0;width:min(100%,355px)}
#ti-page .ti-carousel .ti-message{width:100%}
#ti-page .ti-carousel-nav{font-size:12px;color:var(--ti-muted)}
html[data-bs-theme="light"] #ti-page .ti-preview-bg{background-color:#efeae2;background-image:url('/assets/img/wa-doodle.svg')}
html[data-bs-theme="light"] #ti-page .ti-bubble,html[data-bs-theme="light"] #ti-page .ti-message .ti-preview-button{background:#fff;color:var(--ti-text)}
html[data-bs-theme="light"] #ti-page .ti-bubble::before{border-top-color:#fff}
@media(max-width:950px){#ti-page .ti-shell{padding:18px}#ti-page .ti-layout{grid-template-columns:minmax(240px,33%) minmax(0,1fr)}#ti-page .ti-heading{gap:14px}#ti-page .ti-controls{width:100%}}
@media(max-width:650px){#ti-page .ti-shell{padding:14px}#ti-page .ti-layout{grid-template-columns:1fr}#ti-page .ti-breadcrumb{font-size:18px;margin-bottom:24px}#ti-page h1{font-size:19px}#ti-page .ti-controls input{max-width:129px}#ti-page .ti-icon{width:44px;height:44px}#ti-page .ti-preview-bg{min-height:0}#ti-page .ti-money{grid-template-columns:1fr}#ti-page .ti-panel-title{padding:17px}}
/* Shared overview styling and restrained Tools motion. */
#ti-page{--ti-bg:#0c151b;--ti-card:#13222b;--ti-raised:#1a2b35;--ti-border:#2c3b44;--ti-text:#e7eff3;--ti-muted:#a1b2bc;--ti-teal:#43d8b0}
#ti-page .ti-shell{padding:30px;max-width:1700px}
#ti-page .ti-breadcrumb{font-size:16px;margin-bottom:26px}
#ti-page .ti-heading{padding-bottom:24px;border-bottom:1px solid var(--ti-border);margin-bottom:18px}
#ti-page h1{font-size:28px;letter-spacing:-.6px}
#ti-page h2{font-size:20px}
#ti-page .ti-panel,#ti-page .ti-money-card{border-radius:12px}
#ti-page .ti-performance-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;padding:0 22px 22px}
#ti-page .ti-stat,#ti-page .ti-money-card{background:linear-gradient(145deg,#1a2b35,#13212a);border:1px solid var(--ti-border);border-radius:12px;padding:20px}
#ti-page .ti-stat:first-child{background:linear-gradient(145deg,#183e35,#142b2c);border-color:#287862}
#ti-page .ti-stat span{font-size:13px;margin-bottom:12px}
#ti-page .ti-stat strong{font-size:32px;line-height:1.2}
#ti-page .ti-controls input,#ti-page select{border-radius:8px;padding:10px;background:var(--ti-card)}
#ti-page #ti-refresh{background:var(--ti-teal);border:1px solid var(--ti-teal);color:#08271f;border-radius:8px;font-weight:700;padding:11px 18px}
#ti-page .ti-chart{margin:0 20px 20px;padding:12px;border:1px solid var(--ti-border);border-radius:10px}
#ti-page .ti-chart svg line{stroke:var(--ti-border)}
#ti-page .ti-chart svg text{fill:var(--ti-muted)}
#ti-page .ti-chart svg path{stroke:var(--ti-teal)}
#ti-page .ti-chart svg circle{fill:var(--ti-teal)}
#ti-page .ti-bubble{background:#293c45}
#ti-page .ti-bubble::before{border-top-color:#293c45}
html[data-bs-theme="light"] #ti-page .ti-stat,html[data-bs-theme="light"] #ti-page .ti-money-card{background:#fff}
html[data-bs-theme="light"] #ti-page .ti-stat:first-child{background:#e8f5ee;border-color:#b7dec8}
#mtm-templates-tbody .ti-template-row{cursor:pointer}
#mtm-templates-tbody .ti-template-row:focus-visible{outline:2px solid #43d8b0;outline-offset:-2px}
:where(.wa-main-canvas,.wa-tools-panel,.wa-away-panel,#meta-template-manager-overlay,#ti-page) :is(.card,.mi-card,.mi-panel,.mi-chip,.mtm-card,.away-card,.ti-panel,.ti-stat,.ti-money-card,.ti-chart,.tools-item-btn,button,input,select,.ti-click-row),#mtm-templates-tbody .ti-template-row{transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease,background-color .2s ease}
@media(hover:hover) and (prefers-reduced-motion:no-preference){
 :where(.wa-main-canvas,.wa-tools-panel,.wa-away-panel,#meta-template-manager-overlay,#ti-page) :is(.card,.mi-card,.mi-panel,.mi-chip,.mtm-card,.away-card,.ti-panel,.ti-stat,.ti-money-card,.ti-chart,.tools-item-btn):hover{transform:translateY(-3px);border-color:#43d8b080;box-shadow:0 8px 22px #0003}
 :where(.wa-main-canvas,.wa-tools-panel,.wa-away-panel,#meta-template-manager-overlay,#ti-page) :is(button,input,select):hover:not(:disabled){transform:translateY(-1px);border-color:#43d8b0;box-shadow:0 3px 10px #0002}
 #mtm-templates-tbody .ti-template-row:hover{transform:translateY(-2px);box-shadow:0 4px 12px #0002}
 #mtm-templates-tbody .ti-template-row:hover td{background-color:color-mix(in srgb,var(--mtm-bg,#0b141a),#43d8b0 9%)}
 #ti-page .ti-click-row:hover{transform:translateX(3px);background:#43d8b00a}
}
@media(prefers-reduced-motion:reduce){
 :where(.wa-main-canvas,.wa-tools-panel,.wa-away-panel,#meta-template-manager-overlay,#ti-page) *,#mtm-templates-tbody .ti-template-row{transition:none!important;animation:none!important;transform:none!important}
}
@media(max-width:650px){#ti-page .ti-shell{padding:14px}#ti-page h1{font-size:21px}#ti-page .ti-performance-cards{grid-template-columns:1fr}#ti-page .ti-stat{padding:16px}}
#ti-page .ti-tabs{display:flex;gap:8px;padding:0 22px 18px}
#ti-page .ti-tabs button{background:transparent;border:1px solid transparent;border-radius:7px;padding:9px 16px}
#ti-page .ti-tabs button[aria-pressed=true]{background:#43d8b024;color:var(--ti-teal);border-color:#43d8b050}
#ti-page .ti-left-info{padding:20px}
#ti-page .ti-left-info p{color:var(--ti-muted);margin:8px 0 14px}
#ti-page .ti-left-info strong{font-size:26px}
#ti-page .ti-left-info .ti-button{max-width:none}
#ti-page .ti-funnel{display:grid;gap:18px;padding:12px}
#ti-page .ti-funnel strong{float:right}
#ti-page .ti-funnel-track{height:24px;border-radius:5px;background:var(--ti-raised);margin-top:8px;overflow:hidden}
#ti-page .ti-funnel-track i{display:block;height:100%;background:var(--ti-teal)}
#ti-page .ti-chart svg g path{stroke:var(--ti-series)}
#ti-page .ti-chart svg g circle{fill:var(--ti-series)}
#ti-page .ti-layout>div{min-width:0} #ti-page .ti-chart-tools{flex-wrap:wrap} #ti-page .ti-left-info .ti-button{white-space:normal}
