/* IQ panel design preview: TAS-SAMS left accent, with existing colours and controls. */
@layer iqFlatPanels {
 @media screen {
  html body:not(#original-document):not(#iq-flat-a):not(#iq-flat-b):not(#iq-flat-c):not(#iq-flat-d) :is(
   .panel,.card,.metric,.analytics-card,.report-activity-card,.settings-invite,
   .review-card,.section-card,.management-card,.folder-card,.settings-panel,
   .iq-status-chart,.iq-settings-section,.iq-reporting-section,.tas-site-card,
   .tas-user-card,.tas-admin-stat,.tas-login-card,.tas-daily-dashboard-intro,
   .tas-submission-info,.tas-compliance-heading,.tas-form-step,.tas-evidence,
   .tas-record-month,.tas-record-day,.tas-record-report,.tas-record-item,
   .generator-filename,.generator-replacement,.generator-next,.library-folder,
   .library-login-card,.library-generator-panel,.iq-auth-card,.iq-setting-card
  ):not(:where(.sheet *,#generatorContentPreview *,#libraryPreview *,
    .tas-original-form *,.tas-pdf-report *,.docx-preview *,.document-content *)) {
   border:1px solid #d5dfd9!important;
   border-left:4px solid var(--iq-flat-accent,var(--iq-green,#1a8f20))!important;
   border-radius:0!important;
   box-shadow:none!important;
  }
  html body:not(#original-document):not(#iq-flat-a):not(#iq-flat-b):not(#iq-flat-c):not(#iq-flat-d) :is(
   .tas-form-step,.tas-evidence,.generator-replacement,.library-folder,
   .tas-record-month,.tas-record-day,.tas-record-report,.tas-record-item
  )>summary {
   border-radius:0!important;
   box-shadow:none!important;
  }
  html body:not(#original-document) :is(.panel,.card,.metric,.analytics-card):is(
   .danger,.error,.overdue,[data-state="overdue"],[data-overdue="true"]
  ){--iq-flat-accent:#b92332}
 }
}

/* Place every IQ application header title at its far-right content edge. */
@layer iqFlatPanels {
 @media screen {
  html body header .tas-header-logos>.tas-platform-copy {
   justify-self:stretch!important;
   align-items:flex-end!important;
   text-align:right!important;
   width:100%!important;
   max-width:none!important;
   min-width:0!important;
   margin-left:0!important;
   margin-right:0!important;
  }
  html body header .tas-header-logos>.tas-platform-copy>:is(.tas-platform-title,.tas-platform-description,span) {
   text-align:right!important;
   max-width:100%!important;
   margin-right:0!important;
  }
 }
 @media screen and (min-width:761px) {
  html body header .tas-header-logos>.tas-platform-copy {
   grid-column:2/-1!important;
  }
 }
}

/* TAS-SAMS rectangular controls; preserve every existing IQ colour and state. */
@layer iqFlatPanels {
 @media screen {
  html body:not(#original-document):not(#iq-square-a):not(#iq-square-b):not(#iq-square-c):not(#iq-square-d) :is(
   button,input[type="button"],input[type="submit"],input[type="reset"],
   a,a.btn,a.button,a.primary,a.secondary,a.tas-button,a.tas-link-button,
   a[role="button"],nav a,.tabs a,.toolbar a,.library-page-title>a,
   .tas-dashboard-return>a,.tas-module-tile,.tas-utility-card,.tas-utility-icon,
   .tas-submission-fold,.tas-deadline-guide,.tas-compliance-audit,
   .tas-form-step,.generator-replacement,.library-folder,
   .tas-record-month,.tas-record-day,.tas-record-report,.tas-record-item,
   summary,.password-wrap,.password-field,.tas-login-card,
   header.tas-dual-brand-header,header.app-header,
   h1,h2,h3,.page-title,.page-banner,.section-banner,
   figure[data-evidence-view],figure[data-video-evidence]
  ):not(:where(.sheet *,#generatorContentPreview *,#libraryPreview *,
    .tas-original-form *,.tas-pdf-report *,.docx-preview *,.document-content *)) {
   border-radius:0!important;
   box-shadow:none!important;
  }
  html body:not(#original-document):not(#iq-square-a):not(#iq-square-b):not(#iq-square-c):not(#iq-square-d) :is(
   input:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([type="color"]):not([type="hidden"]),select,textarea
  ):not(:where(.sheet *,#generatorContentPreview *,#libraryPreview *,
    .tas-original-form *,.tas-pdf-report *,.docx-preview *,.document-content *)) {
   border-radius:0!important;
  }
  html body:not(#original-document):not(#iq-square-a):not(#iq-square-b):not(#iq-square-c):not(#iq-square-d) :is(
   button[data-tas-icon],summary
  )::before {
   border-radius:0!important;
   box-shadow:none!important;
  }
 }

/* Square UI badges, counters, avatars, banners and containers throughout IQ. */
@layer iqFlatPanels {
 @media screen {
  html body:not(#original-document):not(#iq-square-a):not(#iq-square-b):not(#iq-square-c):not(#iq-square-d) :is(
   [class*="badge"],[class*="pill"],[class*="chip"],[class*="counter"],[class*="count"],
   [class*="avatar"],[class*="hero"],[class*="card"],[class*="panel"],[class*="banner"],
   [class*="notice"],[class*="alert"],[class*="toast"],[class*="modal"],[class*="dialog"],
   [class*="pagination"],.tas-admin-section-title>span,.tas-admin-add,fieldset,legend,
   .tas-submission-names,.tas-deadline-status,.tas-section-badge,
   details,dialog,form,.iq-fold-indicator,.dashboard-folder>strong,
   body.iq-auth-screen>main,header img
  ):not(:where(.sheet *,#generatorContentPreview *,#libraryPreview *,
    .tas-original-form *,.tas-pdf-report *,.docx-preview *,.document-content *)) {
   border-radius:0!important;
  }
 }
}
}

/* Equal header actions, with the existing primary order and exit positions. */
@layer iqFlatPanels {
 @media screen {
  html body header.app-header nav.tabs {--iq-header-action-columns:7;}
  html body header.app-header :is(#iq-header-primary-actions,#iq-header-exit-actions) {
   display:grid!important;
   grid-template-columns:repeat(var(--iq-header-action-columns),minmax(0,1fr))!important;
   gap:10px!important;
   width:100%!important;
   min-width:0!important;
   flex:1 0 100%!important;
  }
  html body header.app-header :is(#iq-header-primary-actions,#iq-header-exit-actions)>:not([hidden]) {
   display:flex!important;
   align-items:center!important;
   justify-content:center!important;
   width:100%!important;
   min-width:0!important;
   max-width:none!important;
   height:48px!important;
   min-height:48px!important;
   max-height:48px!important;
   margin:0!important;
   padding:6px 8px!important;
   box-sizing:border-box!important;
   text-align:center!important;
   white-space:normal!important;
   line-height:1.15!important;
   border-radius:0!important;
  }
  html body header.app-header #iq-header-primary-actions>#accountManagementNav,
  html body header.app-header #iq-header-exit-actions>[data-iq-back-website] {
   grid-column:-2/-1!important;
  }
  html body header.app-header #iq-header-exit-actions>[data-view="login"] {
   grid-column:1!important;
  }
 }
 @media screen and (max-width:1100px) {
  html body header.app-header nav.tabs {--iq-header-action-columns:4;}
 }
 @media screen and (max-width:640px) {
  html body header.app-header nav.tabs {--iq-header-action-columns:2;}
 }
}


/* Consistent IQ header text size. */
@layer iqFlatPanels {
 @media screen {
  html body header .tas-header-logos>.tas-platform-copy>:is(.tas-platform-title,.tas-platform-description,span) {
   font-size:18px!important;
  }
 }
}

/* Consistent red trim on IQ application headers. */
@layer iqFlatPanels {
 @media screen {
  html body:not(#iq-header-trim-a):not(#iq-header-trim-b):not(#iq-header-trim-c):not(#iq-header-trim-d):not(#iq-header-trim-e) :is(
   header,
   header.app-header nav.tabs,nav.tas-dashboard-return
  ):not(:where(.sheet *,#generatorContentPreview *,#libraryPreview *,
    .tas-original-form *,.tas-pdf-report *,.docx-preview *,.document-content *)) {
   box-shadow:inset 2px 0 0 #b91421,inset -2px 0 0 #b91421,inset 0 -2px 0 #b91421!important;
  }
 }
}

/* Square NCR cards while preserving their status colours. */
@layer iqFlatPanels {
 @media screen {
  html body main#app.ncr-workspace :is(
   .ncr-stat,.ncr-findings-heading,.ncr-detail-box,.ncr-status-pill,
   .ncr-badge,.ncr-bar,.ncr-bar span,.ncr-mini-percentage div
  ) {
   border-radius:0!important;
  }
 }
}

