/* P08 — source-first layout QA, narrowly scoped. No new controllers or hidden data. */
body.kbm-p08-dashboard,
body.kbm-p08-archives{
  --kbm-p08-border:#dce6ed;
  --kbm-p08-text:#12364a;
  --kbm-p08-muted:#506d7e;
  --kbm-p08-gold:#ffd33f;
}
/* Dashboard: only Core's P0 shell, not the retired second dashboard UI. */
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace),
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) :is(.kbm-p0-layout,.kbm-p0-main,.kbm-dashboard-recode-panel,.kbm-dashboard-recode-list){
  box-sizing:border-box;min-width:0;max-width:100%;
}
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-dashboard-recode-header{
  min-width:0;max-width:100%;gap:clamp(10px,1.5vw,20px);
}
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-gdb09-heading,
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-dashboard-recode-user,
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-u6-header-actions{min-width:0;max-width:100%;}
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-p0-sidebar{box-sizing:border-box;min-width:0;max-width:100%;}
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-p0-sidebar [data-kbm-dashboard-tab],
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-gdb20-side-link{
  box-sizing:border-box;min-width:0;max-width:100%;height:auto;
  line-height:1.75;white-space:normal;word-break:normal;overflow-wrap:break-word;
}
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-p0-sidebar [data-kbm-dashboard-tab] > svg,
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-gdb20-side-link > svg{
  flex:0 0 22px;width:22px;height:22px;align-self:center;
}
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) :is(.kbm-dashboard-recode-tab-badge,.kbm-gdb20-side-count,.kbm-u6-unread){
  display:inline-grid;place-items:center;flex:0 0 auto;min-width:23px;
  min-height:23px;height:auto;padding:2px 5px;border-radius:999px;
  font-size:11px;line-height:1.5;white-space:nowrap;
}
/* Live dashboard uses Core Communications markup, NOT retired .kbm-dcc-n cards. */
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-inbox{
  box-sizing:border-box;min-width:0;width:100%;max-width:100%;margin:0;padding:0;
}
body.kbm-p08-dashboard #kbm-panel-notifications :is(.kbm-comm-inbox-title,.kbm-comm-notice-list,.kbm-comm-notice,.kbm-comm-notice-main){
  box-sizing:border-box;min-width:0;max-width:100%;
}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-inbox-title{
  display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:10px 16px;margin:0 0 16px;
}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-inbox-title h3{
  min-width:0;max-width:100%;margin:0;font-size:clamp(17px,1.5vw,22px);
  line-height:1.7;white-space:normal;overflow-wrap:break-word;
}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-unread-count{
  flex:0 0 auto;min-width:0;max-width:100%;line-height:1.5;white-space:nowrap;
}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice-list{
  display:grid;grid-template-columns:minmax(0,1fr);gap:12px;
}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice{
  display:grid;grid-template-columns:minmax(0,1fr);gap:9px;
  width:100%;min-width:0;max-width:100%;padding:clamp(13px,1.45vw,18px);
  border:1px solid var(--kbm-p08-border);border-radius:16px;
  background:#fff;box-shadow:0 7px 18px rgba(8,38,55,.055);
  text-align:right;direction:rtl;
}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice.is-unread{
  border-color:#e6c35b;background:#fffcf3;box-shadow:inset -4px 0 0 #f0ba19;
}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice-main{
  display:grid;grid-template-columns:minmax(0,1fr);gap:5px;
}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice-main :is(strong,p){
  min-width:0;max-width:100%;width:auto;margin:0;white-space:normal;
  word-break:normal;overflow-wrap:anywhere;text-align:right;direction:rtl;
  writing-mode:horizontal-tb;line-height:1.85;
}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice-main strong{font-size:clamp(13px,1.05vw,15px);font-weight:800;color:#15394d;}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice-main p{font-size:clamp(12px,1vw,14px);color:#425d71;}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice footer{
  display:flex;align-items:center;justify-content:space-between;
  gap:8px 12px;flex-wrap:wrap;min-width:0;max-width:100%;
  border-top:1px dashed #d8e4ed;padding:10px 0 0;
}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice footer :is(a,button,small,time){
  min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.75;
}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice footer :is(a,button){
  min-height:42px;display:inline-flex;align-items:center;justify-content:center;
  padding:8px 13px;border-radius:10px;text-decoration:none;font-weight:750;
}
body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice footer :is(a,button):focus-visible,
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-p0-sidebar [data-kbm-dashboard-tab]:focus-visible{
  outline:3px solid #f0bc22;outline-offset:2px;
}
/* Desktop: natural page scroll. No clipped sidebar or 1-character-wide main column. */
@media(min-width:981px){
  body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) > .kbm-p0-layout{
    display:grid;direction:rtl;grid-template-columns:clamp(225px,20vw,270px) minmax(0,1fr);
    gap:clamp(12px,1.7vw,24px);align-items:start;min-width:0;max-width:100%;
  }
  body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-p0-sidebar{
    position:static;top:auto;max-height:none;overflow:visible;align-self:start;
  }
  body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-p0-nav-body{
    height:auto;max-height:none;overflow:visible;min-width:0;
  }
  body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-p0-main{
    min-width:0;width:100%;max-width:100%;overflow:visible;
  }
}
@media(max-width:980px){
  body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) > .kbm-p0-layout{
    grid-template-columns:minmax(0,1fr)!important;max-width:100%;
  }
  body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-p0-main{
    grid-column:1;max-width:100%;min-width:0;
  }
}
@media(max-width:600px){
  body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-inbox-title{align-items:flex-start;flex-direction:column;}
  body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice{border-radius:13px;padding:12px;}
  body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice footer{align-items:stretch;flex-direction:column;}
  body.kbm-p08-dashboard #kbm-panel-notifications .kbm-comm-notice footer :is(a,button){width:100%;}
}
/* Five independent public archives: no owner/query/taxonomy or sticky mobile drawer changes. */
body.kbm-p08-archives.kbm-u13b-market :is(
  .kbm-ads-recode-layout,.kbm-ads-recode-results,.kbm-machine-sale-recode-archive,
  .kbm-machine-sale-recode-results,.kbm-gdb06-provider-archive,.kbm-gdb06-main,
  .kbm-drivers-recode-archive,.kbm-drivers-recode-main,.kbm-c118-archive,.kbm-c118-layout
){box-sizing:border-box;min-width:0;max-width:100%;}
body.kbm-p08-archives.kbm-u13b-market :is(
  .kbm-ads-recode-toolbar,.kbm-machine-sale-recode-topbar,.kbm-gdb06-toolbar,
  .kbm-drivers-recode-topbar,.kbm-c118-toolbar
){min-width:0;max-width:100%;gap:clamp(8px,1vw,14px);}
body.kbm-p08-archives.kbm-u13b-market :is(
  .kbm-ads-recode-toolbar,.kbm-machine-sale-recode-topbar,.kbm-gdb06-toolbar,
  .kbm-drivers-recode-topbar,.kbm-c118-toolbar
) :is(input,select,button){max-width:100%;min-width:0;box-sizing:border-box;}
body.kbm-p08-archives.kbm-u13b-market :is(
  .kbm-ads-recode-empty,.kbm-machine-sale-recode-empty,.kbm-gdb06-empty,
  .kbm-drivers-recode-empty,.kbm-c118-empty
){max-width:100%;min-width:0;overflow-wrap:break-word;line-height:1.85;}
@media(min-width:1025px){
  body.kbm-p08-archives.kbm-u13b-market :is(
    .kbm-ads-recode-sidebar,.kbm-machine-sale-recode-sidebar,
    .kbm-gdb06-provider-archive .kbm-gdb06-sidebar,
    .kbm-drivers-recode-sidebar,.kbm-c118-sidebar
  ){
    top:calc(var(--kbm-header-height,132px) + var(--kbm-header-adminbar,0px) + 12px)!important;
    max-height:calc(100dvh - var(--kbm-header-height,132px) - var(--kbm-header-adminbar,0px) - 24px)!important;
    min-width:0;box-sizing:border-box;
  }
}
@media(max-width:1024px){
  body.kbm-p08-archives.kbm-u13b-market :is(
    .kbm-ads-recode-sidebar,.kbm-machine-sale-recode-sidebar,
    .kbm-gdb06-provider-archive .kbm-gdb06-sidebar,
    .kbm-drivers-recode-sidebar,.kbm-c118-sidebar
  ){max-width:100%;box-sizing:border-box;}
}
@media(prefers-reduced-motion:reduce){body.kbm-p08-dashboard :is(*,*::before,*::after){scroll-behavior:auto!important;}}

