/* =============================================================
 * 공유 허브 · 다크 모드 모던 UI
 * ============================================================= */

:root {
  --bg: #0b0d12;
  --bg-soft: #11141b;
  --surface: #161a23;
  --surface-2: #1d2230;
  --border: #262b39;
  --text: #e6e8ee;
  --text-soft: #a7adbb;
  --muted: #757c8d;
  --primary: #7c5cff;
  --primary-hover: #6b4dff;
  --accent: #36d399;
  --danger: #ff5d6c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --radius: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

/* HTML 의 hidden 속성이 클래스 셀렉터(.btn { display: inline-flex } 등)에
   덮이지 않도록 명시적으로 강제. !important 가 필요한 케이스. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 10% -10%, #1c1a3b 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #0d2840 0%, transparent 55%), var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, "D2Coding", monospace;
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  word-break: break-all;
}

/* ─────────── 헤더 ─────────── */
.topbar {
  padding: 28px 28px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 {
  font-size: 22px;
}

.logo-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.5);
}

.tagline {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tagline strong {
  color: var(--text-soft);
  font-weight: 600;
}

.tag-code {
  font-size: 11.5px;
  background: rgba(124, 92, 255, 0.14);
  border-color: rgba(124, 92, 255, 0.35);
  color: #d5cbff;
}

/* ─────────── 레이아웃 ─────────── */
.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  padding: 20px 28px 28px;
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* ─────────── 카드 ─────────── */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 15px;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* ─────────── 탭 ─────────── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-soft);
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: linear-gradient(180deg, #2a3047, #1e2335);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.tab-panel {
  margin-top: 14px;
}

/* ─────────── 폼 ─────────── */
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.input:focus {
  border-color: var(--primary);
  background: #1e2335;
}

.input::placeholder {
  color: var(--muted);
}

.input.invalid,
.input.invalid:focus {
  border-color: var(--danger);
  background: rgba(255, 93, 108, 0.08);
}

/* 사용자 지정 슬러그 입력 */
.slug-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slug-input-row {
  display: flex;
  align-items: stretch;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

.slug-input-row:focus-within {
  border-color: var(--primary);
  background: #1e2335;
}

.slug-input-row.invalid {
  border-color: var(--danger);
  background: rgba(255, 93, 108, 0.08);
}

.slug-prefix {
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid var(--border);
  user-select: none;
}

.slug-input {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 0;
  font-family: "Pretendard", inherit;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.slug-input:focus {
  background: transparent;
  border: none;
}

.hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.hint code {
  font-size: 11px;
  padding: 1px 5px;
  background: rgba(124, 92, 255, 0.12);
  border-color: rgba(124, 92, 255, 0.2);
  color: #cdc0ff;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 22px 12px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  text-align: center;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(124, 92, 255, 0.08);
  color: var(--text);
}

.dropzone-title {
  font-size: 14px;
  font-weight: 500;
}

.dropzone-sub {
  font-size: 12px;
  color: var(--muted);
}

.file-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  background: var(--surface-2);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 11.5px;
}

.progress {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.15s ease-out;
}

.progress-label {
  position: absolute;
  right: 8px;
  top: -22px;
  font-size: 11px;
  color: var(--muted);
}

.status {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  min-height: 1em;
}

.status.success {
  color: var(--accent);
}

.status.error {
  color: var(--danger);
}

/* ─────────── 버튼 ─────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  user-select: none;
  font-family: inherit;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background: #242a3a;
  border-color: #313749;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn.ghost {
  background: transparent;
}

.btn[aria-pressed="true"] {
  background: rgba(124, 92, 255, 0.18);
  border-color: var(--primary);
  color: #d5cbff;
}

/* ─────────── 라이브러리 ─────────── */
.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 56vh;
  overflow-y: auto;
}

.item-list::-webkit-scrollbar {
  width: 8px;
}
.item-list::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 4px;
}

.item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-width: 0;
}

.item:hover {
  background: var(--surface-2);
}

.item.active {
  background: rgba(124, 92, 255, 0.12);
  border-color: rgba(124, 92, 255, 0.45);
}

.item-thumb {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd0e1;
  font-size: 14px;
  font-weight: 600;
}