/* Square form feedback, joint submission and download panels. */
@layer iqFlatPanels {
 @media screen {
  html body main#app :is(
   #tas-joint-controls,.tas-form-download,[data-submission-status]
  ) {
   border-radius:0!important;
  }
 }
}

/* Shared square UI surfaces in every IQ section. */
@layer iqFlatPanels {
 @media screen {
  html body:not(#iq-square-everywhere-a):not(#iq-square-everywhere-b):not(#iq-square-everywhere-c):not(#iq-square-everywhere-d):not(#iq-square-everywhere-e) :is(
   header,nav,main,section,article,aside,footer,form,fieldset,legend,details,summary,
   button,input,select,textarea,a,div,span,figure,canvas
  ):not(:where(
   .sheet,.sheet *,#generatorContentPreview,#generatorContentPreview *,
   #libraryPreview,#libraryPreview *,.tas-original-form,.tas-original-form *,
   .tas-pdf-report,.tas-pdf-report *,.docx-preview,.docx-preview *,
   .document-content,.document-content *,[role="img"],[role="img"] *,
   .donut-chart,.donut-chart *,#statusDonut,#statusDonut *,
   #iq-loading-status,#iq-loading-status *,#tas-refresh-screen,#tas-refresh-screen *,
   .tas-refresh-ring,.tas-refresh-ring *,input[type="radio"],input[type="checkbox"]
  )),
  html body:not(#iq-square-everywhere-a):not(#iq-square-everywhere-b):not(#iq-square-everywhere-c):not(#iq-square-everywhere-d):not(#iq-square-everywhere-e) :is(
   summary,button,a,[role="button"]
  ):not(:where(.sheet *,#generatorContentPreview *,#libraryPreview *,
    .tas-original-form *,.tas-pdf-report *,.docx-preview *,.document-content *))::before {
   border-radius:0!important;
  }
 }
}

