:root{
  --lesson-canvas-gap:22px;
  --lesson-document-inline:clamp(18px,2vw,26px);
  --lesson-card-gap:18px;
}

/*
  The generated lesson responds to the width of its own planner column.
  Laptop layouts reserve the main horizontal space for the document and move
  the completeness summary below it instead of squeezing the lesson into a
  narrow third-column arrangement.
*/
body.depth-design .lesson-document-shell{
  width:100%;
  max-width:100%;
  min-width:0;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  container-name:lesson-canvas;
  container-type:inline-size;
}

body.depth-design .lesson-document{
  width:100%;
  max-width:100%;
  min-width:0;
  overflow:hidden;
  isolation:isolate;
  border-radius:30px;
}

body.depth-design .lesson-document *,
body.depth-design .lesson-document *::before,
body.depth-design .lesson-document *::after{
  min-width:0;
  max-width:100%;
}

body.depth-design .lesson-document-header{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:start!important;
  gap:24px;
  padding:32px 34px!important;
}

body.depth-design .lesson-document-header>div:first-child{
  min-width:0;
}

body.depth-design .lesson-document-header h1{
  width:100%;
  max-width:100%;
  margin-right:0;
  font-size:clamp(2.15rem,3.25vw,3.7rem);
  line-height:1.02;
  letter-spacing:-.045em;
  overflow-wrap:anywhere;
  word-break:normal;
  text-wrap:balance;
}

body.depth-design .lesson-meta{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  width:100%;
  max-width:100%;
  margin-top:18px;
}

body.depth-design .lesson-meta span{
  flex:0 1 auto;
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
}

body.depth-design .document-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  gap:9px;
  width:max-content;
  max-width:100%;
}

body.depth-design .document-actions .btn{
  flex:0 0 auto;
  white-space:nowrap;
}

/* One consistent paper grid: standalone sections and paired sections share
   the same outside edge, spacing, padding, and corner radius. */
body.depth-design .lesson-document>.lesson-section{
  margin:0 var(--lesson-document-inline) var(--lesson-card-gap)!important;
  padding:23px 25px!important;
  border-radius:20px!important;
}

body.depth-design .lesson-document>.lesson-section:first-of-type{
  margin-top:22px!important;
}

body.depth-design .lesson-section{
  min-width:0;
}

body.depth-design .lesson-section h3{
  margin:0 0 13px;
  line-height:1.25;
}

body.depth-design .lesson-section :is(p,li,span,b,strong,td,th),
body.depth-design .time-validation :is(span,b){
  overflow-wrap:anywhere;
  word-break:normal;
}

body.depth-design .lesson-section p,
body.depth-design .lesson-section li{
  width:100%;
  max-width:none;
  line-height:1.64;
}

body.depth-design .lesson-section p:last-child,
body.depth-design .lesson-section ul:last-child{
  margin-bottom:0;
}

body.depth-design .objective-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  align-items:stretch;
  gap:var(--lesson-card-gap)!important;
}

body.depth-design .objective-grid article{
  width:100%;
  min-width:0!important;
  height:100%;
  padding:20px!important;
}

body.depth-design .objective-grid article p{
  max-width:none;
}

body.depth-design .two-column-sections,
body.depth-design .support-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:stretch;
  gap:var(--lesson-card-gap)!important;
  margin:0 var(--lesson-document-inline) var(--lesson-card-gap)!important;
}

body.depth-design .two-column-sections>.lesson-section,
body.depth-design .support-grid>.lesson-section{
  width:100%;
  min-width:0!important;
  height:100%;
  margin:0!important;
  padding:23px 25px!important;
  border-radius:20px!important;
}

body.depth-design .tag-list{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:8px;
  width:100%;
}

body.depth-design .tag-list span{
  flex:0 1 auto;
  max-width:100%;
  white-space:normal;
}

body.depth-design .table-wrap{
  width:100%;
  max-width:100%;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  overscroll-behavior-inline:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-gutter:stable;
  border-radius:16px;
}

body.depth-design .lesson-flow-table{
  width:100%;
  min-width:880px;
  table-layout:fixed;
}

body.depth-design .lesson-flow-table th:nth-child(1),
body.depth-design .lesson-flow-table td:nth-child(1){
  width:17%;
}

body.depth-design .lesson-flow-table th:nth-child(2),
body.depth-design .lesson-flow-table td:nth-child(2),
body.depth-design .lesson-flow-table th:nth-child(3),
body.depth-design .lesson-flow-table td:nth-child(3){
  width:28%;
}

body.depth-design .lesson-flow-table th:nth-child(4),
body.depth-design .lesson-flow-table td:nth-child(4){
  width:27%;
}

body.depth-design .lesson-flow-table td{
  vertical-align:top;
  line-height:1.55;
}

body.depth-design .time-validation{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:4px var(--lesson-document-inline) 30px!important;
}

/* Wide desktop: keep the useful three-panel workspace, but give the paper a
   larger maximum canvas and reduce dead space between columns. */
@media(min-width:1721px){
  body.depth-design .planner-layout{
    width:min(100%,1880px)!important;
    grid-template-columns:minmax(300px,330px) minmax(0,1fr) minmax(235px,265px)!important;
    gap:24px!important;
    padding:28px clamp(24px,2.4vw,44px) 58px!important;
  }
}

/* Common laptops and browser zoom levels: use two columns. The generated
   lesson receives the entire remaining width and Plan Completeness becomes a
   compact dashboard beneath both columns. */
