/* =========================================================================
   Tifamail — design system
   Teal corporate core, warm greys, near-black ink. Legibility first.
   Display: Fraunces · UI/body: Inter · Code: JetBrains Mono
   ========================================================================= */
:root {
  --tf-teal-900: #042F2E;
  --tf-teal-800: #115E59;
  --tf-teal-700: #0F766E;
  --tf-teal-600: #0D9488;
  --tf-teal-500: #14B8A6;
  --tf-teal-300: #5EEAD4;
  --tf-teal-100: #CCFBF1;
  --tf-teal-50:  #F0FDFA;
  --tf-ink:      #0B1215;
  --tf-ink-2:    #1E293B;
  --tf-slate:    #475569;
  --tf-muted:    #64748B;
  --tf-faint:    #94A3B8;
  --tf-line:     #E2E8F0;
  --tf-line-2:   #EEF2F4;
  --tf-bg:       #F5F7F7;
  --tf-card:     #FFFFFF;
  --tf-dark:     #0B1B1E;
  --tf-side:     #16191D;
  --tf-dark-2:   #102A2E;
  --tf-amber:    #F59E0B;
  --tf-red:      #DC2626;
  --tf-green:    #16A34A;
  --tf-radius:   14px;
  --tf-radius-sm: 10px;
  --tf-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --tf-shadow:   0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
  --tf-shadow-lg: 0 24px 60px rgba(11, 27, 30, .18);
  --tf-font:     'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tf-display:  'Fraunces', Georgia, serif;
  --tf-mono:     'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

  --bs-body-font-family: var(--tf-font);
  --bs-body-color: var(--tf-ink);
  --bs-body-bg: var(--tf-bg);
  --bs-primary: var(--tf-teal-700);
  --bs-primary-rgb: 15, 118, 110;
  --bs-link-color: var(--tf-teal-700);
  --bs-link-color-rgb: 15, 118, 110;
  --bs-link-hover-color: var(--tf-teal-800);
  --bs-border-color: var(--tf-line);
  --bs-secondary-color: var(--tf-muted);
  --bs-emphasis-color: var(--tf-ink);
  --bs-focus-ring-color: color-mix(in srgb, var(--tf-teal-500) 30%, transparent);
}

