:root {
  color-scheme: light;
  --blue: #234f86;
  --dark: #192d46;
  --muted: #52667d;
  --pale: #eef5fc;
  --line: #d9e5f1;
  --white: #fff;
  --present: #2467ac;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: var(--dark);
  background: var(--white);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.55; }
h1, h2, p, ul { margin: 0; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid #235ca0; outline-offset: 3px; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { max-width: 600px; height: 68px; margin: auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }
.header-inner img { display: block; width: 153px; height: auto; }
.shell { max-width: 600px; margin: auto; padding: 18px 18px 38px; }
.text-button { min-height: 44px; padding: 0 8px; background: none; color: var(--blue); border: 0; font-size: 14px; }
.login { max-width: 388px; margin: 52px auto 0; }
h1 { font-size: 26px; line-height: 1.3; font-weight: 740; letter-spacing: -.04em; }
.intro { color: var(--muted); margin: 10px 0 27px; }
label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 6px; }
input, select { width: 100%; min-height: 44px; padding: 8px 11px; border: 1px solid #aec3d9; border-radius: 8px; background: var(--white); color: var(--dark); font-size: 16px; }
#code { min-height: 54px; letter-spacing: .16em; }
#code::placeholder { letter-spacing: normal; color: var(--muted); }
#challenge { min-height: 66px; margin-top: 12px; }
.primary { display: block; width: 100%; min-height: 48px; margin-top: 13px; padding: 9px 12px; border: 0; border-radius: 8px; color: white; background: var(--blue); font-weight: 700; }
.primary:disabled { opacity: .6; }
.muted { color: var(--muted); }
.login-help, .error { margin-top: 13px; font-size: 14px; }
.error { color: #9a293b; }
.chooser { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.chooser label { margin: 0; white-space: nowrap; }
.chooser select { max-width: 220px; }
.student { padding: 14px 15px; border-radius: 12px; background: var(--td-student); margin-bottom: 17px; }
.student h1 { overflow-wrap: anywhere; }
.class-name { margin-top: 4px; color: var(--blue); font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.weekly { margin-top: 7px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.calendar { border: 1px solid var(--line); border-radius: 12px; padding: 7px 8px 9px; }
.month-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 3px; }
.month-bar h2 { font-size: 18px; letter-spacing: -.035em; }
.nav { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--blue); border-radius: 8px; font-size: 25px; line-height: 1; }
.nav:disabled { color: #8593a3; opacity: .7; }
.weekdays, .dates { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays { margin: 4px 0; text-align: center; color: var(--muted); font-size: 12px; }
.weekdays span:first-child { color: #a23c4c; }
.weekdays span:last-child { color: #265f9c; }
.date { border: 0; border-radius: 7px; background: transparent; color: var(--dark); min-height: 43px; padding: 3px 0 2px; display: grid; justify-items: center; align-content: center; gap: 3px; font-size: 14px; line-height: 1.2; }
.date.outside { color: var(--muted); }
.date[aria-pressed="true"] { box-shadow: inset 0 0 0 1px #6d9acb; background: var(--pale); color: #1d4776; font-weight: 760; }
.date .marks { min-height: 6px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; max-width: 100%; gap: 2px; }
.date .closure { color: var(--dark); background: var(--td-event); border-radius: 3px; padding-inline: 2px; font-size: 10px; white-space: nowrap; }
.dot { width: 9px; height: 9px; border: 1px solid var(--mark-outline, var(--muted)); border-radius: 50%; display: inline-block; flex: none; }
.dot, .day-detail li { background: var(--mark-tone, transparent); }
.dot.present, [data-tone=present] { --mark-tone: var(--td-attended); --mark-outline: var(--present); }
.dot.absent, [data-tone=absent] { --mark-tone: var(--td-absent); --mark-outline: #9a293b; }
.dot.unknown, [data-tone=unknown] { --mark-tone: var(--td-unmarked); }
.dot.makeup, [data-tone=makeup] { --mark-tone: var(--td-makeup); --mark-outline: #287183; }
[data-type=closure] { background: var(--td-event); }
[data-type=warning] { background: var(--td-absent); }
#day-note[data-type] { border-radius: 6px; padding: 4px 7px; }

.legend { border-top: 1px solid var(--line); padding: 9px 3px 0; list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 5px 15px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.legend li { display: flex; gap: 5px; align-items: center; }
.day-detail { padding: 12px 3px 2px; margin-top: 7px; }
.day-detail h2 { font-size: 16px; margin-bottom: 6px; }
.day-detail ul { list-style: none; padding: 0; }
.day-detail li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; padding: 6px 8px; border-radius: 6px; margin-block: 4px; font-size: 14px; }
.day-detail li .time { display: block; color: var(--muted); font-size: 13px; }
.result-present { color: var(--present); }
.result-absent { color: #9a293b; }
.result-unknown { color: var(--muted); }
.month-note, #day-note { margin-top: 8px; color: var(--muted); font-size: 13px; }
.month-note { background: var(--pale); border-radius: 8px; padding: 9px 11px; }
.owner-shell { max-width: 680px; }
.owner-shell h2 { margin-top: 18px; font-size: 18px; }
.owner-shell label { margin-top: 8px; }
.owner-shell section { margin-top: 15px; }
.owner-shell ul { padding-inline-start: 18px; }
.account-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.account-actions { display: flex; gap: 6px; }
.account-actions button { margin-top: 4px; padding: 5px 10px; min-height: 44px; background: var(--pale); color: var(--blue); border: 1px solid var(--line); border-radius: 6px; }
#issued-code { margin-top: 12px; font-weight: 700; }
@media (min-width: 540px) {
  .shell { padding: 23px 24px 45px; }
  .date { min-height: 49px; }
}

#publication { margin-block: 1rem; }
#publication-preview { margin-block: 0.75rem; overflow-wrap: anywhere; }
#approved-students { margin-block: 0.65rem; }
#approved-students label { display: flex; align-items: center; gap: 0.4rem; }
#approved-students input { width: 1rem; min-height: 1rem; padding: 0; }

@media(max-width:539px){
 .chooser select{min-width:0;flex:1;max-width:100%}
 .date{min-height:44px;min-width:0}
 .day-detail li .time{white-space:nowrap}
 .account-actions{flex-wrap:wrap}
}
