html {
  min-height: 100%;
  background: var(--ink);   /* 스크롤로 늘어난 영역까지 채우는 바탕색 */
}
body {
  min-height: 100%;
  background:
    radial-gradient(1400px 700px at 50% -10%, var(--page-glow) 0%, transparent 60%),
    var(--ink);
  background-attachment: fixed;   /* 스크롤해도 그라데이션 고정 */
  color: var(--text);
  font-family: var(--font);
  display: grid;
  place-items: start center;
  padding: 13vh 24px 48px;
}

.page {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 히어로: 큰 검색바 (새 탭의 주인공) */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
}

.board {
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  border-radius: 20px;
  padding: 24px 26px 18px;
}

.board-brand { display: inline-flex; align-items: center; gap: 10px; }
.board-title { font: 600 13px/1 var(--font); color: var(--text-sub); }
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.refresh {
  border: 0;
  background: none;
  color: var(--text-sub);
  font: 500 13px/1 var(--font);
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.refresh:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.is-loading .badge-dot { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

.notice { margin-bottom: 12px; }
.notice[hidden] { display: none; }

/* 순위 목록: 2열 배치로 가로 공간을 채운다 (좌 1~5위 / 우 6~10위) */
.rank-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(5, auto);
  grid-auto-flow: column;
  column-gap: 28px;
  row-gap: 2px;
}
.rank-row { padding: 11px 10px; }
.rank-num, .rank-kw { font-size: 15px; }
.rank-empty {
  grid-column: 1 / -1;
  padding: 32px 10px;
  text-align: center;
  color: var(--text-sub);
  font-size: 14px;
}

.board-foot {
  display: flex; align-items: center; justify-content: flex-start;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ink-line);
}
.src-note { font: 500 12px/1.4 var(--font); color: var(--text-dim); cursor: default; }
.src-note .stamp { color: var(--text-sub); font-weight: 600; }

/* 광고 자리 — 목록과 분리 */
.ad-slot {
  position: relative;
  min-height: 100px;
  border: 1px dashed var(--ink-line);
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 13px;
}
.ad-tag {
  position: absolute; top: 10px; left: 12px;
  font: 600 10px/1 var(--font); color: var(--text-dim); letter-spacing: 0.02em;
}

/* 좁은 화면(작은 창)에서는 1열로 되돌린다 */
@media (max-width: 560px) {
  .rank-list { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; column-gap: 0; }
  .page { max-width: 460px; }
}

@media (prefers-reduced-motion: reduce) {
  .is-loading .badge-dot { animation: none; }
}

/* 사이드 패널 유도 배너 (항상 고정, 한 줄) */
.sp-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  border-radius: 16px; padding: 14px 16px 14px 20px;
}
.sp-text { font: 500 14px/1.4 var(--font); color: var(--text); }
.sp-open {
  flex-shrink: 0;
  border: 0; border-radius: 9px; padding: 10px 18px;
  background: var(--btn-bg); color: var(--btn-fg);
  font: 600 13px/1 var(--font); cursor: pointer;
  transition: opacity .15s;
}
.sp-open:hover { opacity: 0.88; }

@media (max-width: 560px) {
  .sp-card { flex-direction: column; align-items: stretch; gap: 12px; text-align: center; }
  .sp-open { align-self: stretch; }
}

/* ── 검색바 (둥근 알약 + 포털 드롭다운 + 검색) ── */
.searchbar {
  display: flex; align-items: center;
  width: 100%;
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  border-radius: 30px;
  height: 60px;
  padding: 0 10px 0 6px;
  position: relative;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}




.search-input {
  flex: 1; min-width: 0;
  border: 0; background: none; color: var(--text);
  font: 400 16px/1 var(--font);
  padding: 0 22px; outline: none;
}
.search-input::placeholder { color: var(--text-dim); }

.search-go {
  flex-shrink: 0;
  border: 0; border-radius: 24px;
  background: var(--seg-on-bg); color: var(--seg-on-fg);
  font: 600 15px/1 var(--font);
  padding: 13px 22px; cursor: pointer;
  transition: opacity .12s;
}
.search-go:hover { opacity: 0.85; }

@media (max-width: 560px) {
  .searchbar { height: 54px; }
  .search-go { padding: 10px 14px; }
}

