:root {
  --bg: #06070c;
  --panel: #0b0d14;
  --line: #21242f;
  --text: #f5f7fb;
  --muted: #8f95a3;
  --yellow: #ffd400;
  --pink: #ff4b8d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

body.dragging-global {
  user-select: none;
  cursor: grabbing;
}

body.dragging-global * {
  cursor: grabbing;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.home-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.left-nav {
  border-right: 1px solid var(--line);
  padding: 22px 18px;
  background: linear-gradient(180deg, #090b11 0%, #05060a 100%);
  display: flex;
  flex-direction: column;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0;
  font-weight: 700;
}
/* 홈 브랜드 로고 = Pinworks 모노그램 + PINWORKS 워드마크 (모노그램은 앱 아이콘과 동일 디자인) */
.brand-mark {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: block;
}
.brand-row:has(.brand-mark) { gap: 8px; }
/* 한 줄 균형 배치 최대치: 모노그램 42px + PINWORKS caps 32px(워드마크 height 44px, caps비율 0.72).
   사이드바 320px−패딩36=284 = 모노42+간격8+워드마크234 → 딱 한 줄. :has로 홈에만 적용, pteam 무영향 */
.brand-row:has(.brand-mark) .brand-lockup {
  width: auto;
  height: 44px;
  max-width: calc(100% - 50px);
  filter: none;
}

.brand-lockup {
  width: min(230px, 100%);
  height: auto;
  display: block;
  max-width: 100%;
  filter: drop-shadow(0 8px 14px rgba(20, 184, 166, 0.24));
  cursor: pointer;
}

.welcome {
  margin-top: 28px;
}

.welcome h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
}

.welcome p {
  margin: 10px 0 0;
  color: #bcc1cd;
  font-size: 16px;
  font-weight: 500;
}

.search-wrap {
  margin-top: 20px;
}

.search-wrap input {
  width: 100%;
  border: 1px solid #262a35;
  border-radius: 14px;
  background: #131722;
  color: #edf0f7;
  caret-color: #f8fafc;
  font-size: 19px;
  padding: 12px 14px;
}

.menu-list {
  margin-top: 18px;
  display: grid;
}

.ally-sidebar-panel {
  margin-top: 14px;
  border: 1px solid #252b38;
  border-radius: 14px;
  background: rgba(11, 16, 27, 0.92);
  padding: 10px 10px 8px;
}

.ally-sidebar-panel.hidden {
  display: none;
}

.ally-sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.ally-sidebar-head:hover .ally-sidebar-arrow {
  color: #a5b4fc;
}

.ally-sidebar-head h3 {
  margin: 0;
  color: #e5e7eb;
  font-size: 18px; /* 왼쪽 사이드바 메뉴(.menu-item)와 동일하게 맞춤 */
  font-weight: 800;
  letter-spacing: 0.01em;
}

.ally-sidebar-count {
  margin: 0;
  color: #9fb2cf;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  flex: 1;
}

.ally-sidebar-arrow {
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.2s;
  display: inline-block;
}

.ally-sidebar-arrow.open {
  transform: rotate(90deg);
}

.ally-sidebar-body {
  overflow: hidden;
}

.ally-sidebar-body.collapsed {
  display: none;
}

.ally-sent-section {
  margin-top: 8px;
  border-top: 1px solid #1e2d44;
  padding-top: 8px;
}

.ally-sent-section.hidden {
  display: none;
}

.ally-sent-header {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ally-sent-list {
  display: grid;
  gap: 5px;
}

.ally-sent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0d1829;
  border: 1px solid #1e2d44;
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 0;
}

.ally-sent-item-name {
  color: #9fb2cf;
  font-size: 12px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ally-sent-cancel-btn {
  background: none;
  border: 1px solid #374151;
  border-radius: 6px;
  color: #64748b;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ally-sent-cancel-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.ally-sidebar-list {
  margin-top: 8px;
  max-height: 152px;
  overflow-y: hidden;
  display: grid;
  gap: 6px;
  padding-right: 3px;
}

.ally-sidebar-list:hover {
  overflow-y: auto;
}

.ally-sidebar-list::-webkit-scrollbar {
  width: 8px;
}

.ally-sidebar-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #5b6475;
}

.ally-sidebar-list::-webkit-scrollbar-track {
  background: transparent;
}

.ally-sidebar-item {
  border: 1px solid #253245;
  border-radius: 10px;
  background: #101b31;
  color: #dbe7ff;
  padding: 7px 8px 8px;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 8px;
}

.ally-sidebar-item:hover {
  border-color: #4b71a2;
  background: #13233f;
}

.ally-sidebar-item-text {
  min-width: 0;
}

.ally-sidebar-item-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ally-sidebar-item-sub {
  margin-top: 1px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ally-sidebar-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 104px;
}

.ally-sidebar-action-btn {
  border: 1px solid #365179;
  border-radius: 999px;
  background: #0e1a2f;
  color: #dbeafe;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
  cursor: pointer;
}

.ally-sidebar-action-btn:hover {
  border-color: #60a5fa;
  background: #162746;
}

.ally-sidebar-action-btn.block {
  border-color: #7f1d1d;
  color: #fecaca;
  background: #2a1217;
}

.ally-sidebar-action-btn.block:hover {
  border-color: #ef4444;
  color: #fff1f2;
}

.ally-sidebar-status {
  display: inline-flex;
  align-items: center;
  border: 1px solid #7c3aed;
  border-radius: 999px;
  background: #2e1065;
  color: #e9d5ff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 7px;
}

.ally-sidebar-empty {
  margin: 8px 0 2px;
  color: #76849a;
  font-size: 12px;
  font-weight: 600;
}

.storage-usage-panel {
  margin-top: auto;
  border: 1px solid #252b38;
  border-radius: 14px;
  background: rgba(17, 23, 34, 0.9);
  padding: 12px;
}

.storage-usage-panel h3 {
  margin: 0 0 8px;
  color: #e5e7eb;
  font-size: 18px; /* 왼쪽 사이드바 메뉴(.menu-item)와 동일하게 맞춤 */
  font-weight: 800;
}

.storage-usage-text {
  margin: 0 0 8px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 700;
}

.storage-usage-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid #334155;
}

.storage-usage-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #3b82f6);
  transition: width 0.2s ease;
}

