/*
 * 학생 화면. 기존 현자의 돌 학생 포털(윤리와 사상)과 같은 느낌:
 * 가운데 한 줄(최대 520px), 금색 점이 붙은 섹션 제목, 회색 카드, 주차별 줄 목록.
 */

body.student {
    min-height: 100vh;
    font-size: 15px;
}

.wrap {
    max-width: 520px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ---------- 버튼·입력 (학생 화면 크기) ---------- */

.student .btn {
    height: auto;
    min-height: 46px;
    padding: 12px 16px;
    border-radius: var(--r-ctl);
    font-size: 15px;
    font-weight: 700;
}

.student .btn-sm {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 13px;
}

.student .btn-block {
    display: flex;
    width: 100%;
}

.student .btn-primary:hover {
    filter: brightness(1.06);
}

.student .btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent-ink);
}

.student .btn-outline:hover {
    background: var(--accent-soft);
}

.student .btn-ghost {
    border: 1px solid var(--line);
    color: var(--ink-2);
}

.student .btn-ghost:hover {
    border-color: var(--ink-3);
    color: var(--ink);
    background: transparent;
}

.student .input,
.student .select,
.student .textarea {
    background: var(--surface-2);
    border-color: var(--line);
    font-size: 16px;
}

.student .input,
.student .select {
    height: 48px;
    padding: 0 14px;
}

.student .select {
    padding-right: 40px;
    background-position: right 15px center;
}

.student .field > label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
}

/* ---------- 머리 ---------- */

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px 0 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.mark {
    font-size: 17px;
    font-weight: 800;
    color: var(--ink);
    white-space: nowrap;
    text-decoration: none;
}

.mark .accent {
    color: var(--accent);
}

.mark small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-3);
}

.top-right {
    display: flex;
    align-items: center;
    gap: 2px;
}

.top-right form {
    margin: 0;
}

.student .top-right .theme-btn {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink-2);
}

.top-link {
    padding: 6px 4px;
    border: 0;
    background: none;
    color: var(--ink-2);
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
}

.top-link:hover {
    color: var(--ink);
}

/* 시즌 메뉴 */
.season-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -8px 0 24px;
}

.season-now {
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nav-menu a {
    position: relative;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 12.5px;
    white-space: nowrap;
    text-decoration: none;
}

.nav-menu a:hover {
    color: var(--ink);
}

.nav-menu a.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-weight: 700;
}

.nav-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border: 2px solid var(--canvas);
    border-radius: 50%;
    background: var(--accent);
    box-sizing: content-box;
}

/* ---------- 공통 덩어리 ---------- */

.hero {
    margin-bottom: 30px;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.hero p {
    color: var(--ink-2);
    font-size: 14px;
}

.card {
    margin-bottom: 14px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--r-box);
    background: var(--surface);
}

.section {
    margin-top: 34px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 800;
}

.section-title .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex: none;
}

.page-title {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.empty-text {
    padding: 6px 0;
    color: var(--ink-3);
    font-size: 14px;
    text-align: center;
}

.accent {
    color: var(--accent-ink);
}

.error-box {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
    border-radius: var(--r-ctl);
    background: var(--bad-soft);
    color: var(--bad);
    font-size: 13.5px;
    line-height: 1.55;
}

.info-box {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 13.5px;
}

.foot {
    margin-top: 48px;
    padding: 22px 0 36px;
    border-top: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 11.5px;
    line-height: 1.8;
    text-align: center;
}

.foot p {
    margin: 0;
}

/* ---------- 로그인 ---------- */

.login-form .btn-primary {
    width: 100%;
    margin-top: 6px;
}

.login-help {
    margin-top: 14px;
    color: var(--ink-3);
    font-size: 12.5px;
    text-align: center;
}

/* ---------- 시즌 고르기 ---------- */

.season-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.season-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--r-box);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    transition: border-color 150ms ease;
}

.season-link:hover {
    border-color: var(--accent);
}

.season-info {
    flex: 1;
    min-width: 0;
}

.season-name {
    display: block;
    font-size: 18px;
    font-weight: 800;
}

.season-academy {
    display: block;
    margin-top: 2px;
    color: var(--ink-2);
    font-size: 13px;
}