/* ── 사이트 바로가기 ── */
.shortcuts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.sc-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px 12px;
  border: 0; background: none; cursor: pointer;
  border-radius: 14px;
  text-decoration: none;
  transition: background .12s;
}
.sc-item:hover { background: var(--row-hover); }
.sc-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--ink);
  overflow: hidden;
  box-shadow: 0 1px 0 var(--ink-line);
}
.sc-icon img { width: 24px; height: 24px; display: block; }
.sc-icon .fallback {
  width: 100%; height: 100%; display: grid; place-items: center;
  font: 700 18px/1 var(--font); color: #fff;
}
.sc-label {
  font: 500 12px/1.2 var(--font); color: var(--text-sub);
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 삭제 버튼 (호버 시) */
.sc-remove {
  position: absolute; top: 4px; right: 4px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,0.5); color: #fff;
  font: 700 11px/1 var(--font); cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; transition: opacity .12s;
}
.sc-item:hover .sc-remove { opacity: 1; }
.sc-remove:hover { background: var(--breaking); }

/* 추가(+) 타일 */
.sc-add .sc-icon {
  background: none;
  border: 1.5px dashed var(--ink-line);
  color: var(--text-dim);
  font: 300 24px/1 var(--font);
  box-shadow: none;
}
.sc-add:hover .sc-icon { border-color: var(--text-dim); color: var(--text-sub); }

/* 추가 다이얼로그 */
.sc-dialog {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.5);
}
.sc-dialog[hidden] { display: none; }
.sc-dialog-box {
  width: 340px; max-width: calc(100vw - 40px);
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  border-radius: 16px; padding: 22px;
}
.sc-dialog-box h3 { font: 700 16px/1 var(--font); color: var(--text); margin-bottom: 16px; }
.sc-field { margin-bottom: 12px; }
.sc-field label { display: block; font: 500 12px/1 var(--font); color: var(--text-sub); margin-bottom: 6px; }
.sc-field input {
  width: 100%; height: 42px; border-radius: 10px;
  border: 1px solid var(--ink-line); background: var(--ink);
  color: var(--text); font: 400 14px/1 var(--font); padding: 0 12px; outline: none;
}
.sc-field input:focus { border-color: var(--text-dim); }
.sc-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.sc-btn {
  border: 0; border-radius: 9px; padding: 10px 16px;
  font: 600 13px/1 var(--font); cursor: pointer;
}
.sc-btn.cancel { background: var(--row-hover); color: var(--text-sub); }
.sc-btn.save { background: var(--seg-on-bg); color: var(--seg-on-fg); }

@media (max-width: 560px) {
  .shortcuts { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .sc-icon { width: 40px; height: 40px; }
}

/* ── 뉴스속보 타임라인 ── */
.news {
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  border-radius: 20px;
  padding: 22px 26px 10px;
}
.news[hidden] { display: none; }
.news-head { margin-bottom: 6px; }
.news-title { display: inline-flex; align-items: center; gap: 8px; font: 700 15px/1 var(--font); color: var(--text); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--breaking); box-shadow: 0 0 0 4px rgba(232, 65, 44, 0.15); }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-item { position: relative; }
.news-item::before {               /* 타임라인 세로선 */
  content: ""; position: absolute; left: 3px; top: 0; bottom: 0;
  width: 1px; background: var(--ink-line);
}
.news-item:first-child::before { top: 20px; }
.news-item:last-child::before { bottom: calc(100% - 20px); }
.news-link {
  position: relative;
  display: grid; grid-template-columns: 70px 1fr; gap: 12px;
  padding: 12px 0 12px 0;
  color: var(--text); text-decoration: none;
  border-bottom: 1px solid var(--ink-line);
}
.news-item:last-child .news-link { border-bottom: 0; }
.news-link::before {               /* 타임라인 점 */
  content: ""; position: absolute; left: 0; top: 17px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-dim);
}
.news-item:first-child .news-link::before { background: var(--breaking); }
.news-time { padding: 2px 0 0 18px; font: 500 12px/1.4 var(--font); color: var(--text-sub); white-space: nowrap; }
.news-item:first-child .news-time { color: var(--breaking); font-weight: 700; }
.news-body { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.news-text { flex: 1; min-width: 0; }
.news-headline {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font: 600 15px/1.45 var(--font); color: var(--text);
}
.news-link:hover .news-headline { text-decoration: underline; text-underline-offset: 3px; }
.news-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font: 500 12px/1 var(--font); color: var(--text-sub); }
.news-chip { padding: 3px 7px; border-radius: 6px; background: var(--row-hover); color: var(--text-sub); font: 500 11px/1 var(--font); }
.news-thumb {
  flex-shrink: 0; width: 120px; height: 68px; border-radius: 10px;
  object-fit: cover; background: var(--row-hover);
}
@media (max-width: 560px) { .news-thumb { width: 88px; height: 50px; } }
.news-more {
  display: block; width: 100%; margin: 4px 0 6px; padding: 11px 0;
  border: 0; border-top: 1px solid var(--ink-line); background: none;
  color: var(--text-sub); font: 600 13px/1 var(--font); cursor: pointer;
}
.news-more:hover { color: var(--text); }
.news-more[hidden] { display: none; }
.news-link { cursor: pointer; }
.news-link:focus-visible { outline: 2px solid var(--down); outline-offset: 2px; border-radius: 8px; }
.sc-item:focus-visible { outline: 2px solid var(--down); outline-offset: 2px; }
.sc-item:focus-within .sc-remove { opacity: 1; }
.news-headline { word-break: keep-all; overflow-wrap: anywhere; }   /* 한글은 단어 단위로 줄바꿈 */