.storage-usage-hint {
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
}

.menu-item {
  background: transparent;
  border: 0;
  text-align: left;
  width: 100%;
  padding: 12px 4px;
  border-bottom: 1px solid #1b1f29;
  color: #d6d9e1;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.menu-item:hover,
.menu-item.active:hover {
  color: var(--yellow);
}

.menu-item.active {
  color: #ffffff;
}

.main-area {
  padding: 20px 28px 36px;
}

.main-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.poster-hero {
  margin: 54px 0 26px; /* 좌측 그리팅("안녕하세요…") 라인에 맞춰 아래로 내림 */
  display: flex;
  justify-content: center;
}
/* pCLOUD 뷰(포스터 숨김)에서도 콘텐츠 헤드가 그리팅 라인에 맞도록 상단 여백 */
body.pcloud-view .content-head { margin-top: 54px; }

.poster-hero img {
  width: 100%;
  max-width: 1200px;
  height: auto;
  border-radius: 26px;
  border: 1px solid #1b2332;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.4);
  background: #0b0f1a;
}

body.home-logged-out .poster-hero {
  margin: 28px 0 18px;
}

body.home-logged-out .poster-hero img {
  max-width: 1600px;
  border: 1px solid #2a3350;
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(124, 58, 237, 0.25),
    0 0 120px rgba(56, 189, 248, 0.25);
  transform: scale(1.05);
  transform-origin: center top;
}

body.home-logged-out .content-head,
body.home-logged-out .my-pin-bar,
body.home-logged-out #boardGrid {
  display: none;
}

body.pcloud-view .poster-hero {
  display: none;
}

.top-spacer {
  flex: 1;
}

.main-top-right {
  align-items: center;
  display: flex;
  gap: 10px;
  position: relative;
}

.ally-search-wrap {
  position: relative;
}

.ally-search-wrap.hidden {
  display: none;
}

.ally-search-input {
  width: min(320px, 46vw);
  height: 40px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
  padding: 0 12px;
}

.ally-search-input::placeholder {
  color: #94a3b8;
  font-weight: 700;
}

.ally-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, 90vw);
  max-height: min(62vh, 420px);
  overflow: auto;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #0b1222;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.45);
  padding: 8px;
  z-index: 220;
}

.ally-search-dropdown.hidden {
  display: none;
}

.ally-search-list {
  display: grid;
  gap: 8px;
}

.ally-search-empty {
  color: #94a3b8;
  font-size: 12px;
  padding: 6px 4px 4px;
}

.ally-search-item {
  border: 1px solid #243246;
  border-radius: 10px;
  background: #101b31;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.ally-search-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ally-search-title {
  color: #dbe7ff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ally-search-sub {
  color: #9fb2cf;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ally-search-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ally-search-btn {
  border-radius: 8px;
  border: 1px solid #1d4ed8;
  background: #1d4ed8;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  cursor: pointer;
}

.ally-search-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.ally-visit-btn {
  border-radius: 8px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  cursor: pointer;
}

.ally-visit-btn:hover {
  background: #263347;
  color: #cbd5e1;
}

