/* ==========================================================================
   /me 시청자 영역 (WSD) — site.css 토큰만 사용, 새 토큰 발명 금지
   모바일 우선(최소 360px), 가로 오버플로 금지, 한국어 클리핑 금지
   ========================================================================== */

.me-main {
  width: var(--content);
  min-width: 0;
  margin: 0 auto;
  padding: 26px 0 72px;
}

.me-head h1 {
  max-width: none;
  margin-bottom: 14px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.12;
}

/* 섹션 탭 -------------------------------------------------------------- */

.me-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.me-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px; /* 터치 타깃 44px+ */
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--secondary);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.me-tabs a:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.me-tabs a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--primary);
}

.me-tabs a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.me-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border: 1px solid var(--gw-border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

/* 카드 ------------------------------------------------------------------ */

.me-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-width: 0;
}

.me-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--gw-border);
  border-radius: var(--radius);
  background: var(--surface);
}

.me-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.me-card h2,
.me-panel h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.3;
}

.me-card-head a {
  color: var(--blue-2);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.me-card-head a:hover {
  text-decoration: underline;
}

/* 프로필 요약 ------------------------------------------------------------ */

.me-profile-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.me-avatar {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--secondary);
  font-size: 22px;
  font-weight: 950;
}

.me-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.me-profile-summary .who {
  min-width: 0;
  flex: 1;
}

.me-profile-summary strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
  /* 한국어 클리핑 금지 — 말줄임 대신 줄바꿈 */
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.me-profile-summary span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

/* 채널 행(홈 미니 목록·팔로잉) ------------------------------------------- */

.me-channel-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.me-channel-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.me-channel-list li:first-child {
  border-top: 0;
}

.me-channel-list .me-avatar {
  width: 42px;
  height: 42px;
  font-size: 16px;
}

.me-channel-list .info {
  min-width: 0;
  flex: 1;
}

.me-channel-list .info a {
  display: block;
  color: var(--primary);
  font-size: 14.5px;
  font-weight: 900;
  text-decoration: none;
  /* 한국어 클리핑 금지 — 말줄임 대신 줄바꿈 */
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.me-channel-list .info a:hover {
  text-decoration: underline;
}

.me-channel-list .info p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-channel-list .actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

/* 뱃지 ------------------------------------------------------------------ */

.me-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.me-live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
}

.me-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid var(--gw-border);
  border-radius: 999px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.me-badge.ok {
  border-color: var(--green);
  color: var(--green);
}

.me-badge.wait {
  border-color: var(--yellow);
  color: var(--yellow);
}

.me-badge.end {
  color: var(--muted);
}

.me-badge.danger {
  border-color: var(--danger);
  color: var(--danger);
}

/* 후원 내역 --------------------------------------------------------------- */

.me-donation-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.me-donation-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.me-donation-list li:first-child {
  border-top: 0;
}

.me-donation-list .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.me-donation-list .meta a {
  color: var(--secondary);
  font-weight: 850;
  text-decoration: none;
}

.me-donation-list .meta a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.me-donation-list .amount {
  justify-self: end;
  color: var(--primary);
  font-size: 15px;
  font-weight: 950;
  white-space: nowrap;
}

.me-donation-list .msg {
  grid-column: 1 / -1;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--secondary);
  font-size: 13.5px;
}

.me-donation-list .row-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.me-text-button {
  min-height: 44px; /* 터치 타깃 44px+ */
  padding: 2px 10px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.me-text-button:hover {
  color: var(--danger);
  text-decoration: underline;
}

.me-text-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* 필터 -------------------------------------------------------------------- */

.me-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.me-filters select {
  min-height: 44px; /* 터치 타깃 44px+ */
  padding: 8px 12px;
  border: 1px solid var(--gw-border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 700;
}

.me-filters select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* 패널(단독 섹션 컨테이너)·폼 ---------------------------------------------- */

.me-panel {
  min-width: 0;
  max-width: 640px;
  padding: 22px;
  border: 1px solid var(--gw-border);
  border-radius: var(--radius);
  background: var(--surface);
}

.me-panel.wide {
  max-width: none;
}

.me-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.me-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 850;
}

.me-form input[type="text"],
.me-form input[type="url"],
.me-form textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--gw-border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--primary);
  font-size: 14.5px;
  font-weight: 600;
}

.me-form textarea {
  min-height: 92px;
  resize: vertical;
}

.me-form input:focus-visible,
.me-form textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.me-form .hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.me-form .counter {
  align-self: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.me-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.me-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--blue);
}

.me-check div strong {
  display: block;
  color: var(--primary);
  font-size: 14px;
  font-weight: 850;
}

.me-check div span {
  color: var(--muted);
  font-size: 12.5px;
}

.me-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* [예약] 지갑 잠금 --------------------------------------------------------- */

.me-locked {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: var(--surface-2);
}

.me-locked.center {
  align-items: center;
  padding: 46px 22px;
  text-align: center;
}

.me-lock-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gw-border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--secondary);
}

.me-lock-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.me-locked p {
  margin: 0;
  color: var(--secondary);
  font-size: 14px;
}

.me-locked .sub {
  color: var(--muted);
  font-size: 12.5px;
}

/* 상태 3종: 스켈레톤 · 빈 상태 · 에러 --------------------------------------- */

.me-skeleton-block {
  border: 1px solid var(--gw-border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
}

.me-skeleton-block .sk-line {
  height: 14px;
  margin-top: 12px;
  border-radius: 6px;
}

.me-skeleton-block .sk-line:first-child {
  margin-top: 0;
  width: 35%;
}

.me-skeleton-block .sk-line.short {
  width: 55%;
}

.sk-shimmer {
  background: linear-gradient(100deg, var(--surface-2) 40%, var(--surface-3) 50%, var(--surface-2) 60%);
  background-size: 200% 100%;
  animation: me-shimmer 1.3s ease-in-out infinite;
}

@keyframes me-shimmer {
  from { background-position: 120% 0; }
  to { background-position: -80% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sk-shimmer { animation: none; }
}

.me-empty,
.me-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 18px;
  text-align: center;
}

.me-empty p,
.me-error p {
  margin: 0 0 8px;
  color: var(--secondary);
  font-size: 14px;
}

.me-error p {
  color: var(--danger);
}

.me-more {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* 푸터·토스트 ---------------------------------------------------------------- */

.me-footer {
  width: var(--content);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 auto;
  padding: 22px 0 40px;
  border-top: 1px solid var(--line);
}

.me-footer a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.me-footer a:hover {
  color: var(--primary);
}

.me-toast-root {
  position: fixed;
  bottom: 18px;
  left: 50%;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.me-toast {
  max-width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--gw-border);
  border-radius: var(--radius);
  background: var(--surface-3);
  box-shadow: var(--shadow);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

.me-toast.error {
  border-color: var(--danger);
}

/* 데스크톱 ------------------------------------------------------------------- */

@media (min-width: 860px) {
  .me-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
