/* ============================================================
   theme.css — 2026-10 디자인 정리 (styles.css 뒤에 로드해서 덮어씀)
   원칙: 단색 카드 + 얇은 경계선, 그라데이션 최소화, 한 줄 유지(keep-all/nowrap),
         모바일은 7열 달력 유지·표는 가로 스크롤
   ============================================================ */
:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --ink: #1d2230;
  --muted: #6a7285;
  --line: #e4e7ef;
  --line-strong: #d3d8e4;
  --brand: #4f5bd5;
  --brand-ink: #3a45b8;
  --brand-soft: #eceefc;
  --ok: #2f9e6e;
  --ok-soft: #e4f5ec;
  --warn: #d98324;
  --warn-soft: #fdf0dd;
  --danger: #d1435b;
  --danger-soft: #fde8ec;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(29, 34, 48, 0.05), 0 4px 14px rgba(29, 34, 48, 0.04);
  --shadow: 0 2px 4px rgba(29, 34, 48, 0.05), 0 12px 32px rgba(29, 34, 48, 0.08);
}

html { -webkit-text-size-adjust: 100%; }

body,
.page-body,
.item-shop-page-body,
.task-list-page-body,
.settings-page-body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  word-break: keep-all;          /* 한글 단어 중간에서 줄바꿈 금지 */
  overflow-wrap: break-word;
}

.item-shop-page-body .page-shell,
.task-list-page-body .page-shell,
.settings-page-body .page-shell {
  background: transparent;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  padding: 20px 0 48px;
}

/* ---------- 상단: 제목 + 로그아웃 / 그 아래 메뉴 ---------- */
.page-topline {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.topline-actions {
  flex-wrap: nowrap;
  gap: 8px;
  margin-left: auto;
}

.topline-actions > * { flex: 0 0 auto; }

.page-nav {
  display: flex;
  gap: 4px;
  margin: 0 0 20px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: none;
  width: fit-content;
  max-width: 100%;
}
.page-nav::-webkit-scrollbar { display: none; }

.page-nav .ghost-button,
.page-nav .ghost-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: none;
  filter: none;
}
.page-nav .ghost-button:hover,
.page-nav .ghost-link:hover { background: var(--brand-soft); color: var(--brand-ink); }
.page-nav .is-current,
.page-nav .ghost-button.is-current {
  background: var(--brand);
  color: #fff;
  box-shadow: none;
  filter: none;
}
.page-nav-icon { font-size: 0.9em; }

.page-topline .page-nav-logout {
  height: auto;
  min-height: 0;
  line-height: 1.2;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}
.page-topline .page-nav-logout:hover { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ---------- 카드 ---------- */
.panel,
.calendar-card,
.parent-block,
.shop-card,
.quest-panel,
.timeline-card,
.avatar-stage,
.info-panel,
.role-card,
.gate-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}
.panel { padding: 20px; }
.panel-parent, .panel-child { background: transparent; border: 0; box-shadow: none; padding: 0; }
.calendar-card, .parent-block, .shop-card { padding: 20px; }
.parent-layout > .parent-block, .summary-row > .summary-card, .child-bottom > .shop-card,
.shop-admin-layout > .parent-block, .parent-layout > .parent-block:first-child { padding: 20px; }
.gate-card { box-shadow: var(--shadow); }

/* 이전 스타일의 칸막이 선/간격 제거 → 카드 간 간격으로 */
.summary-row, .parent-layout, .child-bottom, .today-task-column, .info-panels,
.gear-slots, .character-statbar, .shop-grid, .shop-admin-layout {
  gap: 16px;
  padding-inline: 0;
  border-top: 0;
}
.summary-row > *, .parent-layout > *, .child-bottom > *, .info-panels > *,
.gear-slots > *, .character-statbar > *, .shop-grid > *, .shop-admin-layout > * {
  border-left: 0;
  padding-left: revert;
}
/* 위 규칙이 카드의 왼쪽 선까지 지우므로 카드는 테두리를 다시 되돌린다 */
.parent-block, .shop-card, .calendar-card, .timeline-card, .info-panel, .quest-panel, .panel-card { border-left: 1px solid var(--line); }
.panel-parent, .panel-child { border-left: 0; }
/* 아이 화면 '오늘의 퀘스트' 마지막 항목(빈 안내 포함)의 아래 선 복원 */
.child-page-body .today-quest-card .quest-list .quest:last-child { border-bottom: 1px solid var(--line) !important; }
.parent-layout { margin-top: 16px; padding-top: 0; align-items: start; }
.summary-row { margin-top: 16px; padding-top: 0; }
.parent-notification-block { margin-top: 16px; }

