:root {
  --bg: #0d1117;
  --panel: #161b22;
  --line: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --blue: #4a90e2;
  --yellow: #f5c518;
  --red: #e74c3c;
  --accent: #1f6feb;
}

/* ===================== 밝은 화면(라이트 테마) =====================
   햄버거 '밝은 화면 켜기' → body.light 토글. 변수 + 하드코딩 다크 표면 반전. */
body.light {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #d7dde3;
  --text: #1f2328;
  --muted: #57606a;
  --accent: #007ACC;
}
body.light .hamburger { color: #1f2328; }
body.light .ib-id .idline { color: #1f2328; border-bottom-color: #c2c8ce; }
body.light .ham-menu { background: #ffffff; border-color: #d7dde3; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
body.light .ham-item { color: #1f2328; }
body.light .ham-item:hover { background: #eef1f4; }
body.light .ham-danger { color: #d32f2f; }
body.light .ham-danger:hover { background: #fbeaea; }
body.light .profile-email { color: #1f6feb; }
body.light .subj .std, body.light .subj .grade, body.light .subj .elec,
body.light .univ-sel, body.light .dept-sel { background: #ffffff; color: #1f2328; }
body.light .subj .cell.pct { color: #1f6feb; }
body.light .my-pct { color: #57606a; }
body.light .my-pct b { color: #c77f00; }
body.light .member-tier { color: #57606a; }
body.light .bet span { color: #9aa0a6; }
body.light .ib-notify { background: #eef1f4; border-color: #d7dde3; color: #1f6feb; }
body.light #chart { background: #CCCCCC; }   /* 점도표(전체 판세) 배경 — 라이트 모드 */
body.light #chart-rank, body.light #chart-addpass, body.light .chart { background: #e9edf1; }
/* 좌측 세로 탭은 라이트 모드에서도 '다크 모드와 동일'하게 둔다:
   선택=검정+흰글씨 / 비선택=전체판세 회색·등수 빨강·추합 녹색·제미나이 청색.
   → body.light 오버라이드를 제거해 기본 .tab.t-* 색이 그대로 적용되게 함. */

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
}

/* ===================== 인증 확인 중(로딩) ===================== */
#loading-container {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #1b2a52 0%, #0a0f1f 60%, #05070f 100%);
  z-index: 1100;
}
#loading-container .spinner { color: #cfd6e4; font-size: 15px; letter-spacing: 1px; }

/* ===================== 인트로 스플래시(원본 ui_splash.py 재현) ===================== */
/* 원본처럼 전체 화면에 배경 이미지(galaxy1.png)를 깔고 그 위에 자막이 뜬다(불투명 — 다음 화면을 완전히 가림). */
#splash-container {
  position: fixed; inset: 0; z-index: 1500;
  background: #05070f;
  overflow: hidden;
}
/* 배경 이미지 레이어 — 원본의 느린 줌인(1.0→1.15, 8초) 재현 */
#splash-container::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("galaxy1.png") center center / cover no-repeat;
  transform: scale(1); transform-origin: center;
  animation: splashZoom 8s linear both;
}
@keyframes splashZoom { from { transform: scale(1); } to { transform: scale(1.15); } }
.splash-inner {
  position: absolute; left: 41%; top: 11%;
  max-width: 720px; padding-right: 16px;
}
.splash-top {
  margin: 0 0 6px; color: #fff; font-weight: 800; font-size: 20px; line-height: 1.5;
  text-shadow: 0 2px 10px #000, 0 0 4px #000;
}
.splash-title {
  margin: 6px 0 30px; font-size: 46px; font-weight: 800; line-height: 1.1;
  white-space: nowrap;
  /* 흰 글자에 빨강→초록→파랑 빛 띠가 지나가는 시머(원본) */
  background: linear-gradient(100deg,
    #fff 0%, #fff 34%, #ff1744 43%, #00e676 50%, #2979ff 57%, #fff 66%, #fff 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.9));
  animation: splashSlam 0.5s cubic-bezier(0.2, 1.5, 0.35, 1) both,
             splashShimmer 2.4s linear 0.5s infinite;
}
.splash-body {
  margin: 0; color: #fff; font-weight: 800; font-size: 28px; line-height: 1.55;
  text-shadow: 0 2px 10px #000, 0 0 4px #000;
  opacity: 0; animation: splashFade 2s ease 0.2s forwards;
}
.splash-body .gem { color: #4E8CFF; }
@keyframes splashSlam { from { transform: scale(2.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes splashShimmer { from { background-position: 130% 0; } to { background-position: -30% 0; } }
@keyframes splashFade { to { opacity: 1; } }
@media (max-width: 880px) {
  .splash-inner { left: 8%; right: 8%; top: 14%; max-width: none; }
  .splash-title { font-size: 30px; white-space: normal; }
  .splash-body { font-size: 20px; }
  .splash-top { font-size: 16px; }
}

/* ===================== 로그인 레이어 (갤럭시) ===================== */
#login-container {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;    /* 상단 제목 → 아래 로그인/홍보(가로 중앙) */
  align-items: center;       /* 가로 중앙 */
  justify-content: flex-start; /* 제목은 상단 고정 */
  gap: 24px;
  padding: 24px;
  overflow: auto;
  /* 실제 시뮬레이션 화면(landing_1.png)을 배경으로 — 명도를 낮춰
     막강한 UI를 은은히 보여준다. 어두운 오버레이 + 좌우 비네팅. */
  background:
    /* landing_1.png 을 지금보다 25% 더 어둡게: 투과율(1-alpha)을 0.75배로 → alpha 0.72→0.79, 0.75→0.81 */
    linear-gradient(rgba(3, 6, 15, 0.85), rgba(3, 6, 15, 0.95)),
    url("landing_1.png") center center / cover no-repeat fixed,
    #05070f;
  z-index: 1000;
}

/* ===== 좌측 홍보 문구 ===== */
.login-promo {
  flex: 0 0 320px;
  max-width: 90vw;
  color: #dfe6f2;
  text-align: left;
}
.promo-title {
  font-size: 34px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
}
.promo-title span {
  font-size: 20px;
  font-weight: 700;
  color: #9fd1ff;
}
.promo-lead {
  font-size: 17px;
  font-weight: 600;
  color: #9fd1ff;
  margin: 0 0 22px;
}
.promo-desc {
  font-size: 16px;
  line-height: 1.65;
  color: #cfd6e4;
  margin: 0 0 26px;
}
.promo-price {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.promo-price li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;            /* 사각형 박스 제거 — 텍스트만 노출 */
  background: none;
  border: none;
  border-radius: 0;
  font-size: 15px;
  color: #cfd6e4;
}
.promo-price b {
  font-size: 17px;
  font-weight: 800;
  color: #448AFF;   /* 제미나이 컨설팅 탭 배경색(파랑)과 통일 */
  white-space: nowrap;
}
.promo-price b.free {
  color: #00e676;
}

/* ===== 우측 이용약관 ===== */
.login-terms {
  flex: 1 1 560px;        /* 남는 우측 공간을 채워 넓게 */
  max-width: 960px;
  min-width: 420px;
  background: rgba(13, 17, 23, 0.55);
  border: 1px solid #2a3550;
  border-radius: 16px;
  padding: 20px 8px 20px 20px;
  backdrop-filter: blur(4px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  text-align: left;
}
/* 제목 + 동의 체크를 한 줄에 (제목 왼쪽, 체크 오른쪽) */
.terms-head {
  display: flex;
  flex-direction: column;   /* 세로: 동의 배지(맨 앞) → 제목 */
  align-items: flex-start;
  gap: 12px;
  padding-right: 40px;      /* 닫기(✕) 버튼과 겹침 방지 */
  margin: 0 0 12px;
}
.terms-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}
.terms-scroll {
  max-height: 86vh;        /* 높이 확대 → 스크롤 최소화 */
  overflow-y: auto;
  overflow-x: hidden;      /* 가로 스크롤 제거 — 세로만 */
  padding-right: 14px;
}
/* 긴 토큰(URL 등)이 가로폭을 넘겨 가로 스크롤 생기는 것 방지 */
.terms-scroll p,
.terms-scroll li,
.terms-scroll h4 {
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* 약관은 단일 컬럼 — 세로 스크롤만.
   (다단 column-count 는 높이 제한 시 컬럼을 가로로 늘려 가로 스크롤을 유발하므로 사용 안 함) */
.terms-scroll::-webkit-scrollbar { width: 8px; }
.terms-scroll::-webkit-scrollbar-thumb {
  background: #2a3550; border-radius: 8px;
}
.terms-intro {
  font-size: 14px;
  font-weight: 700;
  color: #9fd1ff;
  margin: 0 0 14px;
}
.terms-scroll h4 {
  font-size: 14px;
  font-weight: 700;
  color: #9fd1ff;   /* 제1조~제12조 제목 — 모바일 약관과 동일한 옅은 하늘색 */
  margin: 16px 0 6px;
}
.terms-scroll p {
  font-size: 12.5px;
  line-height: 1.6;
  color: #aeb6c4;
  margin: 0 0 8px;
}
.terms-scroll ul {
  margin: 0 0 8px;
  padding-left: 18px;
}
.terms-scroll li {
  font-size: 12.5px;
  line-height: 1.6;
  color: #aeb6c4;
  margin-bottom: 6px;
}
.terms-meta {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #2a3550;
  color: #8b949e !important;
  font-size: 12px !important;
}

/* ===== 상단 중앙 대형 제목 ===== */
.login-hero {
  width: fit-content;
  max-width: 92vw;
  text-align: center;
  /* 글자 가독성용 검정 배경 — 밝은 상단바 위라 불투명도를 높여 또렷하게.
     테두리는 box-shadow 블러로 부드럽게 번지게(경계선 흐림). */
  padding: 14px 40px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 40px 40px rgba(0, 0, 0, 0.8);
}
.hero-title {
  font-size: 52px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
}
.hero-title span {
  font-size: 30px;
  font-weight: 700;
  color: #9fd1ff;
}
.hero-sub {
  font-size: 22px;
  font-weight: 600;
  color: #9fd1ff;
  margin: 0;
}
@media (max-width: 640px) {
  .hero-title { font-size: 36px; }
  .hero-title span { font-size: 20px; }
  .hero-sub { font-size: 16px; }
}
/* 히어로 문구 내 '52개 대학' 클릭 링크 */
.univ-link {
  color: #00E676;                 /* 안정 지원 녹색(.dot.green 과 동일) */
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.univ-link:hover { color: #00E676; filter: brightness(1.15); }
/* 52개 대학 목록 모달 — 다열 그리드 */
.univ-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: uni;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 18px;
}
.univ-list li {
  counter-increment: uni;
  color: #cfd3d7;
  font-size: 15px;
  line-height: 1.6;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 2px 0;
}
.univ-list li::before {
  content: counter(uni) ". ";
  color: #6b8fb5;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 900px) { .univ-list { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .univ-list { grid-template-columns: repeat(2, 1fr); } }

/* ===== 좌측: 로그인 카드 + 홍보 (나란히, 화면 좁으면 세로) ===== */
.login-left {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 28px;
  margin: auto 0;            /* 제목 아래 남은 공간의 세로 중앙에 배치 */
}
.login-left .login-card {
  width: 380px;
  max-width: 92vw;
  margin: 0;
}
.promo-block {
  width: 340px;
  max-width: 92vw;
  /* 글자 가독성용 검정 배경 — 테두리는 box-shadow 블러로 부드럽게 번지게(경계선 흐림) */
  padding: 22px 26px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 32px 32px rgba(0, 0, 0, 0.55);
}
.promo-block .promo-desc { margin-top: 4px; }

/* ===== 약관 모달(전면) ===== */
.terms-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  padding: 24px;
}
.terms-modal-card {
  position: relative;
  width: min(1080px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #0d1117;
  border: 1px solid #2a3550;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  overflow: hidden;          /* 카드 레벨 가로 넘침 방지 */
}
.terms-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: #8b949e;
  border: 1px solid #2a3550;
  font-size: 15px;
  cursor: pointer;
  z-index: 1;
}
.terms-close:hover { color: #ffffff; border-color: #8b949e; }
.terms-modal .terms-scroll { max-height: 74vh; }

/* 제목 오른쪽 최종 동의 체크 — 컴팩트 인라인 배지 */
.terms-agree {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(31, 111, 235, 0.14);
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #e6edf3;
  cursor: pointer;
  white-space: nowrap;
}
.terms-agree input {
  width: 17px;
  height: 17px;
  accent-color: #00e676;
  flex: 0 0 auto;
}
.login-card {
  text-align: center;
  padding: 40px 36px;
  max-width: 420px;
  width: 90%;
  background: rgba(13, 17, 23, 0.55);
  border: 1px solid #2a3550;
  border-radius: 16px;
  backdrop-filter: blur(4px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.login-card .brand {
  font-size: 40px; margin: 0 0 6px; font-weight: 800; color: #fff; letter-spacing: 1px;
}
.login-card .tagline { color: var(--muted); font-size: 14px; margin: 0 0 28px; }

/* 소셜 로그인 버튼 (목업: 네이버 초록 / 카카오 노랑 / 구글 흰색) */
.sns-btn {
  display: block; width: 100%; padding: 14px 16px; margin: 0 0 12px;
  border: 0; border-radius: 8px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: transform .08s ease, filter .15s ease;
}
.sns-btn:hover { transform: translateY(-1px); filter: brightness(0.97); }
.sns-btn.naver  { background: #03C75A; color: #ffffff; }
.sns-btn.kakao  { background: #FEE500; color: #191600; }
.sns-btn.google { background: #ffffff; color: #1f2328; border: 1px solid #dadce0; }
.sns-btn.apple  { background: #000000; color: #ffffff; }

.agree {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 14px 0 0; font-size: 13px; color: #cfd6e4;
}
.agree input { accent-color: #03C75A; }
.login-error { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }
.admin-login {
  display: block; text-align: right; margin-top: 10px;
  font-size: 12px; color: #555; text-decoration: none;
}
.admin-login:hover { color: var(--muted); }

/* 앱 레이어 상단바 추가 요소 */
.useremail { font-size: 12px; color: var(--muted); }
.logout-btn {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 12px;
}
.logout-btn:hover { color: var(--text); border-color: var(--muted); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel);
  flex-wrap: wrap; gap: 10px;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar .sub { color: var(--muted); font-weight: 400; font-size: 14px; }
.controls { display: flex; align-items: center; gap: 10px; }
.controls label { font-size: 12px; color: var(--muted); }
.controls input {
  background: #0d1117; border: 1px solid var(--line); color: var(--text);
  padding: 5px 8px; border-radius: 6px; width: 180px;
}
#runBtn {
  background: var(--accent); color: #fff; border: 0; padding: 8px 14px;
  border-radius: 6px; cursor: pointer; font-weight: 600;
}
#runBtn:hover { background: #388bfd; }
#runBtn:disabled { opacity: .5; cursor: default; }
.status { font-size: 12px; color: var(--muted); min-width: 80px; }
.status.ok { color: #3fb950; }
.status.err { color: var(--red); }

/* app-container 는 enterApp 에서 display:flex 로 표시된다. 세로 스택(입력바 위 · main 아래). */
#app-container { flex-direction: column; }
main { display: flex; gap: 14px; padding: 14px; align-items: stretch; }
.left { flex: 1 1 auto; min-width: 0; }
/* 지원/관심 패널(426px). 세로 flex + main 높이에 맞춰 늘어남 → 헤더 클릭으로 두 영역 비율 전환. */
.right {
  flex: 0 0 426px;
  display: flex;
  flex-direction: column;
  min-height: 0;   /* align-items:stretch 로 차트(=main) 높이만큼 늘어나 하단 빈 공간 없음 */
  gap: 10px;
}
.sec {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  flex: 1 1 0;   /* 기본 동등 */
}
.sec .panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-bottom: 0; }
.sec-head { cursor: pointer; user-select: none; }
.sec-head:hover { color: var(--text); }
/* 클릭한 영역 크게, 다른 영역 간략하게 */
.right.expand-support .sec-support { flex: 3 1 0; }
.right.expand-support .sec-interest { flex: 1 1 0; }
.right.expand-interest .sec-support { flex: 1 1 0; }
.right.expand-interest .sec-interest { flex: 3 1 0; }

.chart {
  /* 상단 입력바+범례를 제외한 세로를 꽉 채움 → 하단 빈 공간 제거(원본처럼) */
  width: 100%; height: calc(100vh - 214px); min-height: 460px;
  background: #000; border: 1px solid var(--line); border-radius: 8px;
}

.payload { margin-top: 10px; }
.payload summary { cursor: pointer; color: var(--muted); font-size: 13px; }
#payload {
  width: 100%; height: 220px; margin-top: 8px; background: #0d1117;
  color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  font-family: Consolas, monospace; font-size: 12px; padding: 10px;
}

.right h2 { font-size: 14px; margin: 4px 0 8px; color: var(--muted); }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; margin-bottom: 16px; font-size: 13px; line-height: 1.6;
}
.panel .sel { border-bottom: 1px solid var(--line); padding: 8px 0; }
.panel .sel:last-child { border-bottom: 0; }
.panel .sel .name { font-weight: 600; }
.panel .kv { color: var(--muted); }
.panel .big { font-size: 20px; font-weight: 700; }

.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.dot.blue { background: #2979FF; }
.dot.green { background: #00E676; }
.dot.yellow { background: #FFEA00; }
.dot.orange { background: #FF8A80; }
.dot.red { background: #FF1744; }
.line { display:inline-block; width:16px; height:0; border-top:1px dashed #fff; vertical-align:middle; }
.legend { flex-wrap: wrap; }

@media (max-width: 880px) {
  main { flex-direction: column; }
  .right { flex: 1 1 auto; height: auto; align-self: auto; }
  .sec { flex: 0 0 auto; }          /* 좁은 화면: 고정높이 대신 내용만큼 */
  .sec .panel { overflow: visible; }
  .chart, .gem-empty, #pane-scatter { height: 56vh; }   /* 좁은 화면에서도 모든 패널 동일 높이 */
}

/* ===================== 상단 입력바 ===================== */
.inputbar {
  display: flex; align-items: stretch; gap: 14px; flex-wrap: nowrap;
  padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

/* 좌: 햄버거 + ID(이메일) + 문과/이과 */
.ib-id { display: flex; flex-direction: column; justify-content: center; gap: 6px; flex: 0 0 auto; }
.id-top { display: flex; align-items: center; gap: 8px; }
.hamburger { background: transparent; color: #E0E0E0; border: none; font-size: 24px; cursor: pointer; line-height: 1; padding: 0 2px; }
/* 좌상단 전체화면 버튼(옛 'ID' 자리) — 클릭 시 F11 전체화면 토글.
   넷플릭스 스타일: 배경 없이 흰색 '네 모서리' 전체화면 아이콘, 햄버거(☰)와 같은 높이. */
.fs-btn {
  background: transparent; color: #ffffff; border: none; padding: 0 2px;
  height: 24px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.fs-btn:hover { opacity: 0.8; }
.fs-btn .fs-ico { width: 20px; height: 20px; display: block; }
/* 좌상단 등록 이메일(프로필 색과 동일). ID 컬럼 폭에 '맞춰' 넣고 칸을 넓히지 않는다:
   width:0 + min-width:100% → 컬럼 폭은 형제(≡ID/문과·이과)가 결정, 배지는 그 폭을 채우며 최대 3줄(자르지 않음). */
.id-email {
  width: 0; min-width: 100%; box-sizing: border-box;
  font-size: 10px; line-height: 1.2; color: #9FD1FF;
  word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
body.light .id-email { color: #1f6feb; }
.trk-wrap { display: flex; flex-direction: column; gap: 2px; }
.trk { font-size: 15px; color: var(--muted); }
.trk input { accent-color: #2979FF; }

/* 햄버거 드롭다운 메뉴 */
.ham-menu {
  position: absolute; top: 50px; left: 12px; z-index: 600;
  background: #1E1E1E; border: 1px solid #333; border-radius: 6px; padding: 4px; min-width: 150px;
  box-shadow: 0 6px 20px rgba(0,0,0,.55);
}
.ham-item { display: block; width: 100%; text-align: left; background: transparent; color: #E0E0E0;
  border: 0; padding: 10px 12px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.ham-item:hover { background: #2C2C2C; }
.ham-danger { color: #FF6B6B; }
.ham-danger:hover { background: #3a1f1f; }

/* 프로필 클릭 시 조용히 인라인 표시되는 이메일 */
.profile-email { font-size: 12px; color: #9FD1FF; padding: 0 12px 8px; word-break: break-all; }

/* 밝은 화면 토글 — 메뉴 항목 안의 작은 스위치 */
.ham-toggle { display: flex; align-items: center; justify-content: space-between; }
.switch { position: relative; display: inline-block; width: 38px; height: 20px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #555; border-radius: 20px; transition: .2s; }
.switch .slider:before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: #007ACC; }
.switch input:checked + .slider:before { transform: translateX(18px); }

/* 점수 그리드 (시작부에 흐릿한 세로 구분선) */
.score-grid { display: flex; gap: 5px; flex: 0 0 auto; border-left: 1px solid #333; padding-left: 12px; margin-left: 2px; }
.subj { display: flex; flex-direction: column; gap: 3px; width: 86.4px; text-align: center; }
.subj.labels { width: 62px; text-align: right; }
.subj .sname { font-size: 15px; font-weight: 700; color: var(--text); height: 20px; line-height: 20px; white-space: nowrap; }
.subj .rlbl { font-size: 12px; font-weight: 600; color: #c9d1d9; height: 26px; line-height: 26px; }
/* 밝은 화면: 행 라벨(표준점수/백분위/등급)을 50% 어둡게 → 밝은 배경에서 가독성 향상 (#c9d1d9 ×0.5) */
body.light .subj .rlbl { color: #64686c; }
/* 읽기 전용 표시칸(백분위 / '-') — 박스 없이 텍스트만(입력칸과 구분) */
.subj .cell {
  height: 26px; line-height: 24px; color: var(--muted); font-size: 12px;
  background: transparent; border: 1px solid transparent; border-radius: 4px;
}
.subj .cell.pct { color: #9fd1ff; }
/* 실제 입력/선택칸만 밝은 배경(사용자가 직접 입력·선택하는 곳) */
.subj .std, .subj .grade, .subj .elec {
  width: 100%; height: 26px; background: #262d3a; color: var(--text);
  border: 1px solid var(--line); border-radius: 4px; text-align: center; font-size: 12px;
}
.subj .elec { background: #0d1117; font-size: 12px; padding: 0 1px; }

/* 제미나이 + 나의 백분위 */
.ib-gemini { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; flex: 0 0 auto; }
.gemini-btn {
  background: #007ACC; color: #fff; border: 0; border-radius: 5px;
  width: 99px; height: 78px; padding: 0 6px;
  font-weight: 700; font-size: 15px; cursor: pointer; line-height: 1.3; text-align: center;
}
.gemini-btn:hover { filter: brightness(1.12); }
.my-pct { font-size: 12px; color: #CCCCCC; white-space: nowrap; position: relative; top: 7px; }   /* 우측 %P(-1.488%P 등) 줄과 세로 정렬 */
.my-pct b { color: #FFD700; }
/* 백분위 값 표시 상태 — 크기·굵기를 지원영역 %P(.pp: 16px bold)와 동일하게 (색은 유지) */
.my-pct.has-val { font-size: 16px; font-weight: bold; }

/* 적정/보험/배짱(라디오, 빨강) + 대학·학과 */
/* 지원 영역: 알림창이 내준 남는 공간을 흡수해 넓어짐(드롭다운 3열 균등) */
.ib-select { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-width: 300px; justify-content: center; }
.ib-select .sel-head, .ib-select .sel-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
/* 나의 백분위 %P — 각 칸 아래 중앙, 색은 JS가 부호에 따라(파랑/빨강) */
.pp-row { min-height: 18px; }
.pp { text-align: center; font-size: 16px; font-weight: bold; line-height: 1; }
.bet { display: flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.bet span { font-size: 16px; font-weight: bold; color: #888; }
/* 적정=녹색 / 보험=청색 / 배짱=빨강 — 동그란 버튼(accent)과 글자색 모두 같은 색 */
.bet input[value="target"]    { accent-color: #00E676; }
.bet input[value="insurance"] { accent-color: #2979FF; }
.bet input[value="reach"]     { accent-color: #FF1744; }
.bet input[value="target"]:checked    + span { color: #00E676; }
.bet input[value="insurance"]:checked + span { color: #2979FF; }
.bet input[value="reach"]:checked     + span { color: #FF1744; }
.univ-sel, .dept-sel {
  background: #262d3a; color: var(--text); border: 1px solid var(--line);
  border-radius: 5px; padding: 5px 6px; font-size: 13px; width: 100%;
}

/* Ttakboot 모의지원 + 초기화 + 회원등급 */
.ib-run { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; flex: 0 0 auto; }
#runBtn {
  background: #007ACC; color: #fff; border: 0; border-radius: 5px; padding: 11px 14px;
  font-weight: 700; font-size: 15px; cursor: pointer; line-height: 1.3; text-align: center;
}
#runBtn:hover { filter: brightness(1.12); }
#runBtn:disabled { opacity: .5; cursor: default; }
#resetBtn {
  background: #007ACC; color: #fff; border: 0;
  padding: 6px 14px; border-radius: 5px; cursor: pointer; font-size: 13px;
}
#resetBtn:hover { filter: brightness(1.12); }
.member-tier { font-size: 13px; font-weight: bold; color: #CCCCCC; }
.member-tier.paid { color: #00E676; }

/* 알림창: 아래 지원/관심 패널(.right)과 같은 폭으로 고정(426px) — 세로로 정렬 */
.ib-notify {
  flex: 0 0 426px; background: #1A1A1A; border: 1px solid #333;
  border-radius: 5px; padding: 10px 12px; font-size: 13px; color: #9fd1ff; overflow: auto;
}
.ib-notify .prompt-link { color: #448AFF; text-decoration: none; font-weight: 600; font-size: 15px; }
.ib-notify .prompt-link:hover { text-decoration: underline; }
/* 엑셀 D열 긴급뉴스 */
.ib-notify .prompt-news { margin-top: 6px; color: #ffd54a; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
/* 잘못된 점수 입력 경고(원본 데스크톱 lbl_prompter 빨강 안내 동일) */
.ib-notify.notify-error { color: #FF5252; font-size: 15px; font-weight: 700; }
body.light .ib-notify.notify-error { color: #d32f2f; }

/* ===================== 지원 / 관심 패널 ===================== */
.sup-item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.sup-item:last-child { border-bottom: 0; }
.sup-head { font-weight: 700; margin-bottom: 4px; }
.sup-uni { font-size: 15px; font-weight: 700; }
.sup-dept { color: var(--text); margin-bottom: 6px; font-size: 13px; }
.sup-meta { color: var(--muted); font-size: 12px; line-height: 1.5; }
.sup-meta b { color: #ffd54a; }
.sup-gap { height: 8px; }   /* 예상↔2025 블록 사이 여백(원본 빈 줄) */
.cr-delta { font-size: 11px; }   /* 예상 경쟁률 증감 표기 */
.cr-range { font-size: 11px; color: #9AA0A6; }   /* 10회 최고/최저 경쟁률 */
.ok { color: #3fb950; }
.ng { color: #ff5252; }
.int-item { border-bottom: 1px solid var(--line); font-size: 13px; }
.int-item:last-child { border-bottom: 0; }
.int-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; cursor: pointer;
}
.int-head:hover { color: var(--text); }
.int-right { display: inline-flex; align-items: center; white-space: nowrap; }
.int-name em { color: var(--muted); font-style: normal; }
.int-x { color: var(--muted); text-decoration: none; margin-left: 8px; }
.int-x:hover { color: #ff5252; }
/* 관심 항목 상세(클릭 시 펼침) — 지원 패널과 동일 포맷 */
.int-detail { padding: 4px 0 10px; border-top: 1px solid var(--line); }
.int-detail[hidden] { display: none; }
.hint { color: var(--muted); font-size: 12px; }
.right h2 small { color: var(--muted); font-size: 11px; font-weight: 400; }

/* ===================== 좌측 세로 탭 ===================== */
.tabbar { display: flex; flex-direction: column; gap: 3px; flex: 0 0 30px; }
.tab {
  flex: 1; border: 0; cursor: pointer; font-weight: 700; font-size: 13px;
  color: #cfd3d7; background: #2a2f3a; border-radius: 0 8px 8px 0;
  writing-mode: vertical-rl; text-orientation: upright; letter-spacing: 1px;
  padding: 12px 2px; min-height: 110px;
}
.tab.t-all  { background: #2C2C2C; }
.tab.t-rank { background: #D32F2F; color: #fff; }   /* 등수관찰 빨강 */
.tab.t-add  { background: #388E3C; color: #fff; }   /* 추합관찰 초록 */
.tab.t-gem  { background: #448AFF; color: #fff; }   /* 제미나이 파랑 */
/* 선택 탭: 순수 검정 배경 + 흰 글자(가는 흰 줄 제거) → 선택 탭 글자가 또렷 */
.tab.active { box-shadow: none; }
.tab.active.t-all,
.tab.active.t-rank,
.tab.active.t-add,
.tab.active.t-gem { background: #000; color: #fff; }

/* 좁은 화면(<880px): 세로 북마크 탭 → 컴팩트 가로 탭바.
   ※ 기본 .tabbar/.tab 규칙 '뒤'에 두어 소스 순서상 우선하도록 함(거대 블록 방지) */
@media (max-width: 880px) {
  .tabbar { flex-direction: row; flex: 0 0 auto; gap: 2px; }
  .tab {
    flex: 1 1 0; min-height: 0; padding: 10px 6px;
    writing-mode: horizontal-tb; text-orientation: mixed; letter-spacing: 0;
    border-radius: 8px 8px 0 0; font-size: 12px;
  }
  .tab.active { box-shadow: none; }
}

/* ===================== 랜딩 하단 푸터 (정책 링크 + 회사정보) ===================== */
/* #login-container(fixed·inset:0) 안에서 margin-top:auto 로 하단에 붙임 → 페이지 크기 영향 없음 */
.landing-footer {
  width: 100%; max-width: 1120px; margin-top: auto;
  display: flex; align-items: flex-end; justify-content: center;   /* 가운데로 모아 두 부분을 가깝게 */
  gap: 28px; flex-wrap: wrap;
  padding: 8px 6px 2px; font-size: 11px; line-height: 1.55; color: #7a828c;
}
.lf-links { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.lf-links a { color: #9aa3ad; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.lf-links a:hover { color: #cfd3d7; }
.lf-sep { color: #4a5058; }
.lf-company { flex: 0 1 auto; text-align: left; color: #6b727b; }   /* grow 제거 → 링크 옆에 붙음 */

/* ===================== 앱 유도 바텀시트 (모바일 웹) ===================== */
.app-promo {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
  background: #161b22; border-top: 1px solid #30363d;
  border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.55);
  animation: appPromoUp 0.28s ease;
}
@keyframes appPromoUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.app-promo-x {
  position: absolute; top: 10px; right: 12px; width: 30px; height: 30px;
  border-radius: 50%; background: transparent; color: #8b949e;
  border: 1px solid #30363d; font-size: 14px; cursor: pointer;
}
.app-promo-head { display: flex; align-items: center; gap: 12px; padding-right: 36px; }
.app-promo-icon { width: 46px; height: 46px; border-radius: 11px; flex: 0 0 auto; }
.app-promo-text { display: flex; flex-direction: column; }
.app-promo-text b { color: #e6edf3; font-size: 15px; }
.app-promo-text span { color: #8b949e; font-size: 12.5px; margin-top: 2px; }
.app-promo-badges { display: flex; gap: 10px; margin-top: 14px; }
.store-badge {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 12px; background: #000; border: 1px solid #3a3a3a;
  border-radius: 10px; color: #fff; cursor: pointer;
}
.store-badge svg { width: 22px; height: 22px; flex: 0 0 auto; }
.store-badge span { display: flex; flex-direction: column; line-height: 1.12; font-weight: 700; font-size: 15px; }
.store-badge small { font-size: 9px; font-weight: 500; opacity: 0.82; letter-spacing: 0.2px; }

.pane { width: 100%; }
.gem-empty {
  display: flex; align-items: center; justify-content: center;
  /* .chart 와 '동일 높이'로 → 제미나이 탭 선택 시 좌측 탭 크기가 변하지 않음 */
  height: calc(100vh - 214px); min-height: 460px; color: var(--muted);
  background: #000; border: 1px solid var(--line); border-radius: 8px; font-size: 15px;
}
/* 전체 판세 패널: 다른 패널과 '동일 높이'로 고정(차트가 flex 로 채우고 범례는 하단).
   → 범례가 높이를 더하지 않아 모든 탭에서 좌측 탭 크기가 일정하다. */
#pane-scatter {
  display: flex; flex-direction: column;
  height: calc(100vh - 214px); min-height: 460px;
}
#pane-scatter #chart { flex: 1 1 auto; height: auto; min-height: 0; }

/* [데스크톱 전용] 입력바 아래 남는 세로를 flex 로 '끝까지' 채운다 → 하단 빈 공간 제거.
   기존 calc(100vh-214px) 매직넘버가 화면마다 어긋나 생기던 빈 공간을 근본 제거.
   모바일(≤880px)은 아래 @media(max-width:880px)의 56vh 모델을 그대로 유지(불간섭). */
@media (min-width: 881px) {
  #app-container { height: 100vh; }
  main { flex: 1 1 auto; min-height: 0; }
  .left { display: flex; flex-direction: column; min-height: 0; }
  .left > .pane { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  /* ID 특이도(#pane-*)로 박힌 calc 높이를 auto 로 덮어 flex 가 높이를 결정하게 함 */
  #pane-scatter, #pane-rank, #pane-addpass, #pane-gemini { height: auto; min-height: 0; }
  .left > .pane > .chart,
  .left > .pane > .gem-empty { flex: 1 1 auto; height: auto; min-height: 0; }
}