.season-new {
    display: block;
    margin-top: 6px;
    color: var(--accent-ink);
    font-size: 12.5px;
    font-weight: 700;
}

.chev {
    width: 8px;
    height: 8px;
    border-top: 1.5px solid var(--ink-3);
    border-right: 1.5px solid var(--ink-3);
    transform: rotate(45deg);
    flex: none;
}

.ext-links {
    display: flex;
    gap: 8px;
    margin-top: 34px;
}

.ext-links .btn {
    flex: 1;
}

/* ---------- 대시보드 ---------- */

.student-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.student-row h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
}

.class-tag {
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.cheer {
    margin-bottom: 20px;
    color: var(--ink-2);
    font-size: 14px;
}

.alert-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

/* 주차별 줄 목록 */
.week-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.week-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    text-decoration: none;
}

a.week-item:hover {
    border-color: var(--ink-3);
}

.week-item.is-empty {
    background: transparent;
}

.w-name {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.week-item.is-empty .w-name {
    color: var(--ink-3);
    font-weight: 500;
}

.w-name.unread {
    font-weight: 700;
}

.notice-row .w-name {
    font-weight: 500;
}

.w-right {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-variant-numeric: tabular-nums;
}

.w-status {
    color: var(--ink-3);
}

.w-status.present {
    color: var(--ok);
}

.w-status.late {
    color: var(--late);
}

.w-status.absent {
    color: var(--bad);
}

.w-status.makeup {
    color: var(--makeup);
}

.w-score {
    min-width: 40px;
    text-align: right;
    font-weight: 700;
}

/* 그래프 */
.chart-box {
    width: 100%;
}

.score-svg {
    display: block;
    overflow: visible;
}

.score-svg .grid {
    stroke: var(--line);
    stroke-width: 1;
}

.score-svg .axis {
    fill: var(--ink-2);
    font-size: 11px;
    font-family: var(--font);
}

.score-svg .curve {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.score-svg .me.curve {
    stroke: var(--accent);
    stroke-width: 3;
}

.score-svg .avg.curve {
    stroke: var(--ink-3);
    stroke-width: 2;
    stroke-dasharray: 5 5;
}

.score-svg .gap {
    stroke-width: 1.5;
    stroke-dasharray: 2 5;
}

.score-svg .me.gap {
    stroke: var(--accent);
    opacity: 0.6;
}

.score-svg .avg.gap {
    stroke: var(--ink-3);
    opacity: 0.6;
}

.score-svg .me-dot {
    fill: var(--canvas);
    stroke: var(--accent);
    stroke-width: 2.5;
}

.score-svg .me-label {
    fill: var(--ink);
    font-size: 11.5px;
    font-weight: 700;
    font-family: var(--font);
}

.chart-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
    color: var(--ink);
    font-size: 12.5px;
}

.chart-legend span {
    display: inline-block;
    width: 22px;
    height: 0;
    border-top: 3px solid var(--accent);
    border-radius: 2px;
}

.chart-legend .lg-avg {
    margin-left: 14px;
    border-top: 2px dashed var(--ink-3);
}

.chart-note {
    margin-top: 6px;
    color: var(--ink-3);
    font-size: 12px;
    text-align: center;
}

/* 등급컷 */
.result-box {
    display: none;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--surface-2);
}

.result-box.show {
    display: block;
}

.my-score {
    font-size: 14px;
}

.grade-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
    font-size: 13.5px;
}

.grade-table td {
    padding: 9px 6px;
    border-bottom: 1px solid var(--line);
    color: var(--ink-2);
}

.grade-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.grade-table tr:last-child td {
    border-bottom: 0;
}

.grade-table tr.my-row td {
    color: var(--accent-ink);
    font-weight: 700;
}

/* 복습 영상 */
.video-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.video-item {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--surface);
}

.video-title {
    margin-bottom: 12px;
    font-size: 14.5px;
    font-weight: 600;
}

.week-label {
    color: var(--accent-ink);
    font-weight: 800;
    white-space: nowrap;
}

.video-btns {
    display: flex;
    gap: 8px;
}

.video-btns .btn {
    flex: 1;
}

