/* Custom layouts keep the existing paper controls and paint targets intact. */
html body .page.custom-day-layout .sheet {
  position:relative!important; display:block!important; height:var(--layout-height,444px)!important;
  min-height:0!important; margin:0!important;
}
html body .page.custom-day-layout .sheet-l,
html body .page.custom-day-layout .sheet-r { display:contents!important }
html body .page.custom-day-layout .sheet :is(.tasks,.grid-card,.memo-sec,#reviewCard) {
  position:absolute!important; left:var(--layout-x); top:var(--layout-y);
  width:var(--layout-w); height:var(--layout-h); min-width:0; min-height:0!important;
  padding:0!important; margin:0!important; box-sizing:border-box; grid-area:auto!important;
}
html body .page.custom-day-layout .sheet .sh-lab {
  display:flex; align-items:center!important; height:14px!important; min-height:0!important;
  line-height:14px!important; margin:0 0 2px!important;
}
html body .page.custom-day-layout .sheet .memo-sec::before { top:16px!important }
html body .page.custom-day-layout .sheet :is(#memo,.m-memo,#review) {
  display:block; width:100%; height:calc(100% - 16px)!important; min-height:0!important;
  max-height:none!important; resize:none; overflow:auto; padding-top:0!important;
  line-height:22px!important; background-size:100% 22px!important;
  background-image:linear-gradient(transparent 21.35px,var(--paper-rule) 21.35px)!important;
}
html body .page.custom-day-layout .sheet .tt { display:block!important; flex:none!important; margin:0!important }
html body .page.custom-day-layout .sheet .tk-row :is(.todo-t,.todo-in,.hl) { font-size:12px!important; line-height:1.2!important; padding-top:0!important; padding-bottom:0!important }
html body .page.custom-day-layout .sheet .ln-row .bar em { font-size:9.5px!important; line-height:1.1!important }

html body .page.custom-day-layout #schoolCard { display:none!important }

/* MEMO rules divide the whole writing area evenly, from the heading to the final rule. */
html body.view-day .page:not(.custom-day-layout) .sheet .memo-sec.memo-ruled {
  position:relative; height:var(--memo-box-height)!important; min-height:0!important; padding-top:0!important;
}
html body.view-day .page .sheet .memo-sec.memo-ruled::before { top:var(--memo-start)!important; bottom:0!important }
html body.view-day .page .sheet .memo-sec.memo-ruled.memo-x::before { left:var(--memo-rule-x)!important }
html body.view-day .page .sheet .memo-sec.memo-ruled :is(#memo,.m-memo) {
  position:absolute!important; left:0; top:var(--memo-start); width:100%;
  height:var(--memo-input-height)!important; min-height:0!important; max-height:none!important;
  margin:0!important; padding-top:0!important; padding-bottom:0!important; box-sizing:border-box;
  line-height:var(--memo-step)!important; resize:none; overflow:auto;
  border-bottom:var(--paper-heading-stroke,1.5px) solid var(--ink)!important;
  border-radius:0; background-size:100% var(--memo-step)!important; background-position:0 .325px!important;
  background-repeat:repeat-y!important; background-attachment:local!important;
  background-image:linear-gradient(to bottom,transparent calc(100% - .65px),var(--paper-rule) 0)!important;
  clip-path:inset(.5px 0 0 0);   /* 10/17 맨 윗줄 반쪽이 'MEMO' 글씨 가운데를 긋지 않게 (머리선은 글씨 오른쪽 굵은 선이 맡는다) */
}
html body.view-day .page .sheet .memo-sec.memo-ruled .m-memo { overflow:hidden }