html { scroll-behavior: smooth; }
body { font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; background: var(--tf-bg); color: var(--tf-ink); }
::selection { background: var(--tf-teal-100); color: var(--tf-teal-900); }
a { text-decoration: none; }
h1, h2, h3, h4, h5, h6 { color: var(--tf-ink); font-weight: 700; letter-spacing: -.015em; }
.tf-display { font-family: var(--tf-display); font-weight: 600; letter-spacing: -.02em; font-optical-sizing: auto; }
.text-muted { color: var(--tf-muted) !important; }
.small, small { font-size: .84em; }
code, kbd, pre, .font-mono { font-family: var(--tf-mono); }
.text-teal { color: var(--tf-teal-700) !important; }
.bg-teal-50 { background: var(--tf-teal-50) !important; }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: var(--tf-radius-sm); padding: .6rem 1.1rem; font-size: .94rem; transition: transform .12s ease, box-shadow .15s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .42rem .8rem; font-size: .85rem; border-radius: 9px; }
.btn-lg { padding: .85rem 1.5rem; font-size: 1.02rem; border-radius: 12px; }
.btn-tf { background: var(--tf-teal-700); color: #fff; border: 1px solid var(--tf-teal-700); box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 16px color-mix(in srgb, var(--tf-teal-700) 22%, transparent); }
.btn-tf:hover, .btn-tf:focus { background: var(--tf-teal-800); border-color: var(--tf-teal-800); color: #fff; }
.btn-tf:disabled { background: var(--tf-teal-600); border-color: var(--tf-teal-600); color: #fff; opacity: .65; }
.btn-ink { background: var(--tf-ink); color: #fff; border: 1px solid var(--tf-ink); }
.btn-ink:hover { background: #000; color: #fff; }
.btn-ghost { background: #fff; color: var(--tf-ink); border: 1px solid var(--tf-line); box-shadow: var(--tf-shadow-sm); }
.btn-ghost:hover { background: var(--tf-line-2); color: var(--tf-ink); border-color: #CBD5E1; }
.btn-soft { background: var(--tf-teal-50); color: var(--tf-teal-800); border: 1px solid var(--tf-teal-100); }
.btn-soft:hover { background: var(--tf-teal-100); color: var(--tf-teal-900); }
.btn-light-outline { color: #fff; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.04); }
.btn-light-outline:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-danger-soft { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.btn-danger-soft:hover { background: #FEE2E2; color: #991B1B; }
.tf-icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--tf-slate); display: inline-grid; place-items: center; transition: background .15s; }
.tf-icon-btn:hover { background: var(--tf-line-2); color: var(--tf-ink); }
.tf-icon-btn.active { color: var(--tf-amber); }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .86rem; color: var(--tf-ink-2); margin-bottom: .35rem; }
.form-control, .form-select { border-radius: var(--tf-radius-sm); border-color: #D5DDE3; padding: .62rem .85rem; font-size: .95rem; color: var(--tf-ink); background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--tf-teal-500); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tf-teal-500) 15%, transparent); }
.form-control::placeholder { color: #9AA8B6; }
.form-text { color: var(--tf-muted); font-size: .82rem; }
.form-check-input:checked { background-color: var(--tf-teal-700); border-color: var(--tf-teal-700); }
.form-check-input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--tf-teal-500) 15%, transparent); border-color: var(--tf-teal-500); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }
.input-group-text { border-radius: var(--tf-radius-sm); background: var(--tf-line-2); border-color: #D5DDE3; color: var(--tf-slate); }
.tf-otp { letter-spacing: .5em; font-family: var(--tf-mono); font-size: 1.5rem; text-align: center; padding: .8rem; }

/* ---------- Cards / surfaces ---------- */
.tf-card { background: var(--tf-card); border: 1px solid var(--tf-line); border-radius: var(--tf-radius); box-shadow: var(--tf-shadow-sm); }
.tf-card-pad { padding: 1.5rem; }
.tf-card-head { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--tf-line-2); }
.tf-card-head h2, .tf-card-head h3 { font-size: 1.02rem; margin: 0; }
.tf-card-body { padding: 1.5rem; }
.tf-stat { padding: 1.25rem 1.4rem; }
.tf-stat .label { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tf-muted); }
.tf-stat .value { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; margin-top: .25rem; font-variant-numeric: tabular-nums; }
.tf-stat .hint { font-size: .82rem; color: var(--tf-muted); }
.tf-stat .icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--tf-teal-50); color: var(--tf-teal-700); }
.tf-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--tf-line-2); color: var(--tf-slate); white-space: nowrap; }
.tf-pill.ok { background: #DCFCE7; color: #166534; }
.tf-pill.warn { background: #FEF3C7; color: #92400E; }
.tf-pill.bad { background: #FEE2E2; color: #991B1B; }
.tf-pill.teal { background: var(--tf-teal-50); color: var(--tf-teal-800); }
.tf-pill.dark { background: var(--tf-ink); color: #fff; }
.tf-divider { height: 1px; background: var(--tf-line); margin: 1.5rem 0; }
.table { --bs-table-color: var(--tf-ink); font-size: .92rem; }
.table > :not(caption) > * > * { padding: .8rem 1rem; border-color: var(--tf-line-2); }
.table thead th { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--tf-muted); font-weight: 600; background: #FAFBFB; }
.tf-empty { text-align: center; padding: 4rem 1.5rem; color: var(--tf-muted); }
.tf-empty .ico { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 1rem; display: grid; place-items: center; font-size: 1.5rem; background: var(--tf-teal-50); color: var(--tf-teal-700); }
.tf-empty h3 { font-size: 1.15rem; color: var(--tf-ink); }

/* ---------- Brand mark ---------- */
.tf-logo { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.12rem; color: var(--tf-ink); letter-spacing: -.02em; }
.tf-logo:hover { color: var(--tf-ink); }
.tf-mark { width: 30px; height: 30px; color: var(--tf-teal-700); display: inline-block; flex: none; }
.tf-mark svg { width: 100%; height: 100%; display: block; }
.tf-logo-light, .tf-logo-light:hover { color: #fff; }
.tf-logo-light .tf-mark { color: var(--tf-teal-600); }

/* =========================================================================
   Public site
   ========================================================================= */
.tf-public { background: #FBFCFC; }
.tf-nav { position: sticky; top: 0; z-index: 1030; padding: .9rem 0; background: rgba(251,252,252,.82); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s, background .2s; }
.tf-nav.scrolled { border-bottom-color: var(--tf-line); }
.tf-nav-links { gap: 1.8rem; margin-left: 2rem; }
.tf-nav-links a, .tf-nav-link-btn { color: var(--tf-slate); font-weight: 500; font-size: .93rem; }
.tf-nav-links a:hover, .tf-nav-link-btn:hover { color: var(--tf-ink); }
.tf-nav-dark { background: rgba(11,27,30,.85); }
.tf-nav-dark .tf-logo, .tf-nav-dark .tf-nav-links a, .tf-nav-dark .tf-nav-link-btn { color: #E2E8F0; }

.tf-hero { position: relative; padding: 5.5rem 0 4rem; overflow: hidden; }
.tf-hero::before { content: ""; position: absolute; inset: -30% -10% auto; height: 720px; background: radial-gradient(600px 320px at 20% 30%, rgba(20,184,166,.16), transparent 70%), radial-gradient(520px 300px at 85% 10%, rgba(245,158,11,.10), transparent 70%); pointer-events: none; }
.tf-eyebrow { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem .35rem .4rem; border-radius: 999px; background: #fff; border: 1px solid var(--tf-line); font-size: .82rem; font-weight: 600; color: var(--tf-slate); box-shadow: var(--tf-shadow-sm); }
.tf-eyebrow b { background: var(--tf-teal-700); color: #fff; padding: .12rem .5rem; border-radius: 999px; font-size: .72rem; }
.tf-hero h1 { font-family: var(--tf-display); font-weight: 600; font-size: clamp(2.5rem, 5.4vw, 4.4rem); line-height: 1.03; letter-spacing: -.035em; margin: 1.4rem 0 1.2rem; }
.tf-hero h1 em { font-style: italic; color: var(--tf-teal-700); }
.tf-hero .lead { font-size: 1.2rem; color: var(--tf-slate); max-width: 560px; line-height: 1.6; }
.tf-hero-meta { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.6rem; font-size: .88rem; color: var(--tf-muted); }
.tf-hero-meta i { color: var(--tf-teal-600); }

.tf-hero-stage { position: relative; margin-top: 3.5rem; }
.tf-window { background: #fff; border-radius: 18px; border: 1px solid var(--tf-line); box-shadow: var(--tf-shadow-lg); overflow: hidden; }
.tf-window-bar { display: flex; align-items: center; gap: .45rem; padding: .7rem 1rem; border-bottom: 1px solid var(--tf-line-2); background: #FAFBFB; }
.tf-window-bar span { width: 11px; height: 11px; border-radius: 50%; background: #E2E8F0; }
.tf-window-bar span:nth-child(1) { background: #FCA5A5; } .tf-window-bar span:nth-child(2) { background: #FCD34D; } .tf-window-bar span:nth-child(3) { background: #86EFAC; }
.tf-window-bar small { margin-left: .8rem; color: var(--tf-muted); font-size: .78rem; }
.tf-mock { display: grid; grid-template-columns: 210px 300px 1fr; min-height: 470px; }
.tf-mock-side { background: var(--tf-dark); color: #CBD5E1; padding: 1.1rem .9rem; font-size: .84rem; }
.tf-mock-side .c { background: var(--tf-teal-600); color: #fff; border-radius: 10px; padding: .55rem .8rem; font-weight: 600; margin-bottom: 1rem; }
.tf-mock-side div.i { padding: .45rem .6rem; border-radius: 8px; display: flex; gap: .6rem; align-items: center; }
.tf-mock-side div.i.a { background: rgba(94,234,212,.12); color: #fff; }
.tf-mock-list { border-right: 1px solid var(--tf-line-2); }
.tf-mock-list .m { padding: .85rem 1rem; border-bottom: 1px solid var(--tf-line-2); font-size: .82rem; }
.tf-mock-list .m.a { background: var(--tf-teal-50); box-shadow: inset 3px 0 0 var(--tf-teal-600); }
.tf-mock-list .m b { display: block; color: var(--tf-ink); font-size: .86rem; }
.tf-mock-list .m span { color: var(--tf-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-mock-read { background: #EEF2F2; padding: 1.2rem; overflow: hidden; }
.tf-mock-read iframe { border: 0; background: #fff; pointer-events: none; }
.tf-float { position: absolute; background: #fff; border-radius: 14px; border: 1px solid var(--tf-line); box-shadow: var(--tf-shadow-lg); padding: .9rem 1rem; font-size: .85rem; }
.tf-float .ai { display: flex; gap: .6rem; align-items: center; }
.tf-float .ai i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--tf-teal-600), #0EA5E9); color: #fff; }

.tf-logos { display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5rem; color: var(--tf-faint); font-weight: 700; letter-spacing: .02em; font-size: 1.05rem; opacity: .9; }

.tf-section { padding: 6rem 0; }
.tf-section-sm { padding: 4rem 0; }
.tf-section-head { max-width: 700px; margin: 0 auto 3.5rem; text-align: center; }
.tf-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--tf-teal-700); }
.tf-section-head h2 { font-family: var(--tf-display); font-weight: 600; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.08; letter-spacing: -.03em; margin: .7rem 0 1rem; }
.tf-section-head p { font-size: 1.1rem; color: var(--tf-slate); }

.tf-feature { height: 100%; padding: 1.8rem; border-radius: 18px; background: #fff; border: 1px solid var(--tf-line); transition: transform .2s ease, box-shadow .2s ease; }
.tf-feature:hover { transform: translateY(-3px); box-shadow: var(--tf-shadow); }
.tf-feature .ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--tf-teal-50); color: var(--tf-teal-700); font-size: 1.1rem; margin-bottom: 1.1rem; }
.tf-feature h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.tf-feature p { color: var(--tf-slate); margin: 0; font-size: .95rem; }

.tf-dark { background: var(--tf-dark); color: #CBD5E1; position: relative; overflow: hidden; }
.tf-dark::before { content: ""; position: absolute; inset: 0; background: radial-gradient(700px 400px at 90% 0%, rgba(20,184,166,.18), transparent 60%), radial-gradient(500px 300px at 0% 100%, rgba(14,165,233,.10), transparent 60%); pointer-events: none; }
.tf-dark h2, .tf-dark h3, .tf-dark h4 { color: #fff; }
.tf-dark .tf-kicker { color: var(--tf-teal-300); }
.tf-dark .tf-section-head p, .tf-dark p { color: #A7B6C2; }
.tf-dark-card { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 1.6rem; height: 100%; }
.tf-dark-card i { color: var(--tf-teal-300); }

.tf-steps { counter-reset: s; }
.tf-step { position: relative; padding-left: 3.4rem; margin-bottom: 2rem; }
.tf-step::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--tf-teal-700); color: #fff; }
.tf-step h4 { font-size: 1.05rem; margin-bottom: .25rem; }
.tf-step p { color: var(--tf-slate); margin: 0; }

.tf-ai-demo { background: #fff; border: 1px solid var(--tf-line); border-radius: 18px; box-shadow: var(--tf-shadow); overflow: hidden; }
.tf-ai-prompt { display: flex; gap: .6rem; align-items: center; padding: 1rem; border-top: 1px solid var(--tf-line-2); background: #FAFBFB; }
.tf-ai-prompt .p { flex: 1; background: #fff; border: 1px solid var(--tf-line); border-radius: 12px; padding: .7rem .9rem; font-size: .9rem; color: var(--tf-slate); }
.tf-typing::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--tf-teal-600); }
@keyframes blink { 50% { opacity: 0; } }

.tf-design-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
.tf-thumb { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--tf-line); background: #fff; aspect-ratio: 3 / 4; box-shadow: var(--tf-shadow-sm); transition: transform .2s, box-shadow .2s; }
.tf-thumb:hover { transform: translateY(-3px); box-shadow: var(--tf-shadow); }
.tf-thumb iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.tf-thumb .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: .7rem .9rem; background: linear-gradient(transparent, rgba(255,255,255,.96) 35%); display: flex; justify-content: space-between; align-items: end; font-size: .85rem; }
.tf-thumb .cap b { color: var(--tf-ink); }

.tf-price { background: #fff; border: 1px solid var(--tf-line); border-radius: 22px; padding: 2.2rem; height: 100%; position: relative; }
.tf-price.feature { background: var(--tf-dark); color: #CBD5E1; border-color: var(--tf-dark); box-shadow: var(--tf-shadow-lg); }
.tf-price.feature h3, .tf-price.feature .amt { color: #fff; }
.tf-price .amt { font-size: 2.8rem; font-weight: 700; letter-spacing: -.03em; color: var(--tf-ink); line-height: 1; }
.tf-price .amt small { font-size: 1rem; font-weight: 500; color: var(--tf-muted); letter-spacing: 0; }
.tf-price ul { list-style: none; padding: 0; margin: 1.5rem 0; }
.tf-price li { padding: .45rem 0; display: flex; gap: .6rem; font-size: .95rem; }
.tf-price li i { color: var(--tf-teal-600); margin-top: .3rem; }
.tf-price.feature li i { color: var(--tf-teal-300); }
.tf-currency-toggle { display: inline-flex; background: #fff; border: 1px solid var(--tf-line); border-radius: 999px; padding: .25rem; }
.tf-currency-toggle button { border: 0; background: transparent; padding: .35rem .95rem; border-radius: 999px; font-weight: 600; font-size: .85rem; color: var(--tf-slate); }
.tf-currency-toggle button.active { background: var(--tf-ink); color: #fff; }

.tf-faq .accordion-item { border: 1px solid var(--tf-line); border-radius: 14px !important; margin-bottom: .75rem; overflow: hidden; }
.tf-faq .accordion-button { font-weight: 600; padding: 1.1rem 1.3rem; color: var(--tf-ink); }
.tf-faq .accordion-button:not(.collapsed) { background: var(--tf-teal-50); color: var(--tf-teal-900); box-shadow: none; }
.tf-faq .accordion-button:focus { box-shadow: none; }

.tf-cta { border-radius: 28px; padding: 4rem 2rem; text-align: center; background: linear-gradient(135deg, var(--tf-teal-800), var(--tf-dark)); color: #fff; position: relative; overflow: hidden; }
.tf-cta h2 { color: #fff; font-family: var(--tf-display); font-weight: 600; font-size: clamp(2rem, 3.5vw, 2.8rem); letter-spacing: -.03em; }
.tf-cta p { color: #B6CCCB; font-size: 1.1rem; }

.tf-footer { background: var(--tf-dark); color: #94A3B8; padding: 4.5rem 0 2rem; }
.tf-footer h6 { color: #fff; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1rem; }
.tf-footer a:not(.tf-logo) { display: block; color: #94A3B8; padding: .25rem 0; font-size: .92rem; }
.tf-footer a:hover { color: #fff; }
.tf-footer-lead { max-width: 320px; font-size: .95rem; margin-top: 1rem; }
.tf-footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }
.tf-pay-badges { display: flex; flex-wrap: wrap; gap: .4rem; }
.tf-pay-badges span { border: 1px solid rgba(255,255,255,.15); border-radius: 6px; padding: .2rem .5rem; font-size: .72rem; font-weight: 700; color: #CBD5E1; }
.tf-404 { font-family: var(--tf-display); font-size: 7rem; font-weight: 600; color: var(--tf-teal-100); line-height: 1; }
.tf-empty-page { min-height: 60vh; display: grid; place-items: center; }

/* =========================================================================
   Auth / onboarding
   ========================================================================= */
.tf-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.tf-auth-art { background: var(--tf-dark); color: #CBD5E1; padding: 3rem; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.tf-auth-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 400px at 100% 0%, rgba(20,184,166,.25), transparent 60%), radial-gradient(400px 300px at 0% 100%, rgba(245,158,11,.10), transparent 60%); }
.tf-auth-art > * { position: relative; }
.tf-auth-art h2 { font-family: var(--tf-display); color: #fff; font-weight: 600; font-size: 2.4rem; line-height: 1.1; letter-spacing: -.03em; }
.tf-auth-art .quote { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.5rem; font-size: .95rem; }
.tf-auth-main { display: flex; align-items: center; justify-content: center; padding: 3rem 1.5rem; background: #FBFCFC; }
.tf-auth-box { width: 100%; max-width: 440px; }
.tf-auth-box h1 { font-family: var(--tf-display); font-weight: 600; font-size: 2.1rem; letter-spacing: -.03em; margin-bottom: .4rem; }
.tf-auth-box .sub { color: var(--tf-muted); margin-bottom: 2rem; }
.tf-auth-list { list-style: none; padding: 0; margin: 2rem 0; }
.tf-auth-list li { display: flex; gap: .8rem; margin-bottom: 1rem; color: #CBD5E1; }
.tf-auth-list i { color: var(--tf-teal-300); margin-top: .3rem; }
.tf-strength { height: 4px; border-radius: 4px; background: var(--tf-line); margin-top: .4rem; overflow: hidden; }
.tf-strength span { display: block; height: 100%; width: 0; background: var(--tf-red); transition: width .2s, background .2s; }
.tf-choice { display: block; border: 1.5px solid var(--tf-line); border-radius: 14px; padding: 1rem 1.1rem; cursor: pointer; transition: border-color .15s, background .15s; background: #fff; }
.tf-choice:hover { border-color: #B6C3CC; }
.tf-choice input { display: none; }
.tf-choice.checked, .tf-choice:has(input:checked) { border-color: var(--tf-teal-600); background: var(--tf-teal-50); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tf-teal-500) 12%, transparent); }
.tf-choice.disabled { opacity: .5; cursor: not-allowed; }

.tf-wizard { min-height: 100vh; background: var(--tf-bg); }
.tf-wizard-top { background: #fff; border-bottom: 1px solid var(--tf-line); padding: .9rem 0; position: sticky; top: 0; z-index: 20; }
.tf-stepper { display: flex; gap: .4rem; align-items: center; overflow-x: auto; scrollbar-width: none; }
.tf-stepper .s { display: flex; align-items: center; gap: .5rem; padding: .4rem .75rem; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--tf-muted); white-space: nowrap; }
.tf-stepper .s i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .72rem; background: var(--tf-line-2); color: var(--tf-slate); }
.tf-stepper .s.active { background: var(--tf-teal-50); color: var(--tf-teal-800); }
.tf-stepper .s.active i { background: var(--tf-teal-700); color: #fff; }
.tf-stepper .s.done i { background: var(--tf-green); color: #fff; }
.tf-stepper .sep { width: 18px; height: 1px; background: var(--tf-line); flex: none; }

.tf-studio { display: grid; grid-template-columns: 440px 1fr; gap: 0; min-height: calc(100vh - 64px); }
.tf-studio-panel { background: #fff; border-right: 1px solid var(--tf-line); padding: 1.8rem; overflow-y: auto; max-height: calc(100vh - 64px); position: sticky; top: 64px; }
.tf-studio-stage { padding: 2rem; overflow: auto; }
.tf-stage-tabs { display: inline-flex; background: #fff; border: 1px solid var(--tf-line); border-radius: 12px; padding: .25rem; margin-bottom: 1.2rem; }
.tf-stage-tabs button { border: 0; background: transparent; padding: .45rem 1rem; border-radius: 9px; font-weight: 600; font-size: .86rem; color: var(--tf-slate); }
.tf-stage-tabs button.active { background: var(--tf-ink); color: #fff; }
.tf-stage-frame { background: #fff; border-radius: 14px; border: 1px solid var(--tf-line); box-shadow: var(--tf-shadow); overflow: hidden; }
.tf-stage-frame iframe { width: 100%; border: 0; display: block; background: #fff; }
.tf-swatch-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.tf-swatch { width: 34px; height: 34px; border-radius: 10px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--tf-line); cursor: pointer; padding: 0; }
.tf-swatch.active { box-shadow: 0 0 0 2px var(--tf-ink); }
.tf-color-slot { display: flex; align-items: center; gap: .75rem; padding: .6rem .7rem; border: 1px solid var(--tf-line); border-radius: 12px; background: #fff; }
.tf-color-slot input[type=color] { width: 42px; height: 42px; border: 0; padding: 0; background: none; border-radius: 10px; cursor: pointer; }
.tf-color-slot input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.tf-color-slot input[type=color]::-webkit-color-swatch { border: 0; border-radius: 10px; }
.tf-design-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.tf-design-opt { position: relative; border: 2px solid var(--tf-line); border-radius: 12px; overflow: hidden; cursor: pointer; background: #fff; aspect-ratio: 4/5; transition: border-color .15s; }
.tf-design-opt:hover { border-color: #B6C3CC; }
.tf-design-opt.active { border-color: var(--tf-teal-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tf-teal-500) 18%, transparent); }
.tf-design-opt iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; }
.tf-design-opt .cap { position: absolute; bottom: 0; left: 0; right: 0; padding: .45rem .6rem; font-size: .78rem; font-weight: 600; background: rgba(255,255,255,.95); border-top: 1px solid var(--tf-line-2); display: flex; justify-content: space-between; }
.tf-design-opt .cap span { color: var(--tf-muted); font-weight: 500; }
.tf-design-opt .tick { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--tf-teal-700); color: #fff; display: none; place-items: center; font-size: .7rem; z-index: 2; }
.tf-design-opt.active .tick { display: grid; }
.tf-dropzone { border: 2px dashed #CBD5E1; border-radius: 14px; padding: 1.4rem; text-align: center; cursor: pointer; background: #FAFBFB; transition: border-color .15s, background .15s; }
.tf-dropzone:hover, .tf-dropzone.drag { border-color: var(--tf-teal-500); background: var(--tf-teal-50); }
.tf-dropzone img { max-height: 64px; max-width: 200px; }

/* =========================================================================
   App shell
   ========================================================================= */
.tf-app-body { background: var(--tf-bg); }
.tf-app { display: flex; min-height: 100vh; }
.tf-side { width: 264px; flex: none; background: var(--tf-side); color: #A7B6C2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2A2F35 transparent; z-index: 1040; }
.tf-side-head { display: flex; align-items: center; padding: 1.2rem 1.2rem .8rem; }
.tf-side-company { display: flex; gap: .7rem; align-items: center; margin: .3rem 1rem .9rem; padding: .7rem .8rem; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); }
.tf-side-company strong { display: block; color: #fff; font-size: .9rem; line-height: 1.2; }
.tf-side-company small { color: #7C8D99; font-size: .76rem; }
.tf-co-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.tf-compose-btn { margin: 0 1rem 1rem; display: flex; align-items: center; justify-content: center; gap: .6rem; padding: .8rem; border-radius: 12px; background: linear-gradient(135deg, var(--tf-teal-600), var(--tf-teal-700)); color: #fff; font-weight: 600; box-shadow: 0 8px 20px color-mix(in srgb, var(--tf-teal-600) 32%, transparent); transition: transform .15s, box-shadow .15s; }
.tf-compose-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 26px color-mix(in srgb, var(--tf-teal-600) 42%, transparent); }
.tf-side-nav { padding: 0 .7rem; flex: 1; }
.tf-side-label { font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #5B6E7A; padding: 1rem .6rem .4rem; }
.tf-side-link { display: flex; align-items: center; gap: .8rem; padding: .55rem .7rem; border-radius: 10px; color: #B4C2CC; font-size: .92rem; font-weight: 500; transition: background .12s, color .12s; }
.tf-side-link i { width: 18px; text-align: center; font-size: .92rem; color: #7C8D99; }
.tf-side-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.tf-side-link.active { background: rgba(255,255,255,.08); color: #fff; }
.tf-side-link.active i { color: var(--tf-teal-300); }
.tf-side-badge { margin-left: auto; background: var(--tf-teal-600); color: #fff; font-size: .72rem; font-weight: 700; padding: .05rem .5rem; border-radius: 999px; }
.tf-side-meters { padding: 1rem 1.2rem 1.3rem; border-top: 1px solid rgba(255,255,255,.06); }
.tf-meter { font-size: .78rem; margin-bottom: .75rem; color: #8FA0AC; }
.tf-meter span:last-child { color: #CBD5E1; font-variant-numeric: tabular-nums; }
.tf-meter-bar { height: 5px; background: rgba(255,255,255,.08); border-radius: 5px; margin-top: .4rem; overflow: hidden; }
.tf-meter-bar span { display: block; height: 100%; background: var(--tf-teal-500); border-radius: 5px; }
.tf-meter-bar span.danger { background: var(--tf-red); }
.tf-side-scrim { display: none; }

.tf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tf-top { height: 64px; display: flex; align-items: center; gap: .8rem; padding: 0 1.5rem; background: rgba(245,247,247,.9); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 1020; border-bottom: 1px solid var(--tf-line); }
.tf-top-title { font-weight: 700; font-size: 1.05rem; }
.tf-search { flex: 1; max-width: 640px; position: relative; }
.tf-search i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--tf-faint); font-size: .9rem; }
.tf-search input { width: 100%; height: 44px; border-radius: 12px; border: 1px solid transparent; background: #E9EEEF; padding: 0 3rem 0 2.6rem; font-size: .95rem; color: var(--tf-ink); transition: background .15s, border-color .15s, box-shadow .15s; }
.tf-search input:focus { outline: 0; background: #fff; border-color: var(--tf-teal-500); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tf-teal-500) 12%, transparent); }
.tf-search kbd { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); background: #fff; color: var(--tf-muted); border: 1px solid var(--tf-line); font-size: .72rem; padding: .1rem .4rem; border-radius: 6px; }
.tf-pwa-pill { display: inline-flex; align-items: center; gap: .5rem; border: 0; background: var(--tf-ink); color: #fff; font-weight: 600; font-size: .82rem; padding: .5rem .9rem; border-radius: 999px; box-shadow: 0 6px 16px rgba(11,18,21,.18); animation: pillIn .4s ease; }
.tf-pwa-pill:hover { background: #000; }
.tf-pwa-pill i { color: var(--tf-teal-300); }
@keyframes pillIn { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.tf-avatar-btn { border: 0; background: transparent; padding: 0; border-radius: 50%; }
.tf-avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: .8rem; flex: none; }
.tf-avatar.sm { width: 30px; height: 30px; font-size: .72rem; }
.tf-avatar.lg { width: 44px; height: 44px; font-size: .95rem; }
.tf-dropdown { border-radius: 14px; border: 1px solid var(--tf-line); box-shadow: var(--tf-shadow-lg); padding: .4rem; min-width: 240px; }
.tf-dropdown .dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-size: .9rem; }
.tf-dropdown .dropdown-item:active { background: var(--tf-teal-700); }
.tf-content { padding: 1.75rem; flex: 1; min-width: 0; }
.tf-content.flush { padding: 0; }
.tf-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tf-page-head h1 { font-size: 1.6rem; margin: 0; letter-spacing: -.025em; }
.tf-page-head p { margin: .25rem 0 0; color: var(--tf-muted); }
.tf-banner { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.2rem; border-radius: 14px; background: #FFFBEB; border: 1px solid #FDE68A; color: #78350F; margin-bottom: 1.25rem; }
.tf-banner.teal { background: var(--tf-teal-50); border-color: var(--tf-teal-100); color: var(--tf-teal-900); }
.tf-banner .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.7); flex: none; }

/* ---------- Mail ---------- */
.tf-mail { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; height: calc(100vh - 64px); }
.tf-mail-list { background: #fff; border-right: 1px solid var(--tf-line); display: flex; flex-direction: column; min-height: 0; }
.tf-mail-toolbar { display: flex; align-items: center; gap: .4rem; padding: .8rem 1rem; border-bottom: 1px solid var(--tf-line-2); }
.tf-mail-toolbar h2 { font-size: 1.05rem; margin: 0 auto 0 .2rem; }
.tf-mail-items { overflow-y: auto; flex: 1; }
.tf-mail-item { display: grid; grid-template-columns: 36px 1fr auto; gap: .8rem; padding: .95rem 1.1rem; border-bottom: 1px solid var(--tf-line-2); cursor: pointer; position: relative; color: var(--tf-ink); transition: background .1s; }
.tf-mail-item:hover { background: #F8FAFA; }
.tf-mail-item.active { background: var(--tf-teal-50); box-shadow: inset 3px 0 0 var(--tf-teal-600); }
.tf-mail-item .who { font-size: .92rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-mail-item .subj { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tf-ink-2); }
.tf-mail-item .snip { font-size: .84rem; color: var(--tf-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-mail-item .when { font-size: .76rem; color: var(--tf-muted); text-align: right; white-space: nowrap; }
.tf-mail-item.unread .who, .tf-mail-item.unread .subj { font-weight: 700; color: var(--tf-ink); }
.tf-mail-item.unread::before { content: ""; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--tf-teal-600); transform: translateY(-50%); }
.tf-mail-item .meta-ico { color: var(--tf-faint); font-size: .75rem; margin-top: .3rem; display: flex; gap: .4rem; justify-content: flex-end; }
.tf-mail-item .meta-ico .fa-star { color: var(--tf-amber); }
.tf-count { font-size: .72rem; color: var(--tf-muted); background: var(--tf-line-2); border-radius: 6px; padding: 0 .35rem; margin-left: .3rem; font-weight: 600; }
.tf-reader { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--tf-bg); }
.tf-reader-bar { display: flex; align-items: center; gap: .3rem; padding: .6rem 1rem; border-bottom: 1px solid var(--tf-line); background: #fff; }
.tf-reader-scroll { overflow-y: auto; flex: 1; padding: 1.5rem; }
.tf-reader h1 { font-size: 1.45rem; letter-spacing: -.02em; margin: 0 0 1.2rem; line-height: 1.3; }
.tf-msg { background: #fff; border: 1px solid var(--tf-line); border-radius: 14px; margin-bottom: 1rem; overflow: hidden; }
.tf-msg-head { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.2rem; cursor: pointer; }
.tf-msg-head .from { font-weight: 600; }
.tf-msg-head .addr { color: var(--tf-muted); font-size: .84rem; }
.tf-msg-head .to { color: var(--tf-muted); font-size: .82rem; }
.tf-msg-head .date { margin-left: auto; font-size: .8rem; color: var(--tf-muted); white-space: nowrap; }
.tf-msg-body { border-top: 1px solid var(--tf-line-2); }
.tf-msg-body iframe { width: 100%; border: 0; display: block; min-height: 120px; background: #fff; }
.tf-msg.collapsed .tf-msg-body { display: none; }
.tf-msg.collapsed .tf-msg-head .snip { display: block; }
.tf-msg-head .snip { display: none; color: var(--tf-muted); font-size: .85rem; }
.tf-atts { display: flex; flex-wrap: wrap; gap: .6rem; padding: 1rem 1.2rem; border-top: 1px solid var(--tf-line-2); }
.tf-att { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border: 1px solid var(--tf-line); border-radius: 10px; font-size: .84rem; color: var(--tf-ink); background: #FAFBFB; max-width: 260px; }
.tf-att:hover { border-color: var(--tf-teal-500); color: var(--tf-ink); }
.tf-att i { color: var(--tf-teal-700); font-size: 1.1rem; }
.tf-att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-att small { color: var(--tf-muted); }
.tf-quick-reply { display: flex; gap: .6rem; }
.tf-reader-empty { flex: 1; display: grid; place-items: center; color: var(--tf-muted); text-align: center; padding: 2rem; }
.tf-status { font-size: .72rem; }

/* ---------- Compose ---------- */
.tf-compose { display: grid; grid-template-columns: 1fr 360px; min-height: calc(100vh - 64px); }
.tf-compose-main { padding: 1.5rem; min-width: 0; }
.tf-compose-fields { background: #fff; border: 1px solid var(--tf-line); border-radius: 16px; margin-bottom: 1.2rem; box-shadow: var(--tf-shadow-sm); }
.tf-field-row { display: flex; align-items: center; gap: .8rem; padding: .35rem 1.1rem; border-bottom: 1px solid var(--tf-line-2); min-height: 52px; }
.tf-field-row:last-child { border-bottom: 0; }
.tf-field-row > label { width: 64px; flex: none; font-size: .84rem; font-weight: 600; color: var(--tf-muted); margin: 0; }
.tf-field-row input, .tf-field-row select { border: 0; outline: 0; flex: 1; font-size: .95rem; padding: .5rem 0; background: transparent; min-width: 80px; color: var(--tf-ink); }
.tf-field-row .subject { font-weight: 600; font-size: 1rem; }
.tf-chips { display: flex; flex-wrap: wrap; gap: .35rem; flex: 1; align-items: center; padding: .3rem 0; }
.tf-chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--tf-teal-50); border: 1px solid var(--tf-teal-100); color: var(--tf-teal-900); border-radius: 999px; padding: .15rem .3rem .15rem .65rem; font-size: .84rem; font-weight: 500; }
.tf-chip.bad { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.tf-chip button { border: 0; background: rgba(0,0,0,.06); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .6rem; color: inherit; padding: 0; }
.tf-chips input { flex: 1; min-width: 160px; }
.tf-link-btn { border: 0; background: transparent; color: var(--tf-muted); font-size: .84rem; font-weight: 600; padding: .2rem .4rem; border-radius: 6px; }
.tf-link-btn:hover { color: var(--tf-teal-700); background: var(--tf-teal-50); }
.tf-canvas-wrap { position: relative; border-radius: 16px; overflow: hidden; box-shadow: var(--tf-shadow); border: 1px solid var(--tf-line); }
.tf-canvas { background: #fff; }
.tf-canvas .tf-slot { min-height: 260px; }
.tf-canvas .tf-slot .ql-container { font: inherit; border: 0 !important; }
.tf-canvas .tf-slot .ql-editor { padding: 0; font: inherit; color: inherit; line-height: inherit; min-height: 260px; overflow: visible; }
.tf-canvas .tf-slot .ql-editor p { margin: 0 0 14px; }
.tf-canvas .tf-slot .ql-editor h1, .tf-canvas .tf-slot .ql-editor h2, .tf-canvas .tf-slot .ql-editor h3 { margin: 16px 0 10px; }
.tf-canvas .tf-slot .ql-editor ol, .tf-canvas .tf-slot .ql-editor ul { padding-left: 1.2em; margin: 0 0 14px; }
.tf-canvas .tf-slot .ql-editor blockquote { border-left: 3px solid var(--brand, #0F766E); padding-left: 14px; color: #475569; }
.tf-canvas .tf-slot .ql-editor.ql-blank::before { left: 0; right: 0; font-style: normal; color: #A0AEC0; }
.tf-editor-toolbar.ql-toolbar { position: sticky; top: 64px; z-index: 10; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border: 0 !important; border-bottom: 1px solid var(--tf-line-2) !important; padding: .5rem .8rem !important; font-family: var(--tf-font) !important; }
.tf-editor-toolbar .ql-formats { margin-right: 10px !important; }
.tf-ai-bar { margin-top: 1.2rem; background: #F8F9FA; border: 1px solid var(--tf-line); border-radius: 16px; padding: 1rem 1.1rem; color: var(--tf-slate); }
.tf-ai-bar .lbl { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #5F6B76; display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.tf-ai-bar .lbl i { color: #8A95A0; }
.tf-ai-input { display: flex; gap: .6rem; align-items: flex-end; }
.tf-ai-input textarea { flex: 1; resize: none; background: #fff; border: 1px solid #D7DCE1; color: var(--tf-ink); border-radius: 12px; padding: .75rem .9rem; font-size: .95rem; min-height: 50px; max-height: 180px; }
.tf-ai-input textarea::placeholder { color: #98A2AD; }
.tf-ai-input textarea:focus { outline: 0; border-color: #9AA5B1; box-shadow: 0 0 0 4px rgba(100,116,139,.12); }
.tf-ai-input select { background-color: #fff; border-color: #D7DCE1; color: var(--tf-ink-2); width: auto; }
.tf-ai-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.tf-ai-chips button { border: 1px solid #DDE1E6; background: #fff; color: #5F6B76; border-radius: 999px; font-size: .78rem; padding: .25rem .75rem; }
.tf-ai-chips button:hover { background: #EEF0F3; color: var(--tf-ink); border-color: #CBD2D9; }
.tf-ai-status { font-size: .84rem; margin-top: .6rem; color: #6B7580; display: none; align-items: center; gap: .5rem; }
.tf-ai-status.show { display: flex; }
.tf-ai-status a { color: var(--tf-ink-2); font-weight: 600; }
.tf-ai-status .ok { color: #16A34A; }
.tf-premium-tag { position: absolute; top: 8px; left: 8px; z-index: 2; display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem; border-radius: 999px; background: #111418; color: #E8D5A8; font-size: .66rem; font-weight: 700; letter-spacing: .04em; }
.tf-premium-tag i { font-size: .6rem; color: #D9B864; }
.tf-compose-side { border-left: 1px solid var(--tf-line); background: #fff; padding: 1.5rem; overflow-y: auto; }
.tf-compose-side h3 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--tf-muted); margin: 0 0 .8rem; }
.tf-upload-list .tf-att { max-width: 100%; margin-bottom: .5rem; }
.tf-send-bar { position: sticky; bottom: 0; display: flex; gap: .6rem; align-items: center; padding: 1rem 0 0; background: linear-gradient(transparent, var(--tf-bg) 35%); }
.tf-shimmer { position: relative; }
.tf-shimmer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--tf-teal-500) 12%, transparent) 50%, transparent 80%); background-size: 200% 100%; animation: shimmer 1.4s infinite; pointer-events: none; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Documents ---------- */
.tf-doc-hero { background: var(--tf-side); border-radius: 20px; padding: 2rem; color: #CBD5E1; position: relative; overflow: hidden; margin-bottom: 1.5rem; }
.tf-doc-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 300px at 100% 0%, color-mix(in srgb, var(--tf-teal-500) 22%, transparent), transparent 60%); }
.tf-doc-hero > * { position: relative; }
.tf-doc-hero h1 { color: #fff; font-family: var(--tf-display); font-weight: 600; font-size: 2rem; letter-spacing: -.03em; }
.tf-doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.1rem; }
.tf-doc-card { background: #fff; border: 1px solid var(--tf-line); border-radius: 14px; overflow: hidden; color: var(--tf-ink); transition: transform .15s, box-shadow .15s; display: block; }
.tf-doc-card:hover { transform: translateY(-2px); box-shadow: var(--tf-shadow); color: var(--tf-ink); }
.tf-doc-card .pv { aspect-ratio: 210/297; overflow: hidden; position: relative; background: #F1F5F9; border-bottom: 1px solid var(--tf-line-2); }
.tf-doc-card .pv iframe { position: absolute; top: 0; left: 0; width: 794px; height: 1123px; border: 0; transform-origin: 0 0; pointer-events: none; }
.tf-doc-card .meta { padding: .75rem .9rem; }
.tf-doc-card .meta b { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-doc-card .meta small { color: var(--tf-muted); }
.tf-doc-editor { display: grid; grid-template-columns: 1fr 380px; height: calc(100vh - 64px); }
.tf-doc-stage { overflow-y: auto; overflow-x: hidden; background: #E7EBEE; padding: 1.5rem; }
.tf-doc-stage iframe { border: 0; height: 1180px; display: block; }
.tf-doc-chat { border-left: 1px solid var(--tf-line); background: #fff; display: flex; flex-direction: column; min-height: 0; }
.tf-doc-chat .head { padding: 1rem 1.2rem; border-bottom: 1px solid var(--tf-line-2); }
.tf-doc-chat .log { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; }
.tf-bubble { padding: .7rem .9rem; border-radius: 14px; font-size: .9rem; margin-bottom: .7rem; max-width: 92%; }
.tf-bubble.me { background: var(--tf-teal-700); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.tf-bubble.ai { background: var(--tf-line-2); color: var(--tf-ink); border-bottom-left-radius: 4px; }
.tf-bubble small { display: block; opacity: .7; font-size: .74rem; margin-top: .25rem; }
.tf-doc-chat .foot { padding: 1rem 1.2rem; border-top: 1px solid var(--tf-line-2); }
.tf-version { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: 8px; border: 1px solid var(--tf-line); font-size: .78rem; font-weight: 600; color: var(--tf-slate); background: #fff; }
.tf-version.active { border-color: var(--tf-teal-600); color: var(--tf-teal-800); background: var(--tf-teal-50); }

/* ---------- Setup / DNS ---------- */
.tf-dns td, .tf-dns th { vertical-align: middle; }
.tf-dns code { background: var(--tf-line-2); color: var(--tf-ink); padding: .2rem .45rem; border-radius: 6px; font-size: .82rem; word-break: break-all; }
.tf-copy { border: 0; background: transparent; color: var(--tf-muted); padding: .1rem .35rem; border-radius: 6px; }
.tf-copy:hover { color: var(--tf-teal-700); background: var(--tf-teal-50); }
.tf-progress { height: 10px; border-radius: 10px; background: var(--tf-line-2); overflow: hidden; }
.tf-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--tf-teal-600), var(--tf-teal-500)); transition: width .4s; }
.tf-setup-steps { list-style: none; padding: 0; margin: 0; }
.tf-setup-steps a { display: flex; gap: .8rem; align-items: center; padding: .8rem .9rem; border-radius: 12px; color: var(--tf-slate); font-weight: 500; }
.tf-setup-steps a:hover { background: #fff; color: var(--tf-ink); }
.tf-setup-steps a.active { background: #fff; color: var(--tf-ink); box-shadow: var(--tf-shadow-sm); border: 1px solid var(--tf-line); }
.tf-setup-steps .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--tf-line-2); color: var(--tf-slate); flex: none; }
.tf-setup-steps a.active .n { background: var(--tf-teal-700); color: #fff; }
.tf-setup-steps a.done .n { background: var(--tf-green); color: #fff; }

/* ---------- API docs ---------- */
.tf-docs { display: grid; grid-template-columns: 240px 1fr; gap: 3rem; }
.tf-docs-nav { position: sticky; top: 90px; align-self: start; font-size: .9rem; }
.tf-docs-nav a { display: block; padding: .3rem .6rem; color: var(--tf-slate); border-radius: 6px; }
.tf-docs-nav a:hover { color: var(--tf-ink); background: var(--tf-line-2); }
.tf-docs-nav h6 { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--tf-muted); margin: 1.2rem 0 .4rem .6rem; }
.tf-endpoint { background: #fff; border: 1px solid var(--tf-line); border-radius: 16px; padding: 1.6rem; margin-bottom: 1.5rem; scroll-margin-top: 90px; }
.tf-method { font-family: var(--tf-mono); font-size: .75rem; font-weight: 700; padding: .2rem .5rem; border-radius: 6px; color: #fff; }
.tf-method.get { background: #0EA5E9; } .tf-method.post { background: var(--tf-teal-700); } .tf-method.delete { background: var(--tf-red); }
.tf-path { font-family: var(--tf-mono); font-size: .92rem; font-weight: 500; }
.tf-code { background: #0B1B1E; color: #D5E3E8; border-radius: 12px; padding: 1.1rem 1.2rem; font-size: .82rem; line-height: 1.7; overflow-x: auto; position: relative; margin: 0; }
.tf-code .k { color: #5EEAD4; } .tf-code .s { color: #FCD34D; } .tf-code .c { color: #64748B; }
.tf-params { width: 100%; font-size: .88rem; margin: .8rem 0; }
.tf-params td { padding: .5rem .6rem; border-bottom: 1px solid var(--tf-line-2); vertical-align: top; }
.tf-params td:first-child { font-family: var(--tf-mono); font-size: .82rem; white-space: nowrap; color: var(--tf-teal-800); width: 170px; }

/* ---------- Superadmin ---------- */
.tf-settings-nav .nav-link { color: var(--tf-slate); font-weight: 600; border-radius: 10px; padding: .6rem .9rem; font-size: .9rem; display: flex; gap: .7rem; align-items: center; }
.tf-settings-nav .nav-link.active { background: #fff; color: var(--tf-ink); box-shadow: var(--tf-shadow-sm); border: 1px solid var(--tf-line); }
.tf-settings-nav .nav-link i { width: 18px; text-align: center; color: var(--tf-teal-700); }
.tf-secret { font-family: var(--tf-mono); font-size: .88rem; }
.tf-chart { position: relative; height: 260px; }

/* ---------- RSVP ---------- */
.tf-rsvp { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--tf-bg); }
.tf-rsvp-card { width: 100%; max-width: 560px; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: var(--tf-shadow-lg); border: 1px solid var(--tf-line); }

/* ---------- Toasts / modals ---------- */
.tf-toast { border: 0; border-radius: 12px; background: var(--tf-ink); color: #fff; box-shadow: var(--tf-shadow-lg); font-size: .9rem; min-width: 280px; }
.tf-toast.error { background: #7F1D1D; }
.tf-toast.success i { color: var(--tf-teal-300); }
.tf-toast .toast-body { display: flex; gap: .7rem; align-items: center; padding: .85rem 1rem; }
.modal-content { border-radius: 18px; border: 0; box-shadow: var(--tf-shadow-lg); }
.modal-header, .modal-footer { border-color: var(--tf-line-2); }
.spinner-border-sm { width: .9rem; height: .9rem; border-width: .15em; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
  .tf-compose { grid-template-columns: 1fr; }
  .tf-compose-side { border-left: 0; border-top: 1px solid var(--tf-line); }
  .tf-doc-editor { grid-template-columns: 1fr; height: auto; }
  .tf-doc-chat { border-left: 0; border-top: 1px solid var(--tf-line); min-height: 480px; }
  .tf-studio { grid-template-columns: 380px 1fr; }
}
@media (max-width: 991.98px) {
  .tf-side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--tf-shadow-lg); }
  .tf-app.side-open .tf-side { transform: none; }
  .tf-app.side-open .tf-side-scrim { display: block; position: fixed; inset: 0; background: rgba(11,18,21,.45); z-index: 1035; }
  .tf-mail { grid-template-columns: 1fr; }
  .tf-mail .tf-reader { display: none; }
  .tf-mail.reading .tf-mail-list { display: none; }
  .tf-mail.reading .tf-reader { display: flex; }
  .tf-auth { grid-template-columns: 1fr; }
  .tf-auth-art { display: none; }
  .tf-mock { grid-template-columns: 1fr; }
  .tf-mock-side, .tf-mock-list { display: none; }
  .tf-docs { grid-template-columns: 1fr; }
  .tf-docs-nav { display: none; }
  .tf-studio { grid-template-columns: 1fr; }
  .tf-studio-panel { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--tf-line); }
  .tf-float { display: none; }
}
@media (max-width: 575.98px) {
  .tf-content { padding: 1rem; }
  .tf-top { padding: 0 .75rem; }
  .tf-pwa-pill span { display: none; }
  .tf-section { padding: 4rem 0; }
  .tf-compose-main { padding: .75rem; }
  .tf-doc-stage { padding: .5rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Pills (studio tabs etc.) */
.nav-pills .nav-link { color: var(--tf-slate); font-weight: 600; border-radius: 9px; padding: .45rem .8rem; white-space: nowrap; }
.nav-pills .nav-link:hover { color: var(--tf-ink); background: var(--tf-line-2); }
.nav-pills .nav-link.active { background: var(--tf-ink); color: #fff; }
code { color: var(--tf-teal-800); }
.tf-dns td:nth-child(3) code { white-space: nowrap; word-break: normal; }
.tf-canvas .ql-container.ql-snow, .tf-canvas .tf-slot.ql-container { border: 0 !important; font: inherit; color: inherit; }
.tf-canvas .ql-editor { padding: 0; font: inherit; color: inherit; line-height: inherit; min-height: 260px; }
.tf-canvas-wrap { overflow: visible; }
.tf-canvas { border-radius: 0 0 16px 16px; overflow: hidden; }
.tf-editor-toolbar.ql-toolbar { border-radius: 16px 16px 0 0; }
.tf-canvas .tf-container { table-layout: fixed; width: 600px !important; max-width: 100% !important; }
.tf-canvas .tf-slot { max-width: 100%; overflow-wrap: anywhere; }

/* Recipient autocomplete */
.tf-suggest { position: fixed; z-index: 1100; width: 370px; max-width: calc(100vw - 16px); max-height: 340px; overflow-y: auto; background: #fff; border: 1px solid var(--tf-line); border-radius: 14px; box-shadow: var(--tf-shadow-lg); padding: .35rem; display: none; }
.tf-suggest.show { display: block; animation: pillIn .12s ease; }
.tf-suggest-item { display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem; border-radius: 10px; cursor: pointer; }
.tf-suggest-item.active, .tf-suggest-item:hover { background: var(--tf-teal-50); }
.tf-suggest-item .min-w-0 { min-width: 0; display: flex; flex-direction: column; }
.tf-suggest-item .nm { font-size: .9rem; color: var(--tf-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-suggest-item .em { font-size: .8rem; color: var(--tf-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-suggest-item b { font-weight: 700; color: var(--tf-teal-800); }
.tf-suggest-item .tag { margin-left: auto; font-size: .68rem; font-weight: 600; color: var(--tf-teal-800); background: var(--tf-teal-50); border: 1px solid var(--tf-teal-100); border-radius: 999px; padding: .05rem .5rem; flex: none; }

/* Logo cropper */
.tf-crop-stage { background-color: #F1F5F9; background-image: linear-gradient(45deg, #E2E8F0 25%, transparent 25%), linear-gradient(-45deg, #E2E8F0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #E2E8F0 75%), linear-gradient(-45deg, transparent 75%, #E2E8F0 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; border-radius: 12px; overflow: hidden; height: 360px; }
.tf-crop-stage.dark { background: #0B1B1E; }
.tf-crop-stage img { display: block; max-width: 100%; }
.tf-dropzone.dark { background: #0B1B1E; border-color: #1E3A3F; color: #CBD5E1; }
.tf-dropzone.dark .text-muted { color: #94A3B8 !important; }

/* Workspace identity in the sidebar (company logo leads, platform mark stays quiet) */
.tf-side-company strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-side-logo { flex: none; height: 34px; max-width: 88px; display: inline-flex; align-items: center; border-radius: 8px; }
.tf-side-logo.chip { background: #fff; padding: 4px 7px; }
.tf-side-logo img { max-height: 26px; max-width: 74px; object-fit: contain; display: block; }
.tf-side-mono { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--tf-teal-700); color: #fff; font-weight: 700; font-size: .78rem; }
.tf-side .tf-logo-light .tf-mark { color: #3A4048; }
.tf-side .tf-side-head .tf-logo span { color: #C9D0D6; font-size: 1rem; }
.tf-side-label { color: #5E6670; }
.tf-side-link { color: #B8BFC6; }
.tf-side-link i { color: #7D858E; }
.tf-side-link.active i { color: var(--tf-teal-300); }
.tf-side-meters { border-top-color: rgba(255,255,255,.06); }
.tf-side-company { background: rgba(255,255,255,.035); border-color: rgba(255,255,255,.06); }
.tf-ai-input textarea { scrollbar-width: thin; }

/* Reader: per-message view tools */
.tf-msg-tools { display: flex; align-items: center; gap: .5rem; padding: .55rem 1.2rem; border-bottom: 1px solid var(--tf-line-2); background: #FAFBFC; }
.tf-seg { display: inline-flex; background: #EEF0F3; border-radius: 9px; padding: 2px; }
.tf-seg button { border: 0; background: transparent; font-size: .76rem; font-weight: 600; color: var(--tf-muted); padding: .25rem .65rem; border-radius: 7px; }
.tf-seg button.active { background: #fff; color: var(--tf-ink); box-shadow: var(--tf-shadow-sm); }
.tf-msg-body iframe { background: #fff; }

/* Company migration table */
.tf-mig-shared { background: #F8F9FA; border: 1px solid var(--tf-line); border-radius: 14px; padding: 1rem; }
.tf-mig-table td { vertical-align: top; }
.tf-mig-table input.form-control-sm { min-width: 0; }
.tf-mig-table { table-layout: fixed; }
.tf-mig-table th:nth-child(1) { width: 26%; } .tf-mig-table th:nth-child(2) { width: 24%; } .tf-mig-table th:nth-child(3) { width: 18%; } .tf-mig-table th:nth-child(5) { width: 92px; }
.tf-mig-table td strong { word-break: break-all; }
.tf-gate details summary { cursor: pointer; }
.tf-mig-table .tf-pill { white-space: normal; line-height: 1.35; }
.tf-mig-table th:nth-child(5) { width: 48px; }
.tf-mig-table td:last-child .btn { display: block; margin: 0 0 .3rem auto; padding: .3rem .5rem; }
.tf-mig-table th, .tf-mig-table td { padding-left: .5rem !important; padding-right: .5rem !important; }

/* Show / hide password */
.tf-pw-wrap { position: relative; display: block; flex: 1 1 auto; min-width: 0; }
.tf-pw-wrap > input { padding-right: 2.6rem !important; width: 100%; }
.input-group > .tf-pw-wrap > input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tf-pw-toggle { position: absolute; top: 50%; right: .35rem; transform: translateY(-50%); border: 0; background: transparent; color: var(--tf-muted); width: 2rem; height: 2rem; border-radius: 8px; display: grid; place-items: center; z-index: 5; }
.tf-pw-toggle:hover { color: var(--tf-ink); background: var(--tf-line-2); }
.form-control-sm + .tf-pw-toggle, .tf-pw-wrap > .form-control-sm ~ .tf-pw-toggle { width: 1.7rem; height: 1.7rem; font-size: .8rem; }
.tf-add-row { border-style: dashed; }
.tf-new-addr .small { margin-top: .15rem; word-break: break-all; }