/* Align all report-detail pairs, including the contractor field's nested label. */
html body #app #tas-standard-details .tas-standard-grid{align-items:start!important}
html body #app #tas-standard-details .tas-standard-grid>div{min-width:0!important;align-self:start!important}
html body #app #tas-standard-details .tas-standard-grid>div>label{display:block!important;line-height:20px!important;min-height:20px!important;margin:0 0 8px!important;padding:0!important}
html body #app #tas-standard-details .tas-standard-grid>div>label:has(>input,>select){margin:0!important}
html body #app #tas-standard-details .tas-standard-grid>div>:is(input,select),html body #app #tas-standard-details .tas-standard-grid>div>label>:is(input,select){display:block!important;box-sizing:border-box!important;width:100%!important;height:48px!important;min-height:48px!important;max-height:48px!important;margin:0!important;padding:10px 12px!important;line-height:24px!important;vertical-align:top!important}
html body #app #tas-standard-details .tas-standard-grid>div>label>:is(input,select){margin-top:8px!important}
html body #app #tas-standard-details .tas-standard-grid>div>small{display:block!important;margin-top:8px!important}
/* Settings keep the existing square IQ palette and the original save controls. */
html body #settings .iq-settings-step-list{border:0!important;padding:0!important;background:transparent!important}
html body #settings details.iq-settings-step{border:1px solid #c6d5cb!important;border-left:3px solid var(--primary,#1a8f20)!important;border-radius:0!important;background:#fff!important;padding:0!important;margin:0 0 16px!important;scroll-margin-top:20px}
html body #settings details.iq-settings-step>summary{display:flex!important;align-items:center!important;gap:12px!important;list-style:none!important;cursor:pointer!important;padding:18px 20px!important;margin:0!important;border-radius:0!important;background:#edf5ef!important;color:#185c32!important;font-size:18px!important;font-weight:400!important;line-height:1.4!important}
html body #settings details.iq-settings-step>summary::-webkit-details-marker{display:none}
html body #settings details.iq-settings-step>summary::before{content:none!important}
html body #settings details.iq-settings-step[open]>summary{background:var(--primary,#1a8f20)!important;color:white!important}
html body #settings .iq-settings-step-icon{display:inline-flex;justify-content:center;align-items:center;flex:0 0 28px;width:28px;height:28px;background:#ffffff40;border-radius:0!important}
html body #settings .iq-settings-step-body{padding:20px!important}
html body #settings .iq-settings-step-body>div,html body #settings .iq-settings-step-body>section{margin-top:0!important;max-width:100%!important}
html body #settings .iq-settings-step-body>section#iq-reporting-settings{padding:0!important;border:0!important;background:transparent!important}
html body #settings .iq-settings-step-nav{display:flex!important;justify-content:space-between!important;gap:16px!important;margin-top:24px!important;padding-top:16px!important;border-top:1px solid #d7e1da}
html body #settings .iq-settings-step-nav button{min-width:140px;min-height:44px;border-radius:0!important;margin:0!important}
html body #settings .iq-settings-step-nav button:last-child:not(:first-child),html body #settings .iq-settings-step-nav button.primary{margin-left:auto!important}