.video-date {
    flex: none;
    align-self: center;
    color: var(--ink-3);
    font-size: 12.5px;
}

/* YouTube 가 안 될 때만 Vimeo 로 */
.alt-play {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    margin: 18px 0 0;
    color: var(--ink-3);
    font-size: 13px;
}

.alt-play a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.video-item.is-pending {
    background: transparent;
    border-style: dashed;
}

.video-item.is-pending .video-title {
    margin-bottom: 6px;
    color: var(--ink-2);
}

.video-item.is-pending .week-label {
    color: var(--ink-2);
}

.pending-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
}

.pending-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--late);
    flex: none;
}

.why-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 7px;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 600;
    vertical-align: 1px;
}

.archive-season {
    margin-top: 30px;
}

.archive-season:first-of-type {
    margin-top: 0;
}

.archive-req {
    margin-top: 14px;
}

.link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    text-decoration: none;
}

.link-card:hover {
    border-color: var(--ink-3);
}

/* ---------- 공지 ---------- */

.notice-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.notice-list a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--surface);
    color: var(--ink);
    font-size: 14.5px;
    text-decoration: none;
}

.notice-list a:hover {
    border-color: var(--ink-3);
}

.nl-title {
    min-width: 0;
    flex: 0 1 auto;
    color: var(--ink-2);
}

.notice-list li.is-new .nl-title {
    color: var(--ink);
    font-weight: 700;
}

.nl-clip {
    color: var(--ink-3);
    line-height: 0;
}

.pin {
    flex: none;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 11.5px;
    font-weight: 700;
}

.notice-view .notice-title {
    margin: 0 0 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.45;
}

.notice-view .notice-title .pin {
    vertical-align: 3px;
}

.notice-back {
    margin-top: 16px;
}

.np-title {
    margin-bottom: 10px;
    font-size: 17px;
    font-weight: 800;
}

/* ---------- 클리닉 ---------- */

.clinic-rule {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid var(--accent);
    border-radius: var(--r-ctl);
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 14px;
    font-weight: 700;
}

.clinic-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.clinic-item {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--surface);
}

.clinic-item.is-new {
    border-color: var(--accent);
}

.ci-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.ci-head b {
    color: var(--accent-ink);
}

