/* Family Lesson Maker + Lesson History (lessons.html). Phone first. */
.lm-layout{display:grid;gap:1.5rem}
@media (min-width:62rem){.lm-layout{grid-template-columns:minmax(17rem,22rem) 1fr;align-items:start}.lm-side{position:sticky;top:5rem}.lm-main{order:2}}
.lm-side{display:grid;gap:1rem}
.lm-setup fieldset{border:0;padding:0;margin:0 0 1rem}
.lm-setup legend{font-weight:600;margin-bottom:.4rem;color:var(--heading)}
.lm-setup .check{margin:.2rem 0 .35rem}
.lm-weeknav{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:.5rem}
.lm-weeknav .btn{flex:1 1 auto;min-height:40px}
.lm-setup select{max-width:100%}
.lm-res{grid-template-columns:1fr!important;gap:.7rem}
.lm-res a{font-size:1.05rem!important;line-height:1.25}
.lm-res span{display:block;font-size:var(--step--1);color:var(--text-muted)}
.lm-week-head .eyebrow{margin-bottom:.2rem}
.lm-title{margin:.1rem 0 .2rem;font-size:clamp(1.6rem,5vw,2.3rem)}
.lm-block{font-weight:600;color:var(--navy-700);margin:0 0 .35rem}
.lm-notice{background:#fff8e6;border:1px solid var(--gold-300);border-left:4px solid var(--gold-500);border-radius:12px;padding:.8rem 1rem;margin:1rem 0}
.lm-notice p{margin:0 0 .5rem}
.lm-bar{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;margin:1rem 0 .25rem;padding:.6rem .9rem;border-radius:12px;background:var(--navy-900);color:var(--ivory-50,#F7F1E5);position:sticky;top:4.2rem;z-index:5}
.lm-bar .muted{color:var(--gold-300)}
.lm-total{margin:0;font-size:1.05rem}
.lm-total b{font-size:1.3rem;color:var(--gold-400)}
.lm-edited{background:var(--gold-500);color:var(--navy-900)}
.lm-reset{margin-left:auto;color:var(--gold-300)!important}
.lm-howto{margin:.5rem 0 .75rem}
.lm-sections{list-style:none;padding:0;margin:0;display:grid;gap:.8rem}
.lm-sec{background:var(--surface,#fff);border:1px solid var(--border);border-left:4px solid var(--navy-700);border-radius:14px;padding:.7rem .8rem .5rem;box-shadow:0 1px 2px rgba(27,42,65,.06)}
.lm-sec.is-optional{border-left-color:var(--gold-500);border-left-style:dashed}
.lm-sec.k-base{border-left-color:var(--gold-500)}
.lm-sec.dragging{opacity:.85;box-shadow:0 8px 24px rgba(27,42,65,.25);outline:2px solid var(--gold-500)}
.lm-sec-top{display:flex;align-items:center;gap:.4rem}
.lm-grip{border:0;background:none;padding:.35rem .15rem;cursor:grab;touch-action:none;color:var(--text-muted);min-height:44px;display:flex;align-items:center}
.lm-grip svg{width:18px;height:18px;fill:currentColor}
.lm-num{flex:0 0 auto;width:1.6rem;height:1.6rem;border-radius:50%;background:var(--navy-800);color:var(--ivory-50,#fff);display:grid;place-items:center;font-size:.85rem;font-weight:700}
.lm-sec-title{flex:1 1 auto;min-width:0;font-family:var(--font-display);font-weight:600;font-size:1.15rem;color:var(--heading);border:1px solid transparent;border-radius:8px;padding:.35rem .4rem;background:transparent}
.lm-sec-title:hover,.lm-sec-title:focus,.lm-text:hover,.lm-qs input:hover{border-color:var(--border);background:#fffdf8}
.lm-min{display:flex;align-items:center;gap:.2rem;flex:0 0 auto;margin:0;font-size:.85rem;color:var(--text-muted)}
.lm-min input{width:3.7rem;padding:.35rem .3rem;text-align:center;border:1px solid var(--border);border-radius:8px;font-weight:600;font-size:1rem}
.lm-opt{margin:.15rem 0 0 2.6rem;font-size:var(--step--1);color:var(--accent-text)}
.lm-text{display:block;width:100%;margin:.35rem 0 0;border:1px solid transparent;border-radius:8px;padding:.4rem .5rem;font:inherit;line-height:1.5;resize:vertical;background:transparent;overflow:hidden;min-height:2.6rem}
.lm-qs{margin:.4rem 0 .2rem;padding-left:1.4rem;display:grid;gap:.3rem}
.lm-qs li{display:flex;align-items:center;gap:.2rem}
.lm-qs li::marker{color:var(--gold-700)}
.lm-qs input{flex:1 1 auto;min-width:0;border:1px solid transparent;border-radius:8px;padding:.4rem .45rem;font:inherit;font-weight:600;color:var(--navy-800);background:#fbf7ee}
.lm-addq{margin:.1rem 0 0 1.4rem;font-size:var(--step--1)}
.lm-links{margin:.4rem 0 0;font-size:var(--step--1)}
.lm-sec-tools{display:flex;align-items:center;gap:.25rem;margin-top:.35rem;flex-wrap:wrap}
.lm-sec-tools .btn svg{width:16px;height:16px;vertical-align:-3px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.lm-spacer{flex:1}
.lm-ic{border:1px solid transparent;background:none;border-radius:8px;width:40px;height:40px;display:inline-grid;place-items:center;color:var(--navy-700);cursor:pointer;flex:0 0 auto}
.lm-ic:hover:not(:disabled){border-color:var(--border);background:#fbf7ee}
.lm-ic:disabled{opacity:.3;cursor:default}
.lm-ic svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.lm-add{margin:.8rem 0 0;width:100%}
.lm-notes-f{margin-top:1rem}
.lm-status{min-height:1.4em;color:var(--accent-text);margin:.5rem 0}
.lm-actions{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;margin:.5rem 0 1rem}
.lm-actions .btn{width:100%}
@media (min-width:40rem){.lm-actions{display:flex;flex-wrap:wrap}.lm-actions .btn{width:auto}}
.lm-mark{margin:0 0 1rem}
.lh-row2{display:grid;gap:0 1rem}
@media (min-width:40rem){.lh-row2{grid-template-columns:1fr 1fr}}
/* Lesson History */
.lh-tools{display:grid;gap:0 1rem;margin:1rem 0 .5rem}
@media (min-width:44rem){.lh-tools{grid-template-columns:2fr 1fr 1.4fr}}
.lh-list{list-style:none;padding:0;margin:1rem 0;display:grid;gap:.6rem}
.lh-item{background:var(--surface,#fff);border:1px solid var(--border);border-radius:14px;overflow:hidden}
.lh-row{display:grid;grid-template-columns:1fr;gap:.1rem;width:100%;text-align:left;border:0;background:none;padding:.8rem 1rem;cursor:pointer;font:inherit;color:inherit}
.lh-row:hover{background:#fbf7ee}
.lh-date{font-size:var(--step--1);color:var(--accent-text);font-weight:600}
.lh-t{font-family:var(--font-display);font-size:1.2rem;font-weight:600;color:var(--heading)}
.lh-meta{font-size:var(--step--1);color:var(--text-muted)}
.lh-body{padding:0 1rem 1rem;border-top:1px solid var(--border)}
.lh-out{padding-left:1.3rem}
.lh-out li{margin:.25rem 0}
.lh-out ul{margin:.2rem 0 .4rem;padding-left:1.1rem;font-size:var(--step--1)}
.lh-edit{margin-top:.5rem}
.lh-del{color:#9b2c2c}
/* print one lesson */
#lm-print{display:none}
@media print{
  body.lm-printing > *:not(#lm-print){display:none!important}
  body.lm-printing #lm-print{display:block;font-size:11.5pt;color:#000}
  #lm-print h1{font-size:20pt;margin:0 0 .2rem}
  #lm-print .p-sub{margin:0 0 .8rem;color:#333}
  #lm-print h2{font-size:13pt;margin:.7rem 0 .2rem}
  #lm-print h2 span{font-weight:400;color:#555;font-size:10pt}
  #lm-print .p-secs{padding-left:1.2rem}
  #lm-print li{break-inside:avoid}
  #lm-print p{margin:.15rem 0}
  #lm-print .p-links,#lm-print .p-foot{font-size:8.5pt;color:#444;word-break:break-all}
  #lm-print .p-foot{margin-top:1rem;border-top:1px solid #999;padding-top:.4rem}
}