/* iq-login-no-footer: visible authentication screens only; inactive admin panels must not hide content footers. */
@layer iqFlatPanels {
  @media screen {
    html body.iq-auth-screen footer,
    html body:has(#login.view.active) footer,
    html body.iq-admin:has(#login:not([hidden])) footer,
    html body:has(#management-login) footer,
    html body:has(#libraryLogin) footer,
    html body:has(#gate2app #send) footer {
      display: none !important;
    }
  }
}

/* Mobile layout corrections, 5 November 2026. Screen only; desktop and print keep their layouts. */
@layer iqFlatPanels {
 @media screen and (max-width:760px) {
  html body>footer.tas-brand-footer {
   grid-template-columns:minmax(0,1fr)!important;
   grid-template-areas:none!important;
   gap:20px!important;
  }
  html body>footer.tas-brand-footer>:is(.footer-logo-box,.tas-footer-powered,.tas-footer-contact,.tas-footer-policies,.iq-footer-contact,.iq-footer-policies) {
   grid-area:auto!important;
   grid-column:1!important;
   grid-row:auto!important;
   min-width:0!important;
   max-width:100%!important;
   text-align:center!important;
   justify-self:center!important;
  }
  html body>footer.tas-brand-footer>:is(.footer-logo-box,.tas-footer-powered) {
   margin-left:auto!important;
   margin-right:auto!important;
   align-items:center!important;
   justify-content:center!important;
  }
  html body>footer.tas-brand-footer :is(.footer-logo-box,.tas-footer-powered) img {
   display:block!important;
   max-width:100%!important;
   margin-left:auto!important;
   margin-right:auto!important;
   align-self:center!important;
   object-position:center!important;
  }
  html body>footer.tas-brand-footer .tas-footer-powered p {text-align:center!important}
  html body header.app-header #iq-header-primary-actions>#accountManagementNav,
  html body header.app-header .tabs>:is(#tea-owner-button,#tma-admin-button),
  html body header.app-header .tabs>[data-view="accounts"] {
   grid-column:1/-1!important;
   flex:1 0 100%!important;
   width:100%!important;
   max-width:100%!important;
   margin:0!important;
  }
  html body :is(main,.view,.panel,.card,fieldset,.form-grid,.settings-grid,.panel-grid,.tas-form-grid,.tas-standard-grid,.tas-site-card,.tas-record-entry,.management-shell,.workspace)>* {
   min-width:0;
  }
  html body :is(main,header,footer) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea) {
   box-sizing:border-box!important;
   min-width:0!important;
   max-width:100%!important;
  }
  html body :is(.page-title,.page-banner,.section-banner,.settings-actions,.form-actions,.tas-site-controls,.toolbar,.iq-settings-step-nav) {
   flex-wrap:wrap!important;
   min-width:0!important;
  }
  html body :is(h1,h2,h3,label,.save-status,.tas-site-card,.tas-record-entry,.review-card,.iq-setting-card) {overflow-wrap:anywhere}
  html body :is(.table-wrap,.table-wrapper,.table-scroll,.records-table-wrap) {max-width:100%;overflow-x:auto}
  html body :is(.modal,.modal-content,[role="dialog"]) {box-sizing:border-box;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto}
 }
 @media screen and (max-width:600px) {
  html body :is(.form-grid,.settings-grid,.panel-grid,.tas-form-grid,.tas-standard-grid) {grid-template-columns:minmax(0,1fr)!important}
  html body :is(.form-grid,.settings-grid,.panel-grid,.tas-form-grid,.tas-standard-grid)>* {grid-column:auto!important}
  html body #settings .iq-settings-step-nav button {min-width:0!important;flex:1 1 120px!important;max-width:100%!important}
 }
}

/* Tablet navigation layout: Admin beside Settings, Logout in the fourth column. */
@layer iqFlatPanels {
 @media screen and (min-width:641px) and (max-width:1100px) {
  html body header.app-header nav.tabs {
   display:grid!important;
   grid-template-columns:repeat(4,minmax(0,1fr))!important;
   gap:10px!important;
  }
  html body header.app-header nav.tabs :is(#iq-header-primary-actions,#iq-header-exit-actions) {display:contents!important}
  html body header.app-header nav.tabs #iq-header-primary-actions>#accountManagementNav {
   grid-column:3!important;grid-row:2!important;
   width:100%!important;max-width:100%!important;margin:0!important;
  }
  html body header.app-header nav.tabs #iq-header-exit-actions>[data-view="login"] {grid-column:4!important;grid-row:2!important}
  html body header.app-header nav.tabs #iq-header-exit-actions>[data-iq-back-website] {grid-column:4!important;grid-row:3!important}
  html body header.app-header nav.tabs #iq-header-exit-actions>#tas-news-strip {grid-column:1/4!important;grid-row:3!important}
 }
}

/* IQ responsive content parity, 5 November 2026. Header, logos and desktop remain unchanged. */
/* Phones only: equal reminder actions side by side. */
@layer iqFlatPanels {
 @media screen and (max-width:640px) {
  html body main#app #tas-due-guide-bar {
   display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
   align-items:stretch!important;gap:12px!important;
  }
  html body main#app #tas-due-guide-bar>div {grid-column:1/-1!important;min-width:0!important}
  html body main#app #tas-due-guide-bar>:is(#tas-due-guide-launch,#tas-due-guide-retry) {
   grid-row:2!important;box-sizing:border-box!important;
   display:flex!important;align-items:center!important;justify-content:center!important;
   width:100%!important;min-width:0!important;max-width:100%!important;
   min-height:64px!important;height:100%!important;margin:0!important;padding:10px 8px!important;
   font-size:13px!important;line-height:1.3!important;text-align:center!important;
   white-space:normal!important;overflow-wrap:anywhere;
  }
  html body main#app #tas-due-guide-launch {grid-column:1!important}
  html body main#app #tas-due-guide-retry {grid-column:2!important}
 }
}

/* Tablets: both reminder actions share the bottom row at equal sizes. */
@layer iqFlatPanels {
 @media screen and (min-width:641px) and (max-width:1199px), screen and (min-width:641px) and (max-width:1366px) and (pointer:coarse) {
  html body main#app #tas-due-guide-bar {
   display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
   grid-template-rows:auto auto!important;align-items:stretch!important;gap:12px!important;
  }
  html body main#app #tas-due-guide-bar>div {grid-column:1/-1!important;grid-row:1!important;min-width:0!important}
  html body main#app #tas-due-guide-bar>:is(#tas-due-guide-launch,#tas-due-guide-retry) {
   grid-row:2!important;box-sizing:border-box!important;display:flex!important;
   align-items:center!important;justify-content:center!important;
   width:100%!important;min-width:0!important;max-width:100%!important;
   min-height:64px!important;height:100%!important;margin:0!important;padding:10px 12px!important;
   font-size:15px!important;line-height:1.3!important;text-align:center!important;
   white-space:normal!important;overflow-wrap:anywhere;
  }
  html body main#app #tas-due-guide-retry {grid-column:1!important}
  html body main#app #tas-due-guide-launch {grid-column:2!important}
 }
}

