/**
 * EIBE Workspace 모듈 공통 — 우측 하단 Switch to 런처 + 스위치 접기
 * (메뉴 접기는 각 모듈 좌측 패널 하단 — .sidebar-collapse-rail)
 */
.space-launcher-stack {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.space-launcher-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.space-launcher-stack.is-switch-collapsed .space-launcher-links {
  display: none;
}

.space-launcher,
.space-dock-btn {
  --space-launcher-accent: #3cb34a;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px 11px 15px;
  color: #f4f6f8;
  text-decoration: none;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 42%),
    rgba(16, 19, 26, 0.92);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 10px 28px rgba(9, 12, 20, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  isolation: isolate;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition:
    opacity 0.28s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease,
    border-color 0.22s ease;
  animation: space-launcher-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

.space-dock-btn {
  width: 100%;
  margin: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  animation-delay: 0.16s;
}

.space-launcher-links .space-launcher:nth-of-type(1) {
  animation-delay: 0.28s;
}

.space-launcher-links .space-launcher:nth-of-type(2) {
  animation-delay: 0.38s;
}

.space-dock-btn[data-switch-collapse] {
  --space-launcher-accent: #8aa0b8;
  animation-delay: 0.16s;
}

.space-dock-btn[data-switch-collapse] .space-dock-btn__glyph {
  color: #b8c6d6;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

/* 좌측 사이드 하단 — 메뉴 접기 */
.sidebar-collapse-rail {
  --space-launcher-accent: #3cb34a;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 50%),
    rgba(255, 255, 255, 0.03);
  color: #e8edf2;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.sidebar-collapse-rail:hover {
  border-color: rgba(60, 179, 74, 0.35);
  background: rgba(60, 179, 74, 0.08);
  transform: translateY(-1px);
}

.sidebar-collapse-rail:focus-visible {
  outline: 2px solid #3cb34a;
  outline-offset: 2px;
}

.sidebar-collapse-rail__glyph {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7ad684;
  background: rgba(60, 179, 74, 0.12);
  border: 1px solid rgba(60, 179, 74, 0.22);
}

.sidebar-collapse-rail__glyph svg {
  display: block;
}

.sidebar-collapse-rail__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  line-height: 1.15;
}

.sidebar-collapse-rail__eyebrow {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232, 237, 242, 0.45);
}

.sidebar-collapse-rail__label {
  display: block;
  font-size: 0.86rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.sidebar-collapse-rail__label [data-collapse-label] {
  white-space: inherit;
}

.sidebar-collapse-rail__chev {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-collapse-rail.is-collapsed .sidebar-collapse-rail__chev {
  transform: scaleX(-1);
}

.sidebar-foot .sidebar-collapse-rail,
.panel-foot .sidebar-collapse-rail {
  width: 100%;
}

.eibe-support-credit {
  flex-shrink: 0;
  padding: 0 2px 8px;
}

.eibe-support-credit__copy {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(244, 246, 248, 0.72);
}

.eibe-support-credit__meta {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(244, 246, 248, 0.58);
}

.eibe-support-credit__meta a {
  color: inherit;
  text-decoration: none;
}

.eibe-support-credit__meta a:hover {
  text-decoration: underline;
}

.hub-side .eibe-support-credit {
  margin-top: 12px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--line);
}

.hub-side .eibe-support-credit__copy,
.hub-side .eibe-support-credit__meta {
  color: var(--muted-2);
}

.panel-foot {
  margin-top: auto;
  padding-top: 12px;
  flex-shrink: 0;
}

/* 밝은 패널(맛집·회의실)용 */
.sidebar-collapse-rail--light {
  border-color: rgba(30, 38, 64, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), transparent 55%),
    rgba(30, 38, 64, 0.03);
  color: #1e2640;
}

.sidebar-collapse-rail--light:hover {
  border-color: rgba(46, 172, 57, 0.35);
  background: rgba(46, 172, 57, 0.06);
}

.sidebar-collapse-rail--light .sidebar-collapse-rail__eyebrow {
  color: rgba(30, 38, 64, 0.45);
}

.sidebar-collapse-rail--light .sidebar-collapse-rail__glyph {
  color: #2eac39;
  background: rgba(46, 172, 57, 0.1);
  border-color: rgba(46, 172, 57, 0.22);
}

/* 메뉴 접힌 뒤 — 좌하단 펼치기 칩 */
.sidebar-expand-chip {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 14px 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 42%),
    rgba(16, 19, 26, 0.94);
  color: #f4f6f8;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(9, 12, 20, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  appearance: none;
  -webkit-appearance: none;
}