.section-kicker {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.calendar-head h2, .panel-head h2 { font-size: 1.25rem; letter-spacing: -0.01em; margin: 0; }

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.block-head h3 { font-size: 1.05rem; margin: 0; white-space: nowrap; }
.block-head span { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

/* ---------- 요약 카드 (승인 대기 / 주간 달성률 / 예상 코인) ---------- */
.summary-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.summary-card,
.summary-card.warm,
.summary-card.mint,
.summary-card.gold {
  position: relative;
  padding: 18px 20px;
  background: var(--surface);          /* 그라데이션 제거 */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.summary-card span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.summary-card span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, var(--brand));
}
.summary-card.warm { --accent: var(--warn); }
.summary-card.mint { --accent: var(--ok); }
.summary-card.gold { --accent: var(--brand); }
.summary-card strong {
  display: block;
  margin: 10px 0 2px;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.summary-card small { color: var(--muted); font-size: 0.82rem; }

/* ---------- 버튼 ---------- */
button, .ghost-button, .primary-action, .reject, .view-button { white-space: nowrap; }

.ghost-button {
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ghost-button:hover { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.ghost-button:disabled { opacity: 0.5; cursor: not-allowed; }

.primary-action {
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
}
.primary-action:hover { background: var(--brand-ink); }

.reject {
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
  cursor: pointer;
}

.coin-badge {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: #8a5412;
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
}

.shop-pill {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.shop-pill-coupon { background: var(--warn-soft); color: #8a5412; }

/* 보기 전환 */
.view-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: var(--bg);
}
.view-button {
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.view-button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- 폼 ---------- */
input, select, textarea {
  font: inherit;
  max-width: 100%;
}
.task-form input[type="text"], .task-form input[type="number"], .task-form input[type="date"],
.task-form input[type="time"], .task-form input[type="month"], .task-form select,
input[type="month"], .login-card input, .gate-card input[type="text"], .gate-card input[type="password"] {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: transparent;
}
.task-form label { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.task-form label > input, .task-form label > select {
  margin-top: 6px; width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface);
}
.panel .parent-block, .panel .calendar-card { box-shadow: none; }

.form-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 12px;
}
.coupon-settings { border: 1px solid var(--line); border-radius: 12px; background: #fafbfe; }
.form-feedback { margin: 8px 0 0; font-size: 0.88rem; }

/* ---------- 목록 ---------- */
.approval-list, .quest-list, .inventory-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.approval-list li, .quest, .inventory-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.approval-list li:last-child { border-bottom: 1px solid var(--line); }
.inventory-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inventory-item strong { white-space: nowrap; }
.inventory-item p, .approval-list p { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }
.inventory-empty { padding: 18px; color: var(--muted); text-align: center; border: 1px dashed var(--line-strong); border-radius: 12px; }

.shop-admin-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: none; }
.shop-admin-card-clickable:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.shop-pill-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- 달력 ---------- */
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.calendar-nav-group { display: flex; gap: 6px; }
.calendar-nav-button { min-width: 56px; }
.calendar-monthbar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 10px; }
.calendar-monthbar strong { font-size: 1.1rem; white-space: nowrap; }
.calendar-monthbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.month-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: auto;
  gap: 6px;
}
.calendar-view[data-calendar-view="month"] { overflow-x: visible; padding-bottom: 0; }
.month-labels { overflow: visible; padding-bottom: 0; }
.month-labels { margin-bottom: 6px; }
.month-labels span { border: 0; padding: 4px 0; font-size: 0.8rem; }
.day-cell {
  min-height: 96px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  min-width: 0;
}
.month-grid .day-cell:nth-child(7n + 1), .month-grid .day-cell:nth-child(-n + 7) { border: 1px solid var(--line); }
.day-cell.today, .week-day.is-today { background: var(--brand-soft); border-color: var(--brand); }
.day-cell.muted { opacity: 0.4; }
.calendar-item-stack { display: grid; gap: 3px; margin-top: 6px; }
.calendar-item-badge, .schedule-chip {
  display: block;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.calendar-item-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

.calendar-view { overflow-x: auto; }
.week-timeline {
  grid-template-columns: 64px repeat(7, minmax(110px, 1fr));
  min-width: 860px;
  gap: 0;
}
.timeline-corner, .timeline-dayhead, .time-label, .time-slot { border-color: var(--line); }
.timeline-dayhead.is-today, .time-slot.is-today { background: var(--brand-soft); }
.today-focus { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }

.holiday-label { white-space: nowrap; }

/* ---------- 반응형 ---------- */
@media (max-width: 980px) {
  .parent-layout, .shop-admin-layout, .child-bottom { grid-template-columns: 1fr; }
  .summary-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .page-shell { width: calc(100% - 20px); padding: 12px 0 36px; }
  .page-title { font-size: 1.25rem; }
  .page-topline { display: flex; grid-template-columns: none; }
  .topline-actions { display: flex; grid-template-columns: none; }
  .page-nav { width: 100%; border-radius: 14px; }
  .page-nav .ghost-button, .page-nav .ghost-link { padding: 8px 12px; flex: 1 0 auto; justify-content: center; }

  .panel, .calendar-card, .parent-block, .shop-card,
  .parent-layout > .parent-block, .child-bottom > .shop-card, .shop-admin-layout > .parent-block { padding: 14px; border-radius: 12px; }

  .calendar-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; }
  .calendar-toolbar { flex-wrap: nowrap; }
  .calendar-month-picker input { width: 140px; }
  .calendar-monthbar span { display: none; }

  /* 달력은 모바일에서도 7열 유지, 일정은 점으로 표시 */
  .month-grid, .month-grid.month-labels { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .day-cell { min-height: 58px; padding: 4px 3px; border-radius: 8px; }
  .day-number { font-size: 0.8rem; }
  .holiday-label { display: none; }
  .calendar-item-stack { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
  .calendar-item-badge {
    width: 8px; height: 8px; padding: 0; border-radius: 50%;
    border-left-width: 8px !important; background: transparent !important;
  }
  .month-grid:not(.month-labels) { grid-auto-rows: minmax(58px, 1fr); }
  .panel-parent, .panel-child { padding: 0 !important; }
  .page-nav .ghost-button, .page-nav .ghost-link { padding: 8px 10px; gap: 4px; font-size: 0.86rem; }
  .calendar-item-badge .calendar-item-text { display: none; }

  .week-timeline { min-width: 760px; }

  /* 요약 카드는 한 줄에 3개 (숫자만 크게) */
  .summary-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .summary-card, .summary-card.warm, .summary-card.mint, .summary-card.gold { padding: 12px 10px; }
  .summary-card span { font-size: 0.74rem; gap: 5px; }
  .summary-card strong { font-size: 1.35rem; }
  .summary-card small { display: none; }

  .form-split { grid-template-columns: 1fr 1fr; gap: 10px; }
  .approval-list li, .quest { grid-template-columns: 1fr; }
  .block-head { flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .form-split { grid-template-columns: 1fr; }
}

/* ---------- 아이 화면 보정 ---------- */
.today-layout > *, .character-grid > *, .today-task-column > * { border-left: 0; padding-left: 0; }
.today-layout, .character-grid { gap: 16px; }
.child-page-body .page-topline { flex-wrap: wrap; row-gap: 6px; }
.child-push-status, .push-status-text { margin: 0; color: var(--muted); font-size: 0.8rem; white-space: normal; }
.child-bottom { align-items: start; }
.avatar-stage { overflow: hidden; }
@media (max-width: 640px) {
  .child-page-body .topline-actions { flex-wrap: wrap; justify-content: flex-end; }
  .child-push-status { order: 5; flex: 1 0 100%; text-align: right; font-size: 0.74rem; }
  .today-layout, .character-grid { grid-template-columns: 1fr; }
}

.approve, .quest button { background: var(--brand); color: #fff; border-radius: 10px; padding: 9px 16px; font-weight: 800; cursor: pointer; }
.approve:hover, .quest button:hover { background: var(--brand-ink); }
.approve { background: var(--ok); }
.quest, .quest.active { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.quest.active { border-color: var(--brand); background: #f8f9ff; }
.quest.done { background: #f6faf8; }
.quest:last-child { border-bottom: 1px solid var(--line); }
.status-pill { background: var(--ok-soft); color: var(--ok); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.today-task-column, .calendar-card, .child-page-body .calendar-card { border-left-width: 1px; }
.today-task-column { border-left: 0 !important; }

@media (max-width: 640px) {
  .day-cell .holiday-label { display: none; }
  .calendar-item-stack { align-items: flex-start; align-content: flex-start; }
  .calendar-item-badge { flex: 0 0 8px; min-height: 0; max-height: 8px; align-self: flex-start; }
}
@media (max-width: 430px) {
  .page-nav-icon { display: none; }
  .page-nav .ghost-button, .page-nav .ghost-link { font-size: 0.84rem; padding: 8px 9px; }
}

/* ---------- 페이지 좌우 여백: 메인과 동일하게 ---------- */
.item-shop-page-body .page-shell,
.task-list-page-body .page-shell,
.settings-page-body .page-shell {
  padding-inline: 0;
}

/* ---------- 일정 목록: 한 장씩 보는 카드 형식 ---------- */
.task-template-list-wrap { border: 0; background: transparent; overflow: visible; }
.task-template-list-head { display: none; }
.task-template-list-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.task-template-empty { grid-column: 1 / -1; padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 12px; }
.task-template-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.task-template-row > div { min-width: 0; white-space: normal; overflow: visible; }
.task-template-row > div[data-label]::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}
.task-template-check { position: absolute; top: 14px; right: 14px; }
.task-template-check input { width: 18px; height: 18px; }
.task-template-name-cell { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 10px; padding-right: 30px; }
.task-template-color { flex: 0 0 12px; width: 12px; height: 12px; margin-top: 14px; border-radius: 4px; }
.task-template-name-text { flex: 1; min-width: 0; display: grid; gap: 6px; }
.task-template-reward-cell, .task-template-save-cell { grid-column: 1 / -1; }
.task-template-static { color: var(--ink); font-weight: 600; }
.task-template-save-cell { display: flex; justify-content: flex-end; }
.task-template-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  font-weight: 600;
}
.task-template-input-sub { font-weight: 500; color: var(--muted); }
.task-template-input[readonly], .task-template-input:disabled { background: #f4f5f9; color: var(--muted); }
@media (max-width: 400px) {
  .task-template-list-body { grid-template-columns: 1fr; }
}

.task-template-row > div, .task-template-row > .task-template-name-cell { padding: 0 !important; border: 0 !important; min-height: 0 !important; }
.task-template-row { gap: 10px 12px; align-items: start; }
.task-template-name-text { margin-right: 30px; }
.task-template-color { margin-top: 12px; }
.task-template-save-cell .ghost-button { min-width: 84px; background: var(--brand); color: #fff; border-color: transparent; }
.task-template-save-cell .ghost-button:hover { background: var(--brand-ink); color: #fff; }
.task-template-row { gap: 14px 12px; }
.task-template-reward-cell { grid-column: auto; }

/* ---------- 일정 요약 카드 + 상세 팝업 ---------- */
.tt-card {
  position: relative;
  padding: 14px 14px 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tt-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--tt-color, var(--brand)); }
.tt-card:hover, .tt-card:focus-visible { border-color: var(--brand); box-shadow: var(--shadow); outline: none; }
.tt-card-check { position: absolute; top: 10px; right: 10px; display: inline-flex; }
.tt-card-check input { width: 18px; height: 18px; }
.tt-card-head { display: flex; align-items: center; gap: 8px; padding-right: 28px; min-width: 0; }
.tt-card-title { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tt-kind { flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: 0.72rem; font-weight: 800; white-space: nowrap; }
.tt-card-meta { margin: 6px 0 8px; color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-chip-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.tt-chip { padding: 2px 8px; border-radius: 6px; background: var(--bg); color: var(--ink); font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.tt-chip-reward { background: var(--warn-soft); color: #8a5412; }

.task-template-modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 22px; }
.task-template-modal .task-template-row { border: 0; box-shadow: none; padding: 8px 0 0; }
.task-template-modal .task-template-save-cell { gap: 8px; }
.task-template-modal .task-template-save-cell [data-close-task-template] { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
@media (max-width: 400px) {
  .task-template-list-body { grid-template-columns: 1fr; }
}

.parent-layout-single { grid-template-columns: 1fr; }
.task-setup-block { max-width: 900px; margin: 14px 0 22px; background: #fafbfe; box-shadow: none; }
.task-list-heading { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }

/* 일정 등록 / 등록된 일정 목록: 별개의 카드 */
.task-list-page-body .panel-parent > .calendar-card + .calendar-card { margin-top: 16px; }
.task-setup-block { max-width: none; margin: 12px 0 0; padding: 0; border: 0; background: transparent; }
.task-setup-block > .block-head { display: none; }
.task-list-card .summary-row { margin-top: 12px; }


/* ---------- 일정 등록 폼: 행 단위 배치 (좁아질수록 칸 수 감소, 입력창은 칸에 맞춰 축소) ---------- */
.task-setup-block .task-form { max-width: 1000px; }
.task-form-rows { display: grid; gap: 14px; }
.task-row { display: grid; gap: 12px 14px; min-width: 0; align-items: end; }
.task-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.task-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.task-row > label, .task-row > div { min-width: 0; margin: 0; }
.task-row > label > input, .task-row > label > select { width: 100%; }
.task-row .color-selector-shell { min-height: 42px; margin-top: 6px; }
.task-row .color-preview-wrap { display: grid; gap: 6px; }
.task-row .task-color-preview { height: 42px; border-radius: 10px; }
.task-row .color-preview-label { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.task-form-actions-end { display: flex; justify-content: flex-end; margin-top: 4px; }
.task-form-actions-end .primary-action { min-width: 140px; }
.task-form-rows > .weekday-picker { margin: 0; }
.task-form-rows > .form-feedback { margin: 0; }

.task-form-actions-end { display: flex; justify-content: flex-end; width: 100%; }
.task-form-actions-end .primary-action { width: auto; min-width: 140px; }
.task-form-rows > .form-feedback:empty { display: none; }
.task-row .color-preview-wrap { display: block; width: 100%; justify-self: stretch; }
.task-row .color-preview-wrap .color-preview-label { display: block; margin-bottom: 6px; }
.task-row .color-preview-wrap .task-color-preview { width: 100%; height: 42px; }
.task-form-rows { gap: 12px; }

@media (max-width: 760px) {
  .task-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .task-row-2, .task-row-3, .task-row-4 { grid-template-columns: 1fr; }
  .task-form-actions-end .primary-action { width: 100%; }
}
.task-setup-block .task-form { max-width: none; width: 100%; }

/* ---------- 반복 요일 선택: 반복 드롭다운 바로 아래, 토글 칩 ---------- */
.task-row-3:has(.task-repeat-cell) { align-items: start; }
.task-repeat-cell { display: grid; gap: 10px; min-width: 0; align-content: start; }
.task-repeat-cell .weekday-picker { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfe; }
.task-repeat-cell .weekday-picker[hidden] { display: none; }
.weekday-picker-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.weekday-chip-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.weekday-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.weekday-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.weekday-chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.weekday-chip:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 요일 칩: 폼 라벨 규칙보다 우선 적용해 글자를 정확히 가운데 정렬 */
.task-form .weekday-chip-row .weekday-chip,
.weekday-picker .weekday-chip-row .weekday-chip {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 36px;
  min-height: 36px;
  padding: 0;
  line-height: 1;
  text-align: center;
}
.weekday-picker .weekday-chip-row .weekday-chip input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; flex: none;
}

.item-card .item-thumb { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; }
.item-card button:disabled { opacity: .55; cursor: default; }

/* ---------- 스킬 카드 ---------- */
.skill-card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.skill-card { border: 1px solid var(--line); border-left: 4px solid var(--skill-color, var(--brand)); border-radius: 14px; background: var(--surface); padding: 14px; display: grid; gap: 8px; }
.skill-card p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.skill-card .skill-effect { color: var(--ink); font-weight: 700; }
.skill-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.skill-level { padding: 2px 10px; border-radius: 999px; background: var(--skill-color, var(--brand)); color: #fff; font-size: 0.8rem; font-weight: 800; white-space: nowrap; }
.skill-bar { height: 8px; border-radius: 999px; background: #eceef6; overflow: hidden; }
.skill-bar span { display: block; height: 100%; background: var(--skill-color, var(--brand)); }

.guild-level { display: grid; gap: 8px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.guild-level[hidden] { display: none; }
.guild-level-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.guild-level-head span { color: var(--muted); font-size: 0.82rem; }

.child-bottom .skill-card-wrap { grid-column: 1 / -1; }

/* ---------- 아이 메인: 마을 ---------- */
.town-view[hidden] { display: none; }
.town-stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.town-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: center; padding: 22px 24px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm, 0 1px 3px rgba(20,24,40,.06)); }
.town-hero h2 { margin: 4px 0 6px; font-size: clamp(1.25rem, 3.4vw, 1.7rem); }
.town-hero-sub { margin: 0; color: var(--muted); }
.town-hero-stats { display: grid; gap: 8px; }
.town-level { display: flex; align-items: center; gap: 10px; }
.town-level-badge { padding: 3px 12px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 800; font-size: 0.85rem; white-space: nowrap; }
.town-hero-stats small { color: var(--muted); }
.town-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.town-chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fafbfe; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
#characterModal { z-index: 50; }
.building-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.building-card { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 28px 18px 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.building-card:hover, .building-card:focus-visible { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 10px 24px rgba(60,70,140,.12); outline: none; }
.building-card strong { font-size: 1.25rem; }
.building-icon { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 24px; background: #eef0fb; font-size: 2.6rem; }
.building-icon img { width: 100%; height: 100%; object-fit: contain; }
.building-desc { color: var(--muted); font-size: 0.85rem; }
.building-badge { margin-top: 4px; padding: 4px 12px; border-radius: 999px; background: #eef0fb; color: var(--brand); font-size: 0.82rem; font-weight: 800; white-space: nowrap; }
.town-viewbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.town-viewbar div { display: grid; gap: 2px; }
.town-viewbar strong { font-size: 1.15rem; }
.town-viewbar span { color: var(--muted); font-size: 0.85rem; }
.town-back { padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.town-back:hover { border-color: var(--brand); color: var(--brand); }
@media (max-width: 860px) {
  .town-hero { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .building-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .building-card { grid-template-columns: 72px minmax(0, 1fr); grid-template-areas: "icon title" "icon desc" "icon badge"; justify-items: start; text-align: left; align-items: center; column-gap: 14px; padding: 16px; row-gap: 2px; }
  .building-icon { grid-area: icon; width: 64px; height: 64px; font-size: 2rem; border-radius: 18px; }
  .building-card strong { grid-area: title; }
  .building-desc { grid-area: desc; }
  .building-badge { grid-area: badge; justify-self: start; margin-top: 4px; }
}
.town-stack > .shop-card, .town-stack > .timeline-card, .town-stack > .calendar-card { padding: 20px; border-left: 0; }
.town-viewbar strong { display: none; }

/* ---------- 숙소 상태창: 왼쪽 캐릭터 / 오른쪽 상태 ---------- */
.inn-status { display: grid; grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr); gap: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.inn-character { display: grid; gap: 12px; align-content: start; }
.inn-stage { min-height: 280px; }
.inn-nameplate { display: flex; align-items: center; justify-content: center; gap: 10px; }
.inn-nameplate strong { font-size: 1.2rem; }
.inn-gear { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.inn-gear .gear-slot { padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: 12px; background: #fafbfe; display: grid; gap: 2px; }
.inn-gear .gear-slot span { color: var(--muted); font-size: 0.75rem; }
.inn-gear .gear-slot strong { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.inn-character .character-open-button { justify-self: center; }
.inn-panel { display: grid; gap: 14px; align-content: start; min-width: 0; }
.inn-block { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fbfbfe; display: grid; gap: 10px; min-width: 0; }
.inn-block .block-head { margin: 0; }
.inn-block .block-head h3 { font-size: 1rem; }
.skill-bar-lg { height: 12px; }
.inn-hint { color: var(--muted); }
.inn-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
.inn-stats div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.inn-stats dt { color: var(--muted); font-size: 0.88rem; }
.inn-stats dd { margin: 0; font-weight: 800; white-space: nowrap; }
.inn-panel .skill-card-list { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.today-layout-solo { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (max-width: 860px) {
  .inn-status { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .inn-stage { min-height: 220px; }
}

/* ---------- 캐릭터 레이어 / 장비 ---------- */
.char-stage { position: relative; aspect-ratio: 3 / 4; max-height: 420px; width: 100%; margin-inline: auto; border-radius: 18px; overflow: hidden; background: linear-gradient(#eef3ff, #f7f2e8); border: 1px solid var(--line); }
.char-stage .char-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.char-stage.has-base .char-fallback { display: none; }
.char-layers { position: absolute; inset: 0; }
.char-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; pointer-events: none; }
.char-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.char-pick label { display: grid; gap: 4px; font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.char-pick select { min-height: 38px; }
.inn-gear .gear-slot.is-filled { border-style: solid; border-color: var(--brand); background: #f1f3ff; cursor: pointer; }
.inn-gear .gear-slot.is-filled strong { color: var(--ink); font-weight: 800; }
.wardrobe { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.wardrobe-item { display: grid; gap: 4px; justify-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; text-align: center; }
.wardrobe-item img, .wardrobe-noimg { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: #eef0fb; }
.wardrobe-item strong { font-size: 0.85rem; }
.wardrobe-item small { color: var(--muted); }
.wardrobe-item.is-equipped { border-color: var(--brand); background: #f1f3ff; }
.inn-gear { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .inn-gear { grid-template-columns: repeat(2, minmax(0, 1fr)); } .char-stage { max-height: 360px; } }

/* ---------- 장비 칸을 캐릭터 화면 위에 반투명으로 배치 ---------- */
.inn-gear, .char-pick { display: none; }
.char-stage { max-height: 520px; aspect-ratio: 3 / 4; }
.char-layers { inset: 0; }
.char-layers .char-layer { left: 50%; top: 0; width: auto; height: 100%; aspect-ratio: 2 / 3; transform: translateX(-50%); object-fit: contain; }
.char-layers .char-layer-bg { left: 0; width: 100%; height: 100%; aspect-ratio: auto; transform: none; object-fit: cover; }
.slot-grid { position: absolute; inset: 0; display: grid; grid-template-columns: 24% 1fr 24%; grid-template-rows: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 8px; pointer-events: none; }
.slot-box { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; border: 1px solid rgba(255,255,255,.75); border-radius: 12px; background: rgba(255,255,255,.45); backdrop-filter: blur(2px); box-shadow: 0 1px 6px rgba(30,40,80,.12); text-align: center; overflow: hidden; pointer-events: auto; }
.slot-label { padding: 2px; color: #5b6280; font-size: 0.72rem; font-weight: 700; line-height: 1.2; word-break: keep-all; }
.slot-img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; }
.slot-box.is-filled { cursor: pointer; background: rgba(255,255,255,.7); border-color: var(--brand); }
.slot-box[data-slot="hat"] { grid-column: 2; grid-row: 1; justify-self: center; width: min(100%, 92px); }
.slot-box[data-slot="face"] { grid-column: 1; grid-row: 2; }
.slot-box[data-slot="hair"] { grid-column: 1; grid-row: 1; }
.slot-box[data-slot="accessory"] { grid-column: 3; grid-row: 1; }
.slot-box[data-slot="weapon"] { grid-column: 1; grid-row: 3 / span 2; }
.slot-box[data-slot="ring"] { grid-column: 1; grid-row: 5; }
.slot-box[data-slot="top"] { grid-column: 3; grid-row: 2; }
.slot-box[data-slot="cape"] { grid-column: 3; grid-row: 3; }
.slot-box[data-slot="bottom"] { grid-column: 3; grid-row: 4; }
.slot-box[data-slot="shoes"] { grid-column: 3; grid-row: 5; }
.equip-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-hint { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; }
.settings-character-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-character-pick[hidden] { display: none; }
@media (max-width: 860px) { .equip-fields { grid-template-columns: minmax(0, 1fr); } .char-stage { max-height: 480px; } }

/* 모자 상자가 머리를 가리지 않도록 캐릭터를 아래로 내리고, 상자 블러 제거 */
.slot-box { backdrop-filter: none; }
.char-layers .char-layer:not(.char-layer-bg) { top: 15%; height: 85%; }
.slot-box[data-slot="hat"] { align-self: start; height: 84%; }

.equip-modal { width: min(560px, calc(100vw - 32px)); max-height: 86vh; overflow: auto; display: grid; gap: 12px; align-content: start; }
.equip-modal h2 { margin: 0; }
.equip-modal-current { margin: 0; color: var(--muted); }
.equip-clear[hidden] { display: none; }
.slot-box { cursor: pointer; }
.wardrobe > .inventory-empty, .wardrobe > .primary-action { grid-column: 1 / -1; }

.wardrobe-cell { display: grid; gap: 6px; }
.wardrobe-item.is-locked { opacity: 0.5; cursor: not-allowed; }
.wardrobe-sell { padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font: inherit; font-size: 0.78rem; cursor: pointer; }
.reward-got { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.reward-got img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: #eef0fb; }
.reward-title { margin: 12px 0 8px; font-weight: 700; }

.bulk-form { display: grid; gap: 10px; margin: 10px 0; }
.bulk-actions { display: flex; gap: 8px; }
.bulk-results { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; font-size: 0.85rem; }
.bulk-results li.is-warn { color: #b3261e; }

/* 슬롯 이미지 크기 보정: 반지는 작게, 칼은 세로 두 칸을 채우게 크게 */
.slot-box[data-slot="ring"] .slot-img { inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); }
.slot-box[data-slot="weapon"] .slot-img { transform: scale(1.35); }

/* 상점 목록 페이지 넘김 */
.shop-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 0.9rem; }
.shop-pager[hidden] { display: none; }
.shop-pager button[disabled] { opacity: 0.4; cursor: not-allowed; }
/* 아이템 상세 팝업: 삭제 버튼은 왼쪽 아래, 빨간색 */
.shop-detail-actions { align-items: center; }
.shop-delete-button { margin-right: auto; width: auto; min-width: 0; min-height: 40px; padding: 0 16px; flex: 0 0 auto; white-space: nowrap; border: 1px solid #d93025; border-radius: 14px; background: #d93025; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.shop-delete-button:hover { background: #b3261e; }

/* 배경 변경: 캐릭터 발 밑 중앙의 작은 버튼 */
.bg-change-btn { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 5; padding: 5px 12px; border: 1px solid rgba(255,255,255,.85); border-radius: 999px; background: rgba(30,40,80,.55); color: #fff; font-size: 0.78rem; font-weight: 700; cursor: pointer; backdrop-filter: blur(2px); }
.bg-change-btn:hover { background: rgba(30,40,80,.75); }


/* ---------- 아이템 상점(아이 화면): 카테고리 탭 + 카드 + 구매 팝업 ---------- */
.shop-tabs { position: relative; margin-top: 4px; }
/* 탭 줄이 아래 상자의 윗선 1px 위로 겹쳐서, 선택된 탭이 상자와 끊김 없이 이어진다 */
.shop-cats { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; padding: 0; margin: 0 0 -1px; position: relative; z-index: 1; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.shop-cats::-webkit-scrollbar { display: none; }
.shop-cat { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 88px; min-height: 42px; padding: 0 22px; margin: 0; border: 1px solid var(--line); border-radius: 12px 12px 0 0; background: #eceff8; color: var(--muted); font-weight: 700; font-size: .95rem; cursor: pointer; white-space: nowrap; }
.shop-cat:focus { outline: none; }
.shop-cat:focus-visible { outline: 2px solid var(--brand); outline-offset: -4px; }
.shop-cat small { color: var(--muted); font-weight: 700; font-size: .78rem; }
.shop-cat:hover { background: #f4f6fc; color: var(--text, #1f2433); }
.shop-cat.is-active { background: #f7f8fd; color: var(--brand); border-bottom-color: #f7f8fd; min-height: 46px; margin-top: 0; }
.shop-cat.is-active small { color: var(--brand); }
.shop-tabpanel { position: relative; z-index: 0; background: #f7f8fd; border: 1px solid var(--line); border-radius: 0 14px 14px 14px; padding: 16px; min-height: 160px; }
.shop-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shop-item-card { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; font: inherit; color: inherit; }
.shop-item-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow); }
.shop-item-thumb { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; background: #f4f6fc; overflow: hidden; }
.shop-item-thumb img { width: 100%; height: 100%; object-fit: contain; }
.shop-item-name { font-size: .95rem; line-height: 1.3; word-break: keep-all; }
.shop-item-info { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .82rem; }
.shop-lv { padding: 2px 8px; border-radius: 999px; background: #eef1ff; color: var(--brand); font-weight: 800; }
.shop-price { font-weight: 800; color: #b26a00; }
.shop-owned-badge { position: absolute; top: 8px; right: 8px; z-index: 1; padding: 2px 8px; border-radius: 999px; background: #1f9d6b; color: #fff; font-size: .74rem; font-weight: 800; }

.shop-item-modal { width: min(440px, calc(100vw - 32px)); text-align: left; }
.shop-item-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.shop-item-pic { flex: 0 0 96px; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 14px; background: #f4f6fc; overflow: hidden; }
.shop-item-pic img { width: 100%; height: 100%; object-fit: contain; }
.shop-item-head h2 { margin: 2px 0 4px; font-size: 1.25rem; }
.shop-item-meta { margin: 0; color: var(--muted); font-size: .88rem; }
.shop-item-desc { margin: 0 0 6px; line-height: 1.6; }
.shop-item-owned { margin: 0 0 12px; color: #1f9d6b; font-weight: 700; font-size: .9rem; }
.shop-buy-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.shop-price-line { display: grid; gap: 2px; }
.shop-price-line span { color: var(--muted); font-size: .82rem; }
.shop-price-line strong { font-size: 1.15rem; color: #b26a00; }
.qty-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.qty-stepper button { width: 40px; border: 0; background: #f4f6fc; font-size: 1.4rem; font-weight: 800; cursor: pointer; color: var(--brand); }
.qty-stepper button:disabled { color: #b8bdcc; cursor: not-allowed; }
.qty-stepper input { width: 56px; border: 0; text-align: center; font-size: 1.05rem; font-weight: 800; -moz-appearance: textfield; appearance: textfield; padding: 8px 0; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.shop-total-line { margin: 0 0 8px; text-align: right; }
.shop-total-line strong { font-size: 1.1rem; }
.shop-total-line small { color: var(--muted); }
.shop-buy-button { width: 100%; min-height: 46px; }
.shop-buy-button:disabled { background: #c5cadb; cursor: not-allowed; }
.shop-confirm-modal { width: min(360px, calc(100vw - 32px)); text-align: center; }
.shop-confirm-text { font-size: 1.05rem; line-height: 1.6; margin: 8px 0 18px; word-break: keep-all; }
.shop-confirm-actions { display: flex; gap: 10px; }
.shop-confirm-actions > * { flex: 1; min-height: 44px; }
#shopConfirmModal { z-index: 1100; }
.wardrobe-qty { position: absolute; top: 6px; right: 6px; padding: 1px 7px; border-radius: 999px; background: #1f9d6b; color: #fff; font-size: .74rem; font-weight: 800; }
.wardrobe-item { position: relative; }
@media (max-width: 640px) {
  .shop-tabpanel { padding: 12px; }
  .shop-cat { min-width: 80px; padding: 0 18px; }
  /* 탭이 더 있다는 표시: 오른쪽 끝을 살짝 흐리게 */
  .shop-tabs.has-more::after { content: ''; position: absolute; top: 0; right: 0; width: 28px; height: 46px; background: linear-gradient(to right, rgba(255,255,255,0), #fff 85%); pointer-events: none; z-index: 2; }
  .shop-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* 상점: 큰 탭 3~4개는 폭을 나눠 쓰고, 탭 안의 카테고리는 버튼으로 */
.shop-cats .shop-cat { flex: 1 1 0; min-width: 0; padding: 0 12px; }
.shop-subcats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.shop-subcats[hidden] { display: none; }
.shop-subcat { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text, #1f2433); font-weight: 700; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.shop-subcat small { color: var(--muted); font-weight: 700; font-size: .76rem; }
.shop-subcat:focus { outline: none; }
.shop-subcat:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.shop-subcat.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.shop-subcat.is-active small { color: rgba(255,255,255,.8); }

/* 쿠폰은 보기 전용: 가격·수량·구매 버튼 숨김 */
#shopItemModal.is-view-only .shop-buy-row,
#shopItemModal.is-view-only .shop-total-line,
#shopItemModal.is-view-only .shop-buy-button { display: none; }

/* ===== 길드 의뢰 게시판 (아이) ===== */
.guild-board { margin-top: 14px; padding: 10px; border-radius: 18px; background: #8a5a2e; background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 2px, transparent 2px 9px); box-shadow: inset 0 0 0 4px #6b4421, 0 2px 6px rgba(60, 35, 10, .25); }
.guild-board-sign { width: fit-content; margin: -2px auto 10px; padding: 4px 18px; border-radius: 8px; background: #5a3a1c; color: #ffe9bd; font-weight: 800; font-size: .9rem; letter-spacing: .08em; box-shadow: 0 2px 0 #3d2711; }
.guild-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px 12px; padding: 14px 8px 10px; border-radius: 12px; background: #c9a06a; background-image: radial-gradient(rgba(120,80,30,.18) 1px, transparent 1.4px); background-size: 7px 7px; min-height: 120px; box-shadow: inset 0 2px 8px rgba(70,40,10,.35); }
.guild-board-empty { grid-column: 1 / -1; align-self: center; text-align: center; padding: 22px 10px; color: #5a3a1c; font-weight: 700; }
.guild-card { position: relative; display: grid; gap: 7px; align-content: start; text-align: left; padding: 18px 12px 12px; border: 0; border-radius: 4px; background: #fffaf0; color: #2c2418; font: inherit; cursor: pointer; box-shadow: 0 3px 6px rgba(50, 30, 8, .35); transition: transform .15s ease, box-shadow .15s ease; }
.guild-card.tilt-0 { transform: rotate(-1.4deg); } .guild-card.tilt-1 { transform: rotate(1.1deg); } .guild-card.tilt-2 { transform: rotate(-.6deg); } .guild-card.tilt-3 { transform: rotate(1.6deg); }
.guild-card:hover, .guild-card:focus-visible { transform: rotate(0) translateY(-3px); box-shadow: 0 8px 14px rgba(50, 30, 8, .4); outline: 0; }
.guild-pin { position: absolute; top: -6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff9b8a, #c9302c 70%); box-shadow: 0 2px 3px rgba(0,0,0,.4); }
.guild-card-status { justify-self: start; padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 800; background: #e4f5ec; color: #1f7a52; }
.guild-card.is-mine .guild-card-status { background: #eceefc; color: #3a45b8; }
.guild-card.is-pending .guild-card-status { background: #fdf0dd; color: #a8620f; }
.guild-card.is-taken, .guild-card.is-expired { background: #ece6d8; color: #6f6656; }
.guild-card.is-taken .guild-card-status, .guild-card.is-expired .guild-card-status { background: #ddd5c3; color: #6f6656; }
.guild-card.is-urgent .guild-card-deadline { color: #c9302c; font-weight: 800; }
.guild-card-title { font-size: 1rem; line-height: 1.3; word-break: keep-all; }
.guild-card-desc { font-size: .8rem; color: #5b5240; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; }
.guild-card-rewards { display: flex; flex-wrap: wrap; gap: 4px; }
.guild-chip { padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; background: #f1ead9; color: #5b4a22; white-space: nowrap; }
.guild-chip.xp { background: #eceefc; color: #3a45b8; }
.guild-chip.coin { background: #fdf0dd; color: #a8620f; }
.guild-chip.item { background: #e4f5ec; color: #1f7a52; }
.guild-card-deadline { font-size: .76rem; color: #6b604a; border-top: 1px dashed #d8cdb0; padding-top: 6px; }
@media (max-width: 520px) { .guild-board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; padding: 14px 6px 10px; } .guild-card { padding: 16px 9px 10px; } .guild-card-title { font-size: .92rem; } }

.guild-request-modal { width: min(440px, calc(100vw - 32px)); text-align: left; display: grid; gap: 10px; }
.guild-request-modal h2 { margin: 0; }
.guild-modal-status { justify-self: start; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; font-size: .78rem; }
.guild-modal-desc { margin: 0; padding: 12px; border-radius: 10px; background: #fffaf0; border: 1px solid #eadfc4; white-space: pre-wrap; word-break: keep-all; line-height: 1.55; }
.guild-modal-deadline { margin: 0; font-weight: 700; }
.guild-modal-hint { margin: 0; color: var(--muted); font-size: .85rem; }
.guild-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.guild-modal-actions > * { flex: 1 1 140px; }

/* ===== 길드 의뢰 관리 (부모) ===== */
.guild-board-page-body textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; resize: vertical; }
.guild-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.guild-admin-list { display: grid; gap: 10px; }
.guild-admin-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.guild-admin-row.is-pending { border-color: var(--warn); background: var(--warn-soft); }
.guild-admin-main { flex: 1 1 260px; display: grid; gap: 6px; min-width: 0; }
.guild-admin-main p { margin: 0; color: var(--muted); font-size: .88rem; white-space: pre-wrap; }
.guild-admin-main small { color: var(--muted); }
.guild-admin-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.guild-state { padding: 1px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; background: var(--ok-soft); color: var(--ok); }
.guild-state.mine, .guild-state.taken { background: var(--brand-soft); color: var(--brand-ink); }
.guild-state.pending { background: var(--warn); color: #fff; }
.guild-state.done, .guild-state.expired { background: var(--line); color: var(--muted); }
.guild-admin-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.guild-admin-actions .danger { color: var(--danger); }
@media (max-width: 520px) { .guild-form-row { grid-template-columns: 1fr; } }

/* 폼 안 긴 글 입력칸(상세 설명 등)을 다른 입력칸처럼 */
.task-form label > textarea {
  display: block; margin-top: 6px; width: 100%; min-height: 84px; padding: 10px 12px; box-sizing: border-box;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface);
  color: var(--ink); font-weight: 600; line-height: 1.5; resize: vertical;
}
.task-form label > textarea::placeholder { color: #9aa1b3; font-weight: 500; }