/* Phones only: activity rows grow to fit wrapped labels. */
@layer iqFlatPanels {
 @media screen and (max-width:640px) {
  html body main#app #iq-daily-required :is(details.tas-deadline-guide,details.tas-submission-fold) {
   height:auto!important;max-height:none!important;min-height:0!important;
  }
  html body main#app #iq-daily-required :is(details.tas-deadline-guide,details.tas-submission-fold)>summary {
   box-sizing:border-box!important;height:auto!important;max-height:none!important;
   min-height:56px!important;padding:14px 16px!important;
   line-height:1.4!important;white-space:normal!important;
   overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere;
  }
  html body main#app #iq-daily-required :is(details.tas-deadline-guide,details.tas-submission-fold)>summary>span:not(.tas-guide-plus):not([aria-hidden]) {
   min-width:0!important;white-space:normal!important;overflow:visible!important;
   text-overflow:clip!important;overflow-wrap:anywhere;
  }
  html body main#app #iq-daily-required .tas-daily-guides>.tas-deadline-guides>li {
   height:auto!important;max-height:none!important;min-height:0!important;
  }
 }
}

/* Phones only: download actions span the available width of their panel. */
@layer iqFlatPanels {
 @media screen and (max-width:640px) {
  html body main#app .tas-form-download>:is(button,a) {
   box-sizing:border-box!important;display:flex!important;
   align-items:center!important;justify-content:center!important;
   width:100%!important;min-width:0!important;max-width:100%!important;
   min-height:52px!important;height:auto!important;
   margin:12px 0 0!important;text-align:center!important;
   white-space:normal!important;overflow-wrap:anywhere;
  }
 }
}

/* Compact D3 utility icons share the capture tiles' fixed left icon column. */
@layer iqFlatPanels {
 @media screen and (max-width:1199px), screen and (max-width:1366px) and (pointer:coarse) {
  html body main#app .tas-capture-grid>.tas-module-tile>button.tas-utility-card {
   position:relative!important;padding:26px 22px 26px 88px!important;
   justify-content:flex-start!important;text-align:left!important;
  }
  html body main#app .tas-capture-grid>.tas-module-tile>button.tas-utility-card>.tas-utility-icon {
   position:absolute!important;left:22px!important;top:50%!important;
   transform:translateY(-50%)!important;width:46px!important;height:46px!important;
   min-width:46px!important;min-height:46px!important;max-width:46px!important;max-height:46px!important;
   margin:0!important;flex:0 0 46px!important;
  }
  html body main#app .tas-capture-grid>.tas-module-tile>button.tas-utility-card>.tas-utility-label {
   display:block!important;width:100%!important;min-width:0!important;
   margin:0!important;padding:0!important;text-align:left!important;overflow-wrap:anywhere!important;
  }
 }
}

/* Tablets: View records spans both capture-grid columns. */
@layer iqFlatPanels {
 @media screen and (min-width:641px) and (max-width:1199px), screen and (min-width:641px) and (max-width:1366px) and (pointer:coarse) {
  html body main#app .tas-capture-grid>.tas-module-tile.tas-records-tile {display:contents!important}
  html body main#app .tas-capture-grid>.tas-module-tile.tas-records-tile>button {
   grid-column:1/-1!important;justify-self:stretch!important;
   width:100%!important;max-width:none!important;min-width:0!important;box-sizing:border-box!important;
  }
 }
}

/* Tablet View records: centre the icon and label together within the full-row tile. */
@layer iqFlatPanels {
 @media screen and (min-width:641px) and (max-width:1199px), screen and (min-width:641px) and (max-width:1366px) and (pointer:coarse) {
  html body main#app .tas-capture-grid>.tas-module-tile.tas-records-tile>button.tas-utility-card {
   display:flex!important;justify-content:center!important;align-items:center!important;
   padding:24px 22px!important;gap:18px!important;text-align:center!important;
  }
  html body main#app .tas-capture-grid>.tas-module-tile.tas-records-tile>button.tas-utility-card>.tas-utility-icon {
   position:static!important;left:auto!important;top:auto!important;transform:none!important;
   margin:0!important;flex:0 0 46px!important;
  }
  html body main#app .tas-capture-grid>.tas-module-tile.tas-records-tile>button.tas-utility-card>.tas-utility-label {
   width:auto!important;max-width:100%!important;min-width:0!important;
   flex:0 1 auto!important;margin:0!important;padding:0!important;text-align:center!important;
  }
 }
}