.ci-body {
    font-size: 14.5px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.ci-reply {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.ci-reply .ci-head b {
    color: var(--ink);
}

.ci-form {
    margin-top: 12px;
}

.ci-form .textarea {
    min-height: 84px;
}

.ci-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.ci-form-foot .btn {
    min-height: 40px;
    padding: 8px 16px;
    font-size: 14px;
}

/* 수강 중이 아닐 때 등 안내 화면 */
.st-notice-page {
    padding: 48px 0;
    text-align: center;
}

.st-notice-title {
    margin-bottom: 18px;
    font-size: 17px;
    font-weight: 700;
}

.st-notice-sub {
    margin: -8px 0 22px;
    color: var(--ink-2);
    font-size: 13.5px;
    line-height: 1.6;
}

@media (max-width: 400px) {
    .wrap {
        padding: 0 16px;
    }

    .hero h1 {
        font-size: 23px;
    }

    .card {
        padding: 18px;
    }
}

/* ---------- 복습 영상 ---------- */

.vw-week {
    margin: 0 0 4px;
    color: var(--accent-ink);
    font-size: 13px;
    font-weight: 800;
}

.vw-week a {
    color: inherit;
    text-decoration: none;
}

.vw-title {
    margin: 0 0 6px;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.vw-meta {
    margin-bottom: 18px;
    color: var(--ink-2);
    font-size: 13.5px;
}

.vw-desc {
    font-size: 14px;
    line-height: 1.75;
    color: var(--ink-2);
}

.play-tag {
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--accent);
    color: var(--on-primary);
    font-size: 12.5px;
    font-weight: 700;
}

/* 재생 화면은 조금 넓게 */
body.watch-page .wrap {
    max-width: 900px;
}

.period-tabs {
    margin: 14px 0 16px;
}

.now-label {
    font-weight: 700;
}

.watch-note {
    margin-top: 14px;
    color: var(--ink-3);
    font-size: 12.5px;
}

/* ---------- 위쪽 정리 (메뉴 줄 없이) ---------- */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: -6px 0 20px;
    color: var(--ink-2);
    font-size: 13px;
    text-decoration: none;
}

.back-link::before {
    content: "";
    width: 7px;
    height: 7px;
    border-bottom: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.back-link:hover {
    color: var(--ink);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.season-tag {
    padding: 4px 10px;
    border: 1px solid var(--accent);
    border-radius: 20px;
    color: var(--accent-ink);
    font-size: 12px;
    font-weight: 700;
}

.other-season {
    margin-left: auto;
    color: var(--ink-2);
    font-size: 12.5px;
}

.hello {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.title-count {
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 20px;
    background: var(--accent);
    color: var(--on-primary);
    font-size: 11.5px;
    font-weight: 800;
    text-align: center;
}

.title-more {
    margin-left: auto;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
}

.title-more:hover {
    color: var(--ink);
}

/* ---------- 영상 신청서 ---------- */

.req-entry {
    margin-top: 26px;
}

.req-entry strong {
    display: block;
    font-size: 15px;
}

.req-entry small {
    display: block;
    margin-top: 2px;
    color: var(--ink-3);
    font-size: 12.5px;
}

.req-desc {
    line-height: 1.7;
}

.req-form .field {
    margin-bottom: 22px;
}

.req-form fieldset {
    min-width: 0;
    margin: 0 0 22px;
    padding: 0;
    border: 0;
}

.req-form legend {
    margin-bottom: 8px;
    padding: 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}

.req-form fieldset > .help {
    margin: -2px 0 10px;
}

.req-optional {
    color: var(--ink-3);
    font-weight: 400;
}

.choice-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.is-scale .choice-list {
    flex-direction: row;
    flex-wrap: wrap;
}

.choice {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--surface-2);
    font-size: 15px;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease;
}

.choice:hover {
    border-color: var(--ink-3);
}

.choice input {
    width: 18px;
    height: 18px;
    margin: 0;
    flex: none;
    accent-color: var(--accent);
}

.choice:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.choice:has(input:focus-visible) {
    box-shadow: var(--focus-ring);
}

.req-group[aria-invalid="true"] .choice {
    border-color: color-mix(in srgb, var(--bad) 45%, var(--line));
}

.req-form .field-error {
    margin: 2px 0 0;
}

.req-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.req-form .btn-primary {
    margin-top: 6px;
}

.req-receipt dl {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px 14px;
    margin: 0;
    font-size: 14.5px;
}

.req-receipt dt {
    color: var(--ink-2);
}

.req-receipt dd {
    margin: 0;
    font-weight: 600;
}

.req-after {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.student .input[aria-invalid="true"],
.student .select[aria-invalid="true"],
.student .textarea[aria-invalid="true"] {
    border-color: var(--bad);
}

.req-form .select:invalid {
    color: var(--ink-3);
}

.req-form .select option {
    color: var(--ink);
}

/* 영상 화면: 글자 고르기·길게 눌러 복사 막기 */
body.watch-page,
body.video-page {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* =====================================================================
 * 2026-11 개편: 요약 카드, 주차 격자, 하단 탭, 홈 화면 앱, 넓은 화면(아이패드) 두 단
 * ===================================================================== */

/* ---------- 맨 위 요약 카드 ---------- */

.summary-card {
    position: relative;
    overflow: hidden;
    margin-top: 22px;
    padding: 22px 22px 20px;
    border-radius: 20px;
    background: #17181c;
    color: #f2f1ee;
    box-shadow: 0 10px 30px rgba(23, 24, 28, 0.16);
}

.summary-card::after {
    content: "";
    position: absolute;
    top: -90px;
    right: -70px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 164, 65, 0.32), rgba(217, 164, 65, 0) 70%);
    pointer-events: none;
}

:root[data-theme="dark"] .summary-card {
    background: #1e2024;
    border: 1px solid #2a2c31;
    box-shadow: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .summary-card {
        background: #1e2024;
        border: 1px solid #2a2c31;
        box-shadow: none;
    }
}

.sum-label {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgba(242, 241, 238, 0.62);
    font-size: 13px;
    font-weight: 600;
}

.sum-score {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 6px 0 14px;
    font-variant-numeric: tabular-nums;
}

.sum-score strong {
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #fff;
}

.sum-score span {
    color: rgba(242, 241, 238, 0.62);
    font-size: 17px;
    font-weight: 600;
}

.sum-bar {
    position: relative;
    z-index: 1;
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.sum-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #c8922c, #e8bd62);
}

.sum-chips {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
}

.sum-chip {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    font-variant-numeric: tabular-nums;
}

.sum-chip small {
    color: rgba(242, 241, 238, 0.6);
    font-size: 11.5px;
    font-weight: 600;
}

.sum-chip b {
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}

.sum-chip.is-up b {
    color: #4fdc98;
}

.sum-chip.is-down b {
    color: #ff8589;
}

.sum-chip.is-grade b {
    color: #e8bd62;
}

.sum-empty {
    position: relative;
    z-index: 1;
    margin: 10px 0 0;
    color: rgba(242, 241, 238, 0.85);
    font-size: 15px;
    line-height: 1.6;
}

/* ---------- 주차 격자 ---------- */

.week-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.wg-cell {
    --st: var(--ink-3);
    --st-soft: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 2px 9px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.wg-cell.st-present { --st: var(--ok); --st-soft: var(--ok-soft); }
.wg-cell.st-late { --st: var(--late); --st-soft: var(--late-soft); }
.wg-cell.st-absent { --st: var(--bad); --st-soft: var(--bad-soft); }
.wg-cell.st-makeup { --st: var(--makeup); --st-soft: var(--makeup-soft); }

.wg-cell[class*="st-"] {
    border-color: transparent;
    background: var(--st-soft);
}

.wg-week {
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 600;
}

.wg-score {
    color: var(--ink);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
}

.wg-status {
    color: var(--st);
    font-size: 11.5px;
    font-weight: 700;
}

.wg-cell.is-empty {
    border-style: dashed;
    background: transparent;
}

.wg-cell.is-empty .wg-score,
.wg-cell.is-empty .wg-week {
    color: var(--ink-3);
    font-weight: 500;
}

.wg-cell.is-latest {
    box-shadow: inset 0 0 0 2px var(--accent);
}

.wg-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin: 12px 2px 0;
    color: var(--ink-2);
    font-size: 12px;
}

.wg-legend .lg {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: -7px;
    border-radius: 3px;
}

.wg-legend .lg.st-present { background: var(--ok); }
.wg-legend .lg.st-late { background: var(--late); }
.wg-legend .lg.st-absent { background: var(--bad); }
.wg-legend .lg.st-makeup { background: var(--makeup); }

@media (max-width: 340px) {
    .week-grid { gap: 6px; }
    .wg-score { font-size: 17px; }
}

/* ---------- 하단 탭 ---------- */

body.has-tabs .wrap {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    backdrop-filter: saturate(1.6) blur(16px);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .tabbar { background: var(--surface); }
}

.tabbar-in {
    display: flex;
    max-width: 520px;
    margin: 0 auto;
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 9px 0 8px;
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.tab .icon {
    width: 24px;
    height: 24px;
}

.tab.is-on {
    color: var(--accent-ink);
}

.tab.is-on .icon {
    stroke-width: 2.2;
}

.tab-ic {
    position: relative;
    display: inline-flex;
}

.tab-badge {
    position: absolute;
    top: -4px;
    right: -9px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid var(--surface);
    border-radius: 9px;
    background: var(--bad);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 13px;
    text-align: center;
}

/* ---------- 홈 화면에 추가 안내 ---------- */

.install-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 0;
    padding: 12px 12px 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    font-size: 13px;
    line-height: 1.5;
}

.install-card img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex: none;
}

.install-card p {
    flex: 1;
    margin: 0;
    color: var(--ink-2);
}

.install-card p b {
    display: block;
    color: var(--ink);
    font-size: 14px;
}

.install-card .btn {
    flex: none;
}

.install-x {
    flex: none;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-3);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

/* ---------- 넓은 화면 (아이패드·노트북) ---------- */

@media (min-width: 768px) {
    .wrap {
        max-width: 680px;
        padding: 0 28px;
    }

    .hello {
        font-size: 26px;
    }

    .week-grid {
        grid-template-columns: repeat(10, minmax(0, 1fr));
    }

    .tabbar {
        left: 50%;
        right: auto;
        bottom: calc(16px + env(safe-area-inset-bottom));
        width: 420px;
        padding: 0 8px;
        transform: translateX(-50%);
        border: 1px solid var(--line);
        border-radius: 20px;
        box-shadow: var(--shadow-pop);
    }

    body.has-tabs .wrap {
        padding-bottom: 110px;
    }
}

@media (min-width: 900px) {
    body.dash-page .wrap {
        max-width: 1080px;
    }

    .dash-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        gap: 0 36px;
        align-items: start;
    }

    .dash-grid .week-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .dash-side {
        padding-top: 22px;
    }

    .dash-side > .section:first-child {
        margin-top: 0;
    }
}

.sum-chip:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

/* ---------- 이어보기·시청률 ---------- */

.resume-note {
    margin: 12px 0 0;
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--ink);
    font-size: 13.5px;
    line-height: 1.5;
}