.item-thumb.kind-video {
  background: linear-gradient(135deg, #2a2454, #19324a);
}
.item-thumb.kind-image {
  background: linear-gradient(135deg, #1e3a3a, #2a5450);
}
.item-thumb.kind-audio {
  background: linear-gradient(135deg, #3a2a54, #542a4a);
}
.item-thumb.kind-file {
  background: linear-gradient(135deg, #2a2f3e, #1e2638);
}
.item-thumb.kind-link {
  background: linear-gradient(135deg, #2a3e54, #1e304a);
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-title {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.slug-chip {
  background: rgba(124, 92, 255, 0.16);
  color: #cdc0ff;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11.5px;
}

.item-actions {
  display: flex;
  gap: 4px;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.item:hover .item-actions,
.item.active .item-actions {
  opacity: 1;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-soft);
  border-radius: 6px;
  padding: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--border);
}

.icon-btn.danger:hover {
  color: var(--danger);
}

.empty {
  text-align: center;
  font-size: 12.5px;
  margin: 14px 0 2px;
}

.empty.hidden {
  display: none;
}

/* ─────────── 미리보기 ─────────── */
.preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.preview-head h2 {
  font-size: 17px;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.preview-actions {
  display: flex;
  gap: 8px;
}

.preview-frame {
  position: relative;
  width: 100%;
  min-height: 360px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-frame.is-card {
  background: linear-gradient(180deg, #11141b, #0b0d12);
  aspect-ratio: auto;
  padding: 28px;
}

.media {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

.media-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.media-audio {
  width: 100%;
  max-width: 480px;
}

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  background: linear-gradient(180deg, #11141b, #0b0d12);
  text-align: center;
  padding: 20px;
  font-size: 13.5px;
  position: absolute;
  inset: 0;
}

/* 링크 카드 / 파일 카드 */
.entity-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  width: 100%;
  max-width: 520px;
}

.entity-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.entity-title {
  font-size: 17px;
  font-weight: 600;
  word-break: break-word;
}

.entity-sub {
  color: var(--muted);
  font-size: 12.5px;
  word-break: break-all;
}

.entity-url {
  color: #b6c2ff;
  font-size: 13px;
  word-break: break-all;
  text-decoration: none;
}

.entity-url:hover {
  text-decoration: underline;
}

.entity-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ─────────── 미리보기 메타 ─────────── */
.preview-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.share-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

#share-url {
  max-width: 100%;
  overflow-x: auto;
  cursor: pointer;
  transition: background 0.15s;
}

#share-url:hover {
  background: #232838;
}

.copy-target.flash {
  background: rgba(54, 211, 153, 0.18);
  border-color: rgba(54, 211, 153, 0.4);
  color: #c7f3df;
}

/* ─────────── 토스트 ─────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1d2230;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─────────── 푸터 ─────────── */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 12px 28px 24px;
}

/* ─────────── 헤더 (가로 배치 변형) ─────────── */
.topbar-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding-right: 28px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ─────────── 뷰어 레이아웃 ─────────── */
.viewer-layout {
  padding: 0 28px 28px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ─────────── 로그인 오버레이 ─────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 18, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.login-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px 36px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow);
}

.login-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 20px;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─────────── HTML / PDF 인라인 뷰어 ─────────── */
.preview-frame.is-html,
.preview-frame.is-pdf {
  aspect-ratio: auto;
  min-height: 540px;
  padding: 0;
  background: #fff; /* HTML 콘텐츠는 보통 밝은 배경 */
}

.html-frame-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 540px;
}

.html-frame,
.pdf-frame {
  width: 100%;
  height: 100%;
  min-height: 540px;
  border: none;
  display: block;
  background: #fff;
}

.html-open-new {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(11, 13, 18, 0.78);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  z-index: 2;
}

.html-open-new:hover {
  background: rgba(124, 92, 255, 0.9);
  transform: translateY(-1px);
}

/* ─────────── 뷰어: 빈 상태 ─────────── */
.empty-state {
  text-align: center;
  padding: 64px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-state h2 {
  font-size: 18px;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 2px;
}

.empty-state p {
  margin: 0;
  font-size: 13.5px;
}

.empty-state code {
  font-size: 12px;
  background: rgba(124, 92, 255, 0.12);
  border-color: rgba(124, 92, 255, 0.2);
  color: #cdc0ff;
}

.empty-icon {
  color: var(--muted);
  opacity: 0.6;
}

/* 뷰어 헤더 슬러그 표시 */
.viewer-slug {
  font-size: 12px;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─────────── 스피너 ─────────── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}

/* ─────────── 인터랙션 폴리시 ─────────── */
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.input:focus-visible,
.slug-input-row:focus-within {
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.item {
  position: relative;
}

.item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* ─────────── 모바일 ─────────── */
@media (max-width: 540px) {
  .topbar {
    padding: 22px 18px 8px;
  }
  .tagline {
    margin-left: 0;
  }
  .layout {
    padding: 14px 18px 22px;
    gap: 14px;
  }
  .card {
    padding: 14px;
  }
  .preview-head h2 {
    font-size: 15.5px;
  }
  .preview-frame {
    min-height: 240px;
  }
  .preview-frame.is-html,
  .preview-frame.is-pdf,
  .html-frame,
  .pdf-frame,
  .html-frame-wrap {
    min-height: 380px;
  }
  .viewer-slug {
    max-width: 180px;
  }
  .empty-state {
    padding: 40px 20px;
  }
}

/* ─────────── v3 관리·게스트 워크스페이스 ─────────── */
.boot-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.brand-center { justify-content: center; }
.security-caption {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.full { width: 100%; }
.compact { padding: 7px 10px; font-size: 12px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.field-label {
  display: flex;
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: -6px;
}
.field-label span { color: var(--muted); font-weight: 400; }
.field-stack { display: flex; flex-direction: column; gap: 10px; }
.field-stack .field-label { margin: 0; }

.admin-topbar {
  max-width: 1760px;
  margin: 0 auto;
  padding-top: 22px;
}
.admin-shell {
  max-width: 1760px;
  margin: 0 auto;
  padding: 8px 28px 30px;
}
.workspace-tabs {
  display: inline-flex;
  gap: 5px;
  padding: 5px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(17, 20, 27, 0.74);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}
.workspace-tab {
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  color: var(--muted);
  background: transparent;
  font: 600 13px inherit;
  cursor: pointer;
}
.workspace-tab:hover { color: var(--text); }
.workspace-tab.active {
  color: #fff;
  background: linear-gradient(180deg, #2b3146, #202536);
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset;
}
.workspace-tab:focus-visible,
.segment:focus-visible,
.dropzone:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 360px) minmax(360px, 430px) minmax(420px, 1fr);
  align-items: start;
  gap: 16px;
}
.admin-grid > .card { min-height: 670px; }
.upload-card,
.library-card,
.admin-preview { height: calc(100vh - 155px); min-height: 670px; }
.upload-card { overflow-y: auto; }
.library-card { display: flex; flex-direction: column; }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.section-heading h2,
.upload-card h2,
.invite-create-card h2,
.invitation-list-card h2 {
  color: var(--text);
  font-size: 18px;
  text-transform: none;
  letter-spacing: -.01em;
}
.eyebrow {
  margin: 0 0 4px;
  color: #9180e8;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .13em;
}
.dropzone-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #d8d0ff;
  background: rgba(124,92,255,.15);
  font-size: 20px;
  margin-bottom: 2px;
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  margin-bottom: 10px;
}
.segment {
  border: 0;
  border-radius: 7px;
  padding: 8px 9px;
  color: var(--muted);
  background: transparent;
  font: 600 12px inherit;
  cursor: pointer;
}
.segment.active { background: #292f42; color: var(--text); }
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  color: #cfc6ff;
  background: rgba(124,92,255,.16);
  font-size: 10.5px;
  vertical-align: 1px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255,255,255,.015);
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,92,255,.12); }
.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: 13px inherit;
}
.search-box input::placeholder { color: var(--muted); }
.managed-list { flex: 1; max-height: none; min-height: 0; }
.managed-list .item { padding-inline: 8px; }
.managed-list .item-sub { min-width: 0; white-space: nowrap; overflow: hidden; }
.managed-list .when { overflow: hidden; text-overflow: ellipsis; }
.item-thumb.kind-html { background: linear-gradient(135deg, #3b294c, #253052); font-size: 11px; }
.item-thumb.kind-pdf { background: linear-gradient(135deg, #512b37, #382332); }
.list-empty {
  flex: 1;
  min-height: 180px;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  font-size: 13px;
}
.list-empty > span { font-size: 28px; opacity: .55; }
.list-empty p { margin: 8px 0 0; }
.admin-preview .preview-frame { flex: 1; min-height: 350px; aspect-ratio: auto; }
.admin-preview .preview-meta { flex: 0 0 auto; }

.invite-grid {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(520px, 1fr);
  gap: 16px;
  align-items: start;
}
.invite-grid > .card { min-height: calc(100vh - 155px); }
.card-description { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 8px 0 22px; }
.form-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
select.input { appearance: auto; }
.secret-result {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid rgba(54,211,153,.35);
  border-radius: 11px;
  background: rgba(54,211,153,.07);
}
.secret-result-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(54,211,153,.7); }
.secret-result p { margin: 7px 0 10px; color: var(--muted); font-size: 11.5px; }
.secret-url { display: block; padding: 10px; max-height: 82px; overflow: auto; color: #d5ffe9; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.security-note {
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.018);
  font-size: 12px;
}
.security-note strong { color: var(--text-soft); }
.security-note p { margin: 6px 0 0; color: var(--muted); line-height: 1.55; }
.security-note code { padding: 1px 5px; }
.invitation-list-card { display: flex; flex-direction: column; }
.invitation-list { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 10px; overflow-y: auto; }
.invitation-row {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255,255,255,.018);
}
.invitation-row-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.invitation-title-wrap { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.invitation-title-wrap strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono-id { color: var(--muted); font: 10.5px ui-monospace, monospace; }
.invite-status { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 650; }
.invite-status.active { color: #bdffe3; background: rgba(54,211,153,.13); }
.invite-status.redeemed { color: #d4ccff; background: rgba(124,92,255,.16); }
.invite-status.expired { color: var(--muted); background: rgba(117,124,141,.13); }
.invite-status.revoked { color: #ffb8c0; background: rgba(255,93,108,.12); }
.invitation-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; }
.invite-stat { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.invite-stat:first-child { grid-column: 1 / -1; }
.invite-stat span { color: var(--muted); font-size: 10.5px; }
.invite-stat strong { font-size: 11.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invitation-actions { display: flex; justify-content: flex-end; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--border); }
.danger-text { color: #ff9ba6 !important; }

/* 게스트 전달 페이지 */
.guest-page { background: radial-gradient(800px 480px at 50% -120px, #242052 0%, transparent 72%), var(--bg); }
.guest-topbar {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.guest-topbar h1 { font-size: 18px; }
.safe-badge { color: #9fe7c8; font-size: 11.5px; }
.safe-badge span, .session-active span { color: var(--accent); font-size: 8px; margin-right: 4px; }
.guest-shell { width: min(720px, calc(100% - 32px)); margin: 30px auto 50px; }
.guest-card { padding: 28px; }
.guest-intro { padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.guest-intro h2 { color: var(--text); font-size: clamp(22px, 5vw, 30px); text-transform: none; letter-spacing: -.03em; }
.guest-intro > p:last-child { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 10px 0 0; }
.guest-state { min-height: 300px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; gap: 9px; padding: 34px 20px; }
.guest-state h3 { font-size: 19px; }
.guest-state p { max-width: 480px; color: var(--muted); font-size: 13px; line-height: 1.65; margin: 0 0 10px; }
.state-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; color: #d7cfff; background: rgba(124,92,255,.14); font-size: 24px; margin-bottom: 4px; }
.error-icon { color: #ffb9c0; background: rgba(255,93,108,.12); }
.guest-primary { min-width: 190px; padding: 11px 18px; }
.guest-session-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 21px 0 15px; }
.guest-session-head h3 { margin-top: 5px; font-size: 19px; }
.session-active { color: #aeeed1; font-size: 11px; font-weight: 600; }
.quota-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.quota-grid > div { padding: 11px; border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.018); }
.quota-grid span { display: block; color: var(--muted); font-size: 10.5px; margin-bottom: 4px; }
.quota-grid strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guest-upload-form { display: flex; flex-direction: column; gap: 12px; }
.guest-dropzone { min-height: 180px; }
.dropzone.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.guest-result { margin-top: 20px; padding: 16px; border: 1px solid rgba(54,211,153,.32); border-radius: 11px; background: rgba(54,211,153,.065); }
.guest-result > div:nth-child(2) { display: inline-block; vertical-align: top; }
.result-check { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 8px; border-radius: 50%; background: rgba(54,211,153,.15); color: var(--accent); }
.guest-result p { margin: 4px 0 12px; color: var(--muted); font-size: 11.5px; }
.guest-result code { display: block; color: #cffff0; }
.guest-safety { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.guest-safety > div { display: flex; gap: 9px; padding: 11px 12px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.guest-safety > div > span { color: #9180e8; font-weight: 700; }
.guest-safety p { margin: 0; }
.guest-safety strong { color: var(--text-soft); font-size: 11px; }

@media (max-width: 1320px) {
  .admin-grid { grid-template-columns: 350px minmax(420px, 1fr); }
  .admin-preview { grid-column: 1 / -1; height: auto; min-height: 620px !important; }
  .upload-card, .library-card { height: 700px; }
}
@media (max-width: 900px) {
  .admin-grid, .invite-grid { grid-template-columns: 1fr; }
  .admin-grid > .card, .invite-grid > .card { min-height: auto; height: auto; }
  .library-card { min-height: 620px !important; }
  .invitation-list { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .admin-shell { padding: 8px 14px 24px; }
  .admin-topbar { padding-inline: 16px; align-items: flex-start; }
  .admin-topbar .tagline { display: none; }
  .admin-topbar .topbar-actions .btn:first-child { display: none; }
  .workspace-tabs { display: flex; }
  .workspace-tab { flex: 1; }
  .card { border-radius: 12px; }
  .form-grid-two { grid-template-columns: 1fr; }
  .guest-topbar { padding-inline: 17px; }
  .guest-shell { margin-top: 20px; }
  .guest-card { padding: 19px; }
  .quota-grid { grid-template-columns: 1fr 1fr; }
  .quota-grid > div:last-child { grid-column: 1 / -1; }
  .guest-safety { grid-template-columns: 1fr; gap: 0; }
  .guest-session-head { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
