/* MAXIMA Timetable v3 — simple, fast, one-screen */
:root{
  --v3-green:#174d3b;
  --v3-green2:#21684f;
  --v3-soft:#edf4f0;
  --v3-line:#dce6e0;
  --v3-bg:#f6f8f6;
  --v3-text:#24342d;
  --v3-muted:#748078;
}

html,body{height:100%;overflow:hidden}
body{background:var(--v3-bg);color:var(--v3-text);font-size:13px}

.app-shell{
  width:100%;max-width:none;height:100vh;height:100dvh;
  display:flex;flex-direction:column;
  padding:10px 14px;gap:7px;overflow:hidden
}

/* TOP: only the 4 things used every day */
.page-top{
  min-height:46px;height:46px;flex:none;
  display:flex;align-items:center;gap:12px;margin:0
}
.brand{display:flex;align-items:center;gap:9px;min-width:0}
.brand strong{font-size:18px;letter-spacing:.08em;color:var(--v3-green)}
.brand h1{margin:0;font-size:18px;line-height:1;color:#33463c}
.brand #connection{
  margin-left:2px;padding:3px 7px;max-width:150px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  border:0;background:#edf3ef;color:#688074;font-size:9px
}
.head-actions{margin-left:auto;display:flex;align-items:center;gap:6px;flex-wrap:nowrap}
.head-actions button,.head-actions .home-btn{
  min-height:34px;height:34px;padding:6px 13px;
  border:1px solid #d7e2dc;border-radius:10px;
  background:#fff;color:#315344;box-shadow:none;
  font-size:12px;font-weight:800;white-space:nowrap
}
.head-actions button:hover{background:#f4f8f5}
.head-actions .primary{color:#fff;background:var(--v3-green);border-color:var(--v3-green)}
.head-actions .save-button{background:#e7f1eb;border-color:#cfe0d6;color:var(--v3-green)}
.head-actions .icon-menu{min-width:34px;padding:3px 9px;font-size:19px;line-height:1}
.head-actions .home-btn{padding:6px 10px;text-decoration:none}

#serverNotice{
  flex:none;margin:0;padding:5px 8px;max-height:48px;overflow:auto;
  border-radius:7px;font-size:10px
}
#main{
  flex:1;min-height:0;display:flex;flex-direction:column;
  gap:6px;overflow:hidden
}

/* ONE compact switch line */
.simple-switch{
  min-height:37px;flex:none;
  display:flex;align-items:center;justify-content:space-between;gap:10px
}
.candidate-switch{
  display:flex;align-items:center;gap:3px;padding:3px;
  background:#e8efeb;border-radius:10px
}
.candidate-switch button{
  min-width:43px;min-height:29px;padding:4px 10px;
  border:0;border-radius:7px;background:transparent;
  color:#597064;box-shadow:none;font-size:11px;font-weight:900
}
.candidate-switch button.active{color:#fff;background:var(--v3-green)}
.candidate-switch button:disabled{opacity:.3}
.candidate-switch .published-tab{min-width:50px}
.simple-current{
  min-width:0;display:flex;align-items:center;justify-content:flex-end;
  gap:8px;color:var(--v3-muted);font-size:10px
}
.simple-current strong{
  max-width:360px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:#385547;font-size:11px
}
.simple-current select{
  min-height:28px;height:28px;padding:3px 24px 3px 7px;
  border-radius:7px;font-size:10px
}

/* BOARD */
.fit-board{
  flex:1;min-height:100px;position:relative;overflow:hidden;
  background:#fff;border:1px solid #d3dfd8;border-radius:14px;
  box-shadow:0 10px 28px rgba(23,77,59,.07)
}
.fit-table{display:flex;width:100%;height:100%;overflow:hidden}
.fit-ruler{
  width:44px;flex:none;display:flex;flex-direction:column;
  background:#f7faf8;border-right:1px solid #d9e4dd
}
.fit-corner{
  height:48px;flex:none;display:grid;place-items:center;
  border-bottom:1px solid #d9e4dd;color:#809087;font-size:9px
}
.fit-ruler-body{flex:1;min-height:0;position:relative}
.fit-ruler-body>span{
  position:absolute;left:6px;transform:translateY(-50%);
  color:#7b8b82;font-size:9px;font-weight:700;line-height:1
}
.fit-ruler-body>span.first{transform:translateY(2px)}
.fit-ruler-body>span.last{transform:translateY(-110%)}

.fit-days{flex:1;min-width:0;display:flex}
.fit-day{
  flex:1;min-width:0;display:flex;flex-direction:column;
  border-right:1px solid #cfdcd4
}
.fit-day:last-child{border:0}
.fit-day-name{
  width:100%;height:26px;min-height:26px;padding:0;border:0;border-radius:0;
  background:#dfeae3;color:#2d5a45;box-shadow:none;
  font-size:11px;font-weight:900
}
.fit-day-name span{font-size:9px}
.fit-day-name:hover{background:#d7e6dd!important}

.fit-lanes{flex:1;min-height:0;display:flex}
.fit-lane-wrap{
  flex:1;min-width:0;display:flex;flex-direction:column;
  border-right:1px solid #e1e8e4
}
.fit-lane-wrap:last-child{border:0}
.fit-teacher{
  height:22px;flex:none;display:flex;align-items:center;justify-content:center;
  padding:0 2px;overflow:hidden;border-bottom:1px solid #dce6e0;
  background:#f4f8f5;color:#496257;font-size:9px;font-weight:800;
  text-overflow:ellipsis;white-space:nowrap
}
.fit-lane{position:relative;flex:1;min-height:0;overflow:hidden;background:#fff}
.fit-unavailable{position:absolute;inset:0;background:#f3f5f4}
.fit-available{position:absolute;left:0;right:0;background:#fff}
.fit-lane::after{
  content:'';position:absolute;inset:0;z-index:1;pointer-events:none;
  background:repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--hour) - 1px),
    #e7ece9 calc(var(--hour) - 1px),
    #e7ece9 var(--hour)
  )
}
.fit-block{
  position:absolute;left:0;right:0;z-index:2;padding:0 2px;overflow:hidden;
  color:#6d7f75;background:#e9f1ec;border-top:1px solid #d2dfd7;
  font-size:7px;line-height:1.1;pointer-events:none
}
.fit-block.optional{background:#f4f0e4}

button.fit-lesson{
  position:absolute;left:2px;right:2px;width:calc(100% - 4px);
  min-height:0;margin:0;padding:3px 2px;z-index:3;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  overflow:hidden;cursor:grab;touch-action:manipulation;text-align:center;
  color:#263d31;background:var(--class-fill);
  border:1px solid rgba(75,111,91,.18);border-radius:6px;
  box-shadow:0 1px 2px rgba(28,62,45,.04);
  line-height:1.1;font-size:9px
}
button.fit-lesson strong{
  max-width:100%;overflow-wrap:anywhere;font-size:10px;line-height:1.08
}
button.fit-lesson>span{
  max-width:100%;overflow-wrap:anywhere;font-size:8px;line-height:1.08
}
button.fit-lesson small{color:#718178;font-size:7px;line-height:1}
button.fit-lesson.is-short>span,button.fit-lesson.is-short small{display:none}
button.fit-lesson.is-short strong{font-size:8px}
button.fit-lesson.is-changed{
  border-color:#d3b771;box-shadow:inset 3px 0 #d2a23b
}
/* Conflict is now a small accent, not a red box around everything */
button.fit-lesson.is-conflict{
  background:var(--class-fill);border-color:#dfc2bf;
  box-shadow:inset 3px 0 #c85b55
}
button.fit-lesson:hover:not(:disabled){
  background:var(--class-fill);outline:2px solid #6b9a81;
  outline-offset:-1px;z-index:4
}
button.fit-lesson:focus-visible{z-index:5}

/* only one quiet sentence below the timetable */
.simple-footer{
  min-height:26px;flex:none;display:flex;align-items:center;gap:8px;
  padding:0 2px;color:#63776b;font-size:10px
}
.simple-reason{flex:1;min-width:0;display:flex;align-items:center;gap:7px}
.simple-reason b{
  flex:none;padding:2px 7px;color:var(--v3-green);
  background:#e5efe9;border-radius:999px;font-size:9px
}
.simple-reason span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.simple-ok{flex:none;color:#537364;font-size:9px;font-weight:800}
.simple-issue{
  flex:none;min-height:23px;padding:3px 8px;
  color:#9b6a00;background:#fff5d9;border:0;border-radius:999px;
  box-shadow:none;font-size:9px;font-weight:900
}
.tiny-cancel{min-height:22px;padding:2px 7px;border-radius:6px;font-size:9px}

/* empty */
.canvas-empty{
  height:100%;display:flex;align-items:center;justify-content:center;
  flex-direction:column;gap:10px;padding:20px;color:#6d8175;text-align:center
}
.canvas-empty strong{color:var(--v3-green);font-size:18px}
.canvas-empty p{font-size:12px}
.canvas-empty button{min-height:34px;padding:6px 13px;font-size:12px}

/* overview */
.overview-grid{
  display:grid;grid-template-columns:43px repeat(var(--days),minmax(0,1fr));
  grid-template-rows:27px repeat(var(--hours),minmax(0,1fr));
  width:100%;height:100%
}
.overview-corner,.overview-head{
  display:grid;place-items:center;min-height:0;height:auto;padding:3px;
  color:var(--v3-green);background:#e1ebe5;border:0;
  border-right:1px solid #d2ddd6;border-bottom:1px solid #d2ddd6;
  border-radius:0;font-size:10px
}
.overview-time{
  padding:5px 2px;color:#75877d;background:#f6f9f7;
  border-bottom:1px solid #e3e9e5;font-size:8px;text-align:center
}
.overview-cell{
  min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:3px;padding:3px 2px;overflow:hidden;color:var(--v3-green);
  background:#eef5f0;border:0;border-left:1px solid #e0e8e3;
  border-bottom:1px solid #e0e8e3;border-radius:0;box-shadow:none;text-align:center
}
.overview-cell b{font-size:13px;line-height:1}
.overview-cell b small{display:block;font-size:7px;line-height:1.5;font-weight:normal}
.overview-cell>span{max-height:2.4em;overflow:hidden;font-size:7px;line-height:1.2}
.overview-cell.empty-cell{background:#fbfcfb;color:#cbd5cf;font-size:10px}

/* sheets */
#toolSheet{
  width:min(860px,calc(100vw - 34px));max-height:calc(100dvh - 40px);
  padding:0;overflow:hidden;border-radius:18px
}
#toolSheet[open]{display:flex;flex-direction:column}
.sheet-heading{
  flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:13px 17px;background:#f3f7f4;border-bottom:1px solid var(--line)
}
.sheet-heading h2{font-size:16px}
.sheet-heading button{min-height:30px;padding:4px 9px;border-radius:8px;font-size:11px}
#toolBody{min-height:0;padding:15px 17px;overflow:auto}
#toolBody .panel{margin:0;padding:0;border:0;background:transparent;box-shadow:none}
#toolBody .panel+.panel{margin-top:15px;padding-top:15px;border-top:1px solid var(--line)}
#toolBody .panel-head{margin-bottom:11px}
#toolBody .panel-head h2{font-size:15px}
#toolBody .panel-head p{max-width:540px;font-size:11px}

.settings-tabs{display:flex;gap:5px;margin-bottom:14px;flex-wrap:wrap}
.settings-tabs button{
  min-height:31px;padding:5px 12px;border-radius:8px;font-size:11px
}
.settings-tabs button.active{color:#fff;background:var(--v3-green)}
.sheet-actions{
  display:flex;align-items:center;justify-content:flex-end;gap:10px;
  margin-top:15px;padding-top:11px;border-top:1px solid var(--line)
}
.sheet-section{margin-bottom:16px}

.tool-grid,.quick-more{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px
}
.quick-more button{text-align:center;font-size:12px}
.compact-options{
  margin-top:16px;padding-top:14px;border-top:1px solid var(--line)
}
.compact-options h3{margin:0 0 8px;color:var(--v3-green);font-size:12px}
.mini-filter-row{display:flex;gap:8px}
.mini-filter-row select{flex:1;min-height:36px;font-size:12px}

.advanced{
  margin-top:12px;padding:9px 11px;background:#f7faf8;
  border:1px solid var(--line);border-radius:10px;font-size:11px
}
.advanced summary{cursor:pointer;color:var(--v3-green);font-weight:800}
.advanced .toolbar label{min-width:100px}

/* keep existing editors compact */
#modal{
  max-width:650px;max-height:calc(100dvh - 28px);
  padding:17px 18px;border-radius:16px
}
#modal h2{font-size:16px}
.modal-head{margin-bottom:13px}
.modal-actions{margin-top:14px}
.availability-fields{display:grid;gap:6px}
.availability-fields label{
  display:grid;grid-template-columns:26px 1fr;gap:8px;align-items:center
}
.availability-fields input{min-height:34px!important;padding:7px 10px;font-size:13px}
.availability-fields b{color:var(--v3-green);font-size:12px}
.editor-subhead{display:flex;align-items:center;justify-content:space-between;gap:9px;margin:14px 0 8px}
.editor-subhead small{font-size:10px}
.align-end{display:flex;align-items:flex-end}
.daychecks{align-items:center;gap:7px}
.subject-assignments{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.assignment-row{padding:8px;background:var(--soft2);border:1px solid var(--line);border-radius:8px}
.assignment-row label{display:flex;align-items:center;justify-content:space-between;gap:6px}
.assignment-row select{width:58%;min-height:33px;font-size:12px}
.assignment-row details{margin-top:6px;color:var(--muted);font-size:10px}
.assignment-row .daychecks{margin-top:7px}
.assignment-row .checklabel{font-size:11px}
.formgrid input:not([type=checkbox]),.formgrid select{min-height:35px;font-size:13px}
.modal-actions button{min-height:36px;font-size:12px}

#toolBody .pastebox{
  min-height:120px;max-height:165px;font-size:13px;border-radius:12px
}
.import-preview{max-height:40vh}
.import-preview table{font-size:11px}
.table-scroll{max-width:100%}
#toolBody .table-scroll td{padding:8px}
#toolBody .table-scroll th{padding:7px}
#toolBody .errors{margin:8px 0}
.import-brief{margin-top:8px;color:var(--muted);font-size:11px}
.import-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px}
.import-warnings{color:#80641c;font-size:11px}
.toast{bottom:15px;z-index:10000;max-height:35vh;overflow:auto;padding:10px 16px;font-size:12px}

@media(max-width:1050px){
  .brand #connection{display:none}
  .simple-current strong{max-width:220px}
  .head-actions button,.head-actions .home-btn{padding:5px 9px}
}
@media(max-width:760px){
  .app-shell{padding:7px;gap:4px}
  .page-top{height:auto;min-height:66px;flex-wrap:wrap;gap:5px}
  .brand{width:100%}
  .brand strong{font-size:15px}.brand h1{font-size:16px}
  .head-actions{width:100%;margin-left:0}
  .head-actions button{min-height:31px;height:31px;padding:4px 10px;font-size:10px}
  .head-actions .home-btn{margin-left:auto;min-height:29px;height:29px}
  .simple-switch{min-height:34px;gap:4px}
  .candidate-switch button{min-width:34px;min-height:27px;padding:3px 7px;font-size:10px}
  .simple-current strong{display:none}
  .simple-current span{font-size:9px}
  .simple-footer{font-size:9px}
  .fit-day-name span{display:none}
  #toolSheet{width:calc(100vw - 14px);max-height:calc(100dvh - 18px)}
  #toolBody{padding:11px}
  .sheet-heading{padding:10px 11px}
  .subject-assignments{grid-template-columns:1fr}
  .formgrid{grid-template-columns:1fr 1fr}
}
@media(max-height:520px) and (min-width:600px){
  .app-shell{padding:4px 7px;gap:3px}
  .page-top{height:32px;min-height:32px}
  .brand #connection,.head-actions .home-btn{display:none}
  .simple-switch{min-height:28px}
  .candidate-switch button{min-height:25px}
  .simple-footer{min-height:20px}
  button.fit-lesson small{display:none}
  button.fit-lesson>span{font-size:7px}
  button.fit-lesson strong{font-size:9px}
}
@media print{
  @page{size:A4 landscape;margin:6mm}
  html,body{height:auto!important;overflow:visible!important;background:#fff}
  .app-shell{height:195mm!important;max-width:none;padding:0;gap:2mm}
  .page-top{height:7mm;min-height:7mm}
  .head-actions,.simple-switch,#serverNotice,dialog,.toast{display:none!important}
  .brand #connection{display:none!important}
  .simple-footer{min-height:6mm}
  .fit-board{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .fit-table{height:100%}
  .fit-lesson{break-inside:avoid}
  #main{overflow:hidden}
}

/* V4 · simple common-time / combined-class controls */
.class-global-time{
  padding:10px 12px;
  color:#667970;
  background:#f4f8f5;
  border:1px solid #dce6e0;
  border-radius:10px;
  font-size:11px;
}
.class-global-time strong{color:#174d3b;font-size:12px}
#combinedFields{
  padding:11px 12px;
  background:#f7faf8;
  border:1px solid #dce6e0;
  border-radius:11px;
}
#combinedFields.hidden{display:none!important}
#combinedFields>.daychecks{margin-top:7px}


/* V5 · class summary: total weekly frequency + individual/shared breakdown */
.class-summary-table td{vertical-align:top}
.class-summary-table td:nth-child(1){width:18%}
.class-summary-table td:nth-child(2){width:22%}
.class-summary-table td:nth-child(3){width:auto}
.class-schedule-cell{font-size:12px;line-height:1.45}
.class-day-line{
  display:grid;
  grid-template-columns:26px minmax(0,1fr);
  gap:7px;
  align-items:start;
  margin:0 0 4px;
}
.class-day-line:last-child{margin-bottom:0}
.class-day-line>b{
  color:var(--green);
  font-size:11px;
}
.class-day-line>span{
  min-width:0;
  color:#35483e;
}
.combined-tag{
  display:inline-flex;
  align-items:center;
  padding:1px 5px;
  margin-right:2px;
  color:#174d3b;
  background:#e6f1ea;
  border:1px solid #cfe1d6;
  border-radius:999px;
  font-size:9px;
  font-weight:900;
}
.muted-summary{color:var(--muted);font-size:11px}
.subject-extra{margin-top:9px}
.subject-extra>.subject-assignments{margin-top:8px}

@media(max-width:760px){
  .class-summary-table td:nth-child(1),
  .class-summary-table td:nth-child(2){width:auto}
  .class-schedule-cell{font-size:10px}
}

/* ===== V6 · polished timetable / month / views / copy ===== */
.page-top{position:relative}
.month-nav{
  position:absolute;left:50%;transform:translateX(-50%);
  display:flex;align-items:center;gap:7px;
  min-height:34px;padding:3px 6px;
  background:#fff;border:1px solid #d7e2dc;border-radius:11px;
  box-shadow:0 5px 16px rgba(23,77,59,.06);
}
.month-nav button{
  width:28px;height:28px;min-height:28px;padding:0;
  border:0;border-radius:8px;background:#eef4f0;color:#174d3b;
  box-shadow:none;font-size:19px;font-weight:900
}
.month-nav strong{min-width:88px;text-align:center;color:#244c3b;font-size:12px;white-space:nowrap}
.month-state{padding:3px 6px;border-radius:999px;font-size:8px;font-weight:900;white-space:nowrap}
.month-state.saved{color:#276346;background:#e4f2e9}
.month-state.draft{color:#8a6500;background:#fff3cf}

.simple-switch{gap:8px}
.view-tools{display:flex;align-items:center;justify-content:flex-end;gap:5px;min-width:0}
.view-mode{display:flex;align-items:center;padding:3px;background:#edf3ef;border-radius:9px}
.view-mode button{
  min-height:27px;padding:3px 8px;border:0;border-radius:7px;
  color:#597064;background:transparent;box-shadow:none;font-size:9px;font-weight:900
}
.view-mode button.active{color:#fff;background:#2a674e}
.view-tools select{min-height:29px;height:29px;max-width:130px;padding:3px 25px 3px 7px;border-radius:8px;font-size:9px}
.view-tools>button{
  min-height:29px;padding:3px 9px;border:1px solid #d6e2db;border-radius:8px;
  background:#fff;color:#315344;box-shadow:none;font-size:9px;font-weight:900
}
.view-tools>button.active{color:#fff;background:#2b6b50;border-color:#2b6b50}

/* stronger class colours while keeping a calm parent-facing tone */
button.fit-lesson{
  color:#17382a;
  border-color:rgba(59,95,74,.28);
  box-shadow:0 1px 4px rgba(21,64,43,.08);
}
button.fit-lesson strong{font-weight:900;color:#173c2c}
button.fit-lesson>span{color:#304f40;font-weight:700}
button.fit-lesson.is-changed{border-color:#c39628;box-shadow:inset 3px 0 #c39628,0 1px 4px rgba(21,64,43,.07)}
button.fit-lesson.is-conflict{border-color:#c65e58;box-shadow:inset 3px 0 #c65e58,0 1px 4px rgba(21,64,43,.07)}

.copy-mode .fit-board{cursor:crosshair;user-select:none}
.copy-mode button.fit-lesson{cursor:crosshair!important}
button.fit-lesson.copy-selected{outline:3px solid #1f6a4b!important;outline-offset:-2px;filter:saturate(1.15)}
.copy-marquee{
  position:absolute;z-index:50;pointer-events:none;
  border:2px solid #1f6a4b;background:rgba(54,139,94,.13);border-radius:4px
}

.simulation-intro{
  display:flex;flex-direction:column;gap:4px;margin-bottom:14px;padding:12px 14px;
  color:#315244;background:#edf5f0;border:1px solid #d7e5dc;border-radius:12px
}
.simulation-intro strong{font-size:13px}.simulation-intro span{font-size:11px;color:#6d7f75}
.profile-option.recommended{border-color:#8dbca2;background:#f1f8f4}
.profile-option.recommended strong{color:#174d3b}

/* import screen language and shape */
#toolBody .pastebox{border:2px solid #c8d9cf;background:#fbfdfc}
#toolBody .pastebox:focus{border-color:#5f9d7c;box-shadow:0 0 0 3px rgba(41,111,79,.08)}

@media(max-width:1180px){
  .month-nav{position:static;transform:none;margin-left:auto}
  .head-actions{margin-left:0}
  .brand{flex:1}
}
@media(max-width:900px){
  .page-top{height:auto;min-height:76px;flex-wrap:wrap}
  .month-nav{order:2;margin:0}
  .head-actions{order:3;width:100%}
  .view-tools{gap:3px}
  .view-mode button{padding:3px 6px}
}
@media(max-width:640px){
  .month-nav strong{min-width:74px;font-size:11px}
  .month-state{display:none}
  .head-actions .import-main{font-size:0}.head-actions .import-main::after{content:'가져오기';font-size:10px}
  .head-actions .save-button{font-size:0}.head-actions .save-button::after{content:'저장';font-size:10px}
  .simple-switch{align-items:flex-start;flex-wrap:wrap}
  .candidate-switch{order:1}
  .view-tools{order:2;margin-left:auto;flex-wrap:wrap}
  .simple-current{order:3;width:100%;justify-content:flex-start}
}

@media print{
  .month-nav,.view-tools,.head-actions,.month-state{display:none!important}
  .brand h1::after{content:' · ' attr(data-print-month)}
  .simple-footer{display:none!important}
  .fit-board{border:0;box-shadow:none}
  button.fit-lesson{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}


/* ===== V7 · monthly page 1/2 + roster + level progress ===== */
.progress-button{
  background:#eef5f1!important;
  color:#174d3b!important;
  border-color:#d3e4da!important;
}

.sheet-pages{
  flex:none;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-height:29px;
}
.sheet-pages button{
  min-height:25px;
  padding:3px 10px;
  border:1px solid #d6e2db;
  border-radius:999px;
  background:#fff;
  color:#64796d;
  box-shadow:none;
  font-size:10px;
  font-weight:900;
}
.sheet-pages button.active{
  background:#174d3b;
  color:#fff;
  border-color:#174d3b;
}
.sheet-pages button:first-child,
.sheet-pages button:last-child{
  width:28px;
  padding:2px;
  font-size:16px;
}

button.fit-lesson.roster-card{
  justify-content:flex-start;
  padding-top:4px;
}
button.fit-lesson.roster-card strong{
  flex:none;
}
.roster-list{
  display:block!important;
  width:100%;
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  color:#35493f!important;
  font-size:var(--roster-font,7px)!important;
  line-height:1.16!important;
  letter-spacing:-.18px;
  font-weight:750;
  white-space:normal;
  word-break:keep-all;
}
button.fit-lesson.roster-card small{
  margin-top:auto;
  flex:none;
  color:#174d3b;
  font-weight:900;
}

.progress-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:13px;
}
.progress-toolbar>div{
  display:grid;
  gap:3px;
}
.progress-toolbar strong{
  color:#174d3b;
  font-size:15px;
}
.progress-toolbar span{
  color:#78887f;
  font-size:10px;
}
.progress-toolbar button{
  min-height:32px;
  padding:5px 10px;
  font-size:11px;
}

.progress-empty{
  padding:30px 14px;
  text-align:center;
}
.progress-empty h3{
  margin:0 0 8px;
  color:#174d3b;
}
.progress-empty p{
  margin:0 auto 16px;
  max-width:520px;
  color:#748078;
  font-size:11px;
  line-height:1.55;
}

.level-groups{
  display:grid;
  gap:12px;
}
.level-progress-group{
  overflow:hidden;
  border:1px solid #dce6e0;
  border-radius:13px;
  background:#fff;
}
.level-group-title{
  display:flex;
  align-items:center;
  gap:8px;
  padding:9px 11px;
  background:#f7faf8;
  border-bottom:1px solid #e2e9e5;
}
.level-group-title>span{
  width:13px;
  height:13px;
  border-radius:4px;
  background:var(--level-color);
  border:1px solid rgba(41,70,55,.12);
}
.level-group-title strong{
  color:#174d3b;
  font-size:12px;
}
.level-group-title small{
  margin-left:auto;
  color:#819087;
  font-size:9px;
}
.level-progress-row{
  display:grid;
  grid-template-columns:minmax(155px,1.1fr) minmax(120px,1fr) 52px minmax(150px,1.1fr);
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid #edf1ee;
}
.level-progress-row:last-child{border-bottom:0}
.level-row-main{
  min-width:0;
  display:grid;
  gap:2px;
}
.level-row-main strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#29463a;
  font-size:11px;
}
.level-row-main small{
  color:#849189;
  font-size:9px;
}
.level-bar{
  height:9px;
  overflow:hidden;
  border-radius:999px;
  background:#edf1ef;
}
.level-bar i{
  display:block;
  height:100%;
  border-radius:999px;
  background:var(--level-color);
}
.level-progress-row>b{
  text-align:right;
  color:#174d3b;
  font-size:11px;
}
.level-impact{
  color:#687a70;
  font-size:9.5px;
  line-height:1.35;
}
.level-impact.warn{
  color:#9b5f1b;
  font-weight:800;
}

@media(max-width:760px){
  .level-progress-row{
    grid-template-columns:1fr 48px;
  }
  .level-bar{grid-column:1/2}
  .level-progress-row>b{grid-column:2/3;grid-row:2}
  .level-impact{grid-column:1/-1}
}
@media print{
  .sheet-pages{display:none!important}
}

/* V7.1 roster completeness */
button.fit-lesson.roster-card{
  gap:1px!important;
  padding:3px 3px 2px!important;
}
button.fit-lesson.roster-card strong{
  font-size:8px!important;
  line-height:1.05!important;
  margin-bottom:1px;
}
button.fit-lesson.roster-card small{
  font-size:6.5px!important;
  line-height:1!important;
}


/* V7.3 Drag & Drop · move / swap */
.fit-lesson[draggable="true"]{
  cursor:grab;
}
.fit-lesson[draggable="true"]:active{
  cursor:grabbing;
}
.fit-lesson.dragging{
  opacity:.42!important;
  transform:scale(.97);
}
.fit-lesson.drop-target{
  outline:3px solid #174d3b!important;
  outline-offset:-2px;
  box-shadow:0 0 0 3px rgba(23,77,59,.15)!important;
}
[data-lane-day].drop-lane{
  background-image:linear-gradient(rgba(23,77,59,.045),rgba(23,77,59,.045));
  box-shadow:inset 0 0 0 2px rgba(23,77,59,.22);
}
.tt-dragging .fit-lesson:not(.dragging){
  transition:outline .08s ease,box-shadow .08s ease,opacity .08s ease;
}


/* V7.4 simplified UI */
.no-candidate-switch{justify-content:flex-end!important}
.no-candidate-switch .view-tools{margin-left:auto}
.roster-adjust-button{
  border-color:#dcc8aa!important;
  background:#fff8ed!important;
  color:#8d5918!important;
}
.roster-person.is-moved{
  color:var(--move-accent,#C06B25)!important;
  font-weight:950!important;
  text-decoration:underline 2px;
  text-underline-offset:1px;
}
.roster-person.is-absence{
  color:#87958d!important;
  text-decoration:line-through 1.5px;
  opacity:.8;
}
.roster-sep{color:#7f8e86}
.roster-legend{
  display:flex;
  gap:14px;
  align-items:center;
  margin:0 0 10px;
  font-size:10px;
}
.move-sample{
  color:#C06B25;
  font-weight:900;
  text-decoration:underline 2px;
}
.absence-sample{
  color:#87958d;
  text-decoration:line-through 1.5px;
}
.roster-color-dot{
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:50%;
  margin-right:5px;
  vertical-align:-1px;
}


/* ===== V7.6 RESTORE ===== */
.teacher-own-chip{
  display:inline-flex;align-items:center;min-height:30px;padding:5px 11px;
  border:1px solid #d7e4dc;border-radius:999px;background:#eef5f1;
  color:#174d3b;font-size:10px;font-weight:900
}
.teacher-preview-note{
  display:grid;gap:5px;padding:12px;border:1px solid #d9e6df;border-radius:12px;background:#f7faf8
}
.teacher-preview-note strong{color:#174d3b}
.teacher-preview-note span{color:#748078;font-size:10px;line-height:1.45}
.subject-delete-row{
  display:flex;align-items:center;gap:10px;margin-top:14px;padding-top:12px;border-top:1px solid #edf1ee
}
.subject-delete-row small{color:#7b8881;font-size:10px}
.danger-lite{border-color:#edc8c4!important;background:#fff5f4!important;color:#b23c35!important}

.freeform-create{
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;
  margin:12px 0;padding:13px;border:1px solid #cfe0d7;border-radius:13px;background:#f4f9f6
}
.freeform-create strong{display:block;color:#174d3b;margin-bottom:4px}
.freeform-create p{margin:0;color:#69776f;font-size:10px;line-height:1.45}

.tt-memo{
  position:fixed;right:14px;bottom:14px;z-index:35;width:min(315px,calc(100vw - 28px));
  max-height:min(460px,70vh);border:1px solid #e6dfbd;border-radius:16px;background:#fffef8;
  box-shadow:0 12px 35px rgba(64,54,10,.18);overflow:hidden
}
.tt-memo-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:11px 12px;background:#fff9d9;border-bottom:1px solid #eee4ae}
.tt-memo-head strong{font-size:13px;color:#594b17}
.tt-memo-head-actions{display:flex;align-items:center;gap:7px}
.tt-memo-hint{font-size:10px;color:#8b8157}
.tt-memo-toggle{
  min-height:26px!important;padding:4px 8px!important;border:1px solid #e5d995!important;
  border-radius:8px!important;background:#fffdf0!important;color:#6f611d!important;font-size:10px!important;font-weight:900!important;box-shadow:none!important
}
.tt-memo-list{max-height:300px;padding:8px;overflow:auto;display:grid;gap:5px}
.tt-memo-row{display:grid;grid-template-columns:1fr auto;gap:6px;align-items:start;padding:7px 8px;border-radius:9px;background:#fff}
.tt-memo-text{
  min-height:0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;
  color:#50491e!important;text-align:left!important;font-size:12px!important;line-height:1.45!important
}
.tt-memo-row.done .tt-memo-text{text-decoration:line-through;color:#999!important}
.tt-memo-del{min-height:0!important;padding:0!important;border:0!important;background:transparent!important;color:#a76767!important;box-shadow:none!important;font-weight:900!important}
.tt-memo-add{display:grid;grid-template-columns:1fr auto;gap:6px;padding:8px;border-top:1px solid #eee4ae;background:#fffef8}
.tt-memo-add input{min-width:0;padding:8px 9px;border:1px solid #e3dcae;border-radius:9px}
.tt-memo-add button{border:0!important;border-radius:9px!important;background:#7b6b22!important;color:#fff!important;font-weight:900!important;padding:8px 10px!important}
.tt-memo.collapsed{width:205px;max-height:48px}
.tt-memo.collapsed .tt-memo-body,.tt-memo.collapsed .tt-memo-hint{display:none}
.tt-memo.collapsed .tt-memo-head{border-bottom:0}

@media(max-width:760px){
  .freeform-create{grid-template-columns:1fr}
  .tt-memo{right:8px;bottom:8px;width:min(300px,calc(100vw - 16px))}
}
@media print{.tt-memo{display:none!important}}


/* =========================================================
   V7.6.1 · PHONE RESPONSIVE
   Desktop remains unchanged. These rules apply only <= 760px.
   ========================================================= */
@media(max-width:760px){

  html,body{
    width:100%;
    max-width:100%;
    overflow:hidden;
  }

  body{
    overscroll-behavior:none;
  }

  .app-shell{
    padding:
      max(6px,env(safe-area-inset-top))
      7px
      max(6px,env(safe-area-inset-bottom));
    gap:5px;
  }

  /* Header: row 1 = brand + month, row 2 = horizontally scrollable actions */
  .page-top{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-areas:
      "brand month"
      "actions actions";
    align-items:center;
    width:100%;
    min-height:92px!important;
    height:auto!important;
    gap:6px!important;
  }

  .brand{
    grid-area:brand;
    width:auto!important;
    min-width:0;
    gap:6px;
  }

  .brand strong{
    font-size:14px!important;
    letter-spacing:.06em;
  }

  .brand h1{
    font-size:16px!important;
    white-space:nowrap;
  }

  .brand #connection{
    display:none!important;
  }

  .month-nav{
    grid-area:month;
    position:static!important;
    transform:none!important;
    margin:0!important;
    justify-self:end;
    min-width:0;
  }

  .month-nav button{
    width:34px!important;
    min-width:34px!important;
    height:34px!important;
    min-height:34px!important;
  }

  .month-nav strong{
    min-width:78px!important;
    font-size:11px!important;
  }

  .head-actions{
    grid-area:actions;
    width:100%!important;
    margin:0!important;
    display:flex!important;
    flex-wrap:nowrap!important;
    gap:5px!important;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    padding:1px 0 2px;
  }

  .head-actions::-webkit-scrollbar,
  .view-tools::-webkit-scrollbar{
    display:none;
  }

  .head-actions button,
  .head-actions .home-btn{
    flex:0 0 auto;
    min-height:35px!important;
    height:35px!important;
    padding:5px 10px!important;
    font-size:10px!important;
    border-radius:10px!important;
  }

  /* Do not inject Korean text through CSS content.
     Some servers decode CSS strings incorrectly on phones (mojibake). */
  .head-actions .import-main,
  .head-actions .save-button{
    font-size:10px!important;
  }
  .head-actions .import-main::after,
  .head-actions .save-button::after{
    content:none!important;
    display:none!important;
  }

  .head-actions .home-btn{
    margin-left:0!important;
  }

  /* Server notice remains readable without taking over the screen */
  #serverNotice{
    max-height:58px!important;
    padding:6px 8px!important;
    font-size:9.5px!important;
    line-height:1.35;
    overflow:auto;
  }

  /* View selector: keep readable and swipeable */
  .simple-switch{
    min-height:36px!important;
    height:auto!important;
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    overflow:visible;
  }

  .view-tools{
    width:100%;
    min-width:0;
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:center;
    gap:4px!important;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    padding-bottom:1px;
  }

  .view-mode{
    flex:0 0 auto;
  }

  .view-mode button,
  .view-tools>button,
  .view-tools select{
    flex:0 0 auto;
    min-height:31px!important;
    height:31px!important;
    font-size:9.5px!important;
  }

  .simple-current{
    display:none!important;
  }

  /* Timetable becomes touch-scrollable rather than squeezing columns */
  .fit-board{
    overflow:auto!important;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-x pan-y;
    border-radius:12px;
  }

  .fit-table{
    overflow:visible!important;
  }

  /* Day view is the preferred phone view: 1 day × teachers */
  #boardHost[data-view-mode="day"] .fit-table{
    min-width:100%;
  }

  #boardHost[data-view-mode="day"] .fit-teacher{
    font-size:9px!important;
  }

  #boardHost[data-view-mode="day"] button.fit-lesson strong{
    font-size:9px!important;
  }

  #boardHost[data-view-mode="day"] button.fit-lesson>span{
    font-size:7px!important;
    line-height:1.12!important;
  }

  #boardHost[data-view-mode="day"] button.fit-lesson small{
    font-size:6.5px!important;
  }

  /* Teacher view = one teacher across the week; allow horizontal swipe */
  #boardHost[data-view-mode="teacher"] .fit-table{
    min-width:650px;
  }

  /* '전체' on phone becomes a swipeable overview instead of microscopic cells */
  #boardHost[data-view-mode="all"] .overview-grid{
    min-width:720px;
  }

  #boardHost[data-view-mode="all"].is-overview{
    overflow-x:auto!important;
  }

  .fit-ruler{
    position:sticky;
    left:0;
    z-index:12;
  }

  .fit-corner,
  .fit-ruler-body{
    background:#f7faf8;
  }

  /* Bottom page switch remains accessible */
  .sheet-pages{
    min-height:34px!important;
    padding-bottom:max(2px,env(safe-area-inset-bottom));
  }

  .sheet-pages button{
    min-height:29px!important;
  }

  /* Quick memo stays out of the page selector area */
  .tt-memo{
    right:8px!important;
    bottom:62px!important;
    width:min(285px,calc(100vw - 16px))!important;
    max-height:42vh!important;
  }

  .tt-memo.collapsed{
    width:155px!important;
    max-height:44px!important;
  }

  .tt-memo-head{
    min-height:42px;
    padding:8px 10px!important;
  }

  .tt-memo-head strong{
    font-size:11px!important;
  }

  /* Sheets/modal panels feel native on mobile */
  #toolSheet{
    width:calc(100vw - 10px)!important;
    max-width:none!important;
    max-height:calc(100dvh - 10px)!important;
    margin:5px!important;
    border-radius:14px!important;
  }

  #toolBody{
    padding:10px!important;
    -webkit-overflow-scrolling:touch;
  }

  .formgrid{
    grid-template-columns:1fr!important;
  }

  .grid2{
    grid-template-columns:1fr!important;
  }

  .freeform-create{
    grid-template-columns:1fr!important;
  }
}

/* Slightly larger phones / small tablets */
@media(min-width:761px) and (max-width:980px){
  .head-actions{
    overflow-x:auto;
    scrollbar-width:none;
  }
  .head-actions::-webkit-scrollbar{display:none}
}


/* =========================================================
   V7.6.2 · HANGUL / MOBILE TEXT SAFETY
   Prevent Korean glyph clipping and bad fallback on Android/Samsung browsers.
   ========================================================= */

html,body,button,input,select,textarea{
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Malgun Gothic",
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
}

body{
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

button,input,select,textarea{
  font-synthesis:weight style;
}

@media(max-width:760px){

  /* Korean glyphs can clip vertically when a fixed 1.0~1.1 line-height is used. */
  .brand h1,
  .head-actions button,
  .head-actions .home-btn,
  .month-nav strong,
  .view-mode button,
  .view-tools>button,
  .view-tools select,
  .fit-day-name,
  .fit-teacher,
  button.fit-lesson,
  button.fit-lesson strong,
  button.fit-lesson>span,
  button.fit-lesson small,
  .roster-list,
  .roster-person,
  .sheet-pages button{
    line-height:1.32!important;
  }

  /* Header labels: do not cut the top/bottom of Hangul glyphs. */
  .head-actions button,
  .head-actions .home-btn{
    height:auto!important;
    min-height:36px!important;
    padding-top:7px!important;
    padding-bottom:7px!important;
    overflow:visible!important;
    font-size:10.5px!important;
    font-weight:800!important;
  }

  .month-nav strong{
    line-height:1.35!important;
    font-size:11.5px!important;
  }

  .view-mode button,
  .view-tools>button,
  .view-tools select{
    height:auto!important;
    min-height:32px!important;
    padding-top:5px!important;
    padding-bottom:5px!important;
    font-size:10px!important;
    font-weight:800!important;
  }

  /* Timetable headers */
  .fit-day-name{
    min-height:28px!important;
    height:28px!important;
    padding:3px 2px!important;
    font-size:10.5px!important;
    font-weight:800!important;
  }

  .fit-teacher{
    min-height:24px!important;
    height:24px!important;
    padding:3px 2px!important;
    font-size:9px!important;
    font-weight:700!important;
  }

  /* Lesson-card Korean:
     - keep complete Korean syllables together
     - avoid overflow-wrap:anywhere splitting glyph layout
     - avoid ultra-small fonts that Samsung browsers rasterize poorly */
  button.fit-lesson{
    padding:4px 2px!important;
    font-size:9px!important;
    font-weight:700!important;
    letter-spacing:0!important;
  }

  button.fit-lesson strong{
    font-size:9.5px!important;
    font-weight:800!important;
    word-break:keep-all!important;
    overflow-wrap:break-word!important;
    letter-spacing:0!important;
  }

  button.fit-lesson>span{
    font-size:8.2px!important;
    font-weight:600!important;
    word-break:keep-all!important;
    overflow-wrap:break-word!important;
    letter-spacing:0!important;
  }

  button.fit-lesson small{
    font-size:7.4px!important;
    font-weight:600!important;
    word-break:keep-all!important;
    overflow-wrap:break-word!important;
  }

  button.fit-lesson.is-short strong{
    font-size:8.5px!important;
  }

  /* Roster names must stay readable and complete */
  .roster-list,
  .roster-person{
    word-break:keep-all!important;
    overflow-wrap:break-word!important;
    letter-spacing:0!important;
  }

  /* Do not truncate Korean status labels with ellipsis in the phone toolbar. */
  .simple-current strong,
  .teacher-own-chip{
    text-overflow:clip!important;
    overflow:visible!important;
    white-space:nowrap!important;
    line-height:1.35!important;
  }

  /* Some Samsung WebView builds clip bold Korean at the edge of buttons. */
  button{
    text-indent:0;
  }
}


/* =========================================================
   V7.6.3 · PERSISTENT SAVE VAULT + MOBILE MEMO HIDE
   ========================================================= */

.vault-button{
  white-space:nowrap;
}

.local-vault-panel .vault-note{
  margin:0 0 10px;
  background:#f6faf7;
  border-color:#d9e7df;
  color:#496057;
}

.mobile-memo-open{
  display:none!important;
}

.tt-memo.fully-hidden{
  display:none!important;
}

@media(max-width:760px){
  .mobile-memo-open{
    display:inline-flex!important;
  }

  .tt-memo.fully-hidden{
    display:none!important;
    pointer-events:none!important;
  }

  /* When visible, memo remains above the bottom page selector.
     When hidden, it occupies no screen space at all. */
  .tt-memo:not(.fully-hidden){
    bottom:62px!important;
  }

  .local-vault-panel .panel-head{
    align-items:stretch;
  }

  .local-vault-panel .panel-head .primary{
    width:100%;
  }

  .local-vault-panel table{
    min-width:610px;
  }
}


/* =========================================================
   V7.6.4 · DB / SAVE STATUS TAB
   ========================================================= */
.db-status-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:9px;
  margin:10px 0 12px;
}
.db-status-card{
  display:grid;
  gap:4px;
  padding:12px;
  border:1px solid #dfe8e3;
  border-radius:12px;
  background:#f8fbf9;
}
.db-status-card span{
  color:#6d7d74;
  font-size:10px;
  font-weight:800;
}
.db-status-card strong{
  color:#174d3b;
  font-size:15px;
}
.db-status-card small{
  color:#849088;
  font-size:9px;
}
.db-status-card.ok{
  border-color:#bcd8c9;
  background:#f2f8f4;
}
.db-status-card.warn{
  border-color:#efcfca;
  background:#fff6f4;
}
.db-status-card.warn strong{
  color:#b3443d;
}
.db-error-box{
  margin:8px 0 12px;
  white-space:pre-wrap;
}
.db-actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:10px 0 14px;
}
.db-help{
  padding:12px;
  border:1px solid #e5ebe7;
  border-radius:12px;
  background:#fbfcfb;
  color:#5f6c65;
  font-size:10px;
  line-height:1.55;
}
.db-help strong{
  color:#174d3b;
}
.db-help p{
  margin:5px 0 0;
}
@media(max-width:760px){
  .db-status-grid{
    grid-template-columns:1fr 1fr;
  }
  .db-actions{
    display:grid;
    grid-template-columns:1fr;
  }
  .db-actions button{
    width:100%;
  }
}


/* =========================================================
   V7.7.0 · MAXIMA ADMIN WORKSPACE SKIN
   Matches the Push Notification admin UI visual language.
   Functional timetable layout remains unchanged.
   ========================================================= */

:root{
  --mx-green:#164c3d;
  --mx-dark:#10392e;
  --mx-mint:#eaf2ed;
  --mx-ink:#213a31;
  --mx-muted:#7c8982;
  --mx-line:#e3e9e3;
  --mx-bg:#f5f7f3;
  --mx-white:#fff;
  --mx-red:#a44d41;
}

html,body{
  background:var(--mx-bg)!important;
  color:var(--mx-ink)!important;
  font-family:
    Inter,
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Malgun Gothic",
    "Segoe UI",
    sans-serif!important;
}

body{
  font-size:14px;
  line-height:1.6;
}

/* topbar */
.maxima-topbar{
  height:78px;
  flex:none;
  background:var(--mx-dark);
  color:#fff;
  position:relative;
  z-index:40;
}

.maxima-topbar-inner{
  width:min(100%,1720px);
  height:100%;
  margin:0 auto;
  padding:0 28px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}

.maxima-brand{
  display:flex;
  align-items:center;
  gap:13px;
  min-width:0;
}

.maxima-brandmark{
  display:grid;
  place-items:center;
  width:33px;
  height:33px;
  border:1px solid #749183;
  border-radius:9px;
  font:700 21px Georgia,serif;
  color:#dce8d9;
  flex:none;
}

.maxima-wordmark{
  font-size:23px;
  font-weight:750;
  letter-spacing:4px;
  color:#fff;
  white-space:nowrap;
}

.maxima-workspace{
  border-left:1px solid #557166;
  padding-left:20px;
  color:#b5c8bd;
  font-size:10px;
  letter-spacing:2px;
  white-space:nowrap;
}

.top-home-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:36px;
  min-height:32px;
  padding:5px 10px;
  border:1px solid #dfe5dc;
  border-radius:7px;
  background:#fff;
  color:var(--mx-green);
  text-decoration:none;
  font-size:10px;
  font-weight:700;
}

.top-home-btn:hover{
  background:#f1f6ee;
}

.maxima-account{
  display:flex;
  align-items:center;
  gap:11px;
  min-width:150px;
  justify-content:flex-end;
  font-size:12px;
}

.maxima-avatar{
  width:33px;
  height:33px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#35594b;
  color:#e1eccc;
}

.maxima-account strong{
  display:block;
  color:#fff;
  font-size:11px;
  font-weight:600;
}

.maxima-account small{
  display:block;
  color:#aec1b6;
  font-size:10px;
}

/* shell */
.app-shell{
  width:min(100%,1720px)!important;
  max-width:1720px!important;
  height:calc(100dvh - 78px)!important;
  margin:0 auto!important;
  padding:24px 28px 20px!important;
  gap:9px!important;
}

.timetable-breadcrumb{
  flex:none;
  display:flex;
  align-items:center;
  gap:11px;
  color:var(--mx-muted);
  font-size:11px;
  min-height:22px;
}

.timetable-breadcrumb b{
  color:#50675b;
  font-weight:500;
}

.timetable-heading{
  flex:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  min-height:78px;
}

.timetable-heading-copy{
  min-width:0;
}

.timetable-eyebrow{
  color:#7c9182;
  font-size:10px;
  font-weight:700;
  letter-spacing:2px;
}

.timetable-title-line{
  display:flex;
  align-items:center;
  gap:10px;
  margin:5px 0 3px;
}

.timetable-title-line h1{
  margin:0;
  color:var(--mx-ink);
  font-size:27px;
  line-height:1.25;
  letter-spacing:-1px;
}

.timetable-heading-copy p{
  margin:0;
  color:#7b877e;
  font-size:11px;
}

.connection-pill{
  display:inline-flex;
  align-items:center;
  min-height:25px;
  padding:3px 8px;
  border:1px solid #dce5da;
  border-radius:7px;
  background:#fff;
  color:#60756a;
  font-size:9px;
  font-weight:700;
  white-space:nowrap;
}

.connection-pill.amber{
  border-color:#eadcb4;
  background:#fff8e6;
  color:#95752c;
}

.timetable-month-wrap{
  flex:none;
  display:flex;
  align-items:center;
}

.month-nav{
  position:static!important;
  transform:none!important;
  display:flex!important;
  align-items:center!important;
  gap:4px!important;
  padding:4px!important;
  border:1px solid var(--mx-line)!important;
  border-radius:10px!important;
  background:var(--mx-white)!important;
  box-shadow:0 3px 7px rgba(21,61,44,.02)!important;
}

.month-nav button{
  min-width:34px!important;
  width:34px!important;
  height:34px!important;
  min-height:34px!important;
  padding:0!important;
  border:0!important;
  border-radius:7px!important;
  background:#eff4ed!important;
  color:#436450!important;
  font-size:17px!important;
  box-shadow:none!important;
}

.month-nav strong{
  min-width:96px!important;
  color:var(--mx-ink)!important;
  font-size:12px!important;
  text-align:center!important;
}

.month-state{
  margin-left:2px!important;
  padding:4px 8px!important;
  border-radius:6px!important;
  border:0!important;
  background:#f3f5f1!important;
  color:#7b877e!important;
  font-size:9px!important;
  font-weight:700!important;
}

.month-state.saved{
  background:#eaf2ed!important;
  color:var(--mx-green)!important;
}

/* action toolbar */
.timetable-toolbar{
  flex:none;
  min-height:49px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:7px 9px 7px 11px;
  border:1px solid var(--mx-line);
  border-radius:11px;
  background:var(--mx-white);
  box-shadow:0 3px 7px rgba(21,61,44,.02);
}

.timetable-toolbar .head-actions{
  margin:0!important;
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
  overflow-x:auto;
  scrollbar-width:none;
}

.timetable-toolbar .head-actions::-webkit-scrollbar{
  display:none;
}

.timetable-toolbar .head-actions button{
  flex:0 0 auto;
  min-height:34px!important;
  height:34px!important;
  padding:7px 13px!important;
  border:1px solid #dfe5dc!important;
  border-radius:7px!important;
  background:#fff!important;
  color:var(--mx-green)!important;
  box-shadow:none!important;
  font-size:10.5px!important;
  font-weight:650!important;
  white-space:nowrap;
}

.timetable-toolbar .head-actions button:hover{
  background:#f1f6ee!important;
}

.timetable-toolbar .head-actions .primary{
  border-color:var(--mx-green)!important;
  background:var(--mx-green)!important;
  color:#fff!important;
}

.timetable-toolbar .head-actions .save-button{
  border-color:#bbcfbf!important;
  background:#eef5ed!important;
  color:#355f48!important;
}

.toolbar-access{
  flex:none;
  display:inline-flex;
  align-items:center;
  min-height:32px;
  padding:6px 11px;
  border:1px solid #dce5da;
  border-radius:7px;
  color:#65766d;
  background:#fbfcfa;
  font-size:10px;
  white-space:nowrap;
}

#serverNotice{
  flex:none;
  border:1px solid #ecd7d1!important;
  background:#fff5f2!important;
  color:#a44d41!important;
  border-radius:8px!important;
  font-size:10px!important;
  line-height:1.5!important;
  padding:7px 10px!important;
}

#main{
  gap:7px!important;
}

/* small control strip */
.simple-switch{
  min-height:40px!important;
  padding:5px 8px!important;
  border:1px solid var(--mx-line);
  border-radius:10px;
  background:#fff;
}

.view-mode{
  display:flex;
  gap:4px;
  padding:3px;
  border-radius:8px;
  background:#f3f5f1;
}

.view-mode button{
  border:1px solid transparent!important;
  border-radius:6px!important;
  background:transparent!important;
  color:#7c887e!important;
  font-size:10px!important;
  font-weight:600!important;
}

.view-mode button.active{
  border-color:#dce6da!important;
  background:#fff!important;
  color:var(--mx-green)!important;
  box-shadow:0 2px 4px rgba(35,65,44,.025)!important;
}

.view-tools>button,
.view-tools select{
  border:1px solid #dfe5dc!important;
  border-radius:7px!important;
  background:#fff!important;
  color:var(--mx-green)!important;
  box-shadow:none!important;
}

/* board card */
.fit-board{
  border:1px solid var(--mx-line)!important;
  border-radius:13px!important;
  background:#fff!important;
  box-shadow:0 3px 7px rgba(21,61,44,.02)!important;
}

.fit-day-name{
  background:#edf3ef!important;
  color:#436450!important;
  border-bottom:1px solid var(--mx-line)!important;
}

.fit-day-name:hover{
  background:#e8f0eb!important;
}

.fit-teacher{
  background:#fafbf8!important;
  color:#63746a!important;
  border-bottom:1px solid var(--mx-line)!important;
}

.fit-ruler{
  background:#fafbf8!important;
  border-right:1px solid var(--mx-line)!important;
}

.fit-corner{
  border-bottom:1px solid var(--mx-line)!important;
  color:#8b9788!important;
}

button.fit-lesson{
  border:1px solid rgba(78,108,91,.22)!important;
  border-radius:7px!important;
  box-shadow:0 2px 5px rgba(35,65,44,.04)!important;
}

button.fit-lesson:hover:not(:disabled){
  outline:2px solid #80ab92!important;
  outline-offset:-1px!important;
}

button.fit-lesson.is-conflict{
  border-color:#dfc2bf!important;
  box-shadow:inset 3px 0 #c85b55!important;
}

/* footer / page switch */
.simple-footer{
  color:#7b877e!important;
}

.simple-reason b{
  background:#eef3e9!important;
  color:#436450!important;
}

.sheet-pages button{
  border:1px solid #dfe5dc!important;
  border-radius:7px!important;
  background:#fff!important;
  color:var(--mx-green)!important;
  box-shadow:none!important;
}

.sheet-pages button.active{
  background:var(--mx-green)!important;
  border-color:var(--mx-green)!important;
  color:#fff!important;
}

/* tool sheet / modal = same card language */
#toolSheet,
#modal{
  border:1px solid var(--mx-line)!important;
  border-radius:15px!important;
  background:#fff!important;
  color:var(--mx-ink)!important;
  box-shadow:0 25px 80px rgba(18,56,41,.18)!important;
}

#toolSheet::backdrop,
#modal::backdrop{
  background:rgba(22,55,44,.40)!important;
  backdrop-filter:blur(3px);
}

.sheet-heading,
.modal-head{
  padding:17px 20px!important;
  border-bottom:1px solid var(--mx-line)!important;
  background:#fafbf8!important;
}

.sheet-heading h2,
.modal-head h2{
  color:var(--mx-ink)!important;
  font-size:17px!important;
}

.sheet-heading button,
.modal-head button{
  border:1px solid #dfe5dc!important;
  border-radius:7px!important;
  background:#fff!important;
  color:var(--mx-green)!important;
  box-shadow:none!important;
}

#toolBody,
#modalBody{
  background:#fff!important;
}

#toolBody input,
#toolBody select,
#toolBody textarea,
#modalBody input,
#modalBody select,
#modalBody textarea{
  border:1px solid #dce4db!important;
  border-radius:7px!important;
  background:#fff!important;
  color:var(--mx-ink)!important;
}

/* memo */
.tt-memo{
  border:1px solid #e6dfbd!important;
  border-radius:11px!important;
  background:#fffef8!important;
  box-shadow:0 12px 35px rgba(64,54,10,.18)!important;
}

.tt-memo-head{
  background:#fff9d9!important;
  border-bottom:1px solid #eee4ae!important;
}

/* toast */
.toast{
  border-radius:9px!important;
  background:var(--mx-dark)!important;
  color:#fff!important;
  box-shadow:0 8px 25px rgba(18,60,50,.19)!important;
}

/* responsive */
@media(max-width:850px){
  .maxima-topbar-inner{
    padding:0 20px;
  }

  .maxima-workspace{
    display:none;
  }

  .app-shell{
    padding:20px!important;
  }

  .timetable-heading{
    gap:14px;
  }

  .timetable-title-line h1{
    font-size:24px;
  }
}

@media(max-width:680px){
  .maxima-topbar{
    height:67px;
  }

  .maxima-topbar-inner{
    padding:0 16px;
  }

  .maxima-wordmark{
    font-size:20px;
  }

  .maxima-account{
    min-width:auto;
  }

  .maxima-account small{
    display:none;
  }

  .app-shell{
    height:calc(100dvh - 67px)!important;
    padding:14px 12px 10px!important;
    gap:7px!important;
  }

  .timetable-breadcrumb{
    display:none;
  }

  .timetable-heading{
    min-height:68px;
    align-items:flex-start;
  }

  .timetable-eyebrow{
    font-size:8px;
    letter-spacing:1.3px;
  }

  .timetable-title-line{
    margin-top:3px;
  }

  .timetable-title-line h1{
    font-size:22px;
  }

  .timetable-heading-copy p{
    display:none;
  }

  .connection-pill{
    display:none;
  }

  .timetable-month-wrap{
    padding-top:1px;
  }

  .month-nav strong{
    min-width:74px!important;
    font-size:10px!important;
  }

  .month-nav button{
    width:31px!important;
    min-width:31px!important;
    height:31px!important;
    min-height:31px!important;
  }

  .timetable-toolbar{
    min-height:42px;
    padding:5px!important;
    overflow:hidden;
  }

  .timetable-toolbar .head-actions{
    gap:5px!important;
  }

  .timetable-toolbar .head-actions button{
    min-height:32px!important;
    height:32px!important;
    padding:5px 10px!important;
    font-size:9.5px!important;
  }

  .toolbar-access{
    display:none!important;
  }

  #serverNotice{
    max-height:48px!important;
    overflow:auto;
  }

  .simple-switch{
    min-height:36px!important;
    padding:3px 5px!important;
  }

  .fit-board{
    border-radius:11px!important;
  }

  #toolSheet{
    border-radius:12px!important;
  }
}


/* V7.8.0 · Mon-Fri / taller desktop board */
@media(min-width:900px){
  html,body{height:auto!important;min-height:100%!important;overflow:auto!important}
  .maxima-topbar-inner,.app-shell{width:min(100%,1500px)!important;max-width:1500px!important}
  .app-shell{height:auto!important;min-height:calc(100dvh - 78px)!important;overflow:visible!important;padding:20px 26px 24px!important;gap:8px!important}
  .timetable-heading{min-height:66px!important}
  .timetable-toolbar{min-height:45px!important}
  #main{flex:none!important;overflow:visible!important}
  .fit-board{flex:none!important;height:clamp(570px,66vh,720px)!important;min-height:570px!important}
  .simple-switch{min-height:38px!important}
  .fit-day-name{height:30px!important;min-height:30px!important;font-size:11px!important}
  .fit-teacher{height:24px!important;font-size:9px!important}
  button.fit-lesson strong{font-size:10.5px!important}
  button.fit-lesson>span{font-size:8.5px!important}
  button.fit-lesson small{font-size:7.5px!important}
}
.fit-board.is-empty-board{background:#fff!important}


/* =========================================================
   V7.9.0 · COMPACT 5-DAY BOARD + UNCLIPPED BREAK LABELS
   ========================================================= */

@media(min-width:900px){
  .maxima-topbar-inner,
  .app-shell{
    width:min(100%,1320px)!important;
    max-width:1320px!important;
  }

  .fit-board{
    height:clamp(620px,70vh,760px)!important;
    min-height:620px!important;
  }

  .fit-day-name,
  .fit-teacher,
  .fit-block,
  button.fit-lesson,
  button.fit-lesson strong,
  button.fit-lesson>span,
  button.fit-lesson small{
    text-align:center!important;
  }

  .fit-block{
    overflow:visible!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    white-space:nowrap!important;
    padding:0 1px!important;
    font-size:7.5px!important;
    line-height:1!important;
    z-index:5!important;
  }

  button.fit-lesson{
    justify-content:center!important;
    align-items:center!important;
  }

  button.fit-lesson strong,
  button.fit-lesson>span,
  button.fit-lesson small{
    width:100%;
    margin-left:auto;
    margin-right:auto;
  }
}

.vault-section{
  margin-top:13px;
  padding-top:13px;
  border-top:1px solid #e5ebe7;
}
.vault-section:first-of-type{
  margin-top:0;
  padding-top:0;
  border-top:0;
}
.vault-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
.vault-section-head strong{
  color:#174d3b;
  font-size:12px;
}
.vault-section-head span{
  color:#7c8982;
  font-size:9px;
}


/* =========================================================
   V7.9.2 · VIEW TOOLBAR + TALLER TIMETABLE
   ========================================================= */

/* Desktop: slightly taller, still compact width from V7.9 */
@media(min-width:900px){
  .fit-board{
    height:clamp(680px,74vh,840px)!important;
    min-height:680px!important;
  }
}

/* Phone: 전체 / 강사별 / 요일별 must always be visible.
   The timetable is intentionally tall; the page may scroll vertically. */
@media(max-width:760px){

  html,
  body{
    height:auto!important;
    min-height:100%!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }

  .app-shell{
    height:auto!important;
    min-height:100dvh!important;
    overflow:visible!important;
  }

  #main{
    overflow:visible!important;
  }

  .simple-switch{
    overflow:visible!important;
    height:auto!important;
    min-height:0!important;
    padding:5px!important;
  }

  .view-tools{
    display:flex!important;
    flex-wrap:wrap!important;
    width:100%!important;
    overflow:visible!important;
    gap:5px!important;
  }

  /* First row: the three view modes. Never horizontally clip '전체'. */
  .view-mode{
    order:1;
    flex:0 0 100%!important;
    width:100%!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:4px!important;
    padding:3px!important;
    overflow:visible!important;
  }

  .view-mode button{
    width:100%!important;
    min-width:0!important;
    min-height:34px!important;
    height:auto!important;
    padding:6px 4px!important;
    font-size:10.5px!important;
    line-height:1.25!important;
    text-align:center!important;
    white-space:nowrap!important;
  }

  /* Second row: selector / print / memo. */
  .view-tools>select{
    order:2;
    flex:1 1 130px!important;
    max-width:none!important;
    min-width:115px!important;
    min-height:33px!important;
    height:auto!important;
  }

  .view-tools>.print-button,
  .view-tools>.mobile-memo-open,
  .view-tools>.roster-adjust-button{
    order:3;
    flex:0 0 auto!important;
    min-height:33px!important;
    height:auto!important;
  }

  /* Make the actual timetable vertically readable instead of squat. */
  .fit-board{
    height:72dvh!important;
    min-height:640px!important;
    max-height:820px!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch;
  }

  .fit-table{
    height:100%!important;
    min-height:100%!important;
  }

  /* Keep the page switch under the taller board. */
  .sheet-pages{
    position:relative!important;
    min-height:40px!important;
    margin-top:4px!important;
  }
}

@media(max-width:420px){
  .fit-board{
    min-height:660px!important;
    height:74dvh!important;
  }
}


/* =========================================================
   V7.9.3 · MOBILE GRAPHICAL MAP + ROSTER DETAIL
   ========================================================= */

/* Page [2] roster cards: vertical names, easy to scan */
.roster-card{
  cursor:pointer!important;
}
.roster-card .roster-list{
  width:100%;
  max-width:100%;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:1px!important;
  overflow:hidden!important;
  line-height:1.12!important;
}
.roster-card .roster-person{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  color:#294238;
  font-size:7.5px!important;
  font-weight:750!important;
  line-height:1.12!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  text-align:center!important;
}
.roster-card .roster-person.is-moved{
  color:var(--move-accent,#C06B25)!important;
  text-decoration:underline 1.5px;
}
.roster-card .roster-person.is-absence{
  color:#87958d!important;
  text-decoration:line-through 1.5px;
}
.roster-more{
  display:block;
  margin-top:1px;
  color:#60786b;
  font-size:7px;
  font-weight:900;
}
.roster-empty{
  color:#8c9a92;
  font-size:7px;
}

/* Full roster dialog */
.roster-detail{
  min-width:0;
}
.roster-detail-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:0 0 12px;
  border-bottom:1px solid #e5ebe7;
}
.roster-detail-head>div{
  display:grid;
  gap:3px;
}
.roster-detail-head strong{
  color:#174d3b;
  font-size:18px;
}
.roster-detail-head span{
  color:#77877e;
  font-size:11px;
}
.roster-detail-count{
  flex:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:48px;
  min-height:32px;
  padding:4px 9px;
  border-radius:999px;
  background:#edf4ef;
  color:#174d3b!important;
  font-size:11px!important;
  font-weight:900;
}
.roster-detail-subject{
  margin:10px 0 7px;
  color:#5f7267;
  font-size:11px;
  font-weight:700;
}
.roster-detail-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  margin-top:10px;
}
.roster-detail-person{
  display:grid;
  grid-template-columns:24px minmax(0,1fr) auto;
  align-items:center;
  gap:7px;
  min-height:38px;
  padding:7px 9px;
  border:1px solid #dfe8e3;
  border-radius:9px;
  background:#f9fbfa;
}
.roster-detail-person>b{
  display:grid;
  place-items:center;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#e9f2ed;
  color:#37614d;
  font-size:9px;
}
.roster-detail-person>span{
  color:#263d31;
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
}
.roster-detail-person>small{
  color:#7a8a81;
  font-size:8px;
}
.roster-detail-person.is-moved{
  border-color:#e4c8a8;
  background:#fff8ef;
}
.roster-detail-person.is-moved>span{
  color:#a95d1d;
}
.roster-detail-person.is-absence>span{
  color:#87958d;
  text-decoration:line-through 1.5px;
}
.roster-detail-actions{
  margin-top:14px;
  padding:12px 0 0!important;
  border-top:1px solid #e5ebe7;
}

/* Mobile: graphical timetable with teacher names, swipe day by day */
@media(max-width:760px){

  /* Never use the text-only overview presentation on phone */
  #boardHost.is-overview .overview-grid{
    display:none!important;
  }

  #boardHost{
    overflow-x:auto!important;
    overflow-y:auto!important;
    scroll-snap-type:x proximity;
    -webkit-overflow-scrolling:touch;
  }

  #boardHost .fit-table{
    width:max-content!important;
    min-width:100%!important;
    height:100%!important;
    overflow:visible!important;
  }

  #boardHost .fit-days{
    flex:none!important;
    width:max-content!important;
    min-width:0!important;
  }

  /* 전체: one whole weekday per phone viewport, with every teacher visible */
  #boardHost[data-view-mode="all"] .fit-day{
    flex:0 0 calc(100vw - 64px)!important;
    width:calc(100vw - 64px)!important;
    min-width:320px!important;
    max-width:410px!important;
    scroll-snap-align:start;
    scroll-snap-stop:normal;
  }

  #boardHost[data-view-mode="all"] .fit-lanes{
    width:100%!important;
  }

  #boardHost[data-view-mode="all"] .fit-lane-wrap{
    flex:1 1 0!important;
    min-width:0!important;
  }

  #boardHost[data-view-mode="all"] .fit-teacher{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:25px!important;
    height:25px!important;
    padding:3px 1px!important;
    overflow:visible!important;
    text-overflow:clip!important;
    white-space:nowrap!important;
    font-size:9.5px!important;
    font-weight:900!important;
    color:#345949!important;
    background:#f6f9f7!important;
  }

  #boardHost[data-view-mode="all"] .fit-day-name{
    position:sticky;
    top:0;
    z-index:14;
    min-height:30px!important;
    height:30px!important;
    font-size:11px!important;
  }

  /* Teacher view: one teacher, still swipe one day at a time */
  #boardHost[data-view-mode="teacher"] .fit-table{
    min-width:100%!important;
  }

  #boardHost[data-view-mode="teacher"] .fit-day{
    flex:0 0 calc(100vw - 64px)!important;
    width:calc(100vw - 64px)!important;
    min-width:300px!important;
    max-width:410px!important;
    scroll-snap-align:start;
  }

  /* Day view: one weekday fills the viewport */
  #boardHost[data-view-mode="day"] .fit-day{
    flex:0 0 calc(100vw - 64px)!important;
    width:calc(100vw - 64px)!important;
    min-width:300px!important;
  }

  #boardHost .fit-ruler{
    position:sticky!important;
    left:0!important;
    z-index:20!important;
  }

  .roster-card .roster-person{
    font-size:8px!important;
  }

  .roster-detail-list{
    grid-template-columns:1fr!important;
  }

  .roster-detail-person>span{
    font-size:14px!important;
  }
}


/* =========================================================
   V7.9.6 · PHONE DATA RESTORE + EXACT ACTION ALIGNMENT
   ========================================================= */

/* Exact same flex box for 명단 조정 / 인쇄 / 메모 */
.view-action-row{
  display:flex;
  align-items:stretch;
  gap:5px;
  flex:0 0 auto;
}
.view-action-row>button{
  margin:0!important;
  transform:none!important;
  vertical-align:middle!important;
}

@media(max-width:760px){

  .view-tools{
    align-items:stretch!important;
  }

  .view-action-row{
    order:3;
    display:flex!important;
    align-items:stretch!important;
    gap:5px!important;
    height:34px!important;
    margin:0!important;
    padding:0!important;
  }

  .view-action-row>.roster-adjust-button,
  .view-action-row>.print-button,
  .view-action-row>.mobile-memo-open{
    box-sizing:border-box!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    align-self:stretch!important;
    height:34px!important;
    min-height:34px!important;
    max-height:34px!important;
    margin:0!important;
    padding:0 10px!important;
    top:auto!important;
    bottom:auto!important;
    transform:none!important;
    line-height:1!important;
    font-size:10px!important;
  }

  /* Graphical timetable — one complete weekday per phone screen.
     Same lesson cards/teacher columns as PC, swipe horizontally by weekday. */
  #boardHost{
    overflow-x:auto!important;
    overflow-y:auto!important;
    scroll-snap-type:x proximity!important;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-x pan-y;
  }

  #boardHost .fit-table{
    width:max-content!important;
    min-width:100%!important;
    height:100%!important;
    overflow:visible!important;
  }

  #boardHost .fit-days{
    flex:none!important;
    width:max-content!important;
    min-width:0!important;
    display:flex!important;
  }

  #boardHost[data-view-mode="all"] .fit-day{
    flex:0 0 calc(100vw - 64px)!important;
    width:calc(100vw - 64px)!important;
    min-width:310px!important;
    max-width:420px!important;
    scroll-snap-align:start!important;
  }

  #boardHost[data-view-mode="all"] .fit-lanes{
    display:flex!important;
    width:100%!important;
  }

  #boardHost[data-view-mode="all"] .fit-lane-wrap{
    flex:1 1 0!important;
    min-width:0!important;
  }

  #boardHost .fit-teacher{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    height:25px!important;
    min-height:25px!important;
    padding:2px 1px!important;
    overflow:visible!important;
    white-space:nowrap!important;
    text-overflow:clip!important;
    font-size:9.5px!important;
    font-weight:900!important;
  }

  #boardHost .fit-day-name{
    position:static!important;
    height:30px!important;
    min-height:30px!important;
    font-size:11px!important;
  }

  /* Own-teacher map: one weekday per screen as well */
  #boardHost[data-view-mode="teacher"] .fit-table{
    min-width:100%!important;
  }

  #boardHost[data-view-mode="teacher"] .fit-day{
    flex:0 0 calc(100vw - 64px)!important;
    width:calc(100vw - 64px)!important;
    min-width:300px!important;
    max-width:420px!important;
    scroll-snap-align:start!important;
  }

  #boardHost[data-view-mode="day"] .fit-day{
    flex:0 0 calc(100vw - 64px)!important;
    width:calc(100vw - 64px)!important;
    min-width:300px!important;
  }

  #boardHost .fit-ruler{
    position:sticky!important;
    left:0!important;
    z-index:20!important;
  }
}