.resume-note b {
    font-variant-numeric: tabular-nums;
}

.resume-note .link-btn {
    margin-left: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-ink);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.period-tabs .tab-done,
.period-tabs .tab-pct {
    margin-left: 5px;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.period-tabs .tab-done {
    color: var(--ok);
}

.period-tabs .tab-pct {
    color: var(--ink-3);
}

.vp-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.vp-state.is-done {
    color: var(--ok);
}

.vp-bar {
    width: 44px;
    height: 4px;
    border-radius: 4px;
    background: var(--surface-3);
    overflow: hidden;
}

.vp-bar i {
    display: block;
    height: 100%;
    background: var(--accent);
}

/* ---------- 알림 상태 (홈) ---------- */

.push-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 14px 2px 0;
    color: var(--ink-2);
    font-size: 13px;
}

.push-status .link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-ink);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.push-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ink-3);
}

.push-dot.is-on {
    background: var(--ok);
    box-shadow: 0 0 0 3px var(--ok-soft);
}

#install-slot .install-card + .install-card {
    margin-top: 10px;
}

/* ---------- 로그인 유지 ---------- */
.keep-login {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 2px 0 16px;
    color: var(--ink-2);
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.keep-login input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--accent);
}

.keep-login small {
    color: var(--ink-3);
    font-size: 12px;
}

