/* ==========================================================================
   신천중학교 1학년 2반 스터디 홈 — 디자인 시스템
   ========================================================================== */

/* --- 1. 토큰 -------------------------------------------------------------- */
:root {
  color-scheme: light;

  --brand: #5468ff;
  --brand-strong: #3f51e0;
  --brand-2: #8b5cf6;
  --pink: #ec4899;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;

  --bg: #f5f7fc;
  --bg-tint-1: rgba(84, 104, 255, .10);
  --bg-tint-2: rgba(139, 92, 246, .10);
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --surface-3: #eceff8;
  --glass: rgba(255, 255, 255, .72);

  --text: #14161f;
  --text-2: #626a7e;
  --text-3: #8b93a7;
  --border: #e6e9f3;
  --border-strong: #d5dae9;

  --ring: rgba(84, 104, 255, .30);
  --shadow-sm: 0 1px 2px rgba(20, 26, 60, .05), 0 2px 6px rgba(20, 26, 60, .04);
  --shadow-md: 0 2px 4px rgba(20, 26, 60, .05), 0 12px 28px -8px rgba(20, 26, 60, .12);
  --shadow-lg: 0 8px 20px -6px rgba(20, 26, 60, .12), 0 30px 60px -20px rgba(20, 26, 60, .22);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-full: 999px;

  --header-h: 66px;
  --ease: cubic-bezier(.2, .8, .3, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --brand: #8093ff;
  --brand-strong: #6b7dff;
  --brand-2: #a78bfa;

  --bg: #0b0d14;
  --bg-tint-1: rgba(84, 104, 255, .16);
  --bg-tint-2: rgba(139, 92, 246, .14);
  --surface: #141824;
  --surface-2: #1a1f2e;
  --surface-3: #222839;
  --glass: rgba(20, 24, 36, .72);

  --text: #eaedf7;
  --text-2: #9aa3ba;
  --text-3: #737d95;
  --border: #262c3d;
  --border-strong: #333a4f;

  --ring: rgba(128, 147, 255, .32);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 30px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 10px 30px -8px rgba(0, 0, 0, .5), 0 30px 70px -25px rgba(0, 0, 0, .8);
}

/* --- 2. 리셋 -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
               "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 15.5px;
  line-height: 1.65;
  letter-spacing: -.01em;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

/* 배경 그라디언트 (스크롤과 무관하게 고정) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 88% -8%, var(--bg-tint-2), transparent 62%),
    radial-gradient(760px 420px at 6% -6%, var(--bg-tint-1), transparent 60%);
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: color-mix(in srgb, var(--brand) 26%, transparent); }

/* --- 3. 레이아웃 ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 1.5rem);
}

main { flex: 1; padding: clamp(1.5rem, 4vw, 2.5rem) 0 4.5rem; }

.stack > * + * { margin-top: 1.1rem; }

.grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 280px)), 1fr));
}
.grid-2 { display: grid; gap: 1.1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* --- 4. 헤더 -------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); min-width: 0; }
.brand:hover { color: var(--text); }

/* 교표는 원래 색 그대로, 밝은 판 위에 올린다 */
.brand-crest {
  width: 42px; height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(20, 26, 60, .06);
  transition: box-shadow .2s var(--ease), border-color .2s;
}
:root[data-theme="dark"] .brand-crest {
  background: #f7f8fc;
  border-color: rgba(255, 255, 255, .16);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.brand:hover .brand-crest {
  border-color: var(--border-strong);
  box-shadow: 0 3px 10px -2px rgba(20, 26, 60, .16);
}
.brand-crest img { width: 28px; height: 28px; }

.brand-divider { width: 1px; height: 26px; flex: none; background: var(--border-strong); }
:root[data-theme="dark"] .brand-divider { background: rgba(255, 255, 255, .18); }

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-eyebrow {
  font-size: .58rem; font-weight: 700; letter-spacing: .18em;
  color: var(--text-3); text-transform: uppercase; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-name {
  font-size: 1rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 420px) {
  .brand-divider { display: none; }
  .brand-crest { width: 38px; height: 38px; border-radius: 11px; }
  .brand-crest img { width: 26px; height: 26px; }
}

.nav { display: flex; align-items: center; gap: .15rem; }
.nav a {
  position: relative;
  color: var(--text-2);
  font-weight: 600;
  font-size: .9rem;
  padding: .45rem .72rem;
  border-radius: var(--r-full);
  transition: color .18s, background .18s;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.is-active { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }

.nav-tools { display: flex; align-items: center; gap: .45rem; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: color .18s, border-color .18s, background .18s, transform .18s var(--ease);
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .icon-moon { display: none; }
:root[data-theme="dark"] .icon-btn .icon-moon { display: block; }
:root[data-theme="dark"] .icon-btn .icon-sun { display: none; }

.user-pill {
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .3rem .3rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  font-size: .85rem; font-weight: 600;
  white-space: nowrap;
}
.avatar {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  color: #fff; font-size: .78rem; font-weight: 800;
}
.link-logout {
  border: 0; background: none; padding: 0 .2rem;
  color: var(--text-3); font-size: .82rem; font-weight: 600; cursor: pointer;
}
.link-logout:hover { color: var(--red); }

.hamburger { display: none; }

/* 모바일 드로어 */
.drawer {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  z-index: 45;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: .75rem clamp(1rem, 4vw, 1.5rem) 1.1rem;
  display: none;
  flex-direction: column;
  gap: .2rem;
  animation: drawer-in .22s var(--ease);
}
.drawer.is-open { display: flex; }
@keyframes drawer-in { from { opacity: 0; transform: translateY(-10px); } }
.drawer a, .drawer .drawer-logout {
  display: flex; align-items: center; gap: .7rem;
  padding: .8rem .9rem;
  border-radius: var(--r-md);
  color: var(--text);
  font-weight: 700; font-size: .98rem;
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.drawer a:hover, .drawer .drawer-logout:hover { background: var(--surface-2); }
.drawer a.is-active { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.drawer .drawer-logout { color: var(--red); }
.drawer-user {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .9rem .8rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .35rem;
  font-weight: 700;
}

@media (max-width: 860px) {
  .nav, .user-pill { display: none; }
  .hamburger { display: grid; }
}

/* --- 5. 타이포 ------------------------------------------------------------ */
h1 { font-size: clamp(1.45rem, 3.4vw, 1.85rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.3; }
h2 { font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; }
h3 { font-size: .98rem; font-weight: 700; letter-spacing: -.01em; }

.page-head { margin-bottom: 1.4rem; }
.page-head .eyebrow {
  display: inline-block;
  font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand);
  margin-bottom: .35rem;
}
.page-head p { color: var(--text-2); font-size: .93rem; margin-top: .3rem; }

.muted { color: var(--text-2); font-size: .9rem; }
.tiny { font-size: .8rem; }
.num { font-variant-numeric: tabular-nums; }

.section-title {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  margin-bottom: .9rem;
}
.section-title h2 { display: flex; align-items: center; gap: .5rem; }
.section-title .more { font-size: .84rem; font-weight: 700; color: var(--text-2); }
.section-title .more:hover { color: var(--brand); }

/* --- 6. 카드 -------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1.1rem, 3vw, 1.45rem);
  box-shadow: var(--shadow-sm);
}
.card-flat { box-shadow: none; }
.card-pad-0 { padding: 0; }
.card-link {
  display: block;
  color: inherit;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.card-link:hover {
  color: inherit;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* --- 7. 히어로 (D-day) ---------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: clamp(1.5rem, 5vw, 2.4rem);
  color: #fff;
  background: linear-gradient(135deg, #4f5dfa 0%, #6d5cf3 45%, #9b5cf0 100%);
  box-shadow: 0 18px 40px -18px rgba(79, 93, 250, .75);
  margin-bottom: 1.4rem;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before {
  width: 420px; height: 420px;
  right: -120px; top: -190px;
  background: radial-gradient(circle, rgba(255,255,255,.28), transparent 65%);
}
.hero::after {
  width: 320px; height: 320px;
  left: -110px; bottom: -180px;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 65%);
}
.hero > * { position: relative; z-index: 1; }
.hero-label {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
  padding: .25rem .75rem;
  border-radius: var(--r-full);
  backdrop-filter: blur(6px);
}
.hero-body {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.2rem; flex-wrap: wrap;
  margin-top: 1rem;
}
.hero-subject { font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.hero-meta { margin-top: .35rem; font-size: .95rem; color: rgba(255,255,255,.85); font-weight: 500; }
.hero-scope {
  margin-top: .9rem;
  font-size: .9rem;
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--r-md);
  padding: .6rem .85rem;
  max-width: 30rem;
}
.dday {
  flex: none;
  text-align: center;
  line-height: 1;
}
.dday-num {
  font-size: clamp(3.4rem, 13vw, 5rem);
  font-weight: 900;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.dday-cap { font-size: .82rem; font-weight: 700; letter-spacing: .18em; opacity: .85; margin-top: .45rem; }
.dday-prefix { font-size: .36em; font-weight: 800; letter-spacing: 0; vertical-align: .62em; opacity: .85; margin-right: .04em; }
.dday-word { font-size: clamp(2rem, 8vw, 3.1rem); }
.hero-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.hero .chip-glass {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
}

.hero-cta {
  flex: none;
  background: #fff;
  color: #0d7a63;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .28);
}
.hero-cta:hover { background: #fff; color: #0d7a63; box-shadow: 0 12px 26px -8px rgba(0, 0, 0, .34); }

/* 시험 없음 상태 */
.hero-calm {
  background: linear-gradient(135deg, #10b981 0%, #14b8a6 50%, #0ea5e9 100%);
  box-shadow: 0 18px 40px -18px rgba(16, 185, 129, .7);
}

/* --- 8. 칩 / 배지 --------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .6rem;
  border-radius: var(--r-full);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.7;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--text-2);
}
.chip-brand { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.chip-red { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.chip-green { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.chip-pink { background: color-mix(in srgb, var(--pink) 15%, transparent); color: var(--pink); }
.chip-amber { background: color-mix(in srgb, var(--amber) 18%, transparent); color: #b4740b; }
:root[data-theme="dark"] .chip-amber { color: var(--amber); }

.type-중간고사 { background: color-mix(in srgb, #5468ff 15%, transparent); color: #4a5ae8; }
.type-기말고사 { background: color-mix(in srgb, #8b5cf6 16%, transparent); color: #7c4ef0; }
.type-수행평가 { background: color-mix(in srgb, #10b981 16%, transparent); color: #0d9668; }
.type-학습지검사 { background: color-mix(in srgb, #f59e0b 20%, transparent); color: #b4740b; }
.type-기타 { background: var(--surface-3); color: var(--text-2); }
:root[data-theme="dark"] .type-중간고사 { color: #93a0ff; }
:root[data-theme="dark"] .type-기말고사 { color: #b79bff; }
:root[data-theme="dark"] .type-수행평가 { color: #34d3a3; }
:root[data-theme="dark"] .type-학습지검사 { color: #fbbf24; }

/* --- 9. 버튼 -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: .92rem; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--brand) 70%, transparent);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s, color .16s, border-color .16s;
}
.btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px -5px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn:active { transform: translateY(0); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: none;
}
.btn-ghost:hover { color: var(--brand); border-color: var(--brand); background: var(--surface); box-shadow: var(--shadow-sm); }

.btn-soft {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  box-shadow: none;
}
.btn-soft:hover { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand); box-shadow: none; }

.btn-danger { background: none; color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); box-shadow: none; }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); box-shadow: none; }

.btn-sm { padding: .38rem .85rem; font-size: .84rem; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: .55rem; }

/* 필터 칩 바 */
.filters {
  display: flex;
  gap: .45rem;
  overflow-x: auto;
  padding-bottom: .3rem;
  margin-bottom: 1.2rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none;
  padding: .42rem .95rem;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text-2);
  font-size: .88rem; font-weight: 700;
  transition: color .16s, border-color .16s, background .16s;
}
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 70%, transparent);
}
.toolbar {
  display: flex; align-items: center; gap: 1rem; justify-content: space-between;
  margin-bottom: 1.2rem;
}
.toolbar .filters { margin-bottom: 0; }
@media (max-width: 640px) {
  .toolbar { flex-direction: column; align-items: stretch; gap: .7rem; }
  .toolbar .btn { width: 100%; }
}

/* --- 10. 퀵 액션 타일 ----------------------------------------------------- */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1.4rem; }
@media (max-width: 640px) { .quick-grid { grid-template-columns: repeat(3, 1fr); gap: .55rem; } }
.quick {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.quick:hover { color: var(--text); transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.quick-ico {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 1.1rem;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.quick-ico.v2 { background: color-mix(in srgb, var(--brand-2) 14%, transparent); }
.quick-ico.v3 { background: color-mix(in srgb, var(--green) 14%, transparent); }
.quick strong { font-size: .95rem; font-weight: 700; letter-spacing: -.02em; }
.quick-sub { font-size: .78rem; color: var(--text-2); }
@media (max-width: 480px) {
  .quick { padding: .85rem .6rem; align-items: center; text-align: center; gap: .45rem; }
  .quick-sub { display: none; }
  .quick strong { font-size: .84rem; }
  .quick-ico { width: 34px; height: 34px; font-size: 1rem; }
}

/* --- 11. 리스트 행 -------------------------------------------------------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: .8rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--border);
  color: inherit;
}
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row:first-child { padding-top: 0; }
a.row { transition: opacity .15s; }
a.row:hover { color: inherit; opacity: .72; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; font-size: .95rem; letter-spacing: -.01em; }
.row-sub { font-size: .82rem; color: var(--text-2); display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.row-end { flex: none; text-align: right; }

.date-tile {
  flex: none;
  width: 46px;
  padding: .35rem 0;
  border-radius: 12px;
  background: var(--surface-2);
  text-align: center;
  line-height: 1.15;
}
.date-tile .m { font-size: .66rem; font-weight: 700; color: var(--text-3); }
.date-tile .d { font-size: 1.1rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* --- 12. 자료 카드 (필기/기출) -------------------------------------------- */
.file-card { display: flex; flex-direction: column; overflow: hidden; }
.file-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease); }
.card-link:hover .file-thumb img { transform: scale(1.05); }
.file-thumb-fallback {
  width: 100%; height: 100%;
  display: grid; place-items: center; gap: .3rem;
  align-content: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, transparent), color-mix(in srgb, var(--brand-2) 14%, transparent));
}
.file-thumb-fallback .ext {
  font-size: .78rem; font-weight: 800; letter-spacing: .1em;
  color: var(--brand);
}
.file-thumb-fallback .glyph { font-size: 1.8rem; }
.file-badges { position: absolute; top: .6rem; left: .6rem; display: flex; gap: .3rem; flex-wrap: wrap; }
.file-badges .chip {
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.file-body { padding: .95rem 1.05rem 1.05rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.file-title { font-weight: 700; font-size: .98rem; letter-spacing: -.02em; line-height: 1.4; }
.file-desc {
  font-size: .84rem; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.file-foot {
  margin-top: auto; padding-top: .6rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  font-size: .8rem; color: var(--text-3);
}
.author { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--text-2); }
.author .avatar { width: 20px; height: 20px; font-size: .62rem; }

/* --- 13. 아코디언 (평가 일정) --------------------------------------------- */
.accordion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: .8rem;
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s;
}
.accordion[open] { box-shadow: var(--shadow-md); }
.accordion > summary {
  cursor: pointer;
  list-style: none;
  padding: 1.05rem 1.25rem;
  display: flex; align-items: center; gap: .75rem;
  font-weight: 800;
}
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary:hover { background: var(--surface-2); }
.subject-dot {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  font-size: .95rem; font-weight: 800;
}
.summary-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.summary-title { font-size: 1.02rem; letter-spacing: -.02em; }
.summary-sub { font-size: .8rem; font-weight: 500; color: var(--text-2); }
.summary-caret {
  flex: none; color: var(--text-3);
  transition: transform .25s var(--ease);
}
.accordion[open] > summary .summary-caret { transform: rotate(180deg); }
.accordion-body { padding: 0 1.25rem 1.25rem; border-top: 1px solid var(--border); padding-top: 1.1rem; }

.timeline { display: flex; flex-direction: column; gap: .7rem; }
.tl-item {
  display: flex; gap: .85rem;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.tl-item.is-past { opacity: .62; }
.tl-main { flex: 1; min-width: 0; }
.tl-head { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-bottom: .25rem; }
.tl-date { font-size: .85rem; font-weight: 700; color: var(--text-2); }
.tl-scope { font-size: .9rem; }
.tl-note { font-size: .82rem; color: var(--text-3); margin-top: .3rem; }
.past-toggle { margin-top: 1rem; font-size: .85rem; color: var(--text-2); font-weight: 700; cursor: pointer; }

/* --- 14. 폼 -------------------------------------------------------------- */
.form p { margin-bottom: 1.05rem; }
.form label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: .4rem; }
.form input[type=text], .form input[type=password], .form input[type=number],
.form input[type=email], .form input[type=date], .form select, .form textarea {
  width: 100%;
  padding: .68rem .9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.form textarea { resize: vertical; min-height: 90px; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
}
.form input::placeholder, .form textarea::placeholder { color: var(--text-3); }
.form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93a7' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .8rem center;
  background-size: 16px;
  padding-right: 2.4rem;
}
.form input[type=file] {
  width: 100%;
  padding: .8rem;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: .88rem;
  cursor: pointer;
}
.form input[type=file]:hover { border-color: var(--brand); }
.form input[type=file]::file-selector-button {
  margin-right: .8rem;
  padding: .4rem .9rem;
  border: 0;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--brand);
  font-weight: 700; font-size: .85rem;
  cursor: pointer;
}
.form .helptext { display: block; font-size: .79rem; color: var(--text-3); margin-top: .35rem; }
.form .errorlist { list-style: none; color: var(--red); font-size: .84rem; margin-bottom: .35rem; font-weight: 600; }
.form-actions { display: flex; gap: .6rem; margin-top: 1.3rem; }
.form-actions .btn { flex: 1; }

/* --- 15. 메시지 / 알림 ---------------------------------------------------- */
.messages { list-style: none; display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1.2rem; }
.messages li {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .8rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--green) 32%, transparent);
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  color: var(--text);
  font-size: .92rem; font-weight: 600;
  box-shadow: var(--shadow-sm);
  animation: pop-in .3s var(--ease);
}
.messages li.error, .messages li.warning {
  border-color: color-mix(in srgb, var(--red) 32%, transparent);
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px); } }