/* Small phones only: statistics/site, rotation statement, then the full-row control. */
@layer iqFlatPanels {
 @media screen and (max-width:640px) {
  html body #tasStatsRotation {
   display:grid!important;grid-template-columns:max-content minmax(0,1fr)!important;
   align-items:center!important;gap:12px!important;
  }
  html body #tasStatsRotation>label {
   grid-column:1!important;grid-row:1!important;margin:0!important;white-space:nowrap!important;
  }
  html body #tasStatsRotation>#tasStatsSite {
   grid-column:2!important;grid-row:1!important;width:100%!important;min-width:0!important;
   max-width:100%!important;box-sizing:border-box!important;margin:0!important;
  }
  html body #tasStatsRotation>span {
   grid-column:1/-1!important;grid-row:2!important;display:block!important;
   min-width:0!important;margin:0!important;text-align:center!important;
  }
  html body #tasStatsRotation>#tasStatsPause {
   grid-column:1/-1!important;grid-row:3!important;display:flex!important;
   align-items:center!important;justify-content:center!important;
   width:100%!important;min-width:0!important;max-width:100%!important;
   min-height:48px!important;box-sizing:border-box!important;margin:0!important;
   white-space:normal!important;text-align:center!important;
  }
 }
}

/* IQ phone header typography only; logo and tablet/desktop rules are unchanged. */
@layer iqFlatPanels {
 @media screen and (max-width:640px) {
  html body>header:is(.app-header,.tas-dual-brand-header,.tas-management-header) .tas-platform-copy>.tas-platform-title {
   font-size:14px!important;line-height:1.3!important;
  }
  html body>header:is(.app-header,.tas-dual-brand-header,.tas-management-header) .tas-platform-copy>.tas-platform-description {
   font-size:13px!important;line-height:1.4!important;
  }
 }
}

/* IQ phone/tablet sync and setup buttons: full available width. */
@layer iqFlatPanels {
 @media screen and (max-width:1199px), screen and (max-width:1366px) and (pointer:coarse) {
  html body main>section.card[role="status"]>button:not([data-import]),
  html body :is(#iq-setup-reminder,#iq-setup-gate)>.iq-setup-actions>button {
   display:flex!important;align-items:center!important;justify-content:center!important;
   width:100%!important;min-width:0!important;max-width:100%!important;
   min-height:48px!important;box-sizing:border-box!important;margin:0!important;
   white-space:normal!important;overflow-wrap:anywhere!important;text-align:center!important;
  }
  html body :is(#iq-setup-reminder,#iq-setup-gate)>.iq-setup-actions {
   display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;
   width:100%!important;min-width:0!important;box-sizing:border-box!important;
  }
 }
}

/* IQ introduction banner: align with the paragraph on tablets only. */
@layer iqFlatPanels {
 @media screen and (min-width:641px) and (max-width:1199px), screen and (min-width:641px) and (max-width:1366px) and (pointer:coarse) {
  html body .audit-introduction.dashboard-overview-intro {
   grid-template-columns:minmax(0,1fr)!important;
  }
  html body .audit-introduction.dashboard-overview-intro>.intro-logo-row,
  html body .audit-introduction.dashboard-overview-intro>p {
   grid-column:1/-1!important;width:100%!important;min-width:0!important;
   max-width:none!important;box-sizing:border-box!important;
  }
  html body .audit-introduction.dashboard-overview-intro>.intro-logo-row>img {
   display:block!important;width:100%!important;max-width:none!important;
   height:auto!important;object-fit:contain!important;box-sizing:border-box!important;
   margin:0!important;
  }
 }
}

/* IQ tablet setup actions: equal columns across their row. */
@layer iqFlatPanels {
 @media screen and (min-width:641px) and (max-width:1199px), screen and (min-width:641px) and (max-width:1366px) and (pointer:coarse) {
  html body #iq-setup-reminder>.iq-setup-actions {
   grid-template-columns:repeat(2,minmax(0,1fr))!important;
   align-items:stretch!important;
  }
 }
}

/* IQ D1 phone/tablet expand controls: preserve native details and wrap long labels. */
@layer iqFlatPanels {
 @media screen and (max-width:1199px), screen and (max-width:1366px) and (pointer:coarse) {
  html body main#app #iq-daily-required .tas-daily-guides details.tas-deadline-guide,
  html body main#app #iq-daily-required .tas-daily-guides .tas-deadline-guides>li {
   height:auto!important;max-height:none!important;min-height:0!important;
  }
  html body main#app #iq-daily-required .tas-daily-guides details.tas-deadline-guide>summary {
   display:flex!important;align-items:center!important;gap:12px!important;
   box-sizing:border-box!important;height:auto!important;min-height:64px!important;max-height:none!important;
   padding:14px 16px!important;white-space:normal!important;line-height:1.4!important;
   overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere;
  }
  html body main#app #iq-daily-required .tas-daily-guides details.tas-deadline-guide>summary>.tas-guide-plus {
   display:inline-flex!important;position:static!important;visibility:visible!important;opacity:1!important;
   align-items:center!important;justify-content:center!important;box-sizing:border-box!important;
   flex:0 0 28px!important;width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;
   margin:0!important;padding:0!important;border:0!important;border-radius:0!important;
   background:#e4f0e7!important;color:#1a8f20!important;font-size:0!important;line-height:1!important;
  }
  html body main#app #iq-daily-required .tas-daily-guides details.tas-deadline-guide>summary>.tas-guide-plus::before {
   content:"+"!important;display:block!important;font:400 23px/1 Arial,sans-serif!important;color:inherit!important;
  }
  html body main#app #iq-daily-required .tas-daily-guides details.tas-deadline-guide[open]>summary>.tas-guide-plus::before {
   content:"\2212"!important;
  }
 }
}