/* ---------- 시험 D-day ---------- */
.dday {
    margin-top: 18px;
}

.dday-main {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.dday-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dday-name {
    font-size: 15px;
    font-weight: 800;
}

.dday-date {
    overflow: hidden;
    color: var(--ink-2);
    font-size: 12.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dday-count {
    color: var(--accent-ink);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.dday-count.is-near {
    color: var(--bad);
}

.dday-change {
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--ink-3);
    font-size: 11.5px;
    font-weight: 700;
}

.dday-sheet {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(10, 10, 12, 0.45);
}

.dday-sheet[hidden] {
    display: none;
}

.dday-sheet-in {
    width: 100%;
    max-width: 520px;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    background: var(--surface);
    animation: ddayUp .2s ease-out;
}

@keyframes ddayUp {
    from { transform: translateY(30px); opacity: .5; }
    to { transform: none; opacity: 1; }
}

@media (min-width: 768px) {
    .dday-sheet { align-items: center; }
    .dday-sheet-in { border-radius: 20px; }
}

.dday-sheet-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 800;
}

.dday-sheet-sub {
    margin: 0 0 16px;
    color: var(--ink-2);
    font-size: 13px;
}

.dday-opts {
    display: grid;
    gap: 8px;
}

.dday-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.dday-opt span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dday-opt b {
    font-size: 15px;
}

.dday-opt small {
    color: var(--ink-2);
    font-size: 12.5px;
}

.dday-opt em {
    color: var(--accent-ink);
    font-size: 18px;
    font-style: normal;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.dday-opt.is-on {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.dday-close {
    width: 100%;
    margin-top: 12px;
}

body.has-sheet {
    overflow: hidden;
}
