/* The new header, left menu and phone tab bar around screens that haven't been rebuilt yet (ttc-frame.js),
   plus a restyle of the old content so it matches the new look. Rules on bare elements use :where() so they only
   replace the old site-wide defaults, never a component's own styles. */
#ttc-frame{display:none}
body.tf-framed{--cyan:#3FD2E8;--muted:#8FA6AD;--line:#1E2F36;--bg:#0B1418;--card:#111D22;--card-line:#1E2F36;background:#0B1418;color:#E8F1F3;font-family:Inter,system-ui,sans-serif;padding-top:65px}
body.tf-framed #ttc-frame{display:block}
body.tf-framed>header.portal-header,body.tf-framed>footer,body.tf-framed .phone-tabbar,body.tf-framed #admin-tabs{display:none!important}

/* Frame pieces live outside #ttc-feed-app, so they get the same base rules here. */
#ttc-frame{font-size:15px;line-height:1.45;color:#E8F1F3}
#ttc-frame *{box-sizing:border-box}
#ttc-frame a{color:#3FD2E8;text-decoration:none}
:where(#ttc-frame) button{font:inherit;cursor:pointer;color:inherit;margin:0}
#ttc-frame [hidden]{display:none!important}
#ttc-frame h2{font:700 16px 'Space Grotesk',Inter,sans-serif;letter-spacing:0;margin:0 0 12px;color:#E8F1F3}
#ttc-frame :focus-visible{outline:2px solid #3FD2E8;outline-offset:2px}
#ttc-frame>.tf-header{display:block;height:auto;padding:0;gap:0;position:fixed;top:0;left:0;right:0;z-index:40;background:rgba(11,20,24,.94);border-bottom:1px solid #1A2A30;backdrop-filter:blur(6px)}
#ttc-frame .tf-header-actions{margin-left:0}
#ttc-frame>.tf-left{position:fixed;top:89px;bottom:0;left:max(20px,calc((100vw - 1240px)/2 + 20px));width:232px;overflow-y:auto;padding-bottom:28px;gap:6px;scrollbar-width:thin}
#ttc-frame .tf-me{margin-bottom:8px}
#ttc-frame .tf-label{padding:16px 12px 6px}
.tf-shortcuts a{padding:8px 12px!important;font-size:14px!important}
.tf-shortcuts .tf-ic{width:18px;height:18px;color:#8FA6AD}
.tf-shortcuts a[aria-current] .tf-ic{color:#3FD2E8}

/* Page area next to the left menu */
body.tf-framed>main#content{max-width:1240px;margin:0 auto;padding:24px 20px 56px 280px;min-height:calc(100vh - 65px);color:#E8F1F3}
body.tf-framed[data-frame=chat] #ttc-frame>.tf-left{display:none}
body.tf-framed[data-frame=chat]>main#content{max-width:1440px;padding:16px 20px 24px}
@media(max-width:1099px){
  #ttc-frame>.tf-left{display:none}
  body.tf-framed>main#content{padding:20px 20px 110px}
  /* No left menu below this width, so the tab bar takes over. */
  #ttc-frame .tf-tabbar{display:flex}
}
@media(max-width:759px){
  body.tf-framed{padding-top:67px}
  body.tf-framed>main#content{padding:16px 16px 110px}
  #ttc-frame>.tf-header{background:#0F1A1F;border-bottom:0;backdrop-filter:none;transition:transform .22s ease}
  body.tf-head-hide #ttc-frame>.tf-header:not(.searching){transform:translateY(-100%)}
  body.tf-framed>main#content{padding-bottom:calc(110px + env(safe-area-inset-bottom))}
  body.tf-framed[data-frame=chat]>main#content{padding:0 0 96px}
}

/* ---------- Old content in the new look ---------- */
:where(body.tf-framed main#content){font-size:15px;line-height:1.5}
:where(body.tf-framed main#content) h1{font:700 28px/1.2 'Space Grotesk',Inter,sans-serif;letter-spacing:0;margin:0 0 18px;color:#E8F1F3}
:where(body.tf-framed main#content) h2{font:700 19px/1.25 'Space Grotesk',Inter,sans-serif;letter-spacing:0;margin:0 0 12px;color:#E8F1F3}
:where(body.tf-framed main#content) h3{font:600 16px/1.3 Inter,sans-serif;letter-spacing:0;margin:18px 0 10px;color:#E8F1F3}
:where(body.tf-framed main#content) a{color:#3FD2E8}
:where(body.tf-framed main#content) button{background:#15242A;border:1px solid #23363D;border-radius:12px;padding:9px 16px;font-size:14px;font-weight:600;color:#E8F1F3;min-height:40px}
:where(body.tf-framed main#content) button:hover:not(:disabled){background:#1E2F36;border-color:#2B4650}
:where(body.tf-framed main#content) .primary{background:#3FD2E8;border:0;color:#062026;font-weight:700;border-radius:12px;padding:10px 18px;gap:10px}
:where(body.tf-framed main#content) .primary:hover:not(:disabled){background:#7FE3F2}
:where(body.tf-framed main#content) .secondary{background:#15242A}
:where(body.tf-framed main#content) label{font-size:13px;font-weight:500;color:#8FA6AD}
:where(body.tf-framed main#content) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),select,textarea){background:#0E191D;border:1px solid #23363D;border-radius:12px;color:#E8F1F3;font-size:15px;padding:11px 14px}
:where(body.tf-framed main#content) :is(input,select,textarea):focus{border-color:#3FD2E8;outline:0;box-shadow:0 0 0 3px #3FD2E826}
:where(body.tf-framed main#content) :is(input,textarea)::placeholder{color:#6F878E}
:where(body.tf-framed main#content) input:is([type=checkbox],[type=radio]){accent-color:#3FD2E8}
:where(body.tf-framed main#content) details>summary{cursor:pointer;color:#E8F1F3;font-weight:600}
:where(body.tf-framed main#content) .eyebrow{color:#3FD2E8;letter-spacing:.12em;font-size:11px}
:where(body.tf-framed main#content) dt{color:#8FA6AD;font-size:13px}
:where(body.tf-framed main#content) [role=status]:empty{display:none}

/* Cards: the old panels get the new card surface */
body.tf-framed :is(.calendar-card,.project-row,.agenda-visit,.site-finder,.profile-group,.account-access,.account-photo,#calendar-management,.route-panel,#contact-result>*,#contact-groups>section,#field-admin,#social-admin,.job-card,.stats>div,.member-card){background:#111D22;border:1px solid #1E2F36;border-radius:16px}
body.tf-framed :is(.profile-group,.account-access,.account-photo,#calendar-management,.route-panel,#field-admin,#social-admin){padding:18px 20px}
body.tf-framed .project-row:hover,body.tf-framed .agenda-visit:hover{border-color:#2B4650;background:#15242A}
body.tf-framed .toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:16px}
body.tf-framed .toolbar h2{margin:0}
body.tf-framed .workspace-bar{border-bottom:1px solid #1A2A30;margin-bottom:20px;padding-top:0}
body.tf-framed:not([data-frame=jobs]):not([data-frame=admin]) .workspace-bar{display:none}
body.tf-framed .workspace-heading h1{font-size:26px}
body.tf-framed .stats>div{padding:16px 18px}
body.tf-framed .stats strong{font-family:'Space Grotesk',Inter,sans-serif;color:#E8F1F3}

/* Calendar */
body.tf-framed .calendar-day{border-radius:10px;background:#0E191D;border-color:#1E2F36}
body.tf-framed .calendar-day:hover{background:#15242A}
body.tf-framed .calendar-day[aria-current=date]{border-color:#3FD2E8}
body.tf-framed .calendar-day[aria-pressed=true]{background:#3FD2E8;color:#062026;border-color:#3FD2E8}
body.tf-framed .calendar-modes{background:#111D22;border:1px solid #1E2F36;border-radius:12px;padding:4px;gap:4px;display:inline-flex}
body.tf-framed .calendar-modes button{border:0;background:transparent;min-height:36px;border-radius:9px}
body.tf-framed .calendar-modes button[aria-pressed=true],body.tf-framed .calendar-modes button.active{background:#15242A;color:#3FD2E8}
body.tf-framed .agenda-visit{border-left:3px solid #3FD2E8}

/* Social pages that still use the older screens */
body.tf-framed #social-view .social-heading h1,body.tf-framed #social-view .social-messenger,body.tf-framed #social-view .profile-feed-back{display:none}
body.tf-framed #social-view .social-heading{border:0;margin:0;padding:0;justify-content:flex-end}
body.tf-framed #social-view .social-rail,body.tf-framed #social-view .social-discovery{display:none}
body.tf-framed #social-view .social-layout{display:block}
body.tf-framed #social-view .social-center{max-width:720px;margin:0 auto}
body.tf-framed #social-view .social-card{background:#111D22;border-color:#1E2F36}

/* Account settings */
body.tf-framed #profile-view h1,body.tf-framed #chat-view h1{font:700 28px/1.2 'Space Grotesk',Inter,sans-serif;letter-spacing:0;margin:0 0 8px}
body.tf-framed .anthem-preference{display:flex;align-items:center;gap:10px;margin:0 0 18px;font-size:14px;color:#B9CCD1}
body.tf-framed .anthem-preference input{width:18px;height:18px;margin:0;flex:none}
body.tf-framed #profile-view>a{display:inline-flex;margin:-6px 0 14px}
body.tf-framed .account-layout{gap:20px}
body.tf-framed .account-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:16px}

/* Admin */
body.tf-framed #admin-sections{display:flex;gap:4px;border-bottom:1px solid #1E2F36;margin:-4px 0 20px}
body.tf-framed #admin-sections a{padding:10px 14px;border-bottom:2px solid transparent;color:#8FA6AD;font-weight:600}
body.tf-framed #admin-sections a:hover{color:#E8F1F3}

/* Old pop-up forms */
body.tf-framed dialog:not([class*=tf-]):not([class*=tpp-]):not([class*=dk-]){background:#111D22;border:1px solid #23363D;border-radius:18px;color:#E8F1F3;font-family:Inter,system-ui,sans-serif}
body.tf-framed dialog::backdrop{background:#000a}

/* Phones: an open conversation in Messenger is full screen, so the header and tab bar step aside (it has its own Back button). */
@media(max-width:700px){body.messenger-page[data-panel=conversation] #ttc-frame{display:none}}
