/* Shared sizing rules keep long customer content inside its own card. */
[hidden]{display:none!important}
.grow,.row>*,.pagehead>*,.stack,.card,.workspace,.crumb,.step>*,.activity>*,.brand-card dd,.checklist>*,.settings-grid>*,.ig-inbox>*,.ig-editor-layout>*{min-width:0}
h1,h2,h3,p,dd,.note,.errorbox,.step strong,.crumb,.connection strong,.ig-phonehead strong,.ig-inbox strong,.readiness,.bank-request,.userbox{overflow-wrap:anywhere}
img{max-width:100%}
svg,.mark,.avatar,.pill{flex-shrink:0}
.actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.row.wrap{flex-wrap:wrap}
.metrics{grid-template-columns:repeat(4,minmax(0,1fr))}
.overview-grid{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr)}
.settings-grid,.form-grid,.checklist{grid-template-columns:repeat(2,minmax(0,1fr))}
.features{grid-template-columns:repeat(3,minmax(0,1fr))}
.table-wrap{max-width:100%;overscroll-behavior-x:contain}
.sidebar{overflow-y:auto;overscroll-behavior:contain}
.nav a{flex-shrink:0}
.mobile-menu-toggle{display:none}
.topbar-actions{display:flex;align-items:center;gap:12px;flex-shrink:0}
.topbar-actions button{white-space:nowrap}
.topbar .crumb{flex:1;min-width:0;display:flex;align-items:center;gap:12px}
.topbar .crumb>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topbar .crumb b{margin:0;white-space:nowrap;flex-shrink:0}
.post-title-link{color:var(--ink)}
dialog[open]{display:flex;flex-direction:column;overflow:hidden;max-height:calc(100dvh - 32px)}
.dialog-head{flex-shrink:0;gap:16px}
.dialog-head h2{min-width:0}
.dialog-head button{flex-shrink:0;min-width:40px;min-height:40px}
.dialog-body{min-height:0;overflow:auto;overscroll-behavior:contain}
.dialog-foot{flex-wrap:wrap}
.dialog-foot button{white-space:normal}
.photo-list{grid-template-columns:repeat(auto-fit,minmax(min(140px,100%),1fr))}
.photo-tile>div{flex-wrap:wrap}
.ig-test-layout{grid-template-columns:repeat(2,minmax(0,1fr))}
.ig-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}
.ig-editor-layout{grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr)}
.ig-tabs button{flex-shrink:0}
.ig-flowcard footer>.row{flex-wrap:wrap}
.ig-account-select{min-width:0;max-width:100%}
.ig-inbox header{flex-wrap:wrap;align-items:flex-start}
.ig-inbox aside button>span{min-width:0;overflow-wrap:anywhere}
.ig-inbox aside button>.ig-avatar{flex:none}
.ig-events .row{flex-wrap:wrap;align-items:flex-start}
.ig-events .row>span:first-child{flex:1;min-width:140px}
.ig-phonehead>div{min-width:0}
.ig-phonehead .ig-phone-menu{flex-shrink:0}