/* Match the TAS RAL Back and signed-in box row without changing the IQ masthead. */
@layer iqFlatPanels {
 @media screen {
  html body>nav.tas-dashboard-return:has(>#tas-user-heading-details) {
   box-sizing:border-box!important;padding:14px 18px!important;gap:12px!important;align-items:center!important;
  }
  html body>nav.tas-dashboard-return:has(>#tas-user-heading-details)>#tas-user-heading-details {
   width:max-content!important;min-height:56px!important;
  }
 }
 @media screen and (min-width:641px) {
  html body>nav.tas-dashboard-return:has(>#tas-user-heading-details)>a {
   display:inline-flex!important;align-items:center!important;justify-content:center!important;
   box-sizing:border-box!important;width:185px!important;min-width:185px!important;height:56px!important;
   white-space:nowrap!important;
  }
 }
 @media screen and (max-width:640px) {
  html body>nav.tas-dashboard-return:has(>#tas-user-heading-details) {
   display:grid!important;grid-template-columns:minmax(0,1fr)!important;
  }
  html body>nav.tas-dashboard-return:has(>#tas-user-heading-details)>:is(a,#tas-user-heading-details) {
   box-sizing:border-box!important;display:flex!important;align-items:center!important;justify-content:center!important;
   width:100%!important;min-width:0!important;max-width:100%!important;min-height:64px!important;height:auto!important;
   margin:0!important;white-space:normal!important;overflow-wrap:anywhere!important;text-align:center!important;
  }
 }
}

/* IQ phone/tablet masthead: centred logo with centred title and description below. */
@layer iqFlatPanels {
 @media screen and (max-width:1199px), screen and (max-width:1366px) and (pointer:coarse) {
  html body>header.tas-dual-brand-header .tas-header-logos {
   display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
   box-sizing:border-box!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;
   gap:16px!important;margin:0!important;padding:24px!important;grid-template:none!important;
  }
  html body>header.tas-dual-brand-header .tas-header-logos>img.tas-header-iqaudit {
   display:block!important;position:static!important;float:none!important;order:0!important;
   width:min(100%,420px)!important;min-width:0!important;max-width:100%!important;
   height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:auto!important;
   object-fit:contain!important;object-position:center!important;align-self:center!important;
   margin:0 auto!important;padding:0!important;transform:none!important;grid-area:auto!important;
  }
  html body>header.tas-dual-brand-header .tas-header-logos>.tas-header-platform-copy {
   display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
   position:static!important;float:none!important;order:1!important;grid-area:auto!important;
   box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:100%!important;
   height:auto!important;min-height:0!important;margin:0!important;padding:0!important;gap:8px!important;
   text-align:center!important;transform:none!important;white-space:normal!important;
  }
  html body>header.tas-dual-brand-header .tas-header-platform-copy>.tas-platform-title {
   display:block!important;width:100%!important;margin:0!important;font-size:18px!important;line-height:1.4!important;
   text-align:center!important;white-space:normal!important;overflow-wrap:normal!important;
  }
  html body>header.tas-dual-brand-header .tas-header-platform-copy>.tas-platform-description {
   display:block!important;width:100%!important;margin:0!important;font-size:16px!important;line-height:1.45!important;
   text-align:center!important;white-space:normal!important;overflow-wrap:normal!important;
  }
 }
 @media screen and (max-width:640px) {
  html body>header.tas-dual-brand-header .tas-header-logos {padding:20px!important;gap:14px!important}
  html body>header.tas-dual-brand-header .tas-header-platform-copy>.tas-platform-title {font-size:17px!important}
  html body>header.tas-dual-brand-header .tas-header-platform-copy>.tas-platform-description {font-size:15px!important}
 }
}