.sidebar-expand-chip[hidden] {
  display: none !important;
}

.sidebar-expand-chip:hover {
  border-color: rgba(60, 179, 74, 0.4);
}

.sidebar-expand-chip:focus-visible {
  outline: 2px solid #3cb34a;
  outline-offset: 3px;
}

.sidebar-expand-chip__glyph {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7ad684;
  background: rgba(60, 179, 74, 0.14);
  border: 1px solid rgba(60, 179, 74, 0.22);
}

.sidebar-expand-chip__glyph svg {
  display: block;
  transform: scaleX(-1);
}

.space-launcher::before,
.space-dock-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: var(--space-launcher-accent);
  opacity: 0.72;
  transition: opacity 0.22s ease, top 0.22s ease, bottom 0.22s ease;
}

@keyframes space-launcher-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.space-launcher:hover,
.space-dock-btn:hover {
  transform: translateY(-2px) scale(1);
  border-color: rgba(60, 179, 74, 0.38);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 14px 32px rgba(9, 12, 20, 0.34);
}

.space-launcher:hover::before,
.space-dock-btn:hover::before {
  opacity: 1;
  top: 8px;
  bottom: 8px;
}

.space-launcher:focus-visible,
.space-dock-btn:focus-visible {
  outline: 2px solid var(--space-launcher-accent);
  outline-offset: 3px;
}

.space-launcher__body,
.space-dock-btn__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.15;
  min-width: 0;
  flex: 1;
}

.space-launcher__eyebrow,
.space-dock-btn__eyebrow {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 246, 248, 0.48);
}

.space-launcher__title,
.space-dock-btn__label {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(244, 246, 248, 0.92);
}

.space-launcher__title b,
.space-dock-btn__label b {
  font-weight: 750;
  color: #67c872;
}

.space-launcher__arrow {
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(103, 200, 114, 0.85);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), color 0.22s ease;
}

.space-launcher:hover .space-launcher__arrow {
  transform: translateX(3px);
  color: #7ad684;
}

.space-dock-btn__glyph {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7ad684;
  background: rgba(60, 179, 74, 0.12);
  border: 1px solid rgba(60, 179, 74, 0.22);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.25s ease;
}

.space-dock-btn__glyph svg {
  display: block;
}

.space-dock-btn__chev {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center;
}

.space-dock-btn.is-collapsed .space-dock-btn__chev {
  transform: scaleX(-1);
}

.space-dock-btn.is-collapsed .space-dock-btn__glyph {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(244, 246, 248, 0.82);
}

.space-dock-btn:hover .space-dock-btn__glyph {
  transform: translateY(-1px);
}

@media (max-width: 920px) {
  .space-launcher-stack {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    gap: 6px;
  }
  .space-launcher,
  .space-dock-btn {
    gap: 10px;
    padding: 10px 12px 10px 13px;
  }
  .space-launcher__title,
  .space-dock-btn__label {
    font-size: 0.82rem;
  }
  .space-dock-btn__glyph {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }
  /* 스택 레이아웃에서는 약도 접기·펼치기 칩 숨김 (스위치 접기는 유지) */
  .sidebar-collapse-rail,
  .panel-foot,
  .sidebar-expand-chip {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .space-launcher,
  .space-dock-btn {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .space-dock-btn__chev,
  .space-dock-btn__glyph {
    transition: none;
  }
}