/* Calendar links are separate from actions so opening a post never edits it. */
.calendar-item{padding:0;gap:0;align-items:stretch;overflow:hidden}
.calendar-post-link{display:flex;gap:18px;align-items:center;min-width:0;flex:1;padding:22px;color:var(--ink)}
.calendar-post-link:hover{background:#f3f5f8;text-decoration:none}
.calendar-post-link:focus-visible{outline-offset:-4px}
.calendar-summary{min-width:0;flex:1}
.calendar-summary h3{margin:8px 0;line-height:1.5}
.calendar-summary small{display:block;overflow-wrap:anywhere}
.calendar-photo{width:64px;height:76px;object-fit:cover;border-radius:10px;flex:none}
.calendar-item>.actions{padding:20px;align-content:center;flex:none}
.calendar-detail-hint{display:block;font-size:11px;color:var(--green);margin-top:8px}
.datebox{width:54px}
.detail-back{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:22px;font-size:13px}
.detail-back button{font-size:12px}
.post-detail-heading h1{margin-top:14px;max-width:850px}
.post-detail-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(280px,1fr);gap:24px;align-items:start}
.post-detail-content{display:grid;gap:22px;min-width:0}
.post-detail-aside{min-width:0;position:sticky;top:24px}
.post-detail-facts{display:grid;grid-template-columns:1fr;gap:5px;margin:20px 0;font-size:14px}
.post-detail-facts dt{font-size:11px;color:var(--muted);margin-top:12px}
.post-detail-facts dd{margin:0}
.post-detail-actions{display:grid;gap:10px;margin-top:22px}
.post-detail-actions button,.post-detail-actions .button{width:100%;min-height:44px;justify-content:center}
.post-detail-error,.detail-edit-hint{margin-top:16px}
.detail-edit-hint{margin-bottom:0}
.post-gallery{min-width:0;padding:18px}
.post-gallery h2,.post-caption h2{margin:0}
.post-gallery>.row,.post-caption>.row{margin-bottom:18px;flex-wrap:wrap}
.post-gallery-track{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior-x:contain;border-radius:12px;background:#edf0f2}
.post-gallery-track::-webkit-scrollbar{display:none}
.post-gallery-slide{margin:0;flex:0 0 100%;min-width:0;scroll-snap-align:start;aspect-ratio:1;display:grid;place-items:center}
.post-gallery-slide>img{display:block;width:100%;height:100%;object-fit:contain;min-height:0}
.photo-unavailable{padding:24px;text-align:center;color:var(--muted);font-size:13px}
.gallery-controls{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:12px 0}
.gallery-controls span{text-align:center;font-size:11px}
.gallery-controls button{min-width:44px;min-height:44px;flex:none}
.gallery-thumbs{display:flex;gap:9px;overflow-x:auto;max-width:100%;padding:5px 3px;overscroll-behavior-x:contain}
.gallery-thumbs button{position:relative;flex:0 0 60px;height:60px;padding:3px;border:2px solid transparent;border-radius:10px}
.gallery-thumbs button[aria-current=true]{border-color:var(--green);background:var(--soft)}
.gallery-thumbs img{width:100%;height:100%;object-fit:cover;border-radius:5px}
.gallery-thumbs span{position:absolute;right:4px;bottom:4px;background:#1e2d3de6;color:white;font-size:9px;padding:0 5px;border-radius:4px}
.post-caption-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.9;font-size:14px;margin:0 0 22px}
.post-caption button{font-size:12px;white-space:nowrap}

@media(max-width:1150px){
  .overview-grid{grid-template-columns:minmax(0,1fr)}
  .post-detail-layout{grid-template-columns:minmax(0,1fr)}
  .post-detail-aside{position:static}
  .calendar-item{flex-wrap:wrap}
  .calendar-item>.actions{border-top:1px solid var(--line);width:100%;justify-content:flex-end;padding:12px 20px}
  .calendar-item>.actions:empty{display:none}
}

@media(max-width:800px){
  body.nav-open{overflow:hidden}
  .shell{display:block}
  .sidebar{position:fixed;inset:0 auto 0 0;width:min(320px,calc(100vw - 48px));height:100dvh;padding:26px 20px 20px;display:flex;gap:0;border-right:1px solid var(--line);border-bottom:0;z-index:60;transform:translateX(-100%);visibility:hidden;transition:transform .2s,visibility .2s}
  .nav-open .sidebar{transform:translateX(0);visibility:visible}
  .nav-backdrop{position:fixed;inset:0;z-index:50;width:100%;height:100dvh;border:0;border-radius:0;background:#13202e66;padding:0}
  .sidebar .wordmark{font-size:22px;margin:0 0 26px;padding:0 8px}
  .sidebar .mark{width:37px;height:37px;font-size:30px}
  .workspace{margin:0 0 20px;padding:12px}
  .workspace label{display:block}
  .workspace select{font-size:14px}
  .nav{flex-direction:column;overflow:visible;white-space:normal;gap:4px;padding:0}
  .nav a{font-size:14px;min-height:46px;padding:12px;gap:12px}
  .nav a svg{width:19px}
  .nav .nav-label{display:block;margin:14px 12px 4px}
  .sidebottom{display:block;padding-top:20px;margin-top:auto}
  .userbox small{max-width:160px}
  .mobile-menu-toggle{display:grid;place-items:center;width:44px;height:44px;padding:10px;flex:none}
  .mobile-menu-toggle svg{width:22px;height:22px}
  .topbar{height:72px;padding:0 16px;gap:12px;position:sticky;top:0;z-index:25;background:#ffffffed;backdrop-filter:blur(12px)}
  .topbar .crumb{display:flex;flex-direction:column;align-items:flex-start;gap:1px;overflow:hidden;font-size:10px}
  .topbar .crumb>span{max-width:100%}
  .topbar .crumb b{font-size:13px;max-width:100%;overflow:hidden;text-overflow:ellipsis}
  .topbar-actions{gap:0}
  .topbar-actions>.pill{display:none}
  .topbar-actions button{min-height:42px;padding:9px 12px;font-size:12px}
  .content{padding:24px 18px max(40px,env(safe-area-inset-bottom))}
  .pagehead{flex-direction:column;gap:16px}
  .pagehead>button,.pagehead>.actions{align-self:stretch}
  .pagehead>.actions button{flex:1;min-height:42px}
  .pagehead h1{font-size:26px;line-height:1.35}
  .metrics,.ig-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .features,.settings-grid,.form-grid,.checklist,.ig-test-layout,.ig-editor-layout{grid-template-columns:minmax(0,1fr)}
  .row.between{flex-wrap:wrap}
  .row.between>.pill{max-width:100%;white-space:normal;overflow-wrap:anywhere}
  .step{gap:10px;align-items:flex-start;flex-wrap:wrap}
  .step .grow{flex-basis:120px}
  .step .avatar{flex:none}
  .activity{flex-wrap:wrap}
  .activity time{flex-shrink:0}
  .toolbar input{flex:1 1 180px;min-width:0}
  .toolbar button{min-height:44px}
  .tabs{gap:4px}
  .tabs button{min-height:40px;padding:8px 10px}
  .postcard footer{flex-wrap:wrap;align-items:center;gap:14px}
  .postcard footer button{min-height:40px;padding:8px 12px}
  .postcard footer>div:last-child{margin-left:auto}
  .calendar-post-link{gap:14px;padding:18px;align-items:flex-start}
  .calendar-item>.actions{padding:12px 18px;margin:0}
  .calendar-item>.actions button{min-height:42px;flex:1}
  .calendar-summary .row{gap:6px}
  .calendar-photo{width:56px;height:68px}
  .calendar-summary h3{font-size:15px}
  .post-detail-heading{margin-bottom:20px}
  .post-detail-heading h1{font-size:26px}
  .detail-back{margin-bottom:20px}
  .detail-back button{min-height:40px}
  .post-detail-layout{gap:20px}
  .post-detail-aside .card{padding:22px}
  .post-gallery{padding:16px}
  .post-caption{padding:22px}
  .bank-detail{grid-template-columns:85px minmax(0,1fr)}
  .bank-admin-request .actions{gap:10px}
  .bank-account{padding:18px}
  .ig-accountbar{padding:16px;gap:16px}
  .ig-accountbar>.row{width:100%}
  .ig-accountbar>.row:last-child{justify-content:flex-start}
  .ig-account-select{flex:1}
  .ig-account-select select{max-width:100%;font-size:16px}
  .ig-flowcard footer{flex-direction:column;align-items:stretch}
  .ig-flowcard footer>.row{justify-content:flex-end}
  .ig-flowcard footer button{min-height:40px;font-size:12px}
  .ig-inbox{grid-template-columns:minmax(0,1fr)}
  .ig-inbox>aside{width:100%;min-width:0;flex-wrap:nowrap}
  .ig-inbox>aside button{flex:0 0 190px}
  .ig-inbox>section{min-width:0}
  .ig-inbox header>button{min-height:42px}
  #ig-manual-reply{display:flex;gap:8px;min-width:0}
  #ig-manual-reply input{flex:1;min-width:0}
  #ig-manual-reply button{flex:none}
  .ig-phone{min-width:0}
  .ig-connection-notice{padding:16px;gap:10px}
  dialog{width:calc(100vw - 24px);max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px)!important;border-radius:16px}
  .dialog-head{padding:16px 18px}
  .dialog-head h2{font-size:18px}
  .dialog-body{padding:18px}
  .dialog-foot button{min-height:44px;flex:1}
  label.field input,label.field textarea,label.field select,input,textarea,select{font-size:16px}
  input[type=datetime-local]{min-width:0;max-width:100%;width:100%}
  .hero .actions{flex-wrap:wrap}
  .hero .actions .button{min-width:0}
  .hero-board .row,.hero-board .mock-row,.hero-board footer{flex-wrap:wrap}
  .publicnav{flex-wrap:wrap;gap:16px;padding:18px 20px}
  .publicnav .links{flex-wrap:wrap;gap:16px}
  .publicnav .links>a:first-child{display:inline}
  .publicfooter span{overflow-wrap:anywhere}
  .authform{padding:32px 22px;min-height:calc(100dvh - 89px)}
  .authstory{padding:22px}
  #toast{width:max-content;max-width:calc(100vw - 32px);bottom:max(20px,env(safe-area-inset-bottom))}
}

@media(max-width:480px){
  .calendar-post-link{display:grid;grid-template-columns:48px minmax(0,1fr);gap:12px}
  .calendar-post-link .datebox{width:48px;grid-column:1;grid-row:1}
  .calendar-photo{grid-column:1;grid-row:2;width:48px;height:48px}
  .calendar-summary{grid-column:2;grid-row:1/span 2}
  .calendar-item>.actions{width:100%}
  .publicnav .links{width:100%;justify-content:space-between}
  .hero h1{font-size:36px;letter-spacing:-1.5px}
  .hero-board{padding:18px}
  .hero-board .card{padding:16px}
  .hello,.card{padding:18px}
  .post-gallery{padding:14px}
  .metric{padding:16px}
  .metric label svg{width:18px;height:18px}
  .bank-request{padding:14px}
  .bank-request .bank-account{padding:12px}
  .bank-account strong{font-size:clamp(17px,5.2vw,23px)}
  .photo-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .photo-tile button{padding:6px;min-width:30px}
  .readiness{padding:12px;align-items:flex-start}
  .readiness .pill{flex:none}
  .ig-welcome{padding:24px}
  .ig-welcome h2{font-size:28px}
}

.metric label svg,.step-num svg{width:18px;height:18px;flex:none}
.calendar-item.card{padding:0}