/* 방문 프로필 시트 */
.visit-profile-panel {
  width: min(520px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.visit-profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.visit-profile-header-info {
  min-width: 0;
}

.visit-profile-name {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visit-profile-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visit-profile-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.visit-profile-pin-list {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.visit-pin-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.visit-pin-item:hover {
  background: #f1f5f9;
}

.visit-pin-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visit-pin-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.visit-pin-empty {
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
}

.ally-bell-wrap {
  position: relative;
}

.ally-bell-wrap.hidden {
  display: none;
}

.ally-bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #475569;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  cursor: pointer;
  width: 40px;
  height: 40px;
}

.ally-bell-btn.hidden {
  display: none;
}

.ally-bell-icon {
  font-size: 18px;
  line-height: 1;
}

.ally-bell-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #7f1d1d;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.ally-bell-count.hidden {
  display: none;
}

.ally-bell-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(340px, 88vw);
  max-height: min(62vh, 480px);
  overflow: auto;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #0b1222;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.45);
  padding: 8px;
  z-index: 220;
}

.ally-bell-dropdown.hidden {
  display: none;
}

.ally-bell-header {
  color: #dbe7ff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 4px 8px;
}

.ally-bell-list {
  display: grid;
  gap: 8px;
}

.ally-bell-empty {
  color: #94a3b8;
  font-size: 12px;
  padding: 6px 4px 4px;
}

.ally-bell-item {
  border: 1px solid #243246;
  border-radius: 10px;
  background: #101b31;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.ally-bell-message {
  color: #d8e4ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.ally-bell-message:hover {
  color: #f8fbff;
  text-decoration: underline;
}

.ally-bell-meta {
  color: #9fb2cf;
  font-size: 11px;
}

.ally-bell-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ally-bell-action-btn {
  border-radius: 8px;
  border: 1px solid #334155;
  background: #111a2e;
  color: #dbe7ff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
}

.ally-bell-action-btn.accept {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

.ally-bell-action-btn.reject {
  border-color: #ef4444;
  color: #fecaca;
  background: #2a1117;
}

.ally-bell-previews {
  border-top: 1px dashed #31455f;
  margin-top: 2px;
  padding-top: 6px;
  display: grid;
  gap: 4px;
}

.ally-bell-preview-link {
  color: #bcd2ff;
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
}

.ally-bell-preview-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  color: #c9cfdb;
  font-weight: 700;
}

.tab.active {
  color: var(--yellow);
}

.tab.pink {
  color: var(--pink);
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.open-board-btn {
  border: 1px solid #31374a;
  border-radius: 12px;
  color: #f4f6fb;
  padding: 10px 14px;
  font-weight: 700;
}

.content-head {
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.content-head h1 {
  margin: 0;
  font-size: 24px;
}

.sort {
  color: #d6dae3;
  font-size: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.my-pin-bar {
  margin-top: 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.my-pin-label {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #f8fbff;
  margin-right: 8px;
  white-space: nowrap;
}

/* discoverGrid: New PIN 섹션 전용 컨테이너 */
.discover-grid {
  margin-bottom: 8px;
}
.discover-grid.hidden {
  display: none;
}

.my-pin-left,
.my-pin-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.my-pin-right {
  justify-content: flex-end;
  flex: 1;
}

body.pcloud-view .my-pin-right {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 10px 12px;
  align-items: center;
  justify-content: stretch;
}

body.pcloud-view .my-pin-right > #pcloudQuickActions {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  justify-self: start;
}

body.pcloud-view .my-pin-right > #searchInput {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  justify-self: end;
}

body.pcloud-view .my-pin-right > #pcloudSelectActions,
body.pcloud-view .my-pin-right > #pcloudTrashActions {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  justify-self: end;
}

body.pcloud-view .my-pin-right > #mineActions,
body.pcloud-view .my-pin-right > #trashActions {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  justify-self: end;
}

.sort-search {
  flex: 0 1 420px;
  min-width: 280px;
  border: 1px solid #374052;
  border-radius: 10px;
  background: #111622;
  /* 기존 배경 SVG 돋보기 아이콘 제거(2026-08-11) — placeholder의 🔍 이모지 하나만
     남기기로 함. 웹·태블릿·폰 공통. 아이콘을 뺐으므로 왼쪽 패딩도 40→12px로 복원. */
  color: #ecf2ff;
  font-size: 16px;
  font-weight: 600;
  padding: 6px 12px;
  line-height: 1.2;
  outline: none;
}

.sort-search::placeholder {
  color: #8f95a3;
}

.sort-search:focus {
  border-color: #5b6e93;
  box-shadow: 0 0 0 3px rgba(91, 110, 147, 0.2);
}

.pcloud-quick-actions {
  display: grid;
  grid-template-rows: auto auto;
  gap: 10px;
}

.pcloud-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pcloud-quick-actions.hidden {
  display: none;
}

.pcloud-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid #2f384a;
  background: #0f1422;
}

.pcloud-tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #9aa3b2;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}

.pcloud-tab.active {
  background: #1a2436;
  color: #e5e7eb;
}

.pcloud-btn {
  border: 1px solid #374052;
  border-radius: 10px;
  background: #111622;
  color: #ecf2ff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  padding: 6px 12px;
}

.pcloud-btn.hidden {
  display: none;
}

.pcloud-btn.ghost {
  background: transparent;
}

.pcloud-status {
  color: #a8b2c3;
  font-size: 14px;
  font-weight: 600;
  min-height: 20px;
}

.pcloud-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.grid.pcloud-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-top: 4px;
}

.pcloud-card {
  border: 1px solid #2a2f3c;
  border-radius: 18px;
  background: #0d111b;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.pcloud-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.pcloud-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
  flex: 1;
}

.pcloud-card-check {
  accent-color: #60a5fa;
  width: 16px;
  height: 16px;
}

.pcloud-card-name {
  font-size: 18px;
  font-weight: 800;
  color: #f1f5ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  display: block;
}

