/* ===============================
   Milseong Attendance V2 RC9-2.5
   Color Edition + App Icon UI
   - 캐릭터 이미지 없음 / 저작권 안전
   - localStorage only / Firestore read +0
================================ */
:root{
  --ms-bg:#f6f8fc;
  --ms-surface:#ffffff;
  --ms-surface-2:#f8fafc;
  --ms-surface-3:#eef4ff;
  --ms-text:#111827;
  --ms-heading:#0f172a;
  --ms-muted:#526174;
  --ms-soft-text:#334155;
  --ms-primary:#2563eb;
  --ms-primary-2:#1d4ed8;
  --ms-accent:#7c3aed;
  --ms-border:#d7e0ee;
  --ms-success:#16a34a;
  --ms-danger:#ef4444;
  --ms-warning:#f59e0b;
  --ms-radius:24px;
  --ms-radius-sm:16px;
  --ms-shadow:0 18px 45px rgba(15,23,42,.10);
  --ms-shadow-soft:0 8px 22px rgba(15,23,42,.075);
  --ms-gradient:linear-gradient(135deg,#2563eb 0%,#7c3aed 100%);
  --ms-bg-pattern:radial-gradient(circle at 12% 10%,rgba(37,99,235,.10),transparent 26%),linear-gradient(180deg,#f8fbff 0%,#f6f8fc 100%);
  --ms-card-grad:linear-gradient(135deg,#ffffff 0%,#fbfdff 100%);
  --ms-header-text:#ffffff;
  --ms-header-sub:#eef6ff;
  --ms-icon-bg:linear-gradient(135deg,#dbeafe,#eef2ff);
  --ms-icon-color:#2563eb;
}
html[data-theme="blue"]{
  --ms-bg:#eef7ff;--ms-surface:#ffffff;--ms-surface-2:#f0f8ff;--ms-surface-3:#e0f2fe;
  --ms-text:#0f172a;--ms-heading:#082f49;--ms-muted:#36546d;--ms-soft-text:#1f3b55;
  --ms-primary:#005bac;--ms-primary-2:#004a8f;--ms-accent:#00a3e0;--ms-border:#b9d9ff;
  --ms-gradient:linear-gradient(135deg,#005bac 0%,#00a3e0 100%);
  --ms-bg-pattern:radial-gradient(circle at 14% 7%,rgba(0,91,172,.14),transparent 25%),radial-gradient(circle at 90% 12%,rgba(0,163,224,.18),transparent 28%),linear-gradient(180deg,#eef7ff,#f8fbff);
  --ms-icon-bg:linear-gradient(135deg,#bfdbfe,#e0f2fe);--ms-icon-color:#005bac;
}
html[data-theme="green"]{
  --ms-bg:#f0fdf8;--ms-surface:#ffffff;--ms-surface-2:#f1fff8;--ms-surface-3:#dcfce7;
  --ms-text:#10231b;--ms-heading:#064e3b;--ms-muted:#426458;--ms-soft-text:#1f4337;
  --ms-primary:#10b981;--ms-primary-2:#059669;--ms-accent:#84cc16;--ms-border:#b7efd7;
  --ms-gradient:linear-gradient(135deg,#10b981 0%,#84cc16 100%);
  --ms-bg-pattern:radial-gradient(circle at 10% 12%,rgba(16,185,129,.16),transparent 26%),radial-gradient(circle at 88% 8%,rgba(132,204,22,.15),transparent 28%),linear-gradient(180deg,#effdf7,#fbfffd);
  --ms-icon-bg:linear-gradient(135deg,#bbf7d0,#ccfbf1);--ms-icon-color:#059669;
}
html[data-theme="pink"]{
  --ms-bg:#fff6fa;--ms-surface:#ffffff;--ms-surface-2:#fff1f7;--ms-surface-3:#ffe4ef;
  --ms-text:#351827;--ms-heading:#8a123f;--ms-muted:#745266;--ms-soft-text:#5a2d45;
  --ms-primary:#ec4899;--ms-primary-2:#db2777;--ms-accent:#fb7185;--ms-border:#ffc5dc;
  --ms-gradient:linear-gradient(135deg,#ec4899 0%,#fb7185 100%);
  --ms-bg-pattern:radial-gradient(circle at 12% 8%,rgba(236,72,153,.14),transparent 25%),radial-gradient(circle at 94% 14%,rgba(251,113,133,.16),transparent 30%),linear-gradient(180deg,#fff6fa,#fff);
  --ms-icon-bg:linear-gradient(135deg,#fce7f3,#ffe4e6);--ms-icon-color:#db2777;
}
html[data-theme="purple"]{
  --ms-bg:#f8f5ff;--ms-surface:#ffffff;--ms-surface-2:#f5f0ff;--ms-surface-3:#ede9fe;
  --ms-text:#241c35;--ms-heading:#4c1d95;--ms-muted:#5f5275;--ms-soft-text:#423158;
  --ms-primary:#7c3aed;--ms-primary-2:#6d28d9;--ms-accent:#a855f7;--ms-border:#d8c7ff;
  --ms-gradient:linear-gradient(135deg,#7c3aed 0%,#a855f7 100%);
  --ms-bg-pattern:radial-gradient(circle at 10% 8%,rgba(124,58,237,.14),transparent 25%),radial-gradient(circle at 92% 10%,rgba(168,85,247,.16),transparent 28%),linear-gradient(180deg,#f8f5ff,#fff);
  --ms-icon-bg:linear-gradient(135deg,#ede9fe,#f3e8ff);--ms-icon-color:#7c3aed;
}
html[data-theme="lovely"]{
  --ms-bg:#fff8ee;--ms-surface:#ffffff;--ms-surface-2:#fff7fb;--ms-surface-3:#fff0d6;
  --ms-text:#2d2230;--ms-heading:#9f1239;--ms-muted:#6f5868;--ms-soft-text:#563548;
  --ms-primary:#ff5f8f;--ms-primary-2:#f43f7f;--ms-accent:#22c55e;--ms-border:#ffd1df;
  --ms-gradient:linear-gradient(135deg,#ff5f8f 0%,#a78bfa 48%,#38bdf8 100%);
  --ms-bg-pattern:radial-gradient(circle at 12% 10%,rgba(255,95,143,.18),transparent 22%),radial-gradient(circle at 88% 9%,rgba(56,189,248,.18),transparent 24%),radial-gradient(circle at 50% 0%,rgba(250,204,21,.15),transparent 28%),linear-gradient(180deg,#fff8ee,#fff7fb 55%,#f8fdff);
  --ms-icon-bg:linear-gradient(135deg,#ffe4ef,#dbeafe);--ms-icon-color:#ec4899;
}
html[data-theme="dark"]{
  --ms-bg:#0b1220;--ms-surface:#121c2d;--ms-surface-2:#172236;--ms-surface-3:#21304c;
  --ms-text:#f8fafc;--ms-heading:#ffffff;--ms-muted:#d7e0ee;--ms-soft-text:#eef2ff;
  --ms-primary:#60a5fa;--ms-primary-2:#3b82f6;--ms-accent:#a78bfa;--ms-border:#3a4a66;
  --ms-shadow:0 18px 45px rgba(0,0,0,.38);--ms-shadow-soft:0 8px 24px rgba(0,0,0,.30);
  --ms-gradient:linear-gradient(135deg,#3b82f6 0%,#8b5cf6 100%);
  --ms-bg-pattern:radial-gradient(circle at 10% 7%,rgba(96,165,250,.12),transparent 24%),radial-gradient(circle at 92% 11%,rgba(167,139,250,.12),transparent 26%),linear-gradient(180deg,#101827 0%,#0b1220 100%);
  --ms-card-grad:linear-gradient(135deg,#121c2d 0%,#101827 100%);
  --ms-icon-bg:linear-gradient(135deg,#1d4ed8,#312e81);--ms-icon-color:#dbeafe;
}

html{background:var(--ms-bg)!important;}
body{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;max-width:none!important;background:var(--ms-bg-pattern)!important;color:var(--ms-text)!important;line-height:1.55!important;}
body::before{content:"";position:fixed;inset:0;z-index:-2;pointer-events:none;background:linear-gradient(180deg,rgba(255,255,255,.42),transparent 36%);}html[data-theme="dark"] body::before{background:linear-gradient(180deg,rgba(96,165,250,.08),transparent 40%)}
.app,.container,main,.pc-wide{position:relative;}#portal,.app,.container,main,.pc-wide{max-width:1120px!important;margin-left:auto!important;margin-right:auto!important;}
.card,.box,.login-card,.panel,.section,.tableBox,.summaryBox,.emptyBox,#loginBox,#portal>div:first-child{background:var(--ms-card-grad)!important;color:var(--ms-text)!important;border:1px solid var(--ms-border)!important;border-radius:var(--ms-radius)!important;box-shadow:var(--ms-shadow-soft)!important;}
h1,h2,h3,h4,.menuTitle,.portalSectionTitle{color:var(--ms-heading)!important;letter-spacing:-.035em;font-weight:900!important;}.subText,.sub-text,.hint,#teacherInfo,#studentInfo,.muted,small{color:var(--ms-muted)!important;}

/* Header readability */
.topHeader{position:relative;overflow:hidden;background:var(--ms-gradient)!important;color:var(--ms-header-text)!important;border:1px solid color-mix(in srgb,var(--ms-primary) 28%,white)!important;border-radius:0 0 28px 28px!important;box-shadow:var(--ms-shadow)!important;padding:22px 26px!important;}
.topHeader::after{content:"";position:absolute;right:-38px;top:-42px;width:180px;height:180px;border-radius:999px;background:rgba(255,255,255,.18);pointer-events:none;}.topHeader>div,.topHeader button{position:relative;z-index:1;}.topHeader h1{color:#fff!important;text-shadow:0 1px 8px rgba(0,0,0,.18)!important;}.topHeader p,#teacherInfo,#studentInfo{color:#f8fbff!important;text-shadow:0 1px 6px rgba(0,0,0,.16)!important;font-weight:800!important;opacity:1!important;}.dark,.logoutBtn,#logoutBtn{background:#243244!important;color:#fff!important;border:1px solid rgba(255,255,255,.26)!important;box-shadow:0 8px 18px rgba(15,23,42,.18)!important;}
html[data-theme="dark"] .topHeader p,html[data-theme="dark"] #teacherInfo,html[data-theme="dark"] #studentInfo{color:#eaf2ff!important;}

button,.primary-btn,.smallBtn,.menuBtn,.portalMenuBtn{border-radius:var(--ms-radius-sm)!important;transition:transform .15s ease,box-shadow .15s ease,background .15s ease,border-color .15s ease!important;}button:active,.primary-btn:active,.portalMenuBtn:active{transform:scale(.985)!important;}.primary,.primary-btn,button.primaryBtn,button[type="submit"]{background:var(--ms-gradient)!important;color:#fff!important;border:0!important;box-shadow:0 10px 24px color-mix(in srgb,var(--ms-primary) 26%,transparent)!important;}button:not(.secondary-btn):not(.danger-btn):not(.gray):not(.dark):not(.menuBtn):not(.portalMenuBtn):not(.smallBtn):not(.themeChip):not(.tab){background:var(--ms-gradient);color:#fff;border:0;}
input,select,textarea{background:var(--ms-surface)!important;color:var(--ms-text)!important;border:1px solid var(--ms-border)!important;border-radius:var(--ms-radius-sm)!important;}input::placeholder,textarea::placeholder{color:color-mix(in srgb,var(--ms-muted) 78%,transparent)!important;}input:focus,select:focus,textarea:focus{border-color:var(--ms-primary)!important;box-shadow:0 0 0 4px color-mix(in srgb,var(--ms-primary) 16%,transparent)!important;}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:#0f172a!important;color:#f8fafc!important;border-color:#52617c!important;}html[data-theme="dark"] .form-group label{color:#e5edf8!important;}

/* App-like menu cards */
.menuGrid,#menuArea{gap:14px!important;}#menuArea{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:stretch!important;}#menuArea .portalSectionTitle,#menuArea .menuTitle{grid-column:1 / -1!important;}.portalSectionTitle,.menuTitle{margin:26px 2px 8px!important;padding-top:16px!important;border-top:1px solid var(--ms-border)!important;font-size:15px!important;color:var(--ms-heading)!important;}
.portalMenuBtn,.menuBtn{position:relative!important;min-height:96px!important;display:grid!important;grid-template-columns:68px minmax(0,1fr) 18px!important;grid-template-rows:auto auto!important;column-gap:16px!important;row-gap:4px!important;align-items:center!important;padding:18px 18px!important;background:var(--ms-surface)!important;color:var(--ms-text)!important;border:1px solid var(--ms-border)!important;box-shadow:var(--ms-shadow-soft)!important;text-align:left!important;overflow:hidden!important;}
.portalMenuBtn::after,.menuBtn::after{content:"›";grid-column:3;grid-row:1 / 3;align-self:center;justify-self:end;color:var(--ms-primary);font-size:30px;font-weight:900;line-height:1;}.portalMenuBtn:hover,.menuBtn:hover{border-color:var(--ms-primary)!important;box-shadow:0 15px 30px color-mix(in srgb,var(--ms-primary) 16%,transparent)!important;transform:translateY(-1px)!important;}
.portalMenuIcon,.menuBtn::before{grid-column:1!important;grid-row:1 / 3!important;width:62px!important;height:62px!important;min-width:62px!important;min-height:62px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;margin:0!important;border-radius:22px!important;background:var(--ms-icon-bg)!important;color:var(--ms-icon-color)!important;font-size:28px!important;line-height:1!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.55),0 8px 18px color-mix(in srgb,var(--ms-primary) 16%,transparent)!important;}
.menuBtn::before{content:"✨";}.portalMenuTitle,.portalMenuBtn strong{grid-column:2!important;grid-row:1!important;min-width:0!important;display:block!important;color:var(--ms-heading)!important;font-size:17px!important;font-weight:950!important;letter-spacing:-.03em!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}.portalMenuDesc,.portalMenuBtn span:not(.portalMenuIcon){grid-column:2!important;grid-row:2!important;min-width:0!important;display:block!important;color:var(--ms-soft-text)!important;font-size:13px!important;font-weight:750!important;line-height:1.36!important;white-space:normal!important;word-break:keep-all!important;}
.portalMenuBtn.menu-supervisor{--ms-icon-bg:linear-gradient(135deg,#dbeafe,#bfdbfe);--ms-icon-color:#2563eb}.portalMenuBtn.menu-homeroom{--ms-icon-bg:linear-gradient(135deg,#dcfce7,#bbf7d0);--ms-icon-color:#16a34a}.portalMenuBtn.menu-grade{--ms-icon-bg:linear-gradient(135deg,#ffedd5,#fed7aa);--ms-icon-color:#f97316}.portalMenuBtn.menu-admin{--ms-icon-bg:linear-gradient(135deg,#fee2e2,#fecaca);--ms-icon-color:#dc2626}.portalMenuBtn.menu-viewer{--ms-icon-bg:linear-gradient(135deg,#ede9fe,#ddd6fe);--ms-icon-color:#7c3aed}.portalMenuBtn.menu-common{--ms-icon-bg:linear-gradient(135deg,#eef2ff,#e0e7ff);--ms-icon-color:var(--ms-primary)}
html[data-theme="lovely"] .portalMenuBtn:nth-of-type(6n+1){--ms-icon-bg:linear-gradient(135deg,#ffe4ef,#fbcfe8);--ms-icon-color:#ec4899;}html[data-theme="lovely"] .portalMenuBtn:nth-of-type(6n+2){--ms-icon-bg:linear-gradient(135deg,#ccfbf1,#a7f3d0);--ms-icon-color:#10b981;}html[data-theme="lovely"] .portalMenuBtn:nth-of-type(6n+3){--ms-icon-bg:linear-gradient(135deg,#fef3c7,#fde68a);--ms-icon-color:#f59e0b;}html[data-theme="lovely"] .portalMenuBtn:nth-of-type(6n+4){--ms-icon-bg:linear-gradient(135deg,#dbeafe,#bae6fd);--ms-icon-color:#0284c7;}html[data-theme="lovely"] .portalMenuBtn:nth-of-type(6n+5){--ms-icon-bg:linear-gradient(135deg,#ede9fe,#f5d0fe);--ms-icon-color:#9333ea;}html[data-theme="lovely"] .portalMenuBtn:nth-of-type(6n+6){--ms-icon-bg:linear-gradient(135deg,#ffe4e6,#fed7aa);--ms-icon-color:#f43f5e;}
html[data-theme="dark"] .portalMenuBtn,html[data-theme="dark"] .menuBtn{background:#121c2d!important;color:#f8fafc!important;border-color:#3a4a66!important;}html[data-theme="dark"] .portalMenuTitle,html[data-theme="dark"] .portalMenuBtn strong{color:#fff!important;}html[data-theme="dark"] .portalMenuDesc,html[data-theme="dark"] .portalMenuBtn span:not(.portalMenuIcon){color:#dbe7f7!important;}html[data-theme="dark"] .portalMenuIcon{box-shadow:0 0 0 1px rgba(255,255,255,.07),0 10px 24px rgba(0,0,0,.26)!important;}

/* Login slider */
.login-page{background:transparent!important;}.login-card{max-width:430px!important;padding:30px 24px!important;}.login-brand{text-align:center!important;}.school-logo{filter:drop-shadow(0 8px 14px rgba(15,23,42,.10));}.login-title{color:var(--ms-heading)!important;}.school-name{color:var(--ms-muted)!important;font-weight:800!important;}.tab-row{position:relative!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:0!important;padding:5px!important;border-radius:999px!important;background:color-mix(in srgb,var(--ms-primary) 9%,var(--ms-surface))!important;border:1px solid var(--ms-border)!important;box-shadow:inset 0 1px 3px rgba(15,23,42,.06)!important;overflow:hidden!important;}.tab-row::before{content:"";position:absolute;top:5px;bottom:5px;left:5px;width:calc(50% - 5px);border-radius:999px;background:var(--ms-gradient);box-shadow:0 7px 18px color-mix(in srgb,var(--ms-primary) 23%,transparent);transition:transform .22s ease;}.tab-row:has(#teacherTab.active)::before{transform:translateX(100%);}.tab{position:relative!important;z-index:1!important;background:transparent!important;border:0!important;box-shadow:none!important;color:var(--ms-muted)!important;font-weight:950!important;padding:13px 8px!important;}.tab.active{color:#fff!important;background:transparent!important;box-shadow:none!important;}
html[data-theme="dark"] .login-card{background:#121c2d!important;}html[data-theme="dark"] .school-name{color:#cbd5e1!important;}html[data-theme="dark"] .login-title{color:#fff!important;}html[data-theme="dark"] .tab-row{background:#0f172a!important;border-color:#52617c!important;}.form-group label{color:var(--ms-heading)!important;}

.secondary-btn,.sub,.gray{background:var(--ms-surface)!important;color:var(--ms-text)!important;border:1px solid var(--ms-border)!important;box-shadow:var(--ms-shadow-soft)!important;}.danger-btn,.danger,.deleteBtn{background:var(--ms-danger)!important;color:#fff!important;}table{background:var(--ms-surface)!important;border-radius:16px;overflow:hidden;}th{background:var(--ms-surface-2)!important;color:var(--ms-heading)!important;}td,th{border-color:var(--ms-border)!important;color:var(--ms-text)!important;}tr:hover td{background:color-mix(in srgb,var(--ms-primary) 6%,transparent)!important;}
.ms-theme-panel{position:fixed;right:14px;bottom:14px;z-index:99998;display:flex;gap:6px;align-items:center;padding:8px;border-radius:999px;background:color-mix(in srgb,var(--ms-surface) 94%,transparent);border:1px solid var(--ms-border);box-shadow:var(--ms-shadow);backdrop-filter:blur(12px)}.themeChip{width:auto!important;min-height:34px!important;margin:0!important;padding:7px 10px!important;border-radius:999px!important;border:1px solid var(--ms-border)!important;background:var(--ms-surface)!important;color:var(--ms-text)!important;font-size:12px!important;font-weight:900!important}.themeChip.active{background:var(--ms-gradient)!important;color:#fff!important;border-color:transparent!important}.themeToggle{display:none;}
@media(max-width:900px){#menuArea{grid-template-columns:1fr!important;}.topHeader{border-radius:22px!important;margin:12px!important;}}
@media(max-width:640px){body{padding-left:10px!important;padding-right:10px!important}.app,#portal{padding-bottom:76px}.card,.box,.login-card{border-radius:24px!important}.ms-theme-panel{left:10px;right:10px;bottom:10px;justify-content:flex-start;overflow-x:auto}.themeChip{white-space:nowrap;font-size:11px!important;padding:7px 9px!important}h1{font-size:1.55rem!important}h2{font-size:1.35rem!important}.portalMenuBtn,.menuBtn{min-height:88px!important;grid-template-columns:60px minmax(0,1fr) 16px!important;column-gap:14px!important;padding:15px 14px!important}.portalMenuIcon,.menuBtn::before{width:56px!important;height:56px!important;min-width:56px!important;min-height:56px!important;border-radius:20px!important;font-size:25px!important}.portalMenuTitle,.portalMenuBtn strong{font-size:16px!important}.portalMenuDesc,.portalMenuBtn span:not(.portalMenuIcon){font-size:12.5px!important}.topHeader{padding:18px 18px!important}.topHeader::after{right:-70px;top:-70px}}

/* ===============================
   RC9-2.6 Deep UI Contrast Fix
   - 학생 출석/일반 카드 내부까지 테마 적용
   - 다크모드 글자 묻힘 방지
   - 버튼/상태/최근기록/셀렉트 테마화
================================ */
body {
  color: var(--ms-text) !important;
}

/* 페이지 상단 제목/사용자 정보가 배경에 묻히지 않도록 보정 */
body > h1,
body > h2,
body > h3,
body > p:first-of-type,
#studentInfo,
#teacherInfo,
#dateInfo {
  color: var(--ms-heading) !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

html[data-theme="dark"] body > h1,
html[data-theme="dark"] body > h2,
html[data-theme="dark"] body > h3,
html[data-theme="dark"] body > p:first-of-type,
html[data-theme="dark"] #studentInfo,
html[data-theme="dark"] #teacherInfo,
html[data-theme="dark"] #dateInfo {
  color: #f8fafc !important;
}

/* 헤더 내부 정보만 흰색 유지 */
.topHeader #studentInfo,
.topHeader #teacherInfo,
.topHeader p {
  color: #f8fbff !important;
  text-shadow: 0 1px 6px rgba(0,0,0,.20) !important;
}

/* 일반 카드 내부 요소까지 확실히 테마화 */
.card,
.box,
.panel,
.section,
.summaryBox,
.tableBox,
.emptyBox {
  background: var(--ms-card-grad) !important;
  color: var(--ms-text) !important;
  border-color: var(--ms-border) !important;
}

.card h1,.card h2,.card h3,.card h4,
.box h1,.box h2,.box h3,.box h4,
.panel h1,.panel h2,.panel h3,.panel h4 {
  color: var(--ms-heading) !important;
}

.card p,.card div,.card span,.card label,
.box p,.box div,.box span,.box label,
.panel p,.panel div,.panel span,.panel label {
  color: inherit;
}

.hint,
.subText,
.sub-text,
.muted,
small,
#periodInfo,
#todayArea {
  color: var(--ms-muted) !important;
}

html[data-theme="dark"] .hint,
html[data-theme="dark"] .subText,
html[data-theme="dark"] .sub-text,
html[data-theme="dark"] .muted,
html[data-theme="dark"] small,
html[data-theme="dark"] #periodInfo,
html[data-theme="dark"] #todayArea {
  color: #dbe7f7 !important;
}

/* 학생 출석 화면: 카드 안쪽도 앱 카드처럼 */
.status,
#statusBox {
  background: color-mix(in srgb, var(--ms-primary) 10%, var(--ms-surface)) !important;
  color: var(--ms-heading) !important;
  border: 1px solid var(--ms-border) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.50) !important;
}

html[data-theme="dark"] .status,
html[data-theme="dark"] #statusBox {
  background: #18263c !important;
  color: #ffffff !important;
  border-color: #52617c !important;
}

.period {
  background: var(--ms-surface-2) !important;
  color: var(--ms-text) !important;
  border-color: var(--ms-border) !important;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--ms-primary) 7%, transparent) !important;
}

.period b {
  color: var(--ms-heading) !important;
}

html[data-theme="dark"] .period {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: #52617c !important;
}

html[data-theme="dark"] .period b {
  color: #ffffff !important;
}

/* 안내/오류/경고 색상 대비 */
.ok {
  color: var(--ms-success) !important;
}
.err {
  color: var(--ms-danger) !important;
}
.warn,
#msg.warn {
  color: var(--ms-warning) !important;
}
#msg {
  font-weight: 900 !important;
}
html[data-theme="dark"] .warn,
html[data-theme="dark"] #msg.warn {
  color: #fbbf24 !important;
}
html[data-theme="dark"] .err {
  color: #fca5a5 !important;
}
html[data-theme="dark"] .ok {
  color: #86efac !important;
}

/* 배지 대비 */
.badge {
  border: 1px solid rgba(255,255,255,.35) !important;
  box-shadow: 0 4px 10px rgba(15,23,42,.08) !important;
}
.b-ok { background:#dcfce7 !important; color:#14532d !important; }
.b-warn { background:#fef3c7 !important; color:#78350f !important; }
.b-gray { background:#e5e7eb !important; color:#111827 !important; }
.b-err { background:#fee2e2 !important; color:#7f1d1d !important; }
html[data-theme="dark"] .b-ok { background:#064e3b !important; color:#d1fae5 !important; }
html[data-theme="dark"] .b-warn { background:#78350f !important; color:#fef3c7 !important; }
html[data-theme="dark"] .b-gray { background:#334155 !important; color:#f8fafc !important; }
html[data-theme="dark"] .b-err { background:#7f1d1d !important; color:#fee2e2 !important; }

/* 버튼: disabled도 너무 흐리지 않게 */
button:disabled,
.primary:disabled,
.primary-btn:disabled {
  opacity: 1 !important;
  background: color-mix(in srgb, var(--ms-muted) 24%, var(--ms-surface-3)) !important;
  color: var(--ms-soft-text) !important;
  border: 1px solid var(--ms-border) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] button:disabled,
html[data-theme="dark"] .primary:disabled,
html[data-theme="dark"] .primary-btn:disabled {
  background: #23324a !important;
  color: #dbe7f7 !important;
  border-color: #52617c !important;
}

.back,
#logoutBtn,
.logoutBtn {
  background: #243244 !important;
  color: #ffffff !important;
}

/* 입력창/셀렉트: 다크 포함 대비 강화 */
select option {
  background: var(--ms-surface) !important;
  color: var(--ms-text) !important;
}
html[data-theme="dark"] select option {
  background: #0f172a !important;
  color: #f8fafc !important;
}

/* 테마별로 안쪽 버튼/카드도 색감이 보이게 */
html[data-theme="blue"] .card { box-shadow: 0 12px 28px rgba(0,91,172,.09) !important; }
html[data-theme="green"] .card { box-shadow: 0 12px 28px rgba(16,185,129,.09) !important; }
html[data-theme="pink"] .card { box-shadow: 0 12px 28px rgba(236,72,153,.10) !important; }
html[data-theme="purple"] .card { box-shadow: 0 12px 28px rgba(124,58,237,.10) !important; }
html[data-theme="lovely"] .card { box-shadow: 0 14px 30px rgba(255,95,143,.11) !important; }
html[data-theme="dark"] .card { box-shadow: 0 16px 34px rgba(0,0,0,.34) !important; }

/* 학생 출석 화면처럼 body max-width가 좁게 박힌 페이지 보정 */
@media (min-width: 760px) {
  body:has(#statusBox),
  body:has(#todayArea) {
    max-width: 720px !important;
  }
}

/* ===============================
   RC9-2.7 Dark Mode Global Fix
   - 다크모드에서 inline/background white 영역의 글자 묻힘 해결
   - 캘린더/폼/표/관리 화면 공통 대비 보정
   - 포털 메뉴 아이콘 내부 그림 크기 확대
================================ */

/* 메뉴 앱 아이콘 내부 그림 확대 */
.portalMenuIcon,
.menuBtn::before {
  font-size: 38px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

@media(max-width:640px){
  .portalMenuIcon,
  .menuBtn::before {
    font-size: 34px !important;
  }
}

/* 다크모드: body에 남는 흰/회색 중앙 배경 제거 */
html[data-theme="dark"],
html[data-theme="dark"] body {
  background: var(--ms-bg-pattern) !important;
  color: #f8fafc !important;
}

/* 다크모드: 페이지 최상단 제목/사용자 정보 공통 가독성 */
html[data-theme="dark"] body > h1,
html[data-theme="dark"] body > h2,
html[data-theme="dark"] body > h3,
html[data-theme="dark"] body > p,
html[data-theme="dark"] body > div > h1,
html[data-theme="dark"] body > div > h2,
html[data-theme="dark"] body > div > h3,
html[data-theme="dark"] #studentInfo,
html[data-theme="dark"] #teacherInfo,
html[data-theme="dark"] #todayInfo,
html[data-theme="dark"] #dateInfo {
  color: #f8fafc !important;
  opacity: 1 !important;
  text-shadow: 0 1px 8px rgba(0,0,0,.45) !important;
}

/* 다크모드: 카드 안에서는 정보 문구가 너무 하얗게 날아가지 않게 */
html[data-theme="dark"] .card #studentInfo,
html[data-theme="dark"] .card #teacherInfo,
html[data-theme="dark"] .card #todayInfo,
html[data-theme="dark"] .card #dateInfo,
html[data-theme="dark"] .card .hint,
html[data-theme="dark"] .box .hint,
html[data-theme="dark"] .panel .hint,
html[data-theme="dark"] .topBox .hint {
  color: #cbd5e1 !important;
  text-shadow: none !important;
}

/* 다크모드: inline style background:white로 남는 박스들 강제 테마화 */
html[data-theme="dark"] .topBox,
html[data-theme="dark"] .tableWrap,
html[data-theme="dark"] .calendar,
html[data-theme="dark"] .calendarBox,
html[data-theme="dark"] .calendarGrid,
html[data-theme="dark"] .monthGrid,
html[data-theme="dark"] .grid,
html[data-theme="dark"] .list,
html[data-theme="dark"] .studentList,
html[data-theme="dark"] .studentRow,
html[data-theme="dark"] .row,
html[data-theme="dark"] .slot,
html[data-theme="dark"] .period,
html[data-theme="dark"] .status,
html[data-theme="dark"] .resultBox,
html[data-theme="dark"] .filterBox,
html[data-theme="dark"] .controlBox,
html[data-theme="dark"] .searchBox,
html[data-theme="dark"] .formBox {
  background: #121c2d !important;
  color: #f8fafc !important;
  border-color: #3a4a66 !important;
}

/* 다크모드: h/p/div/span/label 기본 대비 */
html[data-theme="dark"] .topBox,
html[data-theme="dark"] .topBox *,
html[data-theme="dark"] .calendar,
html[data-theme="dark"] .calendar *,
html[data-theme="dark"] .calendarBox,
html[data-theme="dark"] .calendarBox *,
html[data-theme="dark"] .calendarGrid,
html[data-theme="dark"] .calendarGrid *,
html[data-theme="dark"] .monthGrid,
html[data-theme="dark"] .monthGrid *,
html[data-theme="dark"] .resultBox,
html[data-theme="dark"] .resultBox *,
html[data-theme="dark"] .filterBox,
html[data-theme="dark"] .filterBox *,
html[data-theme="dark"] .controlBox,
html[data-theme="dark"] .controlBox *,
html[data-theme="dark"] .formBox,
html[data-theme="dark"] .formBox *,
html[data-theme="dark"] .studentList,
html[data-theme="dark"] .studentList * {
  color: #f8fafc !important;
}

/* 다크모드: 설명/보조문구는 연회색으로 */
html[data-theme="dark"] .hint,
html[data-theme="dark"] .subText,
html[data-theme="dark"] .sub-text,
html[data-theme="dark"] .muted,
html[data-theme="dark"] small {
  color: #cbd5e1 !important;
}

/* 다크모드: 표 */
html[data-theme="dark"] table,
html[data-theme="dark"] tbody,
html[data-theme="dark"] tr,
html[data-theme="dark"] td {
  background: #101827 !important;
  color: #f8fafc !important;
  border-color: #3a4a66 !important;
}
html[data-theme="dark"] th {
  background: #172236 !important;
  color: #ffffff !important;
  border-color: #3a4a66 !important;
}

/* 다크모드: 캘린더 셀. 흰 셀 + 흰 글자 문제 방지 */
html[data-theme="dark"] [class*="day"],
html[data-theme="dark"] [class*="Day"],
html[data-theme="dark"] [class*="date"],
html[data-theme="dark"] [class*="Date"],
html[data-theme="dark"] [class*="calendar"] div,
html[data-theme="dark"] [class*="Calendar"] div {
  color: #f8fafc !important;
}
html[data-theme="dark"] [class*="calendar"] [style*="background: white"],
html[data-theme="dark"] [class*="calendar"] [style*="background:white"],
html[data-theme="dark"] [class*="Calendar"] [style*="background: white"],
html[data-theme="dark"] [class*="Calendar"] [style*="background:white"] {
  background: #172236 !important;
  color: #f8fafc !important;
}

/* 다크모드: 흰 배경으로 남는 일반 div 카드 보정 */
html[data-theme="dark"] div[style*="background:white"],
html[data-theme="dark"] div[style*="background: white"],
html[data-theme="dark"] section[style*="background:white"],
html[data-theme="dark"] section[style*="background: white"] {
  background: #121c2d !important;
  color: #f8fafc !important;
  border-color: #3a4a66 !important;
}

/* 다크모드: 입력창과 옵션 */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: #52617c !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #94a3b8 !important;
}

/* 다크모드: 상태별 셀렉트는 색 유지하면서 글자 보이게 */
html[data-theme="dark"] .periodSelect.present { background:#064e3b !important; color:#d1fae5 !important; }
html[data-theme="dark"] .periodSelect.late { background:#78350f !important; color:#fef3c7 !important; }
html[data-theme="dark"] .periodSelect.absent { background:#7f1d1d !important; color:#fee2e2 !important; }
html[data-theme="dark"] .periodSelect.scheduled { background:#334155 !important; color:#f8fafc !important; }
html[data-theme="dark"] .periodSelect.exception { background:#1e3a8a !important; color:#dbeafe !important; }

/* 다크모드: 월간 감독현황의 사람 이름 pill */
html[data-theme="dark"] .teacher,
html[data-theme="dark"] .name,
html[data-theme="dark"] .pill,
html[data-theme="dark"] .chip {
  color: #ffffff !important;
  background: #21304c !important;
  border-color: #52617c !important;
}

/* 비활성 버튼 대비 추가 */
html[data-theme="dark"] button:disabled,
html[data-theme="dark"] .primary:disabled,
html[data-theme="dark"] .primary-btn:disabled {
  background: #2b3a52 !important;
  color: #e5edf8 !important;
  border-color: #52617c !important;
}


/* ===============================
   RC9-2.11 Real Icon Visibility + Student History Fix
   - The icon artwork, not the square, must be visually dominant.
   - Also fixes dark mode recent attendance white-card text.
================================ */
.portalMenuIcon {
  width: 74px !important;
  height: 74px !important;
  min-width: 74px !important;
  min-height: 74px !important;
  padding: 0 !important;
  border-radius: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  font-size: 0 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 10px 22px color-mix(in srgb,var(--ms-primary) 17%,transparent) !important;
}
.portalMenuIcon .ms-menu-svg,
.portalMenuIcon svg {
  width: 72px !important;
  height: 72px !important;
  min-width: 72px !important;
  min-height: 72px !important;
  display: block !important;
  transform: scale(1.18) !important;
  transform-origin: center !important;
  overflow: visible !important;
  filter: drop-shadow(0 5px 7px rgba(15,23,42,.16)) !important;
}
/* Fallback for pages/browsers still showing legacy emoji icons */
.portalMenuIcon:not(:has(svg)) {
  font-size: 52px !important;
  line-height: 1 !important;
}
.menuBtn {
  grid-template-columns: 86px minmax(0,1fr) 22px !important;
  min-height: 104px !important;
  column-gap: 16px !important;
}
@media(max-width:640px){
  .portalMenuIcon {
    width: 68px !important;
    height: 68px !important;
    min-width: 68px !important;
    min-height: 68px !important;
    border-radius: 22px !important;
  }
  .portalMenuIcon .ms-menu-svg,
  .portalMenuIcon svg {
    width: 66px !important;
    height: 66px !important;
    min-width: 66px !important;
    min-height: 66px !important;
    transform: scale(1.2) !important;
  }
  .portalMenuIcon:not(:has(svg)) { font-size: 48px !important; }
  .menuBtn {
    grid-template-columns: 78px minmax(0,1fr) 18px !important;
    min-height: 98px !important;
  }
}
/* Prevent old pseudo icon from competing with real icon */
.menuBtn::before { content: none !important; display: none !important; }

/* Dark mode: recent attendance cards/lists that intentionally stay light must use dark text. */
html[data-theme="dark"] #recentList,
html[data-theme="dark"] #recentList *,
html[data-theme="dark"] .simple-list,
html[data-theme="dark"] .simple-list *,
html[data-theme="dark"] .history-card,
html[data-theme="dark"] .history-card *,
html[data-theme="dark"] .history-item,
html[data-theme="dark"] .history-item *,
html[data-theme="dark"] .record-item,
html[data-theme="dark"] .record-item * {
  color: #0f172a !important;
  text-shadow: none !important;
}
html[data-theme="dark"] #recentList,
html[data-theme="dark"] .simple-list,
html[data-theme="dark"] .history-card,
html[data-theme="dark"] .history-item,
html[data-theme="dark"] .record-item {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="dark"] #recentList strong,
html[data-theme="dark"] .simple-list strong,
html[data-theme="dark"] .history-card strong,
html[data-theme="dark"] .history-item strong,
html[data-theme="dark"] .record-item strong {
  color: #020617 !important;
}
html[data-theme="dark"] #recentList small,
html[data-theme="dark"] .simple-list small,
html[data-theme="dark"] .history-card small,
html[data-theme="dark"] .history-item small,
html[data-theme="dark"] .record-item small,
html[data-theme="dark"] #recentList .muted,
html[data-theme="dark"] #recentList .hint {
  color: #475569 !important;
}

/* ===============================
   RC9-3 Season Default + Teacher Special Slot
   - 기본 모드: 계절 자동 전환
   - 교사 전용 Loopy Special 슬롯: 이미지 파일은 사용자가 직접 추가
   - Firestore read +0, localStorage + browser date only
================================ */
html[data-theme="default"][data-season="spring"]{
  --ms-bg:#fff7fb;
  --ms-surface:#ffffff;
  --ms-surface-2:#fff1f7;
  --ms-surface-3:#ffe4ef;
  --ms-text:#312032;
  --ms-heading:#9d174d;
  --ms-muted:#715568;
  --ms-soft-text:#5b334e;
  --ms-primary:#ec4899;
  --ms-primary-2:#db2777;
  --ms-accent:#fb7185;
  --ms-border:#ffd0df;
  --ms-gradient:linear-gradient(135deg,#f472b6 0%,#fb7185 58%,#fbbf24 100%);
  --ms-bg-pattern:radial-gradient(circle at 12% 8%,rgba(244,114,182,.18),transparent 25%),radial-gradient(circle at 88% 10%,rgba(251,191,36,.12),transparent 28%),linear-gradient(180deg,#fff7fb,#ffffff);
  --ms-icon-bg:linear-gradient(135deg,#fce7f3,#ffe4e6);
  --ms-icon-color:#db2777;
}
html[data-theme="default"][data-season="summer"]{
  --ms-bg:#eefbff;
  --ms-surface:#ffffff;
  --ms-surface-2:#f0fbff;
  --ms-surface-3:#dff6ff;
  --ms-text:#102a3a;
  --ms-heading:#075985;
  --ms-muted:#42677a;
  --ms-soft-text:#21485c;
  --ms-primary:#0ea5e9;
  --ms-primary-2:#0284c7;
  --ms-accent:#22d3ee;
  --ms-border:#bae6fd;
  --ms-gradient:linear-gradient(135deg,#0ea5e9 0%,#22d3ee 55%,#2dd4bf 100%);
  --ms-bg-pattern:radial-gradient(circle at 12% 9%,rgba(14,165,233,.18),transparent 25%),radial-gradient(circle at 90% 12%,rgba(45,212,191,.15),transparent 28%),linear-gradient(180deg,#eefbff,#ffffff);
  --ms-icon-bg:linear-gradient(135deg,#bae6fd,#ccfbf1);
  --ms-icon-color:#0284c7;
}
html[data-theme="default"][data-season="autumn"]{
  --ms-bg:#fff8ed;
  --ms-surface:#ffffff;
  --ms-surface-2:#fff4e6;
  --ms-surface-3:#ffedd5;
  --ms-text:#332214;
  --ms-heading:#9a3412;
  --ms-muted:#765c44;
  --ms-soft-text:#5c3f27;
  --ms-primary:#f97316;
  --ms-primary-2:#ea580c;
  --ms-accent:#f59e0b;
  --ms-border:#fed7aa;
  --ms-gradient:linear-gradient(135deg,#f97316 0%,#f59e0b 60%,#facc15 100%);
  --ms-bg-pattern:radial-gradient(circle at 10% 8%,rgba(249,115,22,.18),transparent 25%),radial-gradient(circle at 90% 8%,rgba(250,204,21,.14),transparent 28%),linear-gradient(180deg,#fff8ed,#ffffff);
  --ms-icon-bg:linear-gradient(135deg,#ffedd5,#fde68a);
  --ms-icon-color:#ea580c;
}
html[data-theme="default"][data-season="winter"]{
  --ms-bg:#f3f8ff;
  --ms-surface:#ffffff;
  --ms-surface-2:#f6faff;
  --ms-surface-3:#e0f2fe;
  --ms-text:#172033;
  --ms-heading:#1e3a8a;
  --ms-muted:#52657f;
  --ms-soft-text:#344763;
  --ms-primary:#3b82f6;
  --ms-primary-2:#2563eb;
  --ms-accent:#93c5fd;
  --ms-border:#c7ddff;
  --ms-gradient:linear-gradient(135deg,#3b82f6 0%,#93c5fd 58%,#c4b5fd 100%);
  --ms-bg-pattern:radial-gradient(circle at 12% 7%,rgba(59,130,246,.15),transparent 25%),radial-gradient(circle at 88% 10%,rgba(196,181,253,.13),transparent 28%),linear-gradient(180deg,#f3f8ff,#ffffff);
  --ms-icon-bg:linear-gradient(135deg,#dbeafe,#eef2ff);
  --ms-icon-color:#2563eb;
}

html[data-theme="special-loopy"]{
  --ms-bg:#fff3f8;
  --ms-surface:#ffffff;
  --ms-surface-2:#fff0f7;
  --ms-surface-3:#ffe1ef;
  --ms-text:#3f1830;
  --ms-heading:#9d174d;
  --ms-muted:#7a5067;
  --ms-soft-text:#63324e;
  --ms-primary:#f06292;
  --ms-primary-2:#e91e63;
  --ms-accent:#ffb74d;
  --ms-border:#ffc1d9;
  --ms-shadow:0 20px 50px rgba(219,39,119,.18);
  --ms-shadow-soft:0 10px 26px rgba(219,39,119,.12);
  --ms-gradient:linear-gradient(135deg,#f06292 0%,#ff8fab 48%,#ffcc80 100%);
  --ms-bg-pattern:radial-gradient(circle at 10% 9%,rgba(240,98,146,.20),transparent 24%),radial-gradient(circle at 92% 10%,rgba(255,183,77,.18),transparent 27%),linear-gradient(180deg,#fff3f8,#fffdf7 54%,#ffffff);
  --ms-icon-bg:linear-gradient(135deg,#ffe4ef,#ffedd5);
  --ms-icon-color:#e91e63;
}

html[data-theme="special-loopy"] body::after{
  content:"";
  position:fixed;
  right:12px;
  bottom:74px;
  width:min(34vw,220px);
  height:min(34vw,220px);
  pointer-events:none;
  z-index:-1;
  background-image:url("../assets/special/loopy/background.png"), url("../assets/special/loopy/sticker3.png");
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  opacity:.18;
  filter:drop-shadow(0 14px 22px rgba(219,39,119,.18));
}

html[data-theme="special-loopy"] #portal > .box:first-child,
html[data-theme="special-loopy"] .topHeader,
html[data-theme="special-loopy"] .login-card{
  position:relative;
  overflow:hidden;
}
html[data-theme="special-loopy"] #portal > .box:first-child::before,
html[data-theme="special-loopy"] .topHeader::before,
html[data-theme="special-loopy"] .login-card::before{
  content:"";
  position:absolute;
  right:12px;
  bottom:8px;
  width:96px;
  height:96px;
  background:url("../assets/special/loopy/hero.png") center/contain no-repeat;
  opacity:.96;
  pointer-events:none;
  z-index:0;
  filter:drop-shadow(0 10px 18px rgba(219,39,119,.22));
}
html[data-theme="special-loopy"] #portal > .box:first-child > *,
html[data-theme="special-loopy"] .topHeader > *,
html[data-theme="special-loopy"] .login-card > *{
  position:relative;
  z-index:1;
}
html[data-theme="special-loopy"] .menuBtn:nth-of-type(3n+1)::after{
  background-image:url("../assets/special/loopy/sticker1.png");
}
html[data-theme="special-loopy"] .menuBtn:nth-of-type(3n+2)::after{
  background-image:url("../assets/special/loopy/sticker2.png");
}
html[data-theme="special-loopy"] .menuBtn:nth-of-type(3n)::after{
  background-image:url("../assets/special/loopy/sticker3.png");
}
html[data-theme="special-loopy"] .menuBtn::after{
  content:"";
  position:absolute;
  right:34px;
  top:10px;
  width:34px;
  height:34px;
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  opacity:.7;
  pointer-events:none;
}

.themeSpecialDivider{
  width:1px;
  height:24px;
  margin:0 2px;
  background:var(--ms-border);
  display:inline-block;
}
.themeChipSpecial{
  background:linear-gradient(135deg,#fff0f7,#ffedd5)!important;
  color:#9d174d!important;
  border-color:#ffc1d9!important;
}
.themeChipSpecial.active{
  background:var(--ms-gradient)!important;
  color:#fff!important;
}

/* Bigger artwork-first menu icons */
.portalMenuIcon{
  width:76px!important;
  height:76px!important;
  min-width:76px!important;
  min-height:76px!important;
  border-radius:24px!important;
  overflow:visible!important;
}
.portalMenuIcon .ms-menu-svg,
.portalMenuIcon svg{
  width:104px!important;
  height:104px!important;
  min-width:104px!important;
  min-height:104px!important;
  transform:scale(1.08)!important;
  transform-origin:center!important;
  filter:drop-shadow(0 6px 8px rgba(15,23,42,.20))!important;
}
.portalMenuIcon:not(:has(svg)){
  font-size:62px!important;
}
.menuBtn{
  grid-template-columns:92px minmax(0,1fr) 22px!important;
}
@media(max-width:640px){
  .portalMenuIcon{width:70px!important;height:70px!important;min-width:70px!important;min-height:70px!important;}
  .portalMenuIcon .ms-menu-svg,.portalMenuIcon svg{width:98px!important;height:98px!important;min-width:98px!important;min-height:98px!important;}
  .portalMenuIcon:not(:has(svg)){font-size:58px!important;}
  .menuBtn{grid-template-columns:84px minmax(0,1fr) 18px!important;}
}


/* ===============================
   RC9-3.1 Season/Special Visibility Fix
   - 기본 모드가 실제 계절 모드처럼 보이도록 계절 배지/장식 강화
   - 교사 전용 Loopy Special 버튼 노출
   - 루피 이미지 슬롯이 비어 있어도 스페셜 모드 티가 나도록 기본 장식 표시
================================ */
html[data-theme="default"] .topHeader::before,
html[data-theme="default"] #portal > .box:first-child::before,
html[data-theme="default"] .login-card::before{
  content: attr(data-season-label);
}

/* 계절 배지: 포털 상단/로그인 카드/일반 상단 카드에 자동 표시 */
html[data-theme="default"] .topHeader,
html[data-theme="default"] #portal > .box:first-child,
html[data-theme="default"] .login-card{
  position:relative!important;
  overflow:hidden!important;
}
html[data-theme="default"] .topHeader::before,
html[data-theme="default"] #portal > .box:first-child::before,
html[data-theme="default"] .login-card::before{
  position:absolute!important;
  right:24px!important;
  bottom:16px!important;
  z-index:1!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:112px!important;
  height:38px!important;
  padding:0 16px!important;
  border-radius:999px!important;
  font-size:14px!important;
  font-weight:950!important;
  letter-spacing:-.03em!important;
  color:var(--ms-primary-2)!important;
  background:color-mix(in srgb,var(--ms-surface) 82%,transparent)!important;
  border:1px solid var(--ms-border)!important;
  box-shadow:0 10px 24px color-mix(in srgb,var(--ms-primary) 14%,transparent)!important;
  backdrop-filter:blur(10px)!important;
  pointer-events:none!important;
}
html[data-theme="default"] .topHeader > *,
html[data-theme="default"] #portal > .box:first-child > *,
html[data-theme="default"] .login-card > *{
  position:relative!important;
  z-index:2!important;
}

html[data-theme="default"][data-season="spring"] .topHeader::before,
html[data-theme="default"][data-season="spring"] #portal > .box:first-child::before,
html[data-theme="default"][data-season="spring"] .login-card::before{content:"🌸 봄 에디션";}
html[data-theme="default"][data-season="summer"] .topHeader::before,
html[data-theme="default"][data-season="summer"] #portal > .box:first-child::before,
html[data-theme="default"][data-season="summer"] .login-card::before{content:"🌊 여름 에디션";}
html[data-theme="default"][data-season="autumn"] .topHeader::before,
html[data-theme="default"][data-season="autumn"] #portal > .box:first-child::before,
html[data-theme="default"][data-season="autumn"] .login-card::before{content:"🍁 가을 에디션";}
html[data-theme="default"][data-season="winter"] .topHeader::before,
html[data-theme="default"][data-season="winter"] #portal > .box:first-child::before,
html[data-theme="default"][data-season="winter"] .login-card::before{content:"❄️ 겨울 에디션";}

/* 계절별 장식 무드 강화 */
html[data-theme="default"][data-season="spring"] body::after,
html[data-theme="default"][data-season="summer"] body::after,
html[data-theme="default"][data-season="autumn"] body::after,
html[data-theme="default"][data-season="winter"] body::after{
  content:"";
  position:fixed;
  inset:auto 20px 76px auto;
  width:min(28vw,190px);
  height:min(28vw,190px);
  z-index:-1;
  pointer-events:none;
  opacity:.23;
  filter:blur(.1px);
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
}
html[data-theme="default"][data-season="spring"] body::after{
  background-image:radial-gradient(circle at 38% 38%,#f9a8d4 0 8%,transparent 9%),radial-gradient(circle at 58% 38%,#f9a8d4 0 8%,transparent 9%),radial-gradient(circle at 48% 55%,#f472b6 0 9%,transparent 10%);
}
html[data-theme="default"][data-season="summer"] body::after{
  background-image:radial-gradient(ellipse at 50% 56%,#38bdf8 0 24%,transparent 25%),radial-gradient(ellipse at 38% 46%,#22d3ee 0 18%,transparent 19%),radial-gradient(ellipse at 63% 46%,#2dd4bf 0 18%,transparent 19%);
}
html[data-theme="default"][data-season="autumn"] body::after{
  background-image:radial-gradient(ellipse at 48% 52%,#f97316 0 22%,transparent 23%),radial-gradient(ellipse at 36% 44%,#f59e0b 0 16%,transparent 17%),radial-gradient(ellipse at 64% 44%,#fb923c 0 16%,transparent 17%);
}
html[data-theme="default"][data-season="winter"] body::after{
  background-image:radial-gradient(circle at 50% 50%,#bfdbfe 0 18%,transparent 19%),radial-gradient(circle at 35% 35%,#93c5fd 0 10%,transparent 11%),radial-gradient(circle at 66% 36%,#ddd6fe 0 10%,transparent 11%);
}

/* 기본 버튼 라벨이 긴 경우에도 보기 좋게 */
.ms-theme-panel{max-width:min(96vw,760px)!important;}
.themeChip[data-theme="default"]{min-width:92px!important;}
.themeChipSpecial{display:inline-flex!important;align-items:center!important;gap:4px!important;}
html:not(.teacher-special-enabled) .themeChipSpecial,
html:not(.teacher-special-enabled) .themeSpecialDivider{display:none!important;}

/* Loopy Special: 이미지가 없어도 스페셜 모드가 확실히 보이도록 기본 핑크 장식 */
html[data-theme="special-loopy"] .topHeader,
html[data-theme="special-loopy"] #portal > .box:first-child,
html[data-theme="special-loopy"] .login-card{
  background:
    radial-gradient(circle at 92% 20%,rgba(255,255,255,.45),transparent 18%),
    linear-gradient(135deg,#f06292 0%,#ff8fab 50%,#ffcc80 100%)!important;
  color:#fff!important;
}
html[data-theme="special-loopy"] .topHeader h1,
html[data-theme="special-loopy"] .topHeader h2,
html[data-theme="special-loopy"] #portal > .box:first-child h1,
html[data-theme="special-loopy"] #portal > .box:first-child h2,
html[data-theme="special-loopy"] .login-card h1,
html[data-theme="special-loopy"] .login-card h2{
  color:#fff!important;
  text-shadow:0 2px 10px rgba(157,23,77,.20)!important;
}
html[data-theme="special-loopy"] .topHeader p,
html[data-theme="special-loopy"] .topHeader #teacherInfo,
html[data-theme="special-loopy"] #portal > .box:first-child p,
html[data-theme="special-loopy"] #portal > .box:first-child #teacherInfo{
  color:#fff7fb!important;
}
html[data-theme="special-loopy"] .topHeader::after,
html[data-theme="special-loopy"] #portal > .box:first-child::after,
html[data-theme="special-loopy"] .login-card::after{
  content:"SPECIAL"!important;
  position:absolute!important;
  right:24px!important;
  top:18px!important;
  z-index:1!important;
  padding:8px 13px!important;
  border-radius:999px!important;
  font-size:12px!important;
  font-weight:950!important;
  letter-spacing:.04em!important;
  color:#9d174d!important;
  background:rgba(255,255,255,.72)!important;
  border:1px solid rgba(255,255,255,.75)!important;
  box-shadow:0 10px 24px rgba(157,23,77,.16)!important;
}
html[data-theme="special-loopy"] #portal > .box:first-child::before,
html[data-theme="special-loopy"] .topHeader::before,
html[data-theme="special-loopy"] .login-card::before{
  width:128px!important;
  height:128px!important;
  right:18px!important;
  bottom:-18px!important;
  background-image:url("../assets/special/loopy/hero.png"), radial-gradient(circle at 50% 48%,rgba(255,255,255,.58) 0 38%,rgba(255,228,239,.55) 39% 53%,transparent 54%)!important;
  background-size:contain,contain!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  opacity:.98!important;
}
html[data-theme="special-loopy"] .menuBtn,
html[data-theme="special-loopy"] .portalMenuBtn{
  border-color:#ffc1d9!important;
  background:linear-gradient(135deg,#ffffff 0%,#fff7fb 100%)!important;
}
html[data-theme="special-loopy"] .menuBtn::after,
html[data-theme="special-loopy"] .portalMenuBtn::after{
  opacity:.9!important;
}

@media(max-width:640px){
  html[data-theme="default"] .topHeader::before,
  html[data-theme="default"] #portal > .box:first-child::before,
  html[data-theme="default"] .login-card::before{
    right:14px!important;
    bottom:10px!important;
    min-width:96px!important;
    height:32px!important;
    font-size:12px!important;
    padding:0 12px!important;
  }
  html[data-theme="special-loopy"] #portal > .box:first-child::before,
  html[data-theme="special-loopy"] .topHeader::before,
  html[data-theme="special-loopy"] .login-card::before{
    width:96px!important;height:96px!important;right:10px!important;bottom:-12px!important;
  }
}


/* ===============================
   RC9-3.2 Loopy Image Apply Fix
   - 실제 이미지 파일을 화면에 연결
   - ../assets/special/loopy/*.png 기준
================================ */
html[data-theme="special-loopy"] body{
  background-color:#fff3f8!important;
  background-image:
    linear-gradient(180deg,rgba(255,243,248,.86),rgba(255,253,247,.90)),
    url("../assets/special/loopy/background.png"),
    var(--ms-bg-pattern)!important;
  background-repeat:no-repeat,no-repeat,no-repeat!important;
  background-position:center top,center top,center top!important;
  background-size:cover,cover,auto!important;
  background-attachment:fixed,fixed,scroll!important;
}

html[data-theme="special-loopy"] body::after{
  background-image:url("../assets/special/loopy/sticker3.png")!important;
  opacity:.42!important;
  width:min(32vw,240px)!important;
  height:min(32vw,240px)!important;
  right:22px!important;
  bottom:88px!important;
  z-index:0!important;
}

html[data-theme="special-loopy"] #portal > .box:first-child,
html[data-theme="special-loopy"] .topHeader,
html[data-theme="special-loopy"] .login-card{
  min-height:112px!important;
  padding-right:240px!important;
  background:
    linear-gradient(135deg,rgba(240,98,146,.96),rgba(255,143,171,.88) 52%,rgba(255,204,128,.78)),
    url("../assets/special/loopy/background.png") center/cover no-repeat!important;
  border-color:rgba(255,193,217,.95)!important;
  box-shadow:0 18px 44px rgba(219,39,119,.18)!important;
}

html[data-theme="special-loopy"] #portal > .box:first-child::before,
html[data-theme="special-loopy"] .topHeader::before,
html[data-theme="special-loopy"] .login-card::before{
  content:""!important;
  position:absolute!important;
  right:32px!important;
  bottom:-2px!important;
  width:178px!important;
  height:150px!important;
  background-image:url("../assets/special/loopy/hero.png")!important;
  background-repeat:no-repeat!important;
  background-position:center bottom!important;
  background-size:contain!important;
  opacity:1!important;
  z-index:0!important;
  filter:drop-shadow(0 16px 24px rgba(157,23,77,.24))!important;
}

html[data-theme="special-loopy"] #portal > .box:first-child::after,
html[data-theme="special-loopy"] .topHeader::after,
html[data-theme="special-loopy"] .login-card::after{
  content:"SPECIAL"!important;
  position:absolute!important;
  right:146px!important;
  top:22px!important;
  color:#9d174d!important;
  font-size:10px!important;
  font-weight:900!important;
  letter-spacing:.08em!important;
  z-index:1!important;
}

html[data-theme="special-loopy"] #portal > .box:first-child h1,
html[data-theme="special-loopy"] #portal > .box:first-child h2,
html[data-theme="special-loopy"] .topHeader h1,
html[data-theme="special-loopy"] .topHeader h2,
html[data-theme="special-loopy"] .login-card h1,
html[data-theme="special-loopy"] .login-card h2{
  color:#fff!important;
  text-shadow:0 2px 8px rgba(157,23,77,.28)!important;
}

html[data-theme="special-loopy"] #portal > .box:first-child p,
html[data-theme="special-loopy"] #portal > .box:first-child #teacherInfo,
html[data-theme="special-loopy"] .topHeader p,
html[data-theme="special-loopy"] .topHeader #teacherInfo{
  color:rgba(255,255,255,.94)!important;
  text-shadow:0 2px 7px rgba(157,23,77,.25)!important;
}

html[data-theme="special-loopy"] .menuBtn,
html[data-theme="special-loopy"] .portalMenuBtn{
  overflow:hidden!important;
}

html[data-theme="special-loopy"] .menuBtn::after,
html[data-theme="special-loopy"] .portalMenuBtn::after{
  content:""!important;
  position:absolute!important;
  right:46px!important;
  bottom:8px!important;
  top:auto!important;
  width:58px!important;
  height:58px!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-size:contain!important;
  opacity:.22!important;
  z-index:0!important;
  pointer-events:none!important;
  filter:drop-shadow(0 8px 14px rgba(219,39,119,.18))!important;
}

html[data-theme="special-loopy"] .menuBtn:nth-of-type(3n+1)::after,
html[data-theme="special-loopy"] .portalMenuBtn:nth-of-type(3n+1)::after{
  background-image:url("../assets/special/loopy/sticker1.png")!important;
}
html[data-theme="special-loopy"] .menuBtn:nth-of-type(3n+2)::after,
html[data-theme="special-loopy"] .portalMenuBtn:nth-of-type(3n+2)::after{
  background-image:url("../assets/special/loopy/sticker2.png")!important;
}
html[data-theme="special-loopy"] .menuBtn:nth-of-type(3n)::after,
html[data-theme="special-loopy"] .portalMenuBtn:nth-of-type(3n)::after{
  background-image:url("../assets/special/loopy/sticker3.png")!important;
}

html[data-theme="special-loopy"] .menuBtn > *,
html[data-theme="special-loopy"] .portalMenuBtn > *{
  position:relative!important;
  z-index:1!important;
}

@media(max-width:720px){
  html[data-theme="special-loopy"] #portal > .box:first-child,
  html[data-theme="special-loopy"] .topHeader,
  html[data-theme="special-loopy"] .login-card{
    padding-right:132px!important;
    min-height:104px!important;
  }
  html[data-theme="special-loopy"] #portal > .box:first-child::before,
  html[data-theme="special-loopy"] .topHeader::before,
  html[data-theme="special-loopy"] .login-card::before{
    width:118px!important;
    height:112px!important;
    right:12px!important;
  }
  html[data-theme="special-loopy"] #portal > .box:first-child::after,
  html[data-theme="special-loopy"] .topHeader::after,
  html[data-theme="special-loopy"] .login-card::after{
    display:none!important;
  }
}

/* ===============================
   RC9-3.3 Loopy Right Image Slots
   - 사진 파일만 넣으면 교사 메뉴 오른쪽 빈 공간에 자동 표시
   - 이미지 미포함 시 레이아웃만 유지 / 깨진 이미지 표시 없음
   Required path: assets/special/loopy/
   hero.png, background.png, sticker-top.png, sticker-bottom.png, speech.png
================================ */
html[data-theme="special-loopy"]{
  --loopy-bg-image:url("../assets/special/loopy/background.png");
  --loopy-hero-image:url("../assets/special/loopy/hero.png");
  --loopy-sticker-top:url("../assets/special/loopy/sticker-top.png");
  --loopy-sticker-bottom:url("../assets/special/loopy/sticker-bottom.png");
  --loopy-speech:url("../assets/special/loopy/speech.png");
}

/* 상단 Hero: 오른쪽 이미지가 확실히 들어오도록 */
html[data-theme="special-loopy"] .topHeader{
  position:relative!important;
  overflow:hidden!important;
  min-height:132px!important;
  padding:32px 310px 30px 34px!important;
  border-radius:22px!important;
  background:
    linear-gradient(135deg,rgba(236,72,153,.93),rgba(255,151,166,.86) 48%,rgba(255,218,169,.78)),
    var(--loopy-bg-image) center/cover no-repeat!important;
}
html[data-theme="special-loopy"] .topHeader::before{
  content:""!important;
  position:absolute!important;
  right:78px!important;
  bottom:-4px!important;
  width:245px!important;
  height:170px!important;
  background:var(--loopy-hero-image) center bottom/contain no-repeat!important;
  opacity:1!important;
  z-index:0!important;
  filter:drop-shadow(0 18px 24px rgba(157,23,77,.25))!important;
}
html[data-theme="special-loopy"] .topHeader::after{
  content:"⭐ Loopy Special"!important;
  position:absolute!important;
  right:248px!important;
  top:22px!important;
  width:auto!important;
  height:auto!important;
  border-radius:999px!important;
  padding:8px 16px!important;
  background:rgba(236,72,153,.88)!important;
  color:#fff!important;
  font-size:13px!important;
  font-weight:950!important;
  letter-spacing:-.02em!important;
  box-shadow:0 10px 22px rgba(219,39,119,.23)!important;
  z-index:1!important;
}
html[data-theme="special-loopy"] .topHeader > *{
  position:relative!important;
  z-index:2!important;
}

/* 교사 메뉴 큰 카드: 오른쪽 빈 공간에 sticker-top.png 자동 표시 */
html[data-theme="special-loopy"] main > .card:first-child,
html[data-theme="special-loopy"] .app main > section.card:first-child,
html[data-theme="special-loopy"] #portal > .box:first-child + #menuArea,
html[data-theme="special-loopy"] #portal .box{
  position:relative!important;
}

html[data-theme="special-loopy"] main > .card:first-child{
  overflow:hidden!important;
  padding-right:290px!important;
  min-height:640px!important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.96),rgba(255,251,253,.96)),
    var(--loopy-bg-image) center/cover no-repeat!important;
  border-color:#ffc1d9!important;
  box-shadow:0 22px 54px rgba(219,39,119,.12)!important;
}
html[data-theme="special-loopy"] main > .card:first-child::before{
  content:""!important;
  position:absolute!important;
  right:40px!important;
  top:132px!important;
  width:220px!important;
  height:220px!important;
  background:var(--loopy-sticker-top) center/contain no-repeat!important;
  opacity:.96!important;
  z-index:0!important;
  pointer-events:none!important;
  filter:drop-shadow(0 18px 26px rgba(219,39,119,.17))!important;
}
html[data-theme="special-loopy"] main > .card:first-child::after{
  content:""!important;
  position:absolute!important;
  right:72px!important;
  bottom:42px!important;
  width:190px!important;
  height:160px!important;
  background:var(--loopy-sticker-bottom) center/contain no-repeat!important;
  opacity:.9!important;
  z-index:0!important;
  pointer-events:none!important;
  filter:drop-shadow(0 16px 22px rgba(219,39,119,.15))!important;
}
html[data-theme="special-loopy"] main > .card:first-child > *{
  position:relative!important;
  z-index:1!important;
}

/* 말풍선 이미지가 있으면 오른쪽 중간에 살짝 표시 */
html[data-theme="special-loopy"] main > .card:first-child h2::after{
  content:""!important;
  position:absolute!important;
  right:-232px!important;
  top:210px!important;
  width:190px!important;
  height:120px!important;
  background:var(--loopy-speech) center/contain no-repeat!important;
  opacity:.78!important;
  pointer-events:none!important;
}

/* 메뉴 영역은 왼쪽 2열 유지, 오른쪽 이미지와 겹치지 않게 */
html[data-theme="special-loopy"] #menuArea{
  max-width:100%!important;
}
html[data-theme="special-loopy"] .portalMenuBtn,
html[data-theme="special-loopy"] .menuBtn{
  background:linear-gradient(135deg,#ffffff 0%,#fff8fb 100%)!important;
  border-color:#ffb9d3!important;
  box-shadow:0 12px 28px rgba(219,39,119,.08)!important;
}

/* 기존 구형 hero pseudo와 충돌 방지 */
html[data-theme="special-loopy"] #portal > .box:first-child::before{
  background-image:var(--loopy-hero-image)!important;
}

@media(max-width:980px){
  html[data-theme="special-loopy"] main > .card:first-child{
    padding-right:24px!important;
    padding-bottom:190px!important;
    min-height:auto!important;
  }
  html[data-theme="special-loopy"] main > .card:first-child::before{
    right:18px!important;
    top:auto!important;
    bottom:26px!important;
    width:150px!important;
    height:150px!important;
    opacity:.86!important;
  }
  html[data-theme="special-loopy"] main > .card:first-child::after{
    right:160px!important;
    bottom:24px!important;
    width:120px!important;
    height:120px!important;
    opacity:.72!important;
  }
  html[data-theme="special-loopy"] main > .card:first-child h2::after{
    display:none!important;
  }
}
@media(max-width:720px){
  html[data-theme="special-loopy"] .topHeader{
    padding:22px 132px 22px 20px!important;
    min-height:104px!important;
  }
  html[data-theme="special-loopy"] .topHeader::before{
    width:118px!important;
    height:112px!important;
    right:10px!important;
  }
  html[data-theme="special-loopy"] .topHeader::after{
    display:none!important;
  }
}

/* ===============================
   RC9-3.4 Loopy image path + right hero + centered theme dock
   - css/theme.css 기준 이미지 경로는 ../assets/...
   - 사진만 assets/special/loopy/에 넣으면 적용
================================ */
html[data-theme="special-loopy"]{
  --loopy-bg-image:url("../assets/special/loopy/background.png");
  --loopy-hero-image:url("../assets/special/loopy/hero.png");
  --loopy-sticker-top:url("../assets/special/loopy/sticker-top.png");
  --loopy-sticker-bottom:url("../assets/special/loopy/sticker-bottom.png");
  --loopy-speech:url("../assets/special/loopy/speech.png");
}

/* 하단 테마 선택: 오른쪽이 아니라 가운데 고정 플로팅 */
.ms-theme-panel{
  left:50%!important;
  right:auto!important;
  bottom:16px!important;
  transform:translateX(-50%)!important;
  justify-content:center!important;
  max-width:calc(100vw - 28px)!important;
  overflow-x:auto!important;
  scrollbar-width:none!important;
}
.ms-theme-panel::-webkit-scrollbar{display:none!important;}
.themeChip{
  box-shadow:0 8px 18px rgba(15,23,42,.08)!important;
}
.themeChipSpecial{
  background:linear-gradient(135deg,#f472b6,#fb7185,#fbbf24)!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.62)!important;
}
.themeChipSpecial.active{
  background:linear-gradient(135deg,#ec4899,#fb7185,#fbbf24)!important;
  color:#fff!important;
  box-shadow:0 10px 26px rgba(236,72,153,.28)!important;
}

/* Loopy Special 상단: 오른쪽 hero 이미지 + 로그아웃 우측 고정 */
html[data-theme="special-loopy"] .topHeader{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  min-height:134px!important;
  padding:30px 34px!important;
  padding-right:220px!important;
  border-radius:22px!important;
  overflow:hidden!important;
  background:
    linear-gradient(135deg,rgba(236,72,153,.92) 0%,rgba(255,143,165,.78) 48%,rgba(255,223,178,.72) 100%),
    var(--loopy-bg-image) center/cover no-repeat!important;
  border:1px solid rgba(255,165,200,.86)!important;
  box-shadow:0 20px 50px rgba(219,39,119,.16)!important;
}
html[data-theme="special-loopy"] .topHeader::before{
  content:""!important;
  position:absolute!important;
  right:92px!important;
  bottom:-2px!important;
  width:255px!important;
  height:178px!important;
  background:var(--loopy-hero-image) center bottom/contain no-repeat!important;
  opacity:1!important;
  z-index:0!important;
  pointer-events:none!important;
  filter:drop-shadow(0 18px 24px rgba(157,23,77,.25))!important;
}
html[data-theme="special-loopy"] .topHeader::after{
  content:"⭐ Loopy Special"!important;
  position:absolute!important;
  right:285px!important;
  top:24px!important;
  width:auto!important;
  height:auto!important;
  border-radius:999px!important;
  padding:8px 16px!important;
  background:linear-gradient(135deg,#ec4899,#f472b6)!important;
  color:#fff!important;
  font-size:13px!important;
  font-weight:950!important;
  letter-spacing:-.02em!important;
  box-shadow:0 10px 22px rgba(219,39,119,.23)!important;
  z-index:1!important;
  pointer-events:none!important;
}
html[data-theme="special-loopy"] .topHeader > div{
  position:relative!important;
  z-index:2!important;
  min-width:0!important;
}
html[data-theme="special-loopy"] .topHeader h1{
  color:#fff!important;
  text-shadow:0 2px 10px rgba(107,33,80,.22)!important;
}
html[data-theme="special-loopy"] .topHeader p,
html[data-theme="special-loopy"] .topHeader #teacherInfo{
  color:#fff!important;
  text-shadow:0 2px 8px rgba(107,33,80,.22)!important;
  font-weight:850!important;
}
html[data-theme="special-loopy"] .topHeader #logoutBtn,
html[data-theme="special-loopy"] .topHeader .logoutBtn{
  position:absolute!important;
  right:24px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  z-index:4!important;
  min-width:86px!important;
  height:44px!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.92)!important;
  color:#be185d!important;
  border:1px solid rgba(255,182,207,.95)!important;
  box-shadow:0 12px 28px rgba(219,39,119,.22)!important;
  font-weight:950!important;
}

/* 교사 메뉴 큰 카드 오른쪽 사진 슬롯 */
html[data-theme="special-loopy"] main > .card:first-child{
  position:relative!important;
  overflow:hidden!important;
  padding-right:300px!important;
  min-height:640px!important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.97),rgba(255,251,253,.965)),
    var(--loopy-bg-image) center/cover no-repeat!important;
  border-color:#ffc1d9!important;
  box-shadow:0 22px 54px rgba(219,39,119,.12)!important;
}
html[data-theme="special-loopy"] main > .card:first-child::before{
  content:""!important;
  position:absolute!important;
  right:36px!important;
  top:118px!important;
  width:240px!important;
  height:230px!important;
  background:var(--loopy-sticker-top) center/contain no-repeat!important;
  z-index:0!important;
  pointer-events:none!important;
  opacity:.98!important;
  filter:drop-shadow(0 18px 26px rgba(219,39,119,.18))!important;
}
html[data-theme="special-loopy"] main > .card:first-child::after{
  content:""!important;
  position:absolute!important;
  right:58px!important;
  bottom:34px!important;
  width:210px!important;
  height:180px!important;
  background:var(--loopy-sticker-bottom) center/contain no-repeat!important;
  z-index:0!important;
  pointer-events:none!important;
  opacity:.94!important;
  filter:drop-shadow(0 16px 22px rgba(219,39,119,.16))!important;
}
html[data-theme="special-loopy"] main > .card:first-child > *{
  position:relative!important;
  z-index:1!important;
}
html[data-theme="special-loopy"] main > .card:first-child h2::after{
  content:""!important;
  position:absolute!important;
  right:-250px!important;
  top:210px!important;
  width:205px!important;
  height:130px!important;
  background:var(--loopy-speech) center/contain no-repeat!important;
  opacity:.80!important;
  pointer-events:none!important;
}

/* 카드 폭/텍스트 균형 */
html[data-theme="special-loopy"] #menuArea{
  max-width:760px!important;
}
html[data-theme="special-loopy"] .portalMenuBtn,
html[data-theme="special-loopy"] .menuBtn{
  min-height:112px!important;
  grid-template-columns:78px minmax(0,1fr) 20px!important;
  column-gap:18px!important;
  background:linear-gradient(135deg,#ffffff 0%,#fff8fb 100%)!important;
  border-color:#ffb9d3!important;
  box-shadow:0 12px 28px rgba(219,39,119,.08)!important;
}
html[data-theme="special-loopy"] .portalMenuIcon{
  width:70px!important;
  height:70px!important;
  min-width:70px!important;
  min-height:70px!important;
}

@media(max-width:980px){
  html[data-theme="special-loopy"] .topHeader{
    padding-right:150px!important;
    min-height:112px!important;
  }
  html[data-theme="special-loopy"] .topHeader::before{
    width:145px!important;
    height:118px!important;
    right:76px!important;
  }
  html[data-theme="special-loopy"] .topHeader::after{display:none!important;}
  html[data-theme="special-loopy"] .topHeader #logoutBtn{right:16px!important;min-width:74px!important;height:38px!important;}
  html[data-theme="special-loopy"] main > .card:first-child{
    padding-right:24px!important;
    padding-bottom:190px!important;
    min-height:auto!important;
  }
  html[data-theme="special-loopy"] main > .card:first-child::before{
    right:18px!important;top:auto!important;bottom:32px!important;width:152px!important;height:152px!important;
  }
  html[data-theme="special-loopy"] main > .card:first-child::after{
    right:168px!important;bottom:26px!important;width:120px!important;height:120px!important;
  }
  html[data-theme="special-loopy"] main > .card:first-child h2::after{display:none!important;}
  html[data-theme="special-loopy"] #menuArea{max-width:none!important;}
}
@media(max-width:640px){
  .ms-theme-panel{left:10px!important;right:10px!important;transform:none!important;justify-content:flex-start!important;}
  html[data-theme="special-loopy"] .topHeader{padding:18px 96px 18px 18px!important;}
  html[data-theme="special-loopy"] .topHeader::before{width:98px!important;height:96px!important;right:64px!important;opacity:.9!important;}
  html[data-theme="special-loopy"] .topHeader #logoutBtn{right:12px!important;min-width:62px!important;font-size:11px!important;}
}

/* ===============================
   RC9-3.5 Visual Polish
   - Loopy background/stickers more visible
   - Default season badge moved left to avoid logout overlap
   - Center floating theme bar remains
================================ */

/* 기본 계절 배지: 로그아웃과 겹치지 않게 왼쪽으로 이동 */
html[data-theme="default"] .topHeader::before,
html[data-theme="default"] #portal > .box:first-child::before,
html[data-theme="default"] .login-card::before{
  right:150px!important;
  bottom:18px!important;
  min-width:126px!important;
  height:40px!important;
  z-index:3!important;
}

/* 좁은 화면에서는 배지를 아래 왼쪽으로 보내 충돌 방지 */
@media(max-width:760px){
  html[data-theme="default"] .topHeader::before,
  html[data-theme="default"] #portal > .box:first-child::before,
  html[data-theme="default"] .login-card::before{
    right:auto!important;
    left:18px!important;
    bottom:12px!important;
    transform:none!important;
    min-width:108px!important;
    height:34px!important;
    font-size:12px!important;
  }
  html[data-theme="default"] .topHeader,
  html[data-theme="default"] #portal > .box:first-child,
  html[data-theme="default"] .login-card{
    padding-bottom:58px!important;
  }
}

/* Loopy Special: 배경 사진이 너무 흐리지 않도록 가시성 강화 */
html[data-theme="special-loopy"] body{
  background:
    radial-gradient(circle at 22% 8%, rgba(255,182,213,.34) 0 16%, transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(255,228,178,.28) 0 18%, transparent 35%),
    linear-gradient(180deg, rgba(255,239,247,.86), rgba(255,247,251,.92)),
    var(--loopy-bg-image) center top/cover fixed no-repeat!important;
}

html[data-theme="special-loopy"] .topHeader{
  padding-right:320px!important;
  background:
    linear-gradient(135deg,rgba(236,72,153,.80) 0%,rgba(255,143,165,.54) 48%,rgba(255,223,178,.48) 100%),
    var(--loopy-bg-image) center/cover no-repeat!important;
}
html[data-theme="special-loopy"] .topHeader::before{
  right:84px!important;
  width:300px!important;
  height:205px!important;
  opacity:1!important;
  filter:drop-shadow(0 20px 28px rgba(157,23,77,.28))!important;
}
html[data-theme="special-loopy"] .topHeader::after{
  right:276px!important;
  top:20px!important;
}
html[data-theme="special-loopy"] .topHeader #logoutBtn,
html[data-theme="special-loopy"] .topHeader .logoutBtn{
  right:24px!important;
}

/* 메인 카드 안 배경/스티커를 더 잘 보이게 */
html[data-theme="special-loopy"] main > .card:first-child{
  background:
    linear-gradient(180deg,rgba(255,255,255,.88),rgba(255,248,252,.90)),
    var(--loopy-bg-image) center/cover no-repeat!important;
}
html[data-theme="special-loopy"] main > .card:first-child::before{
  width:310px!important;
  height:300px!important;
  right:26px!important;
  top:88px!important;
  opacity:1!important;
  filter:drop-shadow(0 20px 28px rgba(219,39,119,.20))!important;
}
html[data-theme="special-loopy"] main > .card:first-child::after{
  width:280px!important;
  height:240px!important;
  right:34px!important;
  bottom:28px!important;
  opacity:1!important;
  filter:drop-shadow(0 18px 26px rgba(219,39,119,.20))!important;
}
html[data-theme="special-loopy"] main > .card:first-child h2::after{
  width:250px!important;
  height:160px!important;
  right:-285px!important;
  opacity:.96!important;
}

/* Loopy 카드 영역 오른쪽 여백 유지 */
html[data-theme="special-loopy"] main > .card:first-child{
  padding-right:350px!important;
}
html[data-theme="special-loopy"] #menuArea{
  max-width:790px!important;
}

@media(max-width:980px){
  html[data-theme="special-loopy"] .topHeader{
    padding-right:150px!important;
  }
  html[data-theme="special-loopy"] .topHeader::before{
    width:150px!important;
    height:120px!important;
    right:76px!important;
  }
  html[data-theme="special-loopy"] main > .card:first-child{
    padding-right:24px!important;
    padding-bottom:210px!important;
  }
  html[data-theme="special-loopy"] main > .card:first-child::before{
    right:18px!important;top:auto!important;bottom:36px!important;width:170px!important;height:170px!important;
  }
  html[data-theme="special-loopy"] main > .card:first-child::after{
    right:188px!important;bottom:34px!important;width:135px!important;height:135px!important;
  }
}

/* ===============================
   RC9-3.6 Loopy image apply final fix
   root theme.css path: assets/special/loopy/
================================ */
html[data-theme="special-loopy"]{
  --loopy-bg-image:url("../assets/special/loopy/background.png");
  --loopy-hero-image:url("../assets/special/loopy/hero.png");
  --loopy-sticker-top:url("../assets/special/loopy/sticker-top.png");
  --loopy-sticker-bottom:url("../assets/special/loopy/sticker-bottom.png");
  --loopy-speech:url("../assets/special/loopy/speech.png");
}
html[data-theme="special-loopy"] body{
  background:
    radial-gradient(circle at 20% 8%, rgba(255,182,213,.36) 0 15%, transparent 36%),
    radial-gradient(circle at 88% 16%, rgba(255,223,178,.32) 0 18%, transparent 38%),
    linear-gradient(180deg, rgba(255,238,247,.78), rgba(255,247,251,.88)),
    var(--loopy-bg-image) center top/cover fixed no-repeat!important;
}
html[data-theme="special-loopy"] .topHeader,
html[data-theme="special-loopy"] #portal > .box:first-child,
html[data-theme="special-loopy"] .login-card{
  position:relative!important;
  overflow:hidden!important;
  min-height:134px!important;
  padding:30px 320px 30px 34px!important;
  border-radius:22px!important;
  background:
    linear-gradient(135deg,rgba(236,72,153,.80) 0%,rgba(255,143,165,.54) 48%,rgba(255,223,178,.48) 100%),
    var(--loopy-bg-image) center/cover no-repeat!important;
  border:1px solid rgba(255,165,200,.86)!important;
  box-shadow:0 20px 50px rgba(219,39,119,.16)!important;
}
html[data-theme="special-loopy"] .topHeader::before,
html[data-theme="special-loopy"] #portal > .box:first-child::before,
html[data-theme="special-loopy"] .login-card::before{
  content:""!important;
  position:absolute!important;
  right:84px!important;
  bottom:-2px!important;
  width:300px!important;
  height:205px!important;
  min-width:0!important;
  padding:0!important;
  background:var(--loopy-hero-image) center bottom/contain no-repeat!important;
  opacity:1!important;
  z-index:0!important;
  pointer-events:none!important;
  filter:drop-shadow(0 20px 28px rgba(157,23,77,.28))!important;
  border:0!important;
  box-shadow:none!important;
}
html[data-theme="special-loopy"] .topHeader::after,
html[data-theme="special-loopy"] #portal > .box:first-child::after,
html[data-theme="special-loopy"] .login-card::after{
  content:"⭐ Loopy Special"!important;
  position:absolute!important;
  right:276px!important;
  top:20px!important;
  width:auto!important;
  height:auto!important;
  border-radius:999px!important;
  padding:8px 16px!important;
  background:linear-gradient(135deg,#ec4899,#f472b6)!important;
  color:#fff!important;
  font-size:13px!important;
  font-weight:950!important;
  letter-spacing:-.02em!important;
  box-shadow:0 10px 22px rgba(219,39,119,.23)!important;
  z-index:1!important;
  pointer-events:none!important;
}
html[data-theme="special-loopy"] .topHeader > *,
html[data-theme="special-loopy"] #portal > .box:first-child > *,
html[data-theme="special-loopy"] .login-card > *{
  position:relative!important;
  z-index:2!important;
}
html[data-theme="special-loopy"] .topHeader #logoutBtn,
html[data-theme="special-loopy"] #portal > .box:first-child #logoutBtn,
html[data-theme="special-loopy"] .login-card #logoutBtn,
html[data-theme="special-loopy"] .topHeader .logoutBtn,
html[data-theme="special-loopy"] #portal > .box:first-child .logoutBtn,
html[data-theme="special-loopy"] .login-card .logoutBtn{
  position:absolute!important;
  right:24px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  z-index:4!important;
  min-width:86px!important;
  height:44px!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.92)!important;
  color:#be185d!important;
  border:1px solid rgba(255,182,207,.95)!important;
  box-shadow:0 12px 28px rgba(219,39,119,.22)!important;
  font-weight:950!important;
}
html[data-theme="special-loopy"] main > .card:first-child,
html[data-theme="special-loopy"] #portal .box:nth-of-type(2){
  position:relative!important;
  overflow:hidden!important;
  padding-right:350px!important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.88),rgba(255,248,252,.90)),
    var(--loopy-bg-image) center/cover no-repeat!important;
  border-color:#ffc1d9!important;
}
html[data-theme="special-loopy"] main > .card:first-child::before,
html[data-theme="special-loopy"] #portal .box:nth-of-type(2)::before{
  content:""!important;
  position:absolute!important;
  right:26px!important;
  top:88px!important;
  width:310px!important;
  height:300px!important;
  background:var(--loopy-sticker-top) center/contain no-repeat!important;
  z-index:0!important;
  opacity:1!important;
  pointer-events:none!important;
  filter:drop-shadow(0 20px 28px rgba(219,39,119,.20))!important;
}
html[data-theme="special-loopy"] main > .card:first-child::after,
html[data-theme="special-loopy"] #portal .box:nth-of-type(2)::after{
  content:""!important;
  position:absolute!important;
  right:34px!important;
  bottom:28px!important;
  width:280px!important;
  height:240px!important;
  background:var(--loopy-sticker-bottom) center/contain no-repeat!important;
  z-index:0!important;
  opacity:1!important;
  pointer-events:none!important;
  filter:drop-shadow(0 18px 26px rgba(219,39,119,.20))!important;
}
html[data-theme="special-loopy"] main > .card:first-child > *,
html[data-theme="special-loopy"] #portal .box:nth-of-type(2) > *{
  position:relative!important;
  z-index:1!important;
}
@media(max-width:980px){
  html[data-theme="special-loopy"] .topHeader,
  html[data-theme="special-loopy"] #portal > .box:first-child,
  html[data-theme="special-loopy"] .login-card{padding-right:150px!important;min-height:112px!important;}
  html[data-theme="special-loopy"] .topHeader::before,
  html[data-theme="special-loopy"] #portal > .box:first-child::before,
  html[data-theme="special-loopy"] .login-card::before{width:150px!important;height:120px!important;right:76px!important;}
  html[data-theme="special-loopy"] .topHeader::after,
  html[data-theme="special-loopy"] #portal > .box:first-child::after,
  html[data-theme="special-loopy"] .login-card::after{display:none!important;}
  html[data-theme="special-loopy"] main > .card:first-child,
  html[data-theme="special-loopy"] #portal .box:nth-of-type(2){padding-right:24px!important;padding-bottom:210px!important;}
  html[data-theme="special-loopy"] main > .card:first-child::before,
  html[data-theme="special-loopy"] #portal .box:nth-of-type(2)::before{right:18px!important;top:auto!important;bottom:36px!important;width:170px!important;height:170px!important;}
  html[data-theme="special-loopy"] main > .card:first-child::after,
  html[data-theme="special-loopy"] #portal .box:nth-of-type(2)::after{right:188px!important;bottom:34px!important;width:135px!important;height:135px!important;}
}

/* ===============================
   RC9-3.7 Final Polish
   - Loopy Special badge moved below logout
   - menu card text limited to 1~2 lines
   - menu area widened so descriptions do not wrap into 3~4 lines
================================ */
html[data-theme="special-loopy"] .topHeader::after,
html[data-theme="special-loopy"] #portal > .box:first-child::after,
html[data-theme="special-loopy"] .login-card::after{
  content:"⭐ Loopy Special"!important;
  right:24px!important;
  top:calc(50% + 34px)!important;
  transform:none!important;
  padding:6px 13px!important;
  font-size:12px!important;
  line-height:1!important;
  z-index:5!important;
  white-space:nowrap!important;
  background:linear-gradient(135deg,#ec4899,#f472b6,#fb7185)!important;
  box-shadow:0 8px 18px rgba(219,39,119,.20)!important;
}

/* 오른쪽 장식 이미지는 배경처럼 두고, 메뉴 카드 폭은 넓게 사용 */
html[data-theme="special-loopy"] main > .card:first-child,
html[data-theme="special-loopy"] #portal .box:nth-of-type(2){
  padding-right:24px!important;
  min-height:640px!important;
}
html[data-theme="special-loopy"] #menuArea{
  max-width:none!important;
  width:100%!important;
  grid-template-columns:repeat(2,minmax(320px,1fr))!important;
  gap:18px 20px!important;
}

/* 오른쪽 이미지는 메뉴를 가리지 않는 장식 레이어로 처리 */
html[data-theme="special-loopy"] main > .card:first-child::before,
html[data-theme="special-loopy"] #portal .box:nth-of-type(2)::before{
  right:28px!important;
  top:96px!important;
  width:260px!important;
  height:260px!important;
  opacity:.34!important;
  z-index:0!important;
}
html[data-theme="special-loopy"] main > .card:first-child::after,
html[data-theme="special-loopy"] #portal .box:nth-of-type(2)::after{
  right:32px!important;
  bottom:36px!important;
  width:230px!important;
  height:210px!important;
  opacity:.38!important;
  z-index:0!important;
}

/* 메뉴 카드: 제목 1줄, 설명 최대 2줄 */
html[data-theme="special-loopy"] .portalMenuBtn,
html[data-theme="special-loopy"] .menuBtn{
  min-height:108px!important;
  grid-template-columns:80px minmax(0,1fr) 22px!important;
  column-gap:18px!important;
  padding:18px 20px!important;
}
html[data-theme="special-loopy"] .portalMenuTitle,
html[data-theme="special-loopy"] .portalMenuBtn strong,
html[data-theme="special-loopy"] .menuBtn strong{
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  line-height:1.2!important;
}
html[data-theme="special-loopy"] .portalMenuDesc,
html[data-theme="special-loopy"] .portalMenuBtn span:not(.portalMenuIcon),
html[data-theme="special-loopy"] .menuBtn span:not(.portalMenuIcon){
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  line-height:1.35!important;
  max-height:2.7em!important;
  word-break:keep-all!important;
}

/* 설명이 짧아 보이도록 교사 포털 카드 설명 폰트/폭 정리 */
html[data-theme="special-loopy"] .portalMenuDesc{
  font-size:13px!important;
  letter-spacing:-.02em!important;
}

@media(max-width:980px){
  html[data-theme="special-loopy"] #menuArea{
    grid-template-columns:1fr!important;
  }
  html[data-theme="special-loopy"] .topHeader::after,
  html[data-theme="special-loopy"] #portal > .box:first-child::after,
  html[data-theme="special-loopy"] .login-card::after{
    display:none!important;
  }
  html[data-theme="special-loopy"] main > .card:first-child::before,
  html[data-theme="special-loopy"] #portal .box:nth-of-type(2)::before{
    opacity:.28!important;
  }
}

/* ===============================
   RC9 Final+ : login season badge + Loopy image path final
   - 기본 로그인 화면의 계절 배지를 로그인 버튼 아래로 이동
   - root theme.css 기준 이미지 경로: assets/special/loopy/
================================ */
html[data-theme="default"] .login-card{
  padding-bottom:76px!important;
}
html[data-theme="default"] .login-card::before{
  left:50%!important;
  right:auto!important;
  top:auto!important;
  bottom:20px!important;
  transform:translateX(-50%)!important;
  min-width:128px!important;
  height:36px!important;
  padding:0 16px!important;
  border-radius:999px!important;
  font-size:12.5px!important;
  line-height:1!important;
  z-index:5!important;
  white-space:nowrap!important;
  pointer-events:none!important;
  background:color-mix(in srgb,var(--ms-surface) 88%,transparent)!important;
  color:var(--ms-primary-2)!important;
  border:1px solid var(--ms-border)!important;
  box-shadow:0 10px 24px color-mix(in srgb,var(--ms-primary) 16%,transparent)!important;
  backdrop-filter:blur(12px)!important;
}

/* Loopy Special 이미지 슬롯 최종 경로(root theme.css용) */
html[data-theme="special-loopy"]{
  --loopy-bg-image:url("../assets/special/loopy/background.png");
  --loopy-hero-image:url("../assets/special/loopy/hero.png");
  --loopy-sticker-top:url("../assets/special/loopy/sticker-top.png");
  --loopy-sticker-bottom:url("../assets/special/loopy/sticker-bottom.png");
  --loopy-speech:url("../assets/special/loopy/speech.png");
}

/* Loopy 상단: 배지는 로그아웃 아래, 이미지는 오른쪽 장식 */
html[data-theme="special-loopy"] .topHeader::after,
html[data-theme="special-loopy"] #portal > .box:first-child::after,
html[data-theme="special-loopy"] .login-card::after{
  content:"⭐ Loopy Special"!important;
  right:24px!important;
  top:calc(50% + 34px)!important;
  transform:none!important;
  z-index:5!important;
}

@media(max-width:640px){
  html[data-theme="default"] .login-card{
    padding-bottom:74px!important;
  }
  html[data-theme="default"] .login-card::before{
    bottom:18px!important;
    font-size:12px!important;
    height:34px!important;
  }
}

/* ===============================
   RC9 Final Visible Loopy Fix
   - Loopy images moved into open spaces so cards do not hide them
   - background kept soft; top/bottom stickers are fully visible
================================ */
html[data-theme="special-loopy"]{
  --loopy-bg-image:url("../assets/special/loopy/background.png");
  --loopy-hero-image:url("../assets/special/loopy/hero.png");
  --loopy-sticker-top:url("../assets/special/loopy/sticker-top.png");
  --loopy-sticker-bottom:url("../assets/special/loopy/sticker-bottom.png");
  --loopy-speech:url("../assets/special/loopy/speech.png");
}

/* 메인 카드 안 루피 이미지는 메뉴 뒤가 아니라 제목 오른쪽/하단 여백에 배치 */
html[data-theme="special-loopy"] main > .card:first-child,
html[data-theme="special-loopy"] #portal .box:nth-of-type(2){
  position:relative!important;
  overflow:hidden!important;
  padding-bottom:220px!important;
  background:
    linear-gradient(rgba(255,255,255,.82),rgba(255,255,255,.88)),
    var(--loopy-bg-image) center 40%/cover no-repeat!important;
}

/* 상단 오른쪽 스티커: 메뉴 카드와 겹치지 않도록 제목 영역 오른쪽에 표시 */
html[data-theme="special-loopy"] main > .card:first-child::before,
html[data-theme="special-loopy"] #portal .box:nth-of-type(2)::before{
  content:""!important;
  position:absolute!important;
  right:42px!important;
  top:34px!important;
  width:230px!important;
  height:190px!important;
  background:var(--loopy-sticker-top) center/contain no-repeat!important;
  opacity:.98!important;
  z-index:1!important;
  pointer-events:none!important;
  filter:drop-shadow(0 18px 26px rgba(219,39,119,.20))!important;
}

/* 하단 오른쪽 스티커: 카드 아래 여백에 표시 */
html[data-theme="special-loopy"] main > .card:first-child::after,
html[data-theme="special-loopy"] #portal .box:nth-of-type(2)::after{
  content:""!important;
  position:absolute!important;
  right:56px!important;
  bottom:38px!important;
  width:245px!important;
  height:190px!important;
  background:var(--loopy-sticker-bottom) center/contain no-repeat!important;
  opacity:1!important;
  z-index:1!important;
  pointer-events:none!important;
  filter:drop-shadow(0 18px 26px rgba(219,39,119,.20))!important;
}

/* 실제 메뉴와 제목은 스티커보다 위에 두되, 스티커가 비는 공간에만 보이게 함 */
html[data-theme="special-loopy"] main > .card:first-child > *,
html[data-theme="special-loopy"] #portal .box:nth-of-type(2) > *{
  position:relative!important;
  z-index:2!important;
}

/* 제목 영역 오른쪽에 공간을 줘서 상단 스티커가 가려지지 않게 함 */
html[data-theme="special-loopy"] main > .card:first-child > h2,
html[data-theme="special-loopy"] main > .card:first-child > .subText,
html[data-theme="special-loopy"] #portal .box:nth-of-type(2) > h2,
html[data-theme="special-loopy"] #portal .box:nth-of-type(2) > .subText{
  max-width:calc(100% - 280px)!important;
}

/* 메뉴 카드는 넓게 유지: 텍스트 1~2줄 목표 */
html[data-theme="special-loopy"] #menuArea{
  max-width:none!important;
  width:100%!important;
  grid-template-columns:repeat(2,minmax(360px,1fr))!important;
  gap:18px 22px!important;
}
html[data-theme="special-loopy"] .portalMenuBtn,
html[data-theme="special-loopy"] .menuBtn{
  min-height:112px!important;
  grid-template-columns:82px minmax(0,1fr) 24px!important;
  padding:18px 22px!important;
}
html[data-theme="special-loopy"] .portalMenuDesc,
html[data-theme="special-loopy"] .portalMenuBtn span:not(.portalMenuIcon),
html[data-theme="special-loopy"] .menuBtn span:not(.portalMenuIcon){
  -webkit-line-clamp:2!important;
  line-height:1.36!important;
  max-height:2.72em!important;
  word-break:keep-all!important;
}

/* 모바일에서는 이미지가 메뉴를 방해하지 않게 더 작고 흐리게 */
@media(max-width:980px){
  html[data-theme="special-loopy"] main > .card:first-child,
  html[data-theme="special-loopy"] #portal .box:nth-of-type(2){
    padding-bottom:165px!important;
  }
  html[data-theme="special-loopy"] main > .card:first-child::before,
  html[data-theme="special-loopy"] #portal .box:nth-of-type(2)::before{
    width:145px!important;
    height:125px!important;
    right:18px!important;
    top:20px!important;
    opacity:.78!important;
  }
  html[data-theme="special-loopy"] main > .card:first-child::after,
  html[data-theme="special-loopy"] #portal .box:nth-of-type(2)::after{
    width:150px!important;
    height:128px!important;
    right:22px!important;
    bottom:26px!important;
  }
  html[data-theme="special-loopy"] main > .card:first-child > h2,
  html[data-theme="special-loopy"] main > .card:first-child > .subText,
  html[data-theme="special-loopy"] #portal .box:nth-of-type(2) > h2,
  html[data-theme="special-loopy"] #portal .box:nth-of-type(2) > .subText{
    max-width:calc(100% - 160px)!important;
  }
  html[data-theme="special-loopy"] #menuArea{
    grid-template-columns:1fr!important;
  }
}

/* RC13.1 Captain Hotfix: global top theme + mobile bottom nav */
.portalThemeCompact{position:fixed;right:18px;top:18px;z-index:10050;display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.portalThemeToggle{height:34px;border:1px solid rgba(148,163,184,.35);border-radius:999px;background:rgba(255,255,255,.92);color:#0f172a;font-weight:900;font-size:12px;padding:0 12px;box-shadow:0 8px 22px rgba(15,23,42,.12);backdrop-filter:blur(12px);cursor:pointer}
.portalThemeDropdown{width:min(280px,calc(100vw - 28px));padding:10px;border:1px solid rgba(148,163,184,.28);border-radius:18px;background:rgba(255,255,255,.96);box-shadow:0 18px 42px rgba(15,23,42,.18);display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;animation:themeDrop .16s ease-out}
.portalThemeDropdown[hidden]{display:none!important}.portalThemeDropdown button{height:34px;border:1px solid rgba(148,163,184,.25);border-radius:999px;background:#fff;color:#0f172a;font-size:12px;font-weight:800;cursor:pointer}.portalThemeDropdown button.active{background:linear-gradient(135deg,var(--ms-primary,#2563eb),var(--ms-accent,#06b6d4));color:#fff;border-color:transparent}@keyframes themeDrop{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}
html[data-theme="dark"] .portalThemeToggle,html[data-theme="dark"] .portalThemeDropdown{background:rgba(15,23,42,.95);color:#f8fafc;border-color:#334155}html[data-theme="dark"] .portalThemeDropdown button{background:#111827;color:#e2e8f0;border-color:#334155}
.portalMobileBottomNav{display:none}.ms-theme-panel,.themeBar,.themeSwitcher,.themeDock,.themeFloating,.theme-floating,.theme-toggle-bar,.themePalette,.theme-palette{display:none!important}
@media(max-width:760px){
 body:not(.student-page){padding-bottom:96px!important}.portalThemeCompact{top:10px!important;right:10px!important}.portalThemeToggle{height:30px!important;width:34px!important;min-width:34px!important;padding:0!important;font-size:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}.portalThemeToggle::before{content:'🎨';font-size:16px}.portalThemeDropdown{position:fixed!important;left:12px!important;right:12px!important;top:58px!important;width:auto!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;border-radius:24px!important;padding:14px!important}.portalThemeDropdown button{height:48px!important;border-radius:16px!important;font-size:11px!important}
 .portalMobileBottomNav{position:fixed!important;left:10px!important;right:10px!important;bottom:8px!important;z-index:10040!important;display:grid!important;grid-template-columns:repeat(5,1fr)!important;gap:4px!important;padding:8px 8px max(8px,env(safe-area-inset-bottom))!important;border:1px solid rgba(148,163,184,.24)!important;border-radius:25px!important;background:rgba(255,255,255,.92)!important;box-shadow:0 14px 36px rgba(15,23,42,.22)!important;backdrop-filter:blur(16px)!important}.portalMobileBottomNav button{border:0!important;background:transparent!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:3px!important;min-height:50px!important;color:#334155!important;font-weight:900!important}.portalMobileBottomNav button span{font-size:21px!important;line-height:1!important}.portalMobileBottomNav button b{font-size:10px!important;line-height:1.1!important}.portalMobileBottomNav button:active{transform:scale(.96)}
 html[data-theme="dark"] .portalMobileBottomNav{background:rgba(15,23,42,.92)!important;border-color:#334155!important}.portalMobileBottomNav button:first-child{color:var(--ms-primary,#0ea5e9)!important}
 .portalHeaderActions{margin-left:auto!important;justify-content:flex-end!important}.portalHomeHeader .portalHeaderActions{right:18px!important;left:auto!important}
}


/* RC13.2 shared teacher bottom nav for sub pages */
.portalMobileBottomNav{display:none;}
@media (max-width:760px){
  body{padding-bottom:calc(84px + env(safe-area-inset-bottom));}
  .portalMobileBottomNav{
    position:fixed;
    left:max(10px, env(safe-area-inset-left));
    right:max(10px, env(safe-area-inset-right));
    bottom:calc(8px + env(safe-area-inset-bottom));
    z-index:2147482000;
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:2px;
    padding:8px 10px;
    border-radius:24px;
    background:rgba(255,255,255,.96);
    border:1px solid rgba(148,163,184,.22);
    box-shadow:0 12px 34px rgba(15,23,42,.22);
    backdrop-filter:blur(14px);
  }
  .portalMobileBottomNav button{
    border:0;
    background:transparent;
    border-radius:18px;
    min-height:48px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
    color:#334155;
    font-size:10px;
    font-weight:800;
  }
  .portalMobileBottomNav button span{font-size:20px;line-height:1;}
  .portalMobileBottomNav button b{font-size:10px;line-height:1.1;}
  .portalMobileBottomNav button:active,.portalMobileBottomNav button.active{background:rgba(236,72,153,.12);color:var(--ms-primary,#ec4899);}
  html[data-theme="dark"] .portalMobileBottomNav{background:rgba(15,23,42,.94);border-color:#334155;}
  html[data-theme="dark"] .portalMobileBottomNav button{color:#e2e8f0;}
}


/* RC13.4 shared theme compact visual */
.portalThemeCompact{position:fixed!important;right:12px!important;top:12px!important;z-index:2147483600!important;pointer-events:auto!important;}
.portalThemeToggle{width:42px!important;height:42px!important;min-width:42px!important;padding:0!important;border-radius:999px!important;display:flex!important;align-items:center!important;justify-content:center!important;font-size:18px!important;}
.portalThemeDropdown{z-index:2147483601!important;pointer-events:auto!important;}


/* RC13.6 theme single icon fix */
.portalThemeToggle{
  font-size:0!important;
  line-height:0!important;
  overflow:hidden!important;
}
.portalThemeToggle::before{
  content:"🎨"!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:18px!important;
  line-height:1!important;
  width:100%!important;
  height:100%!important;
}
.portalThemeToggle::after{
  content:none!important;
  display:none!important;
}


/* =========================================================
   RC13.27 DARK READABILITY GLOBAL PATCH
   목적: 다크모드에서 회색/흰색 박스 안의 흰 글자 문제를 전역 보정
   적용 범위: 월간업무계획, 자습반 출석체크, 전달사항 등록, 관리자 대시보드,
             홈 대시보드 캐시관리, 메인 포털 버튼/카드
   ========================================================= */

/* 다크모드 기본 변수 대비 강화 */
html[data-theme="dark"],
body.theme-dark{
  --ms-bg:#07111f!important;
  --ms-surface:#0f1b2d!important;
  --ms-surface-2:#14243a!important;
  --ms-surface-3:#1d314c!important;
  --ms-text:#f8fafc!important;
  --ms-heading:#ffffff!important;
  --ms-muted:#d9e4f5!important;
  --ms-soft-text:#f1f5f9!important;
  --ms-border:#334155!important;
}

/* 다크 페이지의 일반 글자 */
html[data-theme="dark"] body,
body.theme-dark{
  color:#f8fafc!important;
}
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] label,
body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3,
body.theme-dark h4,
body.theme-dark label{
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
}

/* 입력창: 다크 배경에서는 흰 글자 유지 */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea{
  color:#f8fafc!important;
  -webkit-text-fill-color:#f8fafc!important;
  background:#0f172a!important;
  border-color:#475569!important;
  caret-color:#ffffff!important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder,
body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder{
  color:#94a3b8!important;
  -webkit-text-fill-color:#94a3b8!important;
}

/* 밝은/회색 버튼: 글자는 검정, 배경은 밝게 고정 */
html[data-theme="dark"] button:not(.primaryBtn):not(.dangerBtn):not(.tabBtn):not(.tabBtn.active):not(.portalBottomNavBtn):not(.portalThemeToggle):not(.themeChip),
body.theme-dark button:not(.primaryBtn):not(.dangerBtn):not(.tabBtn):not(.tabBtn.active):not(.portalBottomNavBtn):not(.portalThemeToggle):not(.themeChip),
html[data-theme="dark"] .smallBtn,
html[data-theme="dark"] .ghostBtn,
html[data-theme="dark"] .grayBtn,
html[data-theme="dark"] .secondaryBtn,
html[data-theme="dark"] .outlineBtn,
html[data-theme="dark"] .backBtn,
body.theme-dark .smallBtn,
body.theme-dark .ghostBtn,
body.theme-dark .grayBtn,
body.theme-dark .secondaryBtn,
body.theme-dark .outlineBtn,
body.theme-dark .backBtn{
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  background:#f8fafc!important;
  border-color:#cbd5e1!important;
  text-shadow:none!important;
  opacity:1!important;
}

/* 버튼 내부 span/strong까지 */
html[data-theme="dark"] button:not(.primaryBtn):not(.dangerBtn):not(.tabBtn):not(.tabBtn.active):not(.portalBottomNavBtn):not(.portalThemeToggle):not(.themeChip) *,
body.theme-dark button:not(.primaryBtn):not(.dangerBtn):not(.tabBtn):not(.tabBtn.active):not(.portalBottomNavBtn):not(.portalThemeToggle):not(.themeChip) *,
html[data-theme="dark"] .smallBtn *,
html[data-theme="dark"] .ghostBtn *,
html[data-theme="dark"] .grayBtn *,
html[data-theme="dark"] .secondaryBtn *,
html[data-theme="dark"] .outlineBtn *,
html[data-theme="dark"] .backBtn *,
body.theme-dark .smallBtn *,
body.theme-dark .ghostBtn *,
body.theme-dark .grayBtn *,
body.theme-dark .secondaryBtn *,
body.theme-dark .outlineBtn *,
body.theme-dark .backBtn *{
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  text-shadow:none!important;
}

/* disabled도 글자 보이게 */
html[data-theme="dark"] button:disabled,
html[data-theme="dark"] button[disabled],
body.theme-dark button:disabled,
body.theme-dark button[disabled]{
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  background:#f8fafc!important;
  border-color:#cbd5e1!important;
  opacity:.82!important;
  text-shadow:none!important;
}

/* 주요 액션 버튼은 흰 글자 유지 */
html[data-theme="dark"] .primaryBtn,
html[data-theme="dark"] button.primaryBtn,
html[data-theme="dark"] .gradientBtn,
html[data-theme="dark"] .savePrimaryBtn,
html[data-theme="dark"] .actionPrimary,
html[data-theme="dark"] .tabBtn.active,
body.theme-dark .primaryBtn,
body.theme-dark button.primaryBtn,
body.theme-dark .gradientBtn,
body.theme-dark .savePrimaryBtn,
body.theme-dark .actionPrimary,
body.theme-dark .tabBtn.active{
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  text-shadow:none!important;
}

/* 특정 버튼: 월간업무계획 / 전달사항 / 포털 헤더 / 출석체크 */
html[data-theme="dark"] #backPortalBtn,
html[data-theme="dark"] #backBtn,
html[data-theme="dark"] #exitBtn,
html[data-theme="dark"] #logoutBtn,
html[data-theme="dark"] #todayBtn,
html[data-theme="dark"] #prevBtn,
html[data-theme="dark"] #nextBtn,
html[data-theme="dark"] #reloadBtn,
html[data-theme="dark"] #newBtn,
html[data-theme="dark"] #copyBtn,
html[data-theme="dark"] #deleteBtn,
html[data-theme="dark"] #saveBtn:disabled,
html[data-theme="dark"] #savedBtn,
html[data-theme="dark"] .monthNav button,
html[data-theme="dark"] .portalHeaderActions button,
html[data-theme="dark"] .noticeHeader button,
body.theme-dark #backPortalBtn,
body.theme-dark #backBtn,
body.theme-dark #exitBtn,
body.theme-dark #logoutBtn,
body.theme-dark #todayBtn,
body.theme-dark #prevBtn,
body.theme-dark #nextBtn,
body.theme-dark #reloadBtn,
body.theme-dark #newBtn,
body.theme-dark #copyBtn,
body.theme-dark #deleteBtn,
body.theme-dark #saveBtn:disabled,
body.theme-dark #savedBtn,
body.theme-dark .monthNav button,
body.theme-dark .portalHeaderActions button,
body.theme-dark .noticeHeader button{
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  background:#ffffff!important;
  border-color:#cbd5e1!important;
  opacity:1!important;
}

/* 밝은 카드/요약 박스/학생 카드/관리자 통계 카드 내부는 검정 글자 */
html[data-theme="dark"] .studentCard,
html[data-theme="dark"] .studentRow,
html[data-theme="dark"] .attendanceStudentCard,
html[data-theme="dark"] .summaryItem,
html[data-theme="dark"] .summaryBox,
html[data-theme="dark"] .statBox,
html[data-theme="dark"] .statusBox,
html[data-theme="dark"] .classStatusCard,
html[data-theme="dark"] .classCard,
html[data-theme="dark"] .statCard,
html[data-theme="dark"] .dashboardCard.light,
html[data-theme="dark"] .dashboard-card.light,
html[data-theme="dark"] .lightCard,
html[data-theme="dark"] .whiteCard,
html[data-theme="dark"] .roomCard,
html[data-theme="dark"] .student-list,
body.theme-dark .studentCard,
body.theme-dark .studentRow,
body.theme-dark .attendanceStudentCard,
body.theme-dark .summaryItem,
body.theme-dark .summaryBox,
body.theme-dark .statBox,
body.theme-dark .statusBox,
body.theme-dark .classStatusCard,
body.theme-dark .classCard,
body.theme-dark .statCard,
body.theme-dark .dashboardCard.light,
body.theme-dark .dashboard-card.light,
body.theme-dark .lightCard,
body.theme-dark .whiteCard,
body.theme-dark .roomCard,
body.theme-dark .student-list{
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  text-shadow:none!important;
}
html[data-theme="dark"] .studentCard *,
html[data-theme="dark"] .studentRow *,
html[data-theme="dark"] .attendanceStudentCard *,
html[data-theme="dark"] .summaryItem *,
html[data-theme="dark"] .summaryBox *,
html[data-theme="dark"] .statBox *,
html[data-theme="dark"] .statusBox *,
html[data-theme="dark"] .classStatusCard *,
html[data-theme="dark"] .classCard *,
html[data-theme="dark"] .statCard *,
html[data-theme="dark"] .lightCard *,
html[data-theme="dark"] .whiteCard *,
html[data-theme="dark"] .roomCard *,
body.theme-dark .studentCard *,
body.theme-dark .studentRow *,
body.theme-dark .attendanceStudentCard *,
body.theme-dark .summaryItem *,
body.theme-dark .summaryBox *,
body.theme-dark .statBox *,
body.theme-dark .statusBox *,
body.theme-dark .classStatusCard *,
body.theme-dark .classCard *,
body.theme-dark .statCard *,
body.theme-dark .lightCard *,
body.theme-dark .whiteCard *,
body.theme-dark .roomCard *{
  color:inherit!important;
  -webkit-text-fill-color:inherit!important;
  text-shadow:none!important;
}

/* 다크 카드 내부 글자 대비 강화 */
html[data-theme="dark"] .card:not(.studentCard):not(.statCard):not(.classCard):not(.lightCard):not(.whiteCard),
html[data-theme="dark"] .panel:not(.lightCard):not(.whiteCard),
html[data-theme="dark"] .sectionCard:not(.lightCard):not(.whiteCard),
body.theme-dark .card:not(.studentCard):not(.statCard):not(.classCard):not(.lightCard):not(.whiteCard),
body.theme-dark .panel:not(.lightCard):not(.whiteCard),
body.theme-dark .sectionCard:not(.lightCard):not(.whiteCard){
  color:#f8fafc!important;
}
html[data-theme="dark"] .card:not(.studentCard):not(.statCard):not(.classCard):not(.lightCard):not(.whiteCard) p,
html[data-theme="dark"] .card:not(.studentCard):not(.statCard):not(.classCard):not(.lightCard):not(.whiteCard) div,
html[data-theme="dark"] .panel p,
html[data-theme="dark"] .panel div,
html[data-theme="dark"] .sectionCard p,
html[data-theme="dark"] .sectionCard div,
body.theme-dark .card:not(.studentCard):not(.statCard):not(.classCard):not(.lightCard):not(.whiteCard) p,
body.theme-dark .card:not(.studentCard):not(.statCard):not(.classCard):not(.lightCard):not(.whiteCard) div,
body.theme-dark .panel p,
body.theme-dark .panel div,
body.theme-dark .sectionCard p,
body.theme-dark .sectionCard div{
  color:inherit!important;
  text-shadow:none!important;
}

/* 안내 박스: 다크에서도 읽히게 */
html[data-theme="dark"] .hint,
html[data-theme="dark"] .notice,
html[data-theme="dark"] .infoBox,
html[data-theme="dark"] .helpBox,
html[data-theme="dark"] .descriptionBox,
body.theme-dark .hint,
body.theme-dark .notice,
body.theme-dark .infoBox,
body.theme-dark .helpBox,
body.theme-dark .descriptionBox{
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  background:#eaf2ff!important;
  border-color:#93c5fd!important;
}
html[data-theme="dark"] .hint *,
html[data-theme="dark"] .notice *,
html[data-theme="dark"] .infoBox *,
html[data-theme="dark"] .helpBox *,
html[data-theme="dark"] .descriptionBox *,
body.theme-dark .hint *,
body.theme-dark .notice *,
body.theme-dark .infoBox *,
body.theme-dark .helpBox *,
body.theme-dark .descriptionBox *{
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
}

/* 체크박스/라벨 */
html[data-theme="dark"] input[type="checkbox"],
body.theme-dark input[type="checkbox"]{
  background:#ffffff!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
}
html[data-theme="dark"] .checkboxLabel,
html[data-theme="dark"] .formLabel,
body.theme-dark .checkboxLabel,
body.theme-dark .formLabel{
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
}

/* 하단 네비 */
html[data-theme="dark"] .portalMobileBottomNav,
html[data-theme="dark"] .portalBottomNav,
body.theme-dark .portalMobileBottomNav,
body.theme-dark .portalBottomNav{
  background:#0f172a!important;
  color:#f8fafc!important;
  border-color:#334155!important;
}
html[data-theme="dark"] .portalMobileBottomNav *,
html[data-theme="dark"] .portalBottomNav *,
body.theme-dark .portalMobileBottomNav *,
body.theme-dark .portalBottomNav *{
  color:inherit!important;
  -webkit-text-fill-color:inherit!important;
}


/* =========================================================
   RC13.33 TEMP DISABLE DARK / LOOPY MODES
   - 다크/루피 모드는 안정화 전까지 선택지에서 숨김
   - 저장값이 남아 있어도 기본 테마처럼 보이게 보정
   ========================================================= */

[data-theme-value="dark"],
[data-theme-value="special-loopy"],
[data-theme-value="loopy"],
.themeChip[data-theme="dark"],
.themeChip[data-theme="special-loopy"],
.themeChip[data-theme="loopy"],
button[data-theme-value="dark"],
button[data-theme-value="special-loopy"],
button[data-theme-value="loopy"]{
  display:none!important;
}

/* 루피 배지/스티커/장식 숨김 */
.loopySpecialBadge,
[data-theme-label="special-loopy"],
html[data-theme="special-loopy"] .loopySpecialBadge,
html[data-theme="special-loopy"] .seasonBadge{
  display:none!important;
}

/* 혹시 기존 저장값으로 dark/loopy class가 남아도 기본 화면처럼 강제 */
html[data-theme="dark"],
html[data-theme="special-loopy"]{
  color-scheme:light!important;
}

html[data-theme="dark"] body,
html[data-theme="special-loopy"] body{
  background:var(--ms-bg,#f8fafc)!important;
  color:var(--ms-text,#0f172a)!important;
}

html[data-theme="dark"] .portalHomeHeader,
html[data-theme="special-loopy"] .portalHomeHeader,
html[data-theme="dark"] header.portalHomeHeader.topHeader,
html[data-theme="special-loopy"] header.portalHomeHeader.topHeader{
  background:linear-gradient(135deg,#38bdf8,#2dd4bf)!important;
  color:#fff!important;
  background-image:linear-gradient(135deg,#38bdf8,#2dd4bf)!important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .sectionCard,
html[data-theme="dark"] .panel,
html[data-theme="special-loopy"] .card,
html[data-theme="special-loopy"] .sectionCard,
html[data-theme="special-loopy"] .panel{
  background:#fff!important;
  color:#0f172a!important;
}


/* =========================================================
   RC13.34 LOGIN SCREEN FIX
   - 자동 로그인 체크박스 정렬
   - 로그인 화면 테마 선택 추가
   - 여름 에디션 문구 숨김
   ========================================================= */

.login-card .autoLoginOption,
.autoLoginOption{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
  width:100%!important;
  margin:4px 0 12px!important;
  padding:0!important;
  line-height:1.2!important;
  color:#0f172a!important;
  font-size:14px!important;
  font-weight:500!important;
}

.login-card .autoLoginOption input,
.autoLoginOption input,
#autoLoginCheck{
  width:16px!important;
  height:16px!important;
  min-width:16px!important;
  min-height:16px!important;
  margin:0!important;
  padding:0!important;
  flex:0 0 16px!important;
  vertical-align:middle!important;
  appearance:auto!important;
}

.login-card .autoLoginOption span,
.autoLoginOption span{
  display:inline-flex!important;
  align-items:center!important;
  line-height:1.2!important;
  margin:0!important;
  padding:0!important;
  white-space:nowrap!important;
}

.loginThemePicker{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:6px!important;
  margin:14px auto 0!important;
  max-width:280px!important;
}

.loginThemePicker button{
  min-height:30px!important;
  padding:6px 8px!important;
  border-radius:999px!important;
  border:1px solid var(--ms-border,#bae6fd)!important;
  background:#fff!important;
  color:var(--ms-heading,#0369a1)!important;
  font-size:12px!important;
  font-weight:800!important;
  box-shadow:0 4px 12px rgba(15,23,42,.06)!important;
}

.loginThemePicker button.active{
  background:var(--ms-gradient,linear-gradient(135deg,#38bdf8,#2dd4bf))!important;
  color:#fff!important;
  border-color:transparent!important;
}

/* 로그인 화면에는 시즌/여름 에디션 문구를 표시하지 않음 */
.login-page .seasonBadge,
.login-page .loopySpecialBadge,
.login-page [data-season-label],
.login-page [data-season-badge],
.login-page [data-theme-label="default"],
.login-card .seasonBadge,
.login-card .loopySpecialBadge,
.login-card [data-theme-label="default"]{
  display:none!important;
}
