/* ============================================================
   치지직 시간표 팝업
   - 다크 톤 + 치지직 네온 그린 단일 강조색
   - 아이콘은 popup.html 상단 SVG 스프라이트 사용 (.ic)
   ============================================================ */

:root {
  --bg: #0f1012;
  --surface: #17181b;
  --surface-2: #1f2024;
  --surface-3: #292a2f;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #ececef;
  --text-2: #a4a6ae;
  --text-3: #6f717a;
  --accent: #00ffa3;
  --accent-hover: #3dffb8;
  --accent-ink: #03140d;
  --accent-soft: rgba(0, 255, 163, 0.12);
  --danger: #ff6464;
  --danger-soft: rgba(255, 100, 100, 0.12);
  --live: #ff3b48;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  overflow-x: hidden;
}

body {
  width: 360px;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.4;
}

a {
  color: inherit;
  text-decoration: none;
}

input,
textarea {
  font: inherit;
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ic {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app {
  padding: 0 14px 12px;
}

/* ---------- 상단 바 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(var(--bg) 80%, rgba(15, 16, 18, 0));
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
}

.brand-mark .ic {
  width: 15px;
  height: 15px;
  stroke-width: 2.3;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.icon-btn-sm .ic {
  width: 16px;
  height: 16px;
}

/* ---------- 공통 ---------- */
.view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.section-tight {
  margin-top: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.section-head h2 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.section-hint,
.count {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}

.muted-box {
  padding: 14px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.6;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn .ic {
  width: 15px;
  height: 15px;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-ghost {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--line-2);
  background: var(--surface-3);
}

.btn-danger-ghost {
  background: transparent;
  border: 1px solid rgba(255, 100, 100, 0.35);
  color: var(--danger);
}

.btn-danger-ghost:hover:not(:disabled) {
  background: var(--danger-soft);
}

.input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
}

.input:focus {
  border-color: var(--accent);
}

.input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}

.input-row {
  display: flex;
  gap: 6px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.field-error {
  margin-top: -4px;
  font-size: 12px;
  color: var(--danger);
}

.hint {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.hint.error {
  color: var(--danger);
}

.avatar {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-3);
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar img:not([src]),
.avatar img[src=""] {
  visibility: hidden;
}

.avatar-lg {
  width: 44px;
  height: 44px;
}

.avatar.is-live::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--live);
  border: 2px solid var(--bg);
}

/* ---------- 채널 선택 화면 ---------- */
.picker-hero {
  padding: 6px 2px 2px;
}

.picker-hero h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.picker-hero p {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 12px;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.15s;
}

.search-row:focus-within {
  border-color: var(--accent);
}

.search-row input {
  flex: 1;
  min-width: 0;
  height: 34px;
  background: none;
  border: none;
  outline: none;
}

.search-ic {
  color: var(--text-3);
  width: 16px;
  height: 16px;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.channel-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.channel-tile:hover {
  background: var(--surface);
}

.channel-tile .avatar {
  width: 48px;
  height: 48px;
}

.channel-tile-name {
  max-width: 100%;
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-btn {
  position: absolute;
  top: 4px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--text-3);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.pin-btn .ic {
  width: 13px;
  height: 13px;
}

.channel-tile:hover .pin-btn,
.pin-btn:focus-visible,
.pin-btn.pinned {
  opacity: 1;
}

.pin-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.pin-btn.pinned {
  color: #ffc83d;
}

.pin-btn.pinned .ic {
  fill: currentColor;
}

.group-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.group-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 8px 8px 10px;
  text-align: left;
}

.avatar-stack {
  display: flex;
  flex: none;
}

.avatar-stack .avatar {
  width: 24px;
  height: 24px;
  border: 2px solid var(--surface);
  box-sizing: content-box;
}

.avatar-stack .avatar + .avatar {
  margin-left: -9px;
}

.group-card-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.group-card-title b {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-card-title span {
  font-size: 11px;
  color: var(--text-3);
}

.week-tag {
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.group-card.no-timetable .group-card-title b {
  color: var(--text-2);
  font-weight: 500;
}

.group-card.no-timetable .avatar-stack {
  opacity: 0.55;
}

.group-card .chev {
  color: var(--text-3);
  transition: transform 0.2s;
}

.group-card.open .chev {
  transform: rotate(180deg);
}

.group-card-body {
  padding: 2px 8px 10px;
}

.group-card-body .group-members {
  padding: 0 4px;
}

.group-card-foot {
  display: flex;
  justify-content: flex-end;
  padding: 4px 4px 0;
}

.more-btn {
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.more-btn:hover {
  color: var(--text);
  border-color: var(--text-3);
}

.filter-empty {
  padding: 4px 2px;
  font-size: 12px;
  color: var(--text-3);
}

.link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 2px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
  text-align: left;
  transition: border-color 0.15s;
}

.link-row:hover {
  border-color: var(--line-2);
}

.link-row > span {
  flex: 1;
}

.link-row b,
.link-inline b {
  color: var(--accent);
  font-weight: 600;
}

.link-row .chev {
  color: var(--text-3);
  width: 16px;
  height: 16px;
}

/* ---------- 채널 화면 ---------- */
.channel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 2px 0;
}

.channel-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.channel-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.channel-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-sub {
  font-size: 12px;
  color: var(--text-3);
}

.live-badge {
  flex: none;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--live);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.vod-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}

.vod-note > .ic {
  width: 13px;
  height: 13px;
  color: var(--text-3);
  fill: currentColor;
  stroke: none;
}

.vod-note > span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vod-note .chip-btn {
  flex: none;
  color: var(--accent);
  font-weight: 600;
  padding: 0 8px;
}

.week-bar {
  display: flex;
  align-items: center;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.week-label {
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.week-name {
  font-weight: 700;
}

.week-range {
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.week-bar.is-current .week-name {
  color: var(--accent);
}

/* 그룹 스트립 */
.group-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-strip-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.group-strip-label .ic {
  width: 14px;
  height: 14px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  color: var(--text-3);
  font-size: 11px;
  transition: background 0.15s, color 0.15s;
}

.chip-btn .ic {
  width: 14px;
  height: 14px;
}

.chip-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.group-members {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.group-members::-webkit-scrollbar {
  display: none;
}

.member {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 58px;
  padding: 4px 0;
  border-radius: var(--radius-sm);
}

.member {
  position: relative;
}

.member .avatar img,
.member .avatar::before {
  transition: opacity 0.2s, transform 0.45s ease;
}

/* 채널 화면 그룹 줄: 선택된 멤버만 선명하게. 사진과 링을 같이 흐리게 한다.
   (방송 중 빨간 점은 흐리지 않는다) */
#groupMembers .member:not(.active):not(:hover):not(:focus-visible) .avatar img {
  opacity: 0.5;
}

#groupMembers .member:not(.active):not(:hover):not(:focus-visible) .avatar.has-tt::before {
  opacity: 0.45;
}

/* 지금 보고 있는 채널: 이름 아래 짧은 밑줄 (링과 겹치지 않게 테두리 대신) */
.member.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 14px;
  height: 2px;
  margin-left: -7px;
  border-radius: 1px;
  background: var(--text);
}

.member-name {
  margin-top: 2px;
  max-width: 54px;
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member.active .member-name {
  color: var(--text);
  font-weight: 600;
}

/* ---------- 가로로 넘치는 줄: 페이드 + 화살표 ---------- */
.hscroll {
  position: relative;
  --hscroll-bg: var(--bg);
}

.group-card-body .hscroll {
  --hscroll-bg: var(--surface);
}

.hscroll::before,
.hscroll::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.hscroll::before {
  left: 0;
  background: linear-gradient(to right, var(--hscroll-bg) 20%, transparent);
}

.hscroll::after {
  right: 0;
  background: linear-gradient(to left, var(--hscroll-bg) 20%, transparent);
}

.hscroll.can-prev::before,
.hscroll.can-next::after {
  opacity: 1;
}

.hscroll-btn {
  position: absolute;
  top: 26px; /* 아바타 가운데 높이 */
  z-index: 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  color: var(--text);
  transform: translateY(-50%) scale(0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s, background 0.15s;
}

.hscroll-btn .ic {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.hscroll-btn.prev {
  left: -2px;
}

.hscroll-btn.next {
  right: -2px;
}

.hscroll.can-prev .hscroll-btn.prev,
.hscroll.can-next .hscroll-btn.next {
  opacity: 0.85;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.hscroll-btn:hover {
  opacity: 1 !important;
  background: var(--surface-2);
}

.link-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  padding: 2px;
  text-align: left;
}

.link-inline .ic {
  width: 14px;
  height: 14px;
}

.link-inline:hover {
  color: var(--text-2);
}

/* ---------- 그 주에 시간표가 있는 채널: 아바타 둘레 링 ----------
   글자 없이 '여기엔 뭔가 있다'는 느낌만. 정보가 오면 부드럽게 나타난다. */
.avatar::before,
.cs-avatar::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 210deg, #00ffa3, #3fe4ff 32%, #00ffa3 58%, #b4ff6a 82%, #00ffa3);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}

.avatar.has-tt::before,
.cs-avatar.has-tt::before {
  opacity: 1;
  transform: scale(1);
}

/* 로딩 스켈레톤 */
.skeleton-card {
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton {
  aspect-ratio: 16 / 9;
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* 시간표 카드 */
.timetable-card {
  overflow: hidden;
}

.timetable-image-btn {
  position: relative;
  display: block;
  width: 100%;
  background: #000;
}

.timetable-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.expand-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
}

.expand-hint .ic {
  width: 15px;
  height: 15px;
}

.timetable-image-btn:hover .expand-hint {
  opacity: 1;
}

.timetable-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.vote-btn .ic {
  width: 15px;
  height: 15px;
}

.vote-btn:hover {
  border-color: var(--line-2);
  color: var(--text);
}

.vote-btn.active-like {
  background: var(--accent-soft);
  border-color: rgba(0, 255, 163, 0.45);
  color: var(--accent);
}

.vote-btn.active-dislike {
  background: var(--danger-soft);
  border-color: rgba(255, 100, 100, 0.45);
  color: var(--danger);
}

.uploader {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uploader.mine {
  color: var(--accent);
}

/* 썸네일 */
.thumb-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.thumb {
  position: relative;
  flex: none;
  width: 92px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--surface);
  transition: border-color 0.15s;
}

/* 이미지가 깨져도 썸네일 칸 크기를 유지한다 */
.thumb.img-broken {
  aspect-ratio: 16 / 10;
}

/* 이미지가 깨지면 '크게 보기'를 숨기고 누를 수 없게 한다 */
.timetable-image-btn.img-broken {
  cursor: default;
  pointer-events: none;
}

.timetable-image-btn.img-broken .expand-hint {
  display: none;
}

.thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.thumb.active {
  border-color: var(--accent);
}

.thumb-score {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 10px;
  font-weight: 700;
}

/* 빈 상태 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 16px 8px;
  text-align: center;
}

.empty-ic {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-3);
}

.empty-title {
  font-weight: 600;
}

.empty-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
}

/* 등록 카드 */
.upload-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  text-align: left;
}

.upload-toggle-ic {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.upload-toggle-ic .ic {
  width: 15px;
  height: 15px;
  stroke-width: 2.3;
}

.upload-toggle-text {
  font-weight: 600;
}

.upload-week {
  flex: 1;
  font-size: 11px;
  color: var(--text-3);
}

.upload-toggle .chev {
  color: var(--text-3);
  transition: transform 0.2s;
}

.upload-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.upload-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 12px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
  font-size: 11px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.direct-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.drop-zone:hover,
.drop-zone:focus,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-ic {
  width: 22px;
  height: 22px;
  color: var(--text-3);
}

.drop-zone-text {
  font-weight: 600;
  font-size: 12px;
}

.drop-zone-sub {
  font-size: 11px;
  color: var(--text-3);
}

kbd {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  font: 600 11px/1.4 ui-monospace, Consolas, monospace;
}

.staged-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.staged-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
}

.staged-meta {
  flex: 1;
  min-width: 0;
}

.staged-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.staged-size {
  font-size: 11px;
  color: var(--text-3);
}

/* ---------- 푸터 ---------- */
.footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
}

.switch {
  position: relative;
  width: 34px;
  height: 20px;
}

.switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--surface-3);
  transition: background 0.2s;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.switch input:checked + .switch-track {
  background: var(--accent);
}

.switch input:checked + .switch-track::after {
  transform: translateX(14px);
  background: var(--accent-ink);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.footer-links a:hover {
  color: var(--text);
}

.made-by {
  text-align: center;
  font-size: 10.5px;
  color: #4b4d55;
}

/* ---------- 바텀 시트 ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  animation: fade-in 0.18s ease-out;
}

.sheet-panel {
  position: relative;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--line-2);
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow);
  animation: slide-up 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px 4px 16px;
}

.sheet-head h2 {
  font-size: 15px;
  font-weight: 700;
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 16px 16px;
  overflow-y: auto;
}

@keyframes slide-up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* 시트 안 공통 요소 */
.sheet-context {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-2);
}

.ctx-thumb {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
}

.ctx-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sheet-context b {
  color: var(--text);
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.option-list.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-list.grid-2 .option:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.option-list.grid-2 .option {
  align-items: flex-start;
  padding: 10px;
}

.option-list.grid-2 .option-dot {
  margin-top: 2px;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.option:hover {
  border-color: var(--line-2);
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-dot {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--text-3);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.option input:checked ~ .option-dot {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px var(--surface-2), inset 0 0 0 8px var(--accent);
}

.option:has(input:checked) {
  border-color: rgba(0, 255, 163, 0.45);
  background: var(--accent-soft);
}

.option-text {
  display: flex;
  flex-direction: column;
}

.option-text b {
  font-size: 13px;
  font-weight: 600;
}

.option-text span {
  font-size: 11px;
  color: var(--text-3);
}

textarea.input {
  height: auto;
  min-height: 64px;
  padding: 8px 12px;
  resize: vertical;
  line-height: 1.5;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 4px 0 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
}

.chip .avatar {
  width: 22px;
  height: 22px;
}

.chip-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-remove {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--text-3);
}

.chip-remove:hover {
  background: var(--surface-3);
  color: var(--text);
}

.chip-remove .ic {
  width: 12px;
  height: 12px;
}

.chip.is-new {
  border-color: rgba(0, 255, 163, 0.45);
}

.chip.is-removed {
  border-color: rgba(255, 100, 100, 0.45);
  background: var(--danger-soft);
}

.chip.is-removed .chip-name {
  text-decoration: line-through;
  color: var(--text-2);
}

.member-check-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.member-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 12px;
  min-width: 0;
}

.member-check .avatar {
  width: 26px;
  height: 26px;
}

.member-check span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.member-check:has(input:checked) {
  border-color: rgba(255, 100, 100, 0.5);
  background: var(--danger-soft);
}

.member-check:has(input:checked) span {
  text-decoration: line-through;
}

.field-optional {
  font-weight: 500;
  color: var(--text-3);
}

.sheet-alt {
  justify-content: center;
  margin-top: -2px;
}

.notice {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}

.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.sheet-actions .btn {
  flex: 1;
}

/* 내 계정 */
.account-id {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.account-id code {
  flex: 1;
  min-width: 0;
  font: 12px/1.4 ui-monospace, Consolas, monospace;
  word-break: break-all;
  color: var(--text);
}

.notes {
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ---------- 토스트 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 60;
  transform: translateX(-50%);
  max-width: 320px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  animation: slide-up 0.2s ease-out;
}

.toast.error {
  color: var(--danger);
}

/* ---------- 스크롤바 ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: #3a3b41 transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  background: #3a3b41;
  border-radius: 4px;
}