/* V7.9.7 · teacher mapping diagnostic */
.teacher-map-warning{
  display:grid;
  place-items:center;
  min-height:220px;
  padding:24px;
  color:#6b7d73;
  background:#fbfcfb;
  border:1px dashed #ccdcd3;
  border-radius:11px;
  text-align:center;
  font-size:12px;
  line-height:1.6;
}

/* =====================================================================
   V7.9.8 - measured mobile canvas-height repair.
   The original percent-height flex child collapsed to header-only height.
   Anchor the drawing canvas to its already sized viewport instead.
   This does NOT modify timetable data, authentication, or save behavior.
   ===================================================================== */
@media screen and (max-width:760px){
  #boardHost.fit-board{
    position:relative!important;
    isolation:isolate;
    --tt-mobile-day-width:calc(100vw - 70px);
    scroll-padding-left:44px!important;
    scroll-padding-inline-start:44px!important;
  }

  /* top + bottom establish a definite height without height:100%.
     Absolute-positioned lesson cards must have a nonzero clipping area. */
  #boardHost[data-view-mode] > .fit-table{
    position:absolute!important;
    top:0!important;
    bottom:0!important;
    left:0!important;
    right:auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    align-items:stretch!important;
    overflow:visible!important;
  }
  #boardHost[data-view-mode] .fit-days{
    align-self:stretch!important;
    align-items:stretch!important;
    height:auto!important;
    min-height:0!important;
  }
  #boardHost[data-view-mode] .fit-days > .fit-day{
    flex:0 0 var(--tt-mobile-day-width)!important;
    width:var(--tt-mobile-day-width)!important;
    min-width:var(--tt-mobile-day-width)!important;
    max-width:none!important;
    height:auto!important;
    align-self:stretch!important;
  }

  /* Keep the header stack at 51px, matching app.js's coordinate calculation:
     26px weekday + 25px teacher. Align the ruler and teaching lanes. */
  #boardHost[data-view-mode] .fit-day > .fit-day-name{
    flex:0 0 26px!important;
    height:26px!important;
    min-height:26px!important;
    max-height:26px!important;
    margin:0!important;
    padding:0 2px!important;
    box-sizing:border-box!important;
  }
  #boardHost[data-view-mode] .fit-lane-wrap > .fit-teacher{
    flex:0 0 25px!important;
    height:25px!important;
    min-height:25px!important;
    max-height:25px!important;
    margin:0!important;
    padding:0 2px!important;
    box-sizing:border-box!important;
  }
  #boardHost[data-view-mode] .fit-ruler > .fit-corner{
    flex:0 0 51px!important;
    height:51px!important;
    min-height:51px!important;
    max-height:51px!important;
    box-sizing:border-box!important;
  }
  #boardHost[data-view-mode] .fit-lanes{
    flex:1 1 0px!important;
    min-height:0!important;
    align-items:stretch!important;
  }
  #boardHost[data-view-mode] .fit-lane-wrap{
    min-height:0!important;
    align-self:stretch!important;
  }
  #boardHost[data-view-mode] .fit-lane,
  #boardHost[data-view-mode] .fit-ruler-body{
    flex:1 1 0px!important;
    min-height:0!important;
  }

  /* Equal button boxes and text baselines; no vertical offset for Memo. */
  .view-tools .view-action-row{
    display:flex!important;
    align-items:stretch!important;
    height:34px!important;
    margin:0!important;
    padding:0!important;
  }
  .view-tools .view-action-row > button{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    align-self:stretch!important;
    box-sizing:border-box!important;
    height:34px!important;
    min-height:34px!important;
    max-height:34px!important;
    margin:0!important;
    padding:0 10px!important;
    line-height:1.25!important;
    transform:none!important;
    top:auto!important;
  }
}
@media screen and (min-width:681px) and (max-width:760px){
  #boardHost.fit-board{--tt-mobile-day-width:calc(100vw - 86px);}
}


/* =========================================================
   V8.0.0 · NORMAL TIMETABLE + EXPLICIT EDIT MODE
   ========================================================= */
.edit-mode-button{white-space:nowrap}
.edit-mode-button.active{
  background:#fff3cf!important;
  border-color:#ead79e!important;
  color:#7b5d08!important;
}

body:not(.timetable-editing) button.fit-lesson:not(.roster-card){
  cursor:default!important;
}
body:not(.timetable-editing) button.fit-lesson:not(.roster-card):hover{
  outline:none!important;
  transform:none!important;
}

body.timetable-editing .fit-board{
  box-shadow:0 0 0 2px rgba(22,76,61,.08),0 3px 7px rgba(21,61,44,.02)!important;
}
body.timetable-editing button.fit-lesson:not(.roster-card){
  cursor:grab!important;
}
body.timetable-editing button.fit-lesson:not(.roster-card):hover{
  outline:2px solid #80ab92!important;
  outline-offset:-1px!important;
}

@media(max-width:760px){
  .edit-mode-button{flex:0 0 auto!important}
}