/* D1 uses the same native expandable controls on every screen size. */
@layer iqFlatPanels {
 @media screen {
  html body main#app #iq-daily-required .tas-daily-guides details.tas-deadline-guide,
  html body main#app #iq-daily-required .tas-daily-guides .tas-deadline-guides>li {
   height:auto!important;max-height:none!important;min-height:0!important;
  }
  html body main#app #iq-daily-required .tas-daily-guides details.tas-deadline-guide>summary {
   display:flex!important;align-items:center!important;gap:12px!important;
   box-sizing:border-box!important;height:auto!important;min-height:48px!important;max-height:none!important;
   padding:10px 16px!important;font-size:15px!important;line-height:1.4!important;
   white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere;
  }
  html body main#app #iq-daily-required .tas-daily-guides details.tas-deadline-guide>summary>.tas-guide-plus {
   display:inline-flex!important;position:static!important;visibility:visible!important;opacity:1!important;
   align-items:center!important;justify-content:center!important;box-sizing:border-box!important;
   flex:0 0 28px!important;width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;
   margin:0!important;padding:0!important;border:0!important;border-radius:0!important;
   background:#e4f0e7!important;color:#1a8f20!important;font-size:0!important;line-height:1!important;
  }
  html body main#app #iq-daily-required .tas-daily-guides details.tas-deadline-guide>summary>.tas-guide-plus::before {
   content:"+"!important;display:block!important;font:400 23px/1 Arial,sans-serif!important;color:inherit!important;
  }
  html body main#app #iq-daily-required .tas-daily-guides details.tas-deadline-guide[open]>summary>.tas-guide-plus::before {
   content:"\2212"!important;
  }
  html body main#app #iq-daily-required .tas-daily-guides .tas-deadline-guide-body {
   padding:0 18px 16px 54px!important;text-align:left!important;white-space:normal!important;overflow-wrap:anywhere;
  }
  html body main#app #iq-daily-required .tas-daily-guides .tas-deadline-guide-body>p {
   margin:8px 0!important;padding:0!important;text-align:left!important;
  }
 }
 @media screen and (max-width:640px) {
  html body main#app #iq-daily-required .tas-daily-guides details.tas-deadline-guide>summary {
   min-height:64px!important;padding:14px 16px!important;
  }
  html body>nav.tas-dashboard-return:has(>#tas-user-heading-details)>#tas-user-heading-details>:is(strong,span) {
   display:block!important;min-width:0!important;max-width:100%!important;
   white-space:normal!important;overflow-wrap:anywhere!important;text-align:center!important;
  }
 }
}

/* TAS EHSQ desktop parity: shared D1/D2 sizes and meaningful status colours. */
@layer iqFlatPanels {
 @media screen {
  html body {--iq-green:#2e8d47;--primary:#2e8d47;--green:#2e8d47}
  html body main#app #iq-daily-required :is(.tas-daily-guides details.tas-deadline-guide,.tas-daily-stats-list details.tas-submission-fold)>summary {
   display:flex!important;align-items:center!important;gap:12px!important;
   box-sizing:border-box!important;width:100%!important;height:auto!important;min-height:var(--iq-daily-row-height,64px)!important;max-height:none!important;
   margin:0!important;padding:14px 16px!important;font-size:15px!important;line-height:1.4!important;
   white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere;
  }
  html body main#app #iq-daily-required[data-iq-row-measure="1"] :is(.tas-daily-guides details.tas-deadline-guide,.tas-daily-stats-list details.tas-submission-fold)>summary {
   min-height:0!important;height:auto!important;
  }
  html body main#app #iq-daily-required :is(.tas-daily-guides details.tas-deadline-guide,.tas-daily-stats-list details.tas-submission-fold) {
   box-sizing:border-box!important;margin:0 0 10px!important;
  }
  html body main#app #iq-daily-required .tas-daily-guides .tas-deadline-guides>li {margin:0!important}
  html body main#app #iq-daily-required details.tas-submission-fold>summary>.tas-submission-overdue-label {
   flex:0 0 auto!important;margin-left:auto!important;
  }
  html body main#app #iq-daily-required :is(.tas-guide-plus,summary>span[aria-hidden="true"]) {
   color:#2e8d47!important;
  }
  html body main#app #iq-daily-required details.tas-submission-fold[data-overdue="true"]>summary {
   background:#c51628!important;background-image:none!important;color:#fff!important;border-color:#c51628!important;
  }
  html body main#app #iq-daily-required details.tas-submission-fold[data-overdue="true"]>summary>.tas-submission-overdue-label {
   background:rgba(0,0,0,.094)!important;color:#fff!important;border:1px solid rgba(255,255,255,.533)!important;
   padding:6px 10px!important;font-size:14px!important;line-height:1.2!important;
  }
  html body main#app :is(button.tas-ncr-overdue[data-ncr-dashboard-alert="1"],button[data-iq-reporting-late="true"]) {
   background:#c51628!important;background-image:none!important;color:#fff!important;border-color:#c51628!important;
  }
  html body main#app :is(button.tas-ncr-overdue[data-ncr-dashboard-alert="1"],button[data-iq-reporting-late="true"]) :is(span,small,strong) {color:#fff!important}
  html body>header.tas-dual-brand-header>.tas-matched-brand {
   background:#2e8d47!important;border-bottom:2px solid #b91421!important;
  }
  html body header.app-header>.brand-meta,
  html body header.app-header nav.tabs :is(button.active,[data-view="login"],a[href*="/ehsqe/"],a[href*="gate2-online"],[data-iq-back-website]),
  html body header.app-header #tas-news-strip {background:#2e8d47!important;color:#fff!important}
 }
}
