.tft-button{box-sizing:border-box;display:inline-block;border:1px solid #b9c2d2;border-radius:7px;background:#fff;padding:9px 13px;font-weight:700;color:#172033;text-decoration:none}
#tft-dialog[open]{position:fixed!important;inset:50% auto auto 50%!important;transform:translate(-50%,-50%)!important;box-sizing:border-box!important;width:min(620px,calc(100vw - 32px))!important;min-width:0!important;max-width:calc(100vw - 32px)!important;max-height:calc(100vh - 48px)!important;margin:0!important;overflow:auto!important}
.tft-primary{transition:transform .08s ease,box-shadow .08s ease,background-color .2s ease}
.tft-primary:active:not(:disabled){transform:translateY(2px);box-shadow:inset 0 2px 5px rgba(0,0,0,.2)}
.tft-primary.tft-is-sending,.tft-primary.tft-is-sent{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-width:145px;transform:translateY(2px);box-shadow:inset 0 2px 6px rgba(0,0,0,.22)}
.tft-primary.tft-is-sending{cursor:wait;opacity:.9}
.tft-primary.tft-is-sent{background:#17803d;border-color:#17803d}
.tft-spinner{width:16px;height:16px;border:2px solid rgba(255,255,255,.45);border-top-color:#fff;border-radius:50%;animation:tft-spin .7s linear infinite}
@keyframes tft-spin{to{transform:rotate(360deg)}}
.tft-danger{color:#b42318;border-color:#f1b7b2}
.tft-wrap{flex-wrap:wrap}
.tft-qr{text-align:center}
.tft-qr-code{display:block;width:min(360px,80vw);height:auto;margin:18px auto}
.tft-kiosk-logo{display:block;width:min(240px,55vw);height:auto;margin:0 auto 18px}
.tft-scan-text{font-size:18px;font-weight:700;color:#1c2a58}
.tft-qr-actions{justify-content:center}
.tft-kiosk-choice{margin-top:22px;padding-top:18px;border-top:1px solid #dce4f0}
.tft-kiosk-choice h3{margin:0 0 6px;color:#1c2a58}
.tft-kiosk-choice p{margin:0 auto 14px;max-width:520px;color:#66738b;font-size:14px;line-height:1.45}
.tft-winner .tft-actions{justify-content:center}
.tft-account{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin:0 0 18px;padding:12px 16px;background:#fff;border:1px solid #dce4f0;border-radius:10px}
.tft-account>a{margin-left:auto}
.tft-view-as{margin:0}
.tft-view-as label{display:flex;align-items:center;gap:8px;font-weight:700}
.tft-view-as select{width:auto;min-width:210px;margin:0}
.tft-login{max-width:440px;margin:30px auto}
.tft-login label{display:block;margin:12px 0 5px;font-weight:700}
.tft-login input[type=text],.tft-login input[type=password]{box-sizing:border-box;width:100%;padding:11px;border:1px solid #b9c2d2;border-radius:7px}
.tft-login input[type=submit]{border:0;border-radius:7px;background:#ed1b2f;color:#fff;padding:11px 18px;font-weight:700;cursor:pointer}
.tft-fieldset{margin:0;border:1px solid #dce4f0;border-radius:9px;padding:14px}
.tft-fieldset legend{padding:0 7px;font-weight:800;color:#1c2a58}
.tft-chapter-list,.tft-supply-list{display:grid;gap:8px}
.tft-chapter-list{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}
.tft-form .tft-check-row,.tft-form .tft-supply-row{display:flex;align-items:center;gap:10px;margin:0;padding:9px 10px;border:1px solid #e1e6ef;border-radius:7px;font-weight:600}
.tft-form .tft-check-row input[type=checkbox],.tft-form .tft-supply-row input[type=checkbox]{width:18px;height:18px;margin:0;padding:0;flex:0 0 auto}
.tft-form .tft-supply-row span{flex:1}
.tft-form .tft-supply-row .tft-qty{width:125px;flex:0 0 125px;padding:7px}
.tft-history{display:grid;gap:12px}
.tft-history-row{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}
.tft-history-main{min-width:0;flex:1}
.tft-history-main h3{margin:4px 0}
.tft-history-main p{margin:4px 0;color:#526079}
.tft-history-meta{font-size:13px;color:#66738b}
.tft-history-side{display:grid;justify-items:end;gap:8px;max-width:430px}
.tft-status{display:inline-block;border-radius:999px;padding:5px 10px;background:#e8edf5;color:#33415f;font-size:13px;font-weight:800}
.tft-status-sent{background:#dcfce7;color:#166534}
.tft-status-scheduled{background:#dbeafe;color:#1e40af}
.tft-status-canceled{background:#fee2e2;color:#991b1b}
.tft-status-cc_draft{background:#fef3c7;color:#92400e}
.tft-email-detail{min-width:min(650px,75vw)}
.tft-email-copy{margin:10px 0 18px;padding:14px;border:1px solid #dce4f0;border-radius:8px;background:#f8fafc;color:#334155}
@media(max-width:600px){.tft-wrap{flex-direction:column}}
@media(max-width:700px){.tft-history-row{display:block}.tft-history-side{justify-items:start;max-width:none;margin-top:14px}.tft-email-detail{min-width:0}}


/* v0.15.10: purpose-built mobile Field Tools layout. Desktop remains unchanged. */
@media (max-width:700px){
  body.tft-portal-page{overflow-x:hidden!important}
  body.tft-portal-page #page,
  body.tft-portal-page #content,
  body.tft-portal-page .site-content,
  body.tft-portal-page #primary,
  body.tft-portal-page .content-area,
  body.tft-portal-page .site-main,
  body.tft-portal-page article,
  body.tft-portal-page .entry-content{box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;margin-left:0!important;margin-right:0!important;float:none!important}
  body.tft-portal-page .entry-content{padding-left:12px!important;padding-right:12px!important}
  body.tft-portal-page .post-heading{box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-height:0!important;height:auto!important;margin:0!important;padding:18px 12px 12px!important}
  body.tft-portal-page .post-heading h1,
  body.tft-portal-page .post-heading .entry-title{margin:0!important;font-size:clamp(30px,9vw,42px)!important;line-height:1.08!important;white-space:normal!important}
  body.tft-portal-page #header{min-height:0!important;height:auto!important;margin-bottom:0!important;padding-bottom:12px!important}
  body.tft-portal-page #logo{margin-bottom:0!important}

  .tft-app{box-sizing:border-box;width:100%;max-width:none;margin:8px 0 24px;padding:0;font-size:16px;overflow:visible}
  .tft-account{display:grid;grid-template-columns:1fr;gap:10px;margin:0 0 14px;padding:14px;border-radius:12px}
  .tft-account>span{font-size:17px}
  .tft-account>a{margin:0;width:max-content}
  .tft-view-as{width:100%}
  .tft-view-as label{display:grid;grid-template-columns:1fr;gap:6px}
  .tft-view-as select{box-sizing:border-box;width:100%;max-width:100%;min-width:0;height:44px}

  .tft-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:0 0 18px;padding:0;border:0;overflow:visible;white-space:normal}
  .tft-tabs button{box-sizing:border-box;min-width:0;min-height:44px;padding:9px 8px;border:1px solid #d9deea;border-radius:9px;background:#fff;color:#46536b;font-size:13px;line-height:1.2;text-align:center;white-space:normal}
  .tft-tabs button.active{border:1px solid var(--tft-red);background:#fff5f6;color:var(--tft-navy);box-shadow:inset 0 -3px 0 var(--tft-red)}

  .tft-toolbar{display:flex;align-items:center;gap:10px;margin-bottom:12px}
  .tft-toolbar h2{margin:0;font-size:28px;line-height:1.1}
  .tft-toolbar>.tft-primary{margin-left:auto;flex:0 0 auto;min-height:44px;padding:10px 14px}
  .tft-toolbar>div{min-width:0}
  .tft-toolbar>div h2{font-size:25px}
  .tft-toolbar>div .tft-help{margin:6px 0 0}
  .tft-grid{grid-template-columns:minmax(0,1fr);gap:12px}
  .tft-card{box-sizing:border-box;width:100%;min-width:0;padding:16px;border-radius:12px}
  .tft-actions{gap:8px}
  .tft-actions>*{box-sizing:border-box;min-height:42px}
  .tft-wrap{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
  .tft-wrap>*{width:100%;text-align:center}
  .tft-meeting-card{grid-template-columns:52px minmax(0,1fr);gap:12px}
  .tft-meeting-copy{min-width:0}
  .tft-chapter-pills{gap:6px}
  .tft-chapter-pills a{font-size:13px;padding:6px 9px}
  .tft-form{width:100%;max-width:none}
  .tft-rich-toolbar{flex-wrap:wrap}
  #tft-toast{left:12px;right:12px;bottom:12px;text-align:center}
}
@media (max-width:390px){
  .tft-tabs button{font-size:12.5px;padding:8px 6px}
  .tft-toolbar h2{font-size:25px}
  .tft-toolbar>.tft-primary{padding:9px 11px;font-size:14px}
}


/* v0.15.11: mobile polish only; desktop intentionally unchanged. */
@media (max-width:700px){
  /* Keep the account controls compact instead of allowing theme/grid rules to stretch the card. */
  .tft-account{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-auto-rows:max-content!important;align-content:start!important;align-items:start!important;gap:8px!important;padding:12px 14px!important;margin-bottom:12px!important;min-height:0!important;height:auto!important}
  .tft-account>span{margin:0!important;font-size:16px!important;line-height:1.3!important}
  .tft-view-as{margin:0!important;padding:0!important}
  .tft-view-as label{margin:0!important;gap:4px!important;font-size:15px!important;line-height:1.25!important}
  .tft-view-as select{height:40px!important;padding:6px 10px!important;font-size:15px!important}
  .tft-account>a{margin:1px 0 0!important;font-size:15px!important;line-height:1.25!important}

  /* Compact app-like navigation while preserving comfortable touch targets. */
  .tft-tabs{gap:6px!important;margin-bottom:16px!important}
  .tft-tabs button{min-height:42px!important;padding:7px 7px!important;font-size:12.5px!important;line-height:1.15!important;border-radius:8px!important}

  /* Give section headers a deliberate mobile rhythm. */
  .tft-toolbar{box-sizing:border-box!important;width:100%!important;padding:0 2px!important;margin:0 0 10px!important;gap:8px!important}
  .tft-toolbar h2{font-size:25px!important;line-height:1.08!important}
  .tft-toolbar>.tft-primary{min-height:42px!important;padding:9px 12px!important;font-size:14px!important;border-radius:8px!important}

  /* Denser, easier-to-scan event cards. */
  .tft-grid{gap:10px!important}
  .tft-card{padding:14px!important;border-radius:11px!important}
  .tft-card .tft-date{margin:0 0 6px!important;font-size:11.5px!important;line-height:1.25!important;letter-spacing:.07em!important}
  .tft-card h3{margin:2px 0 7px!important;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;font-style:normal!important;font-size:21px!important;line-height:1.18!important;font-weight:750!important;letter-spacing:0!important;overflow-wrap:anywhere!important}
  .tft-card p{margin:5px 0!important;line-height:1.35!important}
  .tft-card .tft-actions{margin-top:12px!important}

  /* Avenue leaves a decorative left rail on this app page; neutralize it only behind Field Tools. */
  body.tft-portal-page #content,
  body.tft-portal-page .site-content,
  body.tft-portal-page #primary,
  body.tft-portal-page .content-area,
  body.tft-portal-page .site-main,
  body.tft-portal-page article,
  body.tft-portal-page .entry-content{background:#fff!important;background-image:none!important}
}


/* v0.15.12: place the upcoming-meeting count naturally in the mobile heading flow. */
@media (max-width:700px){
  section[data-panel="meetings"] > .tft-toolbar{display:block!important;}
  section[data-panel="meetings"] > .tft-toolbar > div{width:100%!important;}
  section[data-panel="meetings"] > .tft-toolbar > strong{display:inline-flex!important;align-items:center!important;width:auto!important;margin:8px 0 0!important;padding:5px 9px!important;border-radius:999px!important;background:#f3f5f9!important;color:var(--tft-navy)!important;font-size:12.5px!important;line-height:1!important;font-weight:800!important;}
}


/* v0.15.13: make the Upcoming count part of the heading, not a detached afterthought. */
.tft-meetings-heading-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tft-meetings-heading-row h2{margin:0}
.tft-upcoming-count{display:inline-flex;align-items:center;white-space:nowrap;border-radius:999px;padding:5px 9px;background:#eef2f8;color:var(--tft-navy);font-size:12.5px;line-height:1;font-weight:800}
@media (max-width:700px){
  section[data-panel="meetings"] > .tft-toolbar{display:block!important}
  section[data-panel="meetings"] > .tft-toolbar > div{width:100%!important}
  .tft-meetings-heading-row{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important}
  .tft-meetings-heading-row h2{flex:0 1 auto!important}
  .tft-upcoming-count{margin:0!important;padding:5px 9px!important;background:#eef2f8!important;color:var(--tft-navy)!important;font-size:12px!important}
}