/* A steady heading above every day layout: date, small D-day, recorded time. */
html body.view-day .page .sheet-head {
  display:grid; grid-template-columns:minmax(0,1.45fr) minmax(0,.70fr) minmax(0,1fr)!important;
  grid-template-rows:auto auto!important; gap:12px 10px!important;
  margin:0 0 14px!important; padding:0!important; border:0!important; align-items:start;
}
html body.view-day .page .sheet-head > :is(#slotDate,#ddaySec,#slotTotal,#midRow,.m-date,.m-dday,.m-total,.m-goal) {
  min-width:0; height:auto!important; min-height:0!important; overflow:visible!important;
  margin:0!important; padding:0!important; border:0!important;
}
html body.view-day .page :is(#slotDate,.m-date) { grid-area:1/1!important }
html body.view-day .page :is(#ddaySec,.m-dday) { grid-area:1/2!important }
html body.view-day .page :is(#slotTotal,.m-total) { grid-area:1/3!important; align-self:start!important }
html body.view-day .page :is(#midRow,.m-goal) { grid-area:2/1/3/4!important }
html body.view-day .page .sheet-head .sh-lab {
  display:flex; min-height:12px!important; height:auto!important; line-height:12px!important;
  margin:0 0 5px!important; font-size:8px!important; letter-spacing:.07em;
}
html body.view-day .page .sheet-head .sh-lab { align-items:center }
html body.view-day .page .sheet-head .sh-lab::after { content:""; flex:1; min-width:6px; height:var(--paper-heading-stroke,1.5px); align-self:center; background:var(--ink); opacity:1 }
html body.view-day .page #slotDate .date-card { display:block; width:100% }
html body.view-day .page #slotDate .date-mid { text-align:left; min-width:0; padding:0 }
html body.view-day .page #slotDate :is(.nav,.date-year,.today-chip) { display:none!important }
html body.view-day .page .sheet-head .date-main {
  font-size:24px!important; font-weight:650; line-height:1.25; letter-spacing:-.055em;
  text-align:left; white-space:nowrap;
}
html body.view-day .page .sheet-head .date-main .wd {
  font-size:max(10px,.42em); font-weight:600; letter-spacing:0; margin-left:3px;
}
html body.view-day .page .sheet-head .dd-list { gap:5px!important; align-items:stretch!important }
html body.view-day .page .sheet-head .dd-i {
  display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start!important;
  width:100%; gap:1px; padding:0!important; font-size:9px!important; line-height:1.25; text-align:left;
}
html body.view-day .page .sheet-head .dd-i span { max-width:100% }
html body.view-day .page .sheet-head .dd-i b {
  min-width:0; text-align:left; font-size:17px!important; line-height:1.15; font-weight:700;
}
html body.view-day .page .sheet-head .dd-empty { font-size:11px; padding:2px 0; text-align:left }
html body.view-day .page :is(#slotTotal,.m-total) .sh-lab { justify-content:flex-start }
html body.view-day .page #slotTotal .stat { align-items:flex-end; text-align:right; gap:0 }
html body.view-day .page :is(#slotTotal,.m-total) .stat-val {
  font-size:30px!important; line-height:1.1; white-space:nowrap; text-align:right; zoom:1!important;
  letter-spacing:-.035em; color:var(--accent); font-variant-numeric:tabular-nums;
}
html body.view-day .page :is(#slotTotal,.m-total) .stat-val small { font-size:.38em; letter-spacing:0 }
html body.view-day .page #slotTotal .stat-sub { display:none }
html body.view-day .page #midRow { display:flex; flex-direction:column; gap:8px!important }
html body.view-day .page :is(#goalCard,.m-goal) {
  display:grid; grid-template-columns:59px minmax(0,1fr); gap:8px; align-items:center;
}
html body.view-day .page :is(#goalCard,.m-goal) .sh-lab { margin:0!important }
html body.view-day .page :is(#goal,.m-goal .m-text) {
  width:100%; height:28px!important; min-height:28px!important; max-height:28px;
  padding:0 2px; margin:0; line-height:27px!important; font-size:12px!important; text-align:left;
  border:0; border-bottom:1px solid var(--paper-rule,var(--line))!important; border-radius:0;
  background:none; resize:none; overflow:auto; box-sizing:border-box;
}
html body.view-day .page #goal:focus { font-size:16px!important }
html body.view-day .page #big3Card:not([hidden]) { display:block }
html body.view-day .page :is(#goalCard,#midRow,#big3Card,.m-goal)[hidden] { display:none!important }

/* Header blocks use their own small grid; the original editable fields stay live. */
html body.view-day .page.custom-header-layout .sheet-head {
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
  grid-template-rows:repeat(var(--header-rows,8),var(--header-row,12px))!important;
  grid-auto-rows:auto!important; gap:0!important;
}
html body.view-day .page.custom-header-layout #midRow:not([hidden]) { display:contents!important }
html body.view-day .page.custom-header-layout .sheet-head .sh-lab { height:10px!important; min-height:10px!important; line-height:10px!important; margin:0 0 3px!important }
html body.view-day .page.custom-header-layout :is(#slotDate,.m-date,#ddaySec,.m-dday,#slotTotal,.m-total,#goalCard,.m-goal,#dayGoalCard,.m-day-goal,#big3Card,.m-big3) {
  grid-area:auto!important; grid-column:var(--head-col)!important; grid-row:var(--head-line)!important;
  min-height:0!important; min-width:0; height:auto!important; box-sizing:border-box;
  padding:0 var(--head-right,0px) var(--head-bottom,6px) 0!important;
  overflow:hidden!important; margin:0!important; align-self:stretch!important;
}
html body.view-day .page.custom-header-layout :is(#goalCard,.m-goal,#dayGoalCard,.m-day-goal) {
  display:flex; flex-direction:column; gap:0; align-items:stretch;
}
html body.view-day .page.custom-header-layout :is(#goalCard,.m-goal,#dayGoalCard,.m-day-goal) .sh-lab { flex:none; margin:0 0 3px!important }
html body.view-day .page.custom-header-layout :is(#goal,#dayGoal,.m-goal .m-text,.m-day-goal .m-text) {
  flex:1; width:100%; min-height:0!important; height:0!important; max-height:none!important;
  font:12px/21px var(--hand); line-height:21px!important; color:var(--text); text-align:left; white-space:pre-wrap;
  resize:none; overflow:auto; padding:0 2px; border:0; border-radius:0; box-shadow:none;
  border-bottom:0!important; background:none!important;
}
html body.view-day .page.custom-header-layout :is(#goal,#dayGoal):focus { font-size:16px!important; outline:1px solid var(--accent); outline-offset:1px }
html body.view-day .page.custom-header-layout .sheet-head .date-main { font-size:var(--header-date-font,24px)!important }
html body.view-day .page.custom-header-layout :is(#slotTotal,.m-total) .stat-val { font-size:var(--header-total-font,28px)!important }
html body.view-day .page.custom-header-layout :is(#big3Card,.m-big3) { display:block }
html body.view-day .page.custom-header-layout #big3 { zoom:1!important }
html body.view-day .page.custom-header-layout :is(#big3Card,.m-big3) .b3 { display:flex; gap:5px; height:18px; margin:0; padding:0; font-size:11px; align-items:center; min-width:0 }
html body.view-day .page.custom-header-layout :is(#big3Card,.m-big3) .b3 .num { flex:none; width:14px; height:14px; padding:0; font-size:9px; line-height:14px }
html body.view-day .page.custom-header-layout #big3 input { width:0; flex:1; min-width:0; height:18px; padding:0; font-size:11px; line-height:18px }
html body.view-day #dayView .page :is(.sheet-head,#slotDate,.m-date,#ddaySec,.m-dday,#slotTotal,.m-total,#goalCard,.m-goal,#dayGoalCard,.m-day-goal,#big3Card,.m-big3,.tasks,.grid-card,.memo-sec,#reviewCard)[hidden] { display:none!important; margin:0!important }
html body.view-day .page.custom-header-layout :is(#dayGoalCard,.m-day-goal)[hidden] { display:none!important }

/* Printed labels stay quieter than the user's writing. */
html body.view-day .page.custom-header-layout .sheet-head .sh-lab,html body .page .sheet .sh-lab { font-size:7px!important; letter-spacing:.045em }

/* Use the same printed heading rule in every section and layout. */
html body.view-day .page { --paper-heading-stroke:1.5px }
html body.view-day .page :is(.sheet-head,.sheet) .sh-lab::after {
  height:var(--paper-heading-stroke); align-self:center; background:var(--ink); opacity:1;
}
html body .page .sheet .grid-card > .sh-lab { gap:4px; letter-spacing:.025em }
html body.view-day .page .sheet .grid-card > .sh-lab { position:relative; z-index:2; height:14px!important; line-height:14px!important; margin:0 0 -7px!important; pointer-events:none }
html body.view-day .page .sheet .grid-card > .sh-lab > .tt-title { background:var(--board); padding:0 2px 0 0; margin:0; min-height:0; height:auto; font:inherit; color:inherit; letter-spacing:inherit; line-height:1 }
html body.view-day .page .sheet .grid-card .tt > .ln-row { border-top:0!important }
html body.view-day .page .sheet .grid-card .tt .c.ln { border-left-style:dotted!important }
html body.view-day .page .sheet .grid-card .tt > .ln-row > .c.ln:nth-child(2) { border-left:0!important }
html body.view-day .page .sheet .grid-card .ln-h { font-size:clamp(6.5px,calc(var(--trow,var(--row)) * .40),8.5px)!important; font-weight:650; border-right:.65px solid var(--paper-rule)!important }
html body.view-day .page .sheet .grid-card .ln-h span { width:auto!important; height:auto!important; line-height:1; font-size:inherit; font-weight:650!important }

/* A small printed signature sits below the final rule, inside the paper margin. */
/* Header edits resize writing space, not the content type. Paper zoom still scales the whole page. */
html body.view-day .page { --fs:12px }
html body.view-day .page .sheet .tk-row :is(.todo-t,.todo-in,.hl) { font-size:12px!important }
html body.view-day .page .sheet .ln-row .bar em { font-size:9.5px!important }
html body.view-day #dayView .page { padding-bottom:22px!important }
html body.view-day #dayView .paper-brand {
  position:absolute; right:14px; bottom:5px; margin:0; padding:0;
  font:700 8px/10px Pretendard,sans-serif; letter-spacing:-.025em;
  color:var(--ink); white-space:nowrap; pointer-events:none; user-select:none;
}
/* 10/15 ROUTINE 칸도 같은 자리 규칙 */
html body.view-day .page :is(#routineCard,.m-routine)[hidden] { display:none!important }
html body.view-day .page.custom-header-layout :is(#routineCard,.m-routine) {
  grid-area:auto!important; grid-column:var(--head-col)!important; grid-row:var(--head-line)!important;
  min-height:0!important; min-width:0; height:auto!important; box-sizing:border-box;
  padding:0 var(--head-right,0px) var(--head-bottom,6px) 0!important;
  overflow:hidden!important; margin:0!important; align-self:stretch!important; display:flex; flex-direction:column;
}