.alert {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .75rem .95rem;
  border-radius: var(--r-md);
  font-size: .88rem; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
  color: var(--text);
  margin-bottom: 1rem;
}
.alert-warn {
  border-color: color-mix(in srgb, var(--amber) 40%, transparent);
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
}

/* --- 16. 빈 상태 ---------------------------------------------------------- */
.empty { text-align: center; padding: 2.6rem 1.2rem; }
.empty .glyph {
  width: 62px; height: 62px;
  margin: 0 auto .9rem;
  display: grid; place-items: center;
  border-radius: 20px;
  font-size: 1.7rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 13%, transparent), color-mix(in srgb, var(--brand-2) 15%, transparent));
}
.empty h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.empty p { color: var(--text-2); font-size: .9rem; margin-bottom: 1.2rem; }
.empty p:last-child { margin-bottom: 0; }
.empty-sm { padding: 1.5rem .5rem; }
.empty-sm .glyph { width: 48px; height: 48px; font-size: 1.35rem; border-radius: 16px; margin-bottom: .7rem; }
.empty-sm h3 { font-size: .98rem; }
.empty-sm p { margin-bottom: .9rem; }

/* --- 17. 인증 화면 -------------------------------------------------------- */
.auth-wrap { max-width: 430px; margin: clamp(.5rem, 4vw, 2.5rem) auto; }
.auth-card { padding: clamp(1.4rem, 5vw, 2rem); border-radius: var(--r-xl); box-shadow: var(--shadow-md); }
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-mark {
  width: 66px; height: 66px;
  margin: 0 auto 1rem;
  display: grid; place-items: center;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px -6px rgba(20, 26, 60, .18);
}
:root[data-theme="dark"] .auth-mark {
  background: #f7f8fc;
  border-color: rgba(255, 255, 255, .16);
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .6);
}
.auth-mark img { width: 38px; height: 38px; }
.auth-head h1 { font-size: 1.4rem; }
.auth-head p { color: var(--text-2); font-size: .89rem; margin-top: .4rem; }
.auth-foot { text-align: center; margin-top: 1.3rem; font-size: .88rem; color: var(--text-2); }
.auth-foot a { font-weight: 700; }
.divider {
  display: flex; align-items: center; gap: .8rem;
  margin: 1.2rem 0;
  color: var(--text-3); font-size: .78rem; font-weight: 600;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* --- 18. 상세 보기 -------------------------------------------------------- */
.back-link {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .88rem; font-weight: 700; color: var(--text-2);
  margin-bottom: 1rem;
}
.back-link:hover { color: var(--brand); }
.detail-head { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.viewer {
  margin-top: 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-2);
}
.viewer img { width: 100%; height: auto; }
.file-drop {
  display: flex; align-items: center; gap: .9rem;
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.file-drop .glyph {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, transparent), color-mix(in srgb, var(--brand-2) 16%, transparent));
  font-size: 1.2rem;
}