/* ── 광고 칸: 첫 광고 칸 앞 구분선 + AD 표시 하나 ── */
.sc-ad-first::before,
.sc-add-sep::before {
  content: ""; position: absolute; left: -6px; top: 12px; bottom: 12px;
  width: 1px; background: var(--ink-line);
}
.sc-ad-label {
  position: absolute; top: 2px; left: 2px;
  padding: 2px 4px; border-radius: 4px;
  background: var(--ink); border: 1px solid var(--ink-line);
  font: 700 9px/1 var(--font); letter-spacing: 0.02em; color: var(--text-sub);
}
.ad-notice {
  margin: 4px 0 0; text-align: center;
  font: 400 11px/1.5 var(--font); color: var(--text-dim);
}
.ad-notice[hidden] { display: none; }
.sc-error { margin: -4px 0 10px; font: 500 12px/1.4 var(--font); color: var(--breaking); }
.sc-error[hidden] { display: none; }
.sc-ad .sc-icon .fallback { border-radius: inherit; }

/* 광고 로고: 정사각 로고를 앱 아이콘처럼 둥글게 */
.sc-ad .sc-icon img { border-radius: 7px; }

/* 키워드 알림 */
/* 새 탭 우측 상단 (페이지와 함께 스크롤) */
.alert-btn {
  position: absolute; top: 18px; right: 22px; z-index: 50;
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 19px;
  border: 1px solid var(--ink-line); background: var(--ink-raised); color: var(--text-sub);
  font: 500 13px/1 var(--font); cursor: pointer;
}
.alert-btn:hover { color: var(--text); }
.alert-btn.on { color: var(--text); }
.alert-box { width: 400px; }
.alert-box h3 { margin-bottom: 8px; }
.alert-desc { font: 400 13px/1.55 var(--font); color: var(--text-sub); margin-bottom: 14px; }
.alert-input-row { display: flex; gap: 8px; margin-bottom: 12px; }
.alert-input-row input {
  flex: 1; min-width: 0; height: 40px; border-radius: 10px;
  border: 1px solid var(--ink-line); background: var(--ink);
  color: var(--text); font: 400 14px/1 var(--font); padding: 0 12px; outline: none;
}
.alert-input-row input:focus { border-color: var(--text-dim); }
.alert-input-row .sc-btn { flex: none; }
.alert-perm { font: 500 12px/1.5 var(--font); color: var(--breaking); margin: -4px 0 10px; }
.alert-perm[hidden] { display: none; }
.alert-perm button {
  border: 0; background: none; padding: 0; margin-left: 4px; cursor: pointer;
  color: var(--text); font: 600 12px/1.5 var(--font); text-decoration: underline;
}
.alert-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px; }
.alert-chip {
  display: inline-flex; align-items: center; gap: 2px;
  height: 32px; padding: 0 4px 0 12px; border-radius: 16px;
  background: var(--row-hover); color: var(--text); font: 500 13px/1 var(--font);
}
.alert-chip button {
  width: 24px; height: 24px; border: 0; border-radius: 12px; background: none;
  color: var(--text-dim); font: 400 16px/1 var(--font); cursor: pointer;
}
.alert-chip button:hover { color: var(--text); background: var(--ink-line); }
.alert-empty { font: 400 13px/32px var(--font); color: var(--text-dim); }
.alert-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ink-line);
}
#alMeta { font: 400 12px/1.4 var(--font); color: var(--text-dim); }

/* 웹 버전 */
a.sp-open { text-decoration: none; display: inline-flex; align-items: center; }