/* Preserve Core's sidebar disclosure and canonical tab panels. */
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-gdb09-dashboard-head {
  background:linear-gradient(120deg,#071a33,#153357)!important;
  border:1px solid #25486c!important; border-inline-start:5px solid #ffcc00!important;
  border-radius:18px!important; gap:12px!important; padding:clamp(14px,2.1vw,28px)!important;
}
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-gdb09-dashboard-head h1 {
  color:white!important; font-size:clamp(22px,2.4vw,33px)!important;
}
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-gdb09-dashboard-head .kbm-gdb09-heading p {
  margin:6px 0 0; color:#dbe7f3; line-height:1.75; overflow-wrap:anywhere;
}
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-gdb09-workspace-bar {
  min-width:0; background:#fff; border:1px solid #dbe4ed; border-radius:12px; padding:8px 12px; gap:8px;
}
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-dashboard-recode-tabs a {
  min-height:44px; border-radius:8px;
}
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-dashboard-recode-tabs a[aria-selected="true"] {
  border-inline-start:4px solid #ffcc00;
}
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-comm-card {
  border-radius:14px; border-inline-start:3px solid #ffcc00;
}

body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-p0-sidebar {
  border-radius:var(--kbm-radius-panel,20px);
  border-color:var(--kbm-color-line,#e2e8f0); background:var(--kbm-color-surface,#fff);
}
body.kbm-p08-dashboard #kbm-vr-dashboard.kbm-p0-server-shell:not(.kbm-b5-workspace) .kbm-p0-sidebar [aria-selected=true] {
  box-shadow:inset -3px 0 var(--kbm-color-brand,#ffcc00);
}