/* --- 19. 테이블 (관리 화면) ----------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .7rem .55rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
thead th, tr:first-child th { font-size: .78rem; font-weight: 700; color: var(--text-3); letter-spacing: .02em; }
tbody tr:last-child td, tr:last-child td { border-bottom: 0; }

/* --- 20. 푸터 ------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  padding: 2rem 0 2.6rem;
  text-align: center;
}
footer .foot-name { font-weight: 800; letter-spacing: -.02em; margin-bottom: .25rem; }
footer .foot-sub { color: var(--text-2); font-size: .85rem; }
footer .foot-meta { color: var(--text-3); font-size: .76rem; margin-top: .8rem; }

/* --- 21. 모션 ------------------------------------------------------------- */
.reveal { animation: reveal .5s var(--ease) both; }
.reveal:nth-child(1) { animation-delay: .02s; }
.reveal:nth-child(2) { animation-delay: .07s; }
.reveal:nth-child(3) { animation-delay: .12s; }
.reveal:nth-child(4) { animation-delay: .17s; }
.reveal:nth-child(5) { animation-delay: .22s; }
.reveal:nth-child(n+6) { animation-delay: .26s; }
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- 22. 생일 배너 -------------------------------------------------------- */
.bday-banner {
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; gap: 1.1rem;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.1rem;
  border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--pink) 28%, transparent);
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--amber) 14%, var(--surface)),
    color-mix(in srgb, var(--pink) 14%, var(--surface)));
  box-shadow: var(--shadow-sm);
}
.bday-glow {
  width: 54px; height: 54px; flex: none;
  display: grid; place-items: center;
  border-radius: 18px;
  font-size: 1.7rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: bday-bob 2.6s ease-in-out infinite;
}
@keyframes bday-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-5px) rotate(4deg); } }
.bday-eyebrow { font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--pink); }
.bday-names { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.35; }
.bday-sub { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .85rem; color: var(--text-2); margin-top: .25rem; }

/* --- 23. 공지 ------------------------------------------------------------- */
.notices { display: flex; flex-direction: column; gap: .7rem; }
.notice {
  padding: .9rem 1rem .9rem 1.1rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border-left: 3px solid var(--brand);
}
.notice-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; margin-bottom: .25rem; }
.notice-head h3 { font-size: .96rem; }
.notice p { font-size: .9rem; color: var(--text-2); }

/* 지난 평가 토글 */
.past-details > summary { list-style: none; }
.past-details > summary::-webkit-details-marker { display: none; }
.past-details > summary::before { content: "▸ "; }
.past-details[open] > summary::before { content: "▾ "; }
.past-details > summary:hover { color: var(--brand); }

.file-chosen { color: var(--brand) !important; font-weight: 600; }

/* --- 24. 유틸 ------------------------------------------------------------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .6rem; }
.mt-2 { margin-top: 1.1rem; }
.mb-1 { margin-bottom: .6rem; }
.mb-2 { margin-bottom: 1.1rem; }
.flex { display: flex; align-items: center; gap: .5rem; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