.pcloud-card-meta {
  color: #9aa3b2;
  font-size: 13px;
  font-weight: 600;
}

.pcloud-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pcloud-card-actions a,
.pcloud-card-actions button {
  border: 1px solid #334155;
  border-radius: 999px;
  background: #111827;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
}

.pcloud-card-actions button.danger {
  border-color: #ef4444;
  color: #ef4444;
  background: transparent;
}

.pcloud-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.pcloud-menu-btn {
  border: 1px solid #334155;
  border-radius: 10px;
  background: #111827;
  color: #e2e8f0;
  font-size: 18px;
  font-weight: 700;
  padding: 2px 8px 4px;
  cursor: pointer;
  line-height: 1;
}

.pcloud-menu {
  position: absolute;
  right: 0;
  top: 110%;
  min-width: 160px;
  border: 1px solid #2b3344;
  border-radius: 12px;
  background: #0f1422;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  padding: 6px;
  display: grid;
  gap: 4px;
  z-index: 20;
}

.pcloud-menu.hidden {
  display: none;
}

.pcloud-menu button {
  border: 0;
  background: transparent;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.pcloud-menu button:hover {
  background: rgba(148, 163, 184, 0.12);
}

.pcloud-menu button.danger {
  color: #f87171;
}

.pcloud-folder-card {
  cursor: pointer;
  background: #0f1524;
  border-color: #2f3b55;
}

.pcloud-folder-card:hover {
  border-color: #566c96;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.pcloud-trash-card {
  cursor: default;
}

.pcloud-folder-badge {
  border: 1px solid #324055;
  border-radius: 999px;
  background: #1a2336;
  color: #cdd6e6;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  white-space: nowrap;
}

.pcloud-upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(5, 7, 12, 0.72);
  display: grid;
  place-items: center;
  padding: 16px;
}

.pcloud-upload-overlay.hidden {
  display: none;
}

.pcloud-upload-panel {
  border-radius: 16px;
  border: 1px solid #2f3442;
  background: #0f1422;
  color: #e5e7eb;
  padding: 18px 22px;
  display: grid;
  gap: 12px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.35);
}

.pcloud-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 4px solid rgba(148, 163, 184, 0.3);
  border-top-color: #60a5fa;
  animation: pcloud-spin 0.8s linear infinite;
  justify-self: center;
}

.pcloud-upload-text {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
}

@keyframes pcloud-spin {
  to {
    transform: rotate(360deg);
  }
}

.shared-folder-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.shared-owner {
  color: #d6dae3;
  font-size: 20px;
  font-weight: 700;
}

.shared-permission-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #111827;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 800;
  padding: 6px 12px;
}

.overlay-sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(2, 6, 23, 0.68);
  display: grid;
  place-items: center;
  padding: 16px;
}

.overlay-sheet.hidden {
  display: none;
}

.access-panel {
  width: min(460px, 100%);
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.35);
  padding: 18px;
}

.access-panel h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

.ally-panel {
  width: min(520px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;
}

.ally-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ally-block {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
  margin-bottom: 10px;
}

.ally-block h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #334155;
}

.ally-list {
  display: grid;
  gap: 8px;
}

.ally-empty {
  color: #64748b;
  font-size: 13px;
}

