/* 맞춤 학습 — design_handoff_custom_study */
:root{
  --indigo:#4d5bf0;
  --indigo-deep:#3b48d8;
  --indigo-soft:#eef0fe;
  --indigo-line:#dfe2fb;
  --indigo-bar:#c8cdf7;
  --bg:#f6f7fc;
  --card:#fff;
  --text:#1B1F2E;
  --sub:#5b6070;
  --muted:#6b7180;
  --faint:#9196a3;
  --dim:#a4a9b8;
  --border:#e6e8ef;
  --border-soft:#e2e4ee;
  --danger:#d64545;
  --violet:#7c3aed;
  --violet-soft:#f3ebfe;
  --energy:#c85a1c;
  --energy-soft:#fdefe4;
  --g9:#4d5bf0;
  --g7:#118049;
  --g7-soft:#e7f5ee;
  --hae:#0369a1;
  --hae-soft:#e6f2fb;
  --page-max:1060px;
  --disabled-bg:#e2e4ee;
  --disabled-fg:#8990a3;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;background:var(--bg);color:var(--text);
  font-family:var(--font-sans);
  line-height:1.5;-webkit-font-smoothing:antialiased;
}
a{color:var(--indigo);text-decoration:none}
a:hover{color:var(--indigo-deep)}
button,input{font-family:inherit}