@media(min-width:981px) and (max-width:1720px){
  body.depth-design .planner-layout{
    width:min(100%,1780px)!important;
    grid-template-columns:minmax(290px,320px) minmax(0,1fr)!important;
    gap:24px!important;
    padding:24px clamp(18px,2vw,30px) 50px!important;
  }

  body.depth-design .planner-form-panel{
    padding:27px 23px 30px!important;
  }

  body.depth-design .lesson-document-shell{
    grid-column:2;
  }

  body.depth-design .planner-insights{
    position:static!important;
    top:auto!important;
    grid-column:1/-1!important;
    display:grid!important;
    grid-template-columns:minmax(220px,1.2fr) repeat(5,minmax(120px,.8fr))!important;
    grid-template-rows:auto auto auto;
    align-items:stretch!important;
    gap:0!important;
    padding:24px 26px!important;
    border-radius:26px!important;
  }

  body.depth-design .planner-insights::before{
    display:none!important;
  }

  body.depth-design .planner-insights>.panel-label{
    grid-column:1;
    grid-row:1;
    align-self:end;
    color:#bfe2dd;
  }

  body.depth-design .planner-insights>h2{
    grid-column:1;
    grid-row:2;
    align-self:start;
    margin:7px 20px 0 0!important;
  }

  body.depth-design .planner-insights .insight-row{
    min-width:0;
    min-height:84px;
    display:flex!important;
    flex-direction:column;
    align-items:flex-start!important;
    justify-content:center!important;
    gap:6px!important;
    margin:0!important;
    padding:13px 16px!important;
    border:0!important;
    border-left:1px solid rgba(255,255,255,.16)!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    grid-row:1/3;
  }

  body.depth-design .planner-insights .insight-row:nth-of-type(1){grid-column:2}
  body.depth-design .planner-insights .insight-row:nth-of-type(2){grid-column:3}
  body.depth-design .planner-insights .insight-row:nth-of-type(3){grid-column:4}
  body.depth-design .planner-insights .insight-row:nth-of-type(4){grid-column:5}
  body.depth-design .planner-insights .insight-row:nth-of-type(5){grid-column:6}

  body.depth-design .planner-insights .insight-row span{
    color:rgba(255,255,255,.72)!important;
    line-height:1.35;
  }

  body.depth-design .planner-insights .insight-row b{
    color:#fff!important;
  }

  body.depth-design .planner-insights .insight-tip{
    grid-column:1/-1;
    grid-row:3;
    margin:18px 0 0!important;
    padding:16px 18px!important;
    border:1px solid rgba(255,255,255,.14)!important;
    border-radius:17px!important;
    color:#fff!important;
    background:rgba(255,255,255,.09)!important;
    box-shadow:none!important;
  }

  body.depth-design .planner-insights .insight-tip p{
    margin:5px 0 0;
    color:rgba(255,255,255,.76)!important;
  }
}

/* Container-aware rules work for laptops, tablets, split-screen windows and
   zoomed browsers without relying only on viewport breakpoints. */
@container lesson-canvas (max-width:900px){
  body.depth-design .lesson-document-header{
    grid-template-columns:1fr!important;
  }

  body.depth-design .document-actions{
    width:100%;
    justify-content:flex-start;
  }

  body.depth-design .objective-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  body.depth-design .objective-grid article:last-child{
    grid-column:1/-1;
  }
}

@media(min-width:981px) and (max-width:1240px){
  body.depth-design .planner-insights{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
  }

  body.depth-design .planner-insights>.panel-label,
  body.depth-design .planner-insights>h2{
    grid-column:1/-1;
    grid-row:auto;
  }

  body.depth-design .planner-insights>h2{
    margin-bottom:14px!important;
  }

  body.depth-design .planner-insights .insight-row{
    grid-row:auto!important;
    min-height:72px;
    border-top:1px solid rgba(255,255,255,.14)!important;
    border-left:0!important;
  }

  body.depth-design .planner-insights .insight-row:nth-of-type(1){grid-column:1}
  body.depth-design .planner-insights .insight-row:nth-of-type(2){grid-column:2}
  body.depth-design .planner-insights .insight-row:nth-of-type(3){grid-column:3}
  body.depth-design .planner-insights .insight-row:nth-of-type(4){grid-column:4}
  body.depth-design .planner-insights .insight-row:nth-of-type(5){grid-column:5}
}

@container lesson-canvas (max-width:680px){
  body.depth-design .lesson-document-header{
    padding:24px 20px!important;
  }

  body.depth-design .lesson-document-header h1{
    font-size:clamp(1.85rem,8cqi,2.65rem);
  }

  body.depth-design .objective-grid,
  body.depth-design .two-column-sections,
  body.depth-design .support-grid{
    grid-template-columns:1fr!important;
  }

  body.depth-design .objective-grid article:last-child{
    grid-column:auto;
  }

  body.depth-design .lesson-document>.lesson-section{
    margin-right:12px!important;
    margin-left:12px!important;
    padding:19px 18px!important;
  }

  body.depth-design .two-column-sections,
  body.depth-design .support-grid{
    margin-right:12px!important;
    margin-left:12px!important;
  }

  body.depth-design .two-column-sections>.lesson-section,
  body.depth-design .support-grid>.lesson-section{
    padding:19px 18px!important;
  }

  body.depth-design .time-validation{
    margin-right:12px!important;
    margin-left:12px!important;
  }

  body.depth-design .document-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  body.depth-design .document-actions .btn{
    width:100%;
    white-space:normal;
  }
}

@container lesson-canvas (max-width:460px){
  body.depth-design .document-actions{
    grid-template-columns:1fr;
  }

  body.depth-design .lesson-meta{
    align-items:stretch;
  }

  body.depth-design .lesson-meta span{
    width:100%;
    text-align:left;
  }
}