.ally-item {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ally-item-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ally-item-title {
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ally-item-sub {
  color: #64748b;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ally-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ally-btn {
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
}

.ally-btn.accept {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.ally-btn.reject {
  border-color: #ef4444;
  color: #dc2626;
  background: #fff;
}

.move-panel {
  width: min(540px, 100%);
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.35);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.move-panel h3 {
  margin: 0;
  font-size: 22px;
}

.move-panel-sub {
  margin: 0;
  color: #475569;
  font-size: 14px;
}

.move-tree {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  max-height: min(60vh, 420px);
  overflow: auto;
  padding: 10px 6px;
}

.move-tree-root {
  display: grid;
  gap: 4px;
}

.move-tree-list {
  display: grid;
  gap: 4px;
}

.move-tree-item {
  display: grid;
}

.move-tree-btn {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 10px;
  cursor: pointer;
}

.move-tree-btn.root {
  font-weight: 800;
}

.move-tree-btn.active {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1d4ed8;
}

.move-tree-btn.disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.move-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.move-cancel-btn,
.move-confirm-btn {
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 14px;
}

.move-confirm-btn {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.move-confirm-btn:disabled {
  background: #cbd5e1;
  border-color: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
}

.access-mode {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.access-mode-btn {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 12px;
}

.access-mode-btn.active {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1d4ed8;
}

.share-role-picker {
  display: grid;
  gap: 8px;
}

.share-role-btn {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
}

.share-role-btn.active {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1d4ed8;
}

.merge-access-summary {
  margin: 0 0 10px;
  color: #475569;
  font-size: 17px;
  line-height: 1.4;
  white-space: pre-line;
}

.merge-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.merge-actions button {
  min-height: 44px;
}

.danger-soft {
  border-color: #ef4444;
  color: #ef4444;
  background: #fee2e2;
}

.ghost-btn {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 14px;
}

.share-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.share-actions button {
  flex: 1 1 0;
  min-height: 44px;
}

.share-links-wrap {
  margin-top: 14px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 12px;
}

.share-links-title {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.share-links-list {
  display: grid;
  gap: 8px;
}

.share-links-empty {
  color: #94a3b8;
  font-size: 13px;
}

.share-link-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 6px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
}

.share-link-meta {
  display: grid;
  gap: 2px;
}

.share-link-token {
  font-size: 12px;
  color: #64748b;
  word-break: break-all;
}

.share-link-date {
  font-size: 12px;
  font-weight: normal;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.share-link-perm {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.share-link-btn {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
}

.share-link-btn.danger {
  border-color: #ef4444;
  color: #ef4444;
  background: #fee2e2;
}

.share-link-info-btn {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: none;
  box-shadow: none;
  padding: 0 2px;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  color: #64748b;
  line-height: 1;
  flex-shrink: 0;
}
.share-link-info-btn.has-memo {
  color: #6366f1;
}
.share-link-info-btn:hover {
  color: #6366f1;
  background: #ede9fe;
}

.share-link-memo-area {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  margin-top: 4px;
}
.share-link-memo-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #334155;
  resize: vertical;
  font-family: inherit;
  outline: none;
  background: #fff;
}
.share-link-memo-textarea:focus {
  border-color: #6366f1;
}
.share-link-memo-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.share-link-memo-save {
  border: none;
  border-radius: 8px;
  background: #6366f1;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  cursor: pointer;
}
.share-link-memo-save:disabled {
  opacity: 0.6;
  cursor: default;
}
.share-link-memo-cancel {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  cursor: pointer;
}
.share-link-memo-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #334155;
  resize: vertical;
  font-family: inherit;
  outline: none;
  background: #fff;
}
.share-link-memo-input:focus {
  border-color: #6366f1;
}
.share-links-loading {
  font-size: 13px;
  color: #94a3b8;
  padding: 6px 0;
}

.my-pin-actions {
  margin-top: 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-action-btn {
  border: 1px solid #5b3db0;
  border-radius: 14px;
  background: linear-gradient(180deg, #a855f7 0%, #7c3aed 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-transform: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
  min-height: 34px;
  padding: 6px 12px;
  box-shadow: 0 8px 18px rgba(59, 33, 100, 0.22);
}

.top-action-btn.board-action {
  border: 1px solid #2e3546;
  background: linear-gradient(180deg, #2b3242 0%, #1d2330 100%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.35);
}

.top-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(59, 33, 100, 0.28);
}

.top-action-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(59, 33, 100, 0.2);
}

.top-action-btn .action-label {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.plus-circle {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
  transform: translateY(-0.5px);
}

.top-action-btn.hidden {
  display: none;
}

.trash-actions {
  display: flex;
  gap: 8px;
}

.trash-actions.hidden {
  display: none;
}

.trash-actions button {
  border: 1px solid #374052;
  border-radius: 10px;
  background: #111622;
  color: #ecf2ff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  padding: 6px 12px;
  line-height: 1.1;
  white-space: nowrap;
}

.grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid-section-heading {
  grid-column: 1 / -1;
  margin: 8px 0 -2px;
  color: #f8fbff;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.newpin-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.newpin-mark-read-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: transparent;
  border: 1.5px solid rgba(248,251,255,0.35);
  border-radius: 20px;
  color: rgba(248,251,255,0.7);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}
.newpin-mark-read-btn:hover {
  background: rgba(248,251,255,0.15);
  color: #f8fbff;
  border-color: rgba(248,251,255,0.7);
}

.grid-section-empty {
  grid-column: 1 / -1;
}

.padlet-card {
  display: block;
  position: relative;
  cursor: grab;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.padlet-card.dragging {
  opacity: 0.45;
  z-index: 8;
}

.padlet-card.folder-card .folder-thumb {
  position: relative;
  background: linear-gradient(180deg, #1f3f7f, #122a55);
}

.folder-mini-grid {
  width: 100%;
  height: 100%;
  padding: 14px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.folder-mini-item {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 5px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  cursor: grab;
}

.folder-mini-item.empty {
  background: rgba(255, 255, 255, 0.06);
}

.folder-mini-item.dragging {
  opacity: 0.45;
}

.mini-drag-ghost {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(5, 12, 30, 0.35);
  opacity: 0.92;
  will-change: transform;
}

.folder-mini-title {
  display: block;
  width: 100%;
  color: #ffffff;
  font-size: clamp(10.5px, 1.2vw, 12px);
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb {
  height: 182px;
  border-radius: 14px;
  border: 1px solid #2a2f3f;
  background: #1a1f2a;
  overflow: hidden;
  position: relative;
}

/* 썸네일 이미지 그리드 */
.thumb-img-grid {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 2px;
  pointer-events: none;
}
.thumb-img-grid-1 { grid-template-columns: 1fr; }
.thumb-img-grid-2 { grid-template-columns: 1fr 1fr; }
.thumb-img-grid-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.thumb-img-grid-3 .thumb-img:first-child { grid-row: span 2; }
.thumb-img-grid-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.thumb-img {
  background-size: cover;
  background-position: center;
  min-height: 0;
}

/* 썸네일 텍스트 칩 */
.thumb-text-chips {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 10px;
  overflow: hidden;
  pointer-events: none;
}
.thumb-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.thumb.plus {
  display: grid;
  place-items: center;
  font-size: 72px;
  color: #c7cad2;
  border-style: dashed;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.15) 0, transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.12) 0, transparent 43%),
    #2d313b;
}

.g1 {
  background: linear-gradient(90deg, #07b2ff, #f9f000);
}

.g2 {
  background: linear-gradient(180deg, #ddd59a, #c7d86d);
}

.g3 {
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 153, 232, 0.35) 0, transparent 36%),
    radial-gradient(circle at 75% 62%, rgba(86, 142, 255, 0.42) 0, transparent 40%),
    linear-gradient(180deg, #02043f, #052064);
}

.g4 {
  background: #8d6354;
}

.g5 {
  background: #6e3ecb;
}

.g6 {
  background: #d9d8d3;
}

.padlet-card strong {
  margin-top: 8px;
  display: block;
  font-size: clamp(13px, 1.7vw, 18px);
  line-height: 1.25;
}

.padlet-card span {
  margin-top: 4px;
  display: block;
  color: #aeb4c3;
  font-size: clamp(10px, 1.2vw, 12px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.padlet-card .card-title {
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-source-label {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  background: #e8f0fe;
  color: #4a6cf7;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.padlet-card .card-title::after {
  content: attr(data-full);
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 6px;
  max-width: min(320px, 90vw);
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(6, 10, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e8edff;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 6;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.35);
}

.padlet-card .card-title:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.card-actions {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

.icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(10, 14, 30, 0.72);
  color: #fff;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.icon-btn.on {
  color: #ff5a85;
}

.folder-menu {
  position: absolute;
  right: 0;
  top: 36px;
  min-width: 170px;
  border: 1px solid #2b3243;
  border-radius: 12px;
  background: #0f1420;
  box-shadow: 0 16px 28px rgba(2, 6, 23, 0.45);
  padding: 6px;
  display: grid;
  gap: 4px;
}

.folder-menu.hidden {
  display: none;
}

.folder-menu-item {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 10px;
}

.folder-menu-item:hover {
  background: #1b2335;
}

.folder-menu-item.danger {
  color: #fb7185;
}

.trash-check {
  position: absolute;
  left: 10px;
  top: 10px;
  transform: scale(1.4);
  z-index: 4;
  cursor: pointer;
}

/* 핀·폴더 카드 공통 — 체크박스·⋮ 메뉴를 썸네일 위에 겹쳐 띄우는 대신 썸네일 위쪽에
   별도의 가로줄(행)로 배치한다. 핀 카드는 썸네일 안 텍스트 칩과 겹치는 문제,
   폴더 카드는 핀 카드와 썸네일 시작 위치가 안 맞아 그리드 정렬이 어긋나는 문제가 있어
   두 카드 타입 모두 동일한 구조로 통일(2026-08-10) — 하나만 바꾸면 그리드에서 다시
   줄이 안 맞으므로 반드시 함께 유지할 것. */
.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  margin-bottom: 8px;
}

.card-top-row .trash-check {
  position: static;
  transform: scale(1.3);
}

.card-top-row .card-actions {
  position: relative;
  top: auto;
  right: auto;
}

/* 휴지통 뷰: 카드 전체가 클릭 가능 */
.board-card.trash-selected .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(99, 102, 241, 0.28);
  border-radius: inherit;
  pointer-events: none;
}
.board-card.trash-selected {
  outline: 2px solid rgba(99, 102, 241, 0.85);
  outline-offset: -2px;
}


.empty-state {
  border: 1px dashed #2f3442;
  border-radius: 14px;
  color: #9ca3b5;
  font-size: 24px;
  padding: 24px;
}

/* 폰 전용 햄버거 드로어 요소 — 기본은 데스크톱/태블릿이라 숨김.
   실제 드로어 전환 규칙은 아래 @media (max-width: 600px) 블록에 있으며,
   그 블록은 1280/980 브레이크포인트보다 "뒤"에 있어야 .grid 등의 규칙이
   폰 폭에서 이긴다(모든 max-width 조건이 동시에 매치되므로 소스 순서상 뒤가 승). */
.mobile-nav-toggle { display: none; }
.mobile-nav-overlay { display: none; }
.home-account-toggle { display: none; }

@media (max-width: 1280px) {
  .home-shell {
    grid-template-columns: 280px 1fr;
  }

  .welcome h2 {
    font-size: 24px;
  }

  .welcome p {
    font-size: 16px;
  }

  .menu-item {
    font-size: 16px;
  }

  .content-head h1 {
    font-size: 22px;
  }

  .sort {
    font-size: 22px;
  }

  .padlet-card strong {
    font-size: 22px;
  }

  .padlet-card span {
    font-size: 18px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 980px) {
  .home-shell {
    grid-template-columns: 1fr;
  }

  .left-nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .welcome h2 {
    font-size: 24px;
  }

  .welcome p {
    font-size: 16px;
  }

  .menu-item {
    font-size: 16px;
  }

  .content-head h1 {
    font-size: 20px;
  }

  .sort {
    font-size: 20px;
  }

  .brand-lockup {
    width: min(200px, 100%);
  }

  .shared-owner {
    font-size: 16px;
  }

  .padlet-card strong {
    font-size: 19px;
  }

  .padlet-card span {
    font-size: 15px;
  }

  .my-pin-actions {
    flex-wrap: wrap;
  }
}

/* ── 폰 전용 (≤600px) — 반드시 1280/980 블록 "뒤"에 위치 ──────────────────
   폰 폭에서는 1280·980·600 세 조건이 전부 매치되므로, 소스 순서상 뒤에 있는
   이 블록이 .grid 컬럼 등에서 이겨야 함(모두 동일 특이도). 앞에 두면 넓은
   브레이크포인트의 minmax(260/300px)가 이 규칙을 덮어써 1열로 나옴(실측 확인). */
@media (max-width: 600px) {
  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #262a35;
    border-radius: 12px;
    background: #131722;
    cursor: pointer;
    flex: 0 0 auto;
  }
  .mobile-nav-toggle-icon {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 20px;
  }
  .mobile-nav-toggle-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: #edf0f7;
    border-radius: 2px;
  }

  /* left-nav를 화면 밖에 숨겨둔 드로어로 전환 (position:fixed라 grid 흐름에서 빠짐) */
  .left-nav {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: min(84vw, 300px);
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 1001;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: 18px 16px;
  }
  body.nav-open .left-nav { transform: translateX(0); }

  .mobile-nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }
  body.nav-open .mobile-nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  /* left-nav가 fixed로 빠졌으므로 main-area가 전체 폭을 차지 */
  .home-shell { grid-template-columns: 1fr; }
  .main-area { padding: 14px 12px 28px; }

  /* 핀·폴더·New PIN(discover) 카드 그리드 — 폰에서 2열로 촘촘하게 */
  .grid {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 카드 썸네일 높이 축소 (기본 182px → 폰 124px) — 카드가 세로로 덜 커짐 */
  .thumb { height: 124px; }

  /* 카드 제목·메타 글자도 살짝 축소 */
  .padlet-card strong { font-size: 15px; }
  .padlet-card span { font-size: 12.5px; }

  /* 상단 "홈" 탭은 폰에서 불필요 — 햄버거·계정 영역만 남겨 공간 확보 */
  .main-top .tabs { display: none; }

  /* 홈 상단바 재배치: 검색을 가운데, 알림·계정·로그아웃은 ⋮ 드롭다운으로 ─────────
     (main.js initMobileHomeTopbar가 .ally-search-wrap을 .main-top 직접 자식으로 옮기고,
      .main-top-right(알림+계정)은 드롭다운 패널로 남긴다) */
  .main-top {
    position: relative;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .main-top .top-spacer { display: none; }
  .main-top > .ally-search-wrap {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
  }
  .main-top > .ally-search-wrap .ally-search-input { width: 100%; }

  .home-account-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    padding: 0;
    font-size: 24px;
    line-height: 1;
    border: 1px solid #262a35;
    border-radius: 12px;
    background: #131722;
    color: #edf0f7;
    cursor: pointer;
  }

  .main-top-right {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    flex-flow: row wrap;
    align-items: center;
    gap: 10px;
    width: min(84vw, 280px);
    padding: 14px;
    background: #0e121c;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
    z-index: 1002;
  }
  .main-top-right.open { display: flex; }
  /* auth-bar / auth-user-box의 레이아웃 박스를 없애(display:contents) 그 자식인
     계정 버튼·로그아웃을 .main-top-right의 flex에 직접 참여시킴. 그래야 알림(bell)과
     계정을 같은 행에 놓고 로그아웃만 다음 행으로 내릴 수 있음.
     :not(.hidden) — 로그아웃 상태(authUserBox.hidden)를 display:contents가 덮어써
     계정이 잘못 노출되는 것을 방지. */
  .main-top-right .auth-bar { display: contents; }
  .main-top-right .auth-user-box:not(.hidden) { display: contents; }
  /* 1행: 알림 + 계정 (알림은 고정폭, 계정이 남은 폭을 채움) */
  .main-top-right .ally-bell-wrap { flex: 0 0 auto; }
  .main-top-right .account-menu-wrap { flex: 1 1 auto; min-width: 0; }
  .main-top-right .account-menu-btn { width: 100%; }
  /* 2행: 로그아웃 (flex-basis 100%로 강제 줄바꿈) */
  .main-top-right .auth-logout-btn { flex: 0 0 100%; width: 100%; }

  /* My PIN 영역: "My PIN"·Folder+·Pin+ 가 한 행에 들어오도록 축소, 줄바꿈 방지 */
  .my-pin-left { flex-wrap: nowrap; gap: 8px; }
  .my-pin-label { font-size: 20px; margin-right: 4px; }
  .top-action-btn { font-size: 13px; padding: 6px 10px; min-height: 32px; gap: 6px; }
  .top-action-btn .plus-circle { width: 20px; height: 20px; font-size: 16px; }

  /* 전체선택·해제·삭제 등 액션 버튼을 우측 정렬(한 줄 전체 폭 차지 후 flex-end) */
  .my-pin-right { justify-content: flex-end; }
  .my-pin-right .trash-actions {
    justify-content: flex-end;
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  /* ── pCLOUD 툴바 모바일 (Photo 3 깨짐 수정) ──
     ⚠️ .sort-search 기본값 flex:0 1 420px / min-width:280px가 세로 컬럼에선 "높이 420px"로
     해석돼 검색창이 거대한 상자가 됐음. quick-actions를 display:contents로 승غ해 탭행/버튼행을
     my-pin-right의 직접 flex 아이템으로 만든 뒤, order로 [탭+검색] / [Folder+행] / [전체선택행] 3행 구성. */
  body.pcloud-view .my-pin-left { display: none; }
  body.pcloud-view .my-pin-bar { display: block; }
  body.pcloud-view .my-pin-right {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    width: 100%;
    gap: 10px;
  }
  body.pcloud-view .pcloud-quick-actions { display: contents; }

  /* 1행: 파일/휴지통 탭 + 검색(축소) */
  body.pcloud-view .pcloud-row-top { order: 1; flex: 0 0 auto; }
  body.pcloud-view .sort-search {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;          /* 기존 min-width:280px 해제 */
    width: auto;
    max-width: 230px;      /* 검색창 폭 축소 → 탭 옆 한 행에 들어감 */
  }
  /* 2행: Folder+ 업로드 다운로드 (한 행) */
  body.pcloud-view .pcloud-row-bottom { order: 3; flex: 1 1 100%; justify-content: flex-start; }
  /* 3행: 전체선택 해제 삭제 (한 행, 우측 정렬) */
  body.pcloud-view .my-pin-right .trash-actions {
    order: 4; flex: 1 1 100%;
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
  }

  body.pcloud-view .pcloud-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .pcloud-tab { white-space: nowrap; font-size: 12px; padding: 5px 12px; }
  .pcloud-btn { font-size: 13px; padding: 7px 10px; flex: 0 0 auto; white-space: nowrap; }
  body.pcloud-view .my-pin-right .trash-actions button { font-size: 13px; white-space: nowrap; padding: 7px 12px; }
  body.pcloud-view .pcloud-status { display: none; }
  body.pcloud-view .pcloud-upload-input { display: none; }
}

@media (min-width: 981px) {
  body {
    overflow: hidden;
  }

  .home-shell {
    /* 100vh는 일부 태블릿 브라우저에서 실제 보이는 화면보다 크게 계산돼
       (주소창 등 브라우저 UI를 포함해 레이아웃 뷰포트 기준으로 잡힘)
       .left-nav 맨 아래 저장 공간, .main-area 맨 아래 줄이 화면 밖으로
       밀려나면서도 스크롤로는 닿지 않는 문제가 실기기로 확인됨 —
       100dvh(동적 뷰포트 높이)로 교체. 미지원 브라우저는 앞의 100vh를 사용. */
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .left-nav {
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    scrollbar-color: transparent transparent;
  }

  .left-nav::-webkit-scrollbar {
    width: 9px;
  }

  .left-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: transparent;
    border: 8px solid transparent;
    background-clip: content-box;
  }

  .left-nav::-webkit-scrollbar-track {
    background: transparent;
  }

  .left-nav:hover {
    scrollbar-width: thin;
    scrollbar-color: #5b6475 transparent;
  }

  .left-nav:hover::-webkit-scrollbar-thumb {
    background: #5b6475;
    border: 8px solid transparent;
    background-clip: content-box;
  }

  .main-area {
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* pager 고정 컨테이너 — DOM 위치 불변, 내용만 교체 */
.mine-pager-wrap { display: block; }
.mine-pager-wrap.hidden { display: none; }

/* My PIN pagination */
.mine-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 0 20px;
}
.mine-pager-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #2e3340;
  border-radius: 6px;
  background: transparent;
  color: #9ba3b0;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mine-pager-btn:hover:not(:disabled) {
  background: #1e2230;
  color: #f5f7fb;
}
.mine-pager-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  font-weight: 600;
}
.mine-pager-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* 잘린 제목 커스텀 툴팁 */
#pinway-tooltip {
  position: fixed;
  z-index: 99999;
  background: rgba(15, 20, 40, 0.93);
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  padding: 5px 10px;
  border-radius: 7px;
  pointer-events: none;
  max-width: 300px;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
}

/* ── 첨부파일 다운로드 진행 모달 ─────────────────────────────────────────── */
.download-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(2, 6, 23, 0.55);
  display: grid;
  place-items: center;
}
.download-progress-overlay.hidden { display: none; }
.download-progress-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.28);
}
.download-progress-box p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}
.download-progress-spinner {
  width: 38px;
  height: 38px;
  border: 4px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: dlSpin 0.75s linear infinite;
}
@keyframes dlSpin { to { transform: rotate(360deg); } }