/* Header */
.cs-hd{
  position:sticky;top:0;z-index:40;
  background:#fff;border-bottom:1px solid #eceef2;
}
.cs-hd-inner{
  max-width:var(--page-max);margin:0 auto;padding:12px 16px;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
}
@media(min-width:720px){.cs-hd-inner{padding:14px 24px}}
.cs-hd-left{display:flex;align-items:center;gap:12px;min-width:0}
.cs-back{
  width:32px;height:32px;border-radius:10px;border:0;background:#f1f2f6;color:#5b6070;
  display:inline-flex;align-items:center;justify-content:center;font-size:18px;font-weight:600;
  cursor:pointer;text-decoration:none;flex-shrink:0;line-height:1;
}
.cs-back:hover{background:#e8eaef;color:var(--text);text-decoration:none}
.cs-title-wrap{display:flex;align-items:center;gap:9px;min-width:0;flex-wrap:wrap}
.cs-title{font-size:16px;font-weight:900;color:var(--text);letter-spacing:-.3px;white-space:nowrap}
.cs-pill{
  font-size:11px;font-weight:700;padding:3px 9px;border-radius:999px;white-space:nowrap;
}
.cs-pill.gisa{color:var(--violet);background:var(--violet-soft)}
.cs-pill.energy{color:var(--energy);background:var(--energy-soft)}
.cs-pill.g9{color:var(--g9);background:var(--indigo-soft)}
.cs-pill.g7{color:var(--g7);background:var(--g7-soft)}
.cs-pill.hae,.cs-pill.haegyeong{color:var(--hae);background:var(--hae-soft)}
.cs-pill.gongjo{color:#0369a1;background:#e0f2fe}
.cs-pill.labsafety{color:#047857;background:#ecfdf5}
.cs-pill.electricity{color:#b45309;background:#fef3c7}
.cs-pill.gas{color:#0f766e;background:#ccfbf1}
.cs-av{
  width:30px;height:30px;border-radius:50%;background:var(--indigo-soft);color:var(--indigo-deep);
  display:flex;align-items:center;justify-content:center;font-weight:800;font-size:12px;
  text-decoration:none;flex-shrink:0;
}
.cs-av:hover{text-decoration:none}

.cs-body{
  max-width:var(--page-max);margin:0 auto;padding:20px 16px 48px;
}
@media(min-width:720px){.cs-body{padding:28px 24px 56px}}

.cs-grid{
  display:grid;grid-template-columns:1fr;gap:14px;align-items:start;
}
@media(min-width:860px){
  .cs-grid{grid-template-columns:1.15fr 1fr;gap:16px}
}

.cs-card{
  background:#fff;border:1px solid var(--border);border-radius:16px;padding:18px 16px;
}
@media(min-width:560px){.cs-card{padding:22px}}

.cs-card-hd{
  display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;
}
.cs-card-hd b{font-size:14px;font-weight:800;color:var(--text)}
.cs-card-hd .cap{font-size:11px;color:var(--faint);white-space:nowrap;font-weight:500}

.cs-sec-lab{
  font-size:12.5px;font-weight:800;color:var(--sub);margin:16px 0 8px;
}
.cs-sec-lab span{font-size:10.5px;font-weight:700;color:var(--faint)}

/* Subject multi select */
.cs-subs{
  display:grid;grid-template-columns:1fr 1fr;gap:8px;
}
.cs-sub{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  border:1.5px solid var(--border);background:#fff;border-radius:11px;padding:12px 14px;
  cursor:pointer;width:100%;text-align:left;font-family:inherit;
}
.cs-sub .nm{
  font-size:13px;font-weight:700;color:var(--muted);white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis;min-width:0;
}
.cs-sub .box{
  width:19px;height:19px;border-radius:6px;border:1.5px solid #d3d7e2;flex-shrink:0;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:11px;font-weight:800;color:#fff;background:transparent;
}
.cs-sub.on{
  border:2px solid var(--indigo);background:var(--indigo-soft);padding:11.5px 13.5px;
}
.cs-sub.on .nm{color:var(--text);font-weight:800}
.cs-sub.on .box{background:var(--indigo);border-color:var(--indigo)}
.cs-sub:not(.on):hover{border-color:#d0d4e0}

/* Per-subject count segments */
.cs-counts{
  display:flex;gap:7px;flex-wrap:wrap;
}
.cs-counts button{
  flex:1;min-width:52px;text-align:center;padding:11px 0;
  border:1.5px solid var(--border);background:#fff;color:var(--muted);
  border-radius:11px;font-size:13px;font-weight:700;cursor:pointer;white-space:nowrap;
}
.cs-counts button.on{
  border-color:var(--indigo);background:var(--indigo);color:#fff;font-weight:800;
}
.cs-counts button:not(.on):hover{background:#f4f5fb;color:var(--text)}
.cs-custom-input{
  margin-top:10px;display:none;align-items:center;gap:8px;
}
.cs-custom-input.show{display:flex}
.cs-custom-input input{
  width:100px;border:1.5px solid var(--border);border-radius:10px;padding:10px 12px;
  font-size:14px;font-weight:800;text-align:center;color:var(--text);
}
.cs-custom-input input:focus{outline:0;border-color:var(--indigo)}
.cs-custom-input span{font-size:12.5px;font-weight:700;color:var(--sub)}
.cs-count-hint{
  margin:8px 0 0;font-size:12.5px;line-height:1.5;font-weight:700;color:var(--indigo-deep);
}

.cs-goal-bar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
  margin-top:16px;background:var(--bg);border:1px solid var(--border);
  border-radius:11px;padding:13px 16px;
}
.cs-goal-bar .txt{font-size:12.5px;color:var(--sub);line-height:1.4}
.cs-goal-bar .txt b{color:var(--text);font-weight:800}
.cs-goal-bar button{
  flex-shrink:0;border:0;font-weight:700;font-size:12px;padding:8px 16px;
  border-radius:9px;cursor:pointer;white-space:nowrap;
}
.cs-goal-bar button.off{
  background:var(--disabled-bg);color:var(--disabled-fg);cursor:default;
}
.cs-goal-bar button.on{
  background:var(--indigo);color:#fff;
}
.cs-goal-bar button.on:hover{filter:brightness(1.04)}

/* Right column */
.cs-right{display:flex;flex-direction:column;gap:14px}
.cs-progress .row{
  display:flex;align-items:baseline;justify-content:space-between;margin-top:14px;
}
.cs-progress .row:nth-of-type(2){margin-top:8px}
.cs-progress .row .k{font-size:12.5px;color:var(--sub);white-space:nowrap}
.cs-progress .row .v{font-size:22px;font-weight:900;color:var(--text)}
.cs-progress .row .v.zero{color:var(--danger)}
.cs-progress .row .v.mid{color:var(--indigo)}
.cs-progress .row .v.full{color:#118049}
.cs-bar{
  margin-top:12px;height:8px;background:#eef0f4;border-radius:99px;overflow:hidden;
}
.cs-bar > i{
  display:block;height:100%;background:var(--indigo);border-radius:99px;
  transition:width .25s ease;
}
.cs-bar-labs{
  display:flex;justify-content:space-between;font-size:10.5px;color:var(--dim);margin-top:5px;
}

.cs-cta{
  background:linear-gradient(150deg,#4d5bf0,#3b48d8);border-radius:16px;padding:22px;color:#fff;
}
.cs-cta b{display:block;font-size:14px;font-weight:800}
.cs-cta p{margin:6px 0 0;font-size:12.5px;opacity:.85;line-height:1.65}
.cs-cta a,.cs-cta button{
  display:block;width:100%;margin-top:16px;border:0;background:#fff;color:var(--indigo-deep);
  font-weight:800;font-size:14.5px;padding:13px;border-radius:12px;cursor:pointer;
  white-space:nowrap;text-align:center;text-decoration:none;font-family:inherit;
}
.cs-cta a:hover,.cs-cta button:hover{filter:brightness(1.03);color:var(--indigo-deep);text-decoration:none}
.cs-cta a.is-off,.cs-cta button.is-off{
  opacity:.55;cursor:not-allowed;pointer-events:none;
}

/* Week chart */
.cs-week{margin-top:16px}
.cs-week-bars{
  display:flex;gap:8px;margin-top:14px;
}
.cs-week-col{flex:1;text-align:center;min-width:0}
.cs-week-col .bar-wrap{
  height:64px;display:flex;align-items:flex-end;
}
.cs-week-col .bar{
  width:100%;border-radius:7px 7px 0 0;min-height:4%;
  background:var(--disabled-bg);transition:height .2s ease;
}
.cs-week-col .bar.full{background:var(--indigo)}
.cs-week-col .bar.part{background:var(--indigo-bar)}
.cs-week-col .bar.today-empty{background:#e2e4ee}
.cs-week-col .d{
  font-size:10.5px;color:var(--faint);font-weight:700;margin-top:6px;
}
.cs-week-col .d.today{color:var(--indigo);font-weight:800}
.cs-week-cap{
  font-size:11.5px;color:var(--faint);margin-top:10px;font-weight:500;line-height:1.45;
}

/* confirm modal */
.cs-modal-bg{
  display:none;position:fixed;inset:0;z-index:100;background:rgba(20,24,44,.45);
  align-items:center;justify-content:center;padding:20px;
}
.cs-modal-bg.show{display:flex}
.cs-modal{
  background:#fff;border-radius:16px;padding:22px 20px;max-width:360px;width:100%;
  box-shadow:0 24px 60px rgba(20,24,44,.3);
}
.cs-modal h3{margin:0;font-size:16px;font-weight:900;color:var(--text)}
.cs-modal p{margin:10px 0 0;font-size:13.5px;color:var(--sub);line-height:1.55}
.cs-modal .acts{display:flex;gap:8px;margin-top:18px}
.cs-modal .acts button{
  flex:1;border:0;border-radius:11px;padding:12px;font-weight:800;font-size:13.5px;
  cursor:pointer;
}
.cs-modal .acts .cancel{background:#f1f2f6;color:var(--sub)}
.cs-modal .acts .ok{background:var(--indigo);color:#fff}
