    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --navy:    #0a0e1a;
      --navy2:   #0d1b2a;
      --navy3:   #112240;
      --navy4:   #152d4a;
      --border:  #1e3a5f;
      --accent:  #4fc3f7;
      --accent2: #81d4fa;
      --txt0:    #e0f0ff;
      --txt1:    #c8d8e8;
      --txt2:    #78909c;
      --txt3:    #455a7a;
    }

    html, body {
      width: 100%; height: 100%;
      background: var(--navy);
      color: var(--txt0);
      font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
      overflow: hidden;
    }

    /* ── 캔버스 배경 */
    #bgCanvas {
      position: fixed; inset: 0; z-index: 0;
      pointer-events: none;
    }

    /* ── 레이아웃 */
    #root {
      position: relative; z-index: 1;
      width: 100%; height: 100vh;
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      padding: 28px 32px 280px;
      overflow: hidden;
      gap: 0;
    }

    /* ── 헤더 */
    #header {
      flex-shrink: 0;
      display: flex; flex-direction: column; align-items: center;
      margin-bottom: clamp(18px, 3vh, 36px);
    }
    #logoRow {
      display: flex; align-items: center; gap: 14px;
      margin-bottom: 10px;
    }
    #logoIcon {
      width: 44px; height: 44px; flex-shrink: 0;
    }
    #logoText {
      font-size: clamp(28px, 4vw, 42px);
      font-weight: 800; letter-spacing: 3px;
      background: linear-gradient(135deg, #e0f0ff 0%, #4fc3f7 50%, #81d4fa 100%);
      -webkit-background-clip: text; -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    #tagline {
      font-size: 12px; letter-spacing: 3px; color: var(--txt2);
      text-transform: uppercase; font-weight: 500;
    }
    .header-divider {
      width: 60px; height: 1px;
      background: linear-gradient(90deg, transparent, var(--accent), transparent);
      margin: 12px auto 0;
    }

    /* ── 워크스페이스 섹션 */
    #wsSection {
      width: 100%; max-width: 960px;
      display: flex; flex-direction: column;
      max-height: 55vh;
    }
    #wsLabel {
      font-size: 11px; letter-spacing: 2px; color: var(--txt3);
      text-transform: uppercase; margin-bottom: 14px; font-weight: 600;
    }

    /* ── 카드 그리드 */
    #wsGrid {
      flex: 1; min-height: 0;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      align-content: start;
      align-items: start;
      gap: 16px;
      overflow-y: auto;
      padding: 6px 4px 4px;
    }
    #wsGrid::-webkit-scrollbar { width: 4px; }
    #wsGrid::-webkit-scrollbar-track { background: transparent; }
    #wsGrid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

    /* ── 카드 */
    .ws-card {
      border: 1px solid var(--border);
      border-radius: 12px; overflow: hidden;
      cursor: pointer; position: relative;
      background: var(--navy2);
      transition: border-color .2s, transform .2s, box-shadow .2s;
      display: flex; flex-direction: column;
    }
    .ws-card:hover {
      border-color: var(--accent);
      transform: translateY(-3px);
      box-shadow: 0 8px 32px rgba(79,195,247,.18);
    }
    .ws-thumb-wrap {
      width: 100%; aspect-ratio: 16/9;
      overflow: hidden; flex-shrink: 0; position: relative;
    }
    .ws-thumb {
      width: 100%; height: 100%; object-fit: cover;
      display: block; transition: transform .35s;
    }
    .ws-card:hover .ws-thumb { transform: scale(1.04); }
    .ws-thumb-placeholder {
      width: 100%; height: 100%;
      background: linear-gradient(135deg, var(--navy) 0%, var(--navy3) 100%);
      display: flex; align-items: center; justify-content: center;
      font-size: 32px; color: var(--txt3);
    }
    .ws-info {
      padding: 10px 12px 12px; flex: 1;
    }
    .ws-name {
      font-size: 13px; font-weight: 700; color: var(--txt0);
      margin-bottom: 4px;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .ws-date {
      font-size: 10px; color: var(--txt3); font-weight: 400;
    }
    .ws-badge {
      position: absolute; top: 7px; left: 7px;
      background: rgba(79,195,247,.2); border: 1px solid rgba(79,195,247,.5);
      border-radius: 4px; font-size: 9px; color: var(--accent);
      padding: 2px 6px; font-weight: 700; letter-spacing: .5px;
    }

    /* ── '워크스페이스 추가하기' 카드 ── */
    .ws-card-add {
      border-style: dashed;
      background: linear-gradient(135deg, rgba(79,195,247,0.04) 0%, rgba(79,195,247,0.10) 100%);
    }
    .ws-card-add:hover {
      border-color: var(--accent);
      box-shadow: 0 8px 32px rgba(79,195,247,.28);
    }
    .ws-thumb-add {
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      background: linear-gradient(135deg, var(--navy) 0%, var(--navy3) 100%);
      position: relative;
    }
    .ws-add-plus {
      font-size: 64px; line-height: 1;
      color: var(--accent); font-weight: 200;
      text-shadow: 0 0 20px rgba(79,195,247,.4);
      transition: transform .25s;
    }
    .ws-card-add:hover .ws-add-plus {
      transform: scale(1.15) rotate(90deg);
    }
    .ws-add-tag {
      position: absolute; top: 8px; right: 8px;
      background: rgba(79,195,247,.2);
      border: 1px solid rgba(79,195,247,.5);
      border-radius: 4px; font-size: 9px; color: var(--accent);
      padding: 2px 7px; font-weight: 700; letter-spacing: .8px;
    }

    /* 카드 hover overlay */
    .ws-overlay {
      position: absolute; inset: 0;
      background: rgba(10,14,26,.72);
      display: flex; align-items: center; justify-content: center;
      opacity: 0; transition: opacity .2s;
    }
    .ws-card:hover .ws-overlay { opacity: 1; }
    .ws-enter-btn {
      padding: 9px 24px; border-radius: 8px;
      background: var(--accent); color: #fff;
      font-size: 13px; font-weight: 700; border: none; cursor: pointer;
      letter-spacing: .5px;
      box-shadow: 0 4px 16px rgba(79,195,247,.4);
      transition: background .15s, transform .15s;
    }
    .ws-enter-btn:hover { background: var(--accent2); transform: scale(1.04); }


    /* ── 푸터 */
    #footer {
      flex-shrink: 0; margin-top: 18px;
      display: flex; align-items: center; gap: 20px;
    }
    #footer span {
      font-size: 10px; color: var(--txt3); letter-spacing: 1px;
    }
    #footer .dot { color: var(--border); }

    /* ── 우상단 사용자 영역 ── */
    #userBar {
      position: fixed;
      top: 16px; right: 24px;
      z-index: 50;
      display: flex; align-items: center; gap: 8px;
    }
    .user-btn {
      background: rgba(13, 27, 42, 0.85);
      color: var(--txt0);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 7px 14px;
      font-size: 12px; font-weight: 600;
      cursor: pointer;
      transition: border-color .15s, color .15s, background .15s;
      backdrop-filter: blur(4px);
    }
    .user-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
      background: rgba(13, 27, 42, 0.95);
    }
    #userBadge {
      display: flex; align-items: center; gap: 8px;
      background: rgba(13, 27, 42, 0.85);
      border: 1px solid var(--accent);
      border-radius: 8px;
      padding: 6px 10px 6px 12px;
      color: var(--txt0); font-size: 13px; font-weight: 600;
      backdrop-filter: blur(4px);
      box-shadow: 0 0 0 1px rgba(79,195,247,.15), 0 4px 16px rgba(0,0,0,.4);
    }
    .ub-icon { font-size: 14px; }
    .user-btn-mini {
      background: transparent;
      color: var(--txt2);
      border: 1px solid var(--border);
      border-radius: 5px;
      padding: 3px 9px;
      font-size: 10px; font-weight: 600;
      cursor: pointer;
      transition: all .12s;
      margin-left: 4px;
    }
    .user-btn-mini:hover {
      color: #ff8a80;
      border-color: #ff8a80;
    }

    /* ── 인증 모달 ── */
    .auth-backdrop {
      position: fixed; inset: 0;
      z-index: 200;
      background: rgba(5, 10, 20, 0.72);
      display: flex; align-items: center; justify-content: center;
      backdrop-filter: blur(6px);
      animation: auth-fadein .18s ease-out;
    }
    @keyframes auth-fadein { from { opacity: 0; } to { opacity: 1; } }
    .auth-card {
      width: min(400px, 92vw);
      background: linear-gradient(135deg, var(--navy2), var(--navy3));
      border: 1px solid var(--border);
      border-radius: 14px;
      box-shadow: 0 20px 64px rgba(0,0,0,.7), 0 0 0 1px rgba(79,195,247,.15);
      overflow: hidden;
      animation: auth-popin .25s cubic-bezier(0.2, 0.7, 0.3, 1.1);
    }
    @keyframes auth-popin {
      from { opacity: 0; transform: scale(0.92) translateY(20px); }
      to   { opacity: 1; transform: scale(1) translateY(0); }
    }
    .auth-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 20px;
      background: linear-gradient(135deg, rgba(79,195,247,.12), transparent);
      border-bottom: 1px solid var(--border);
      font-size: 15px; font-weight: 700;
      color: var(--accent);
      letter-spacing: 0.4px;
    }
    .auth-close {
      background: transparent; border: none;
      color: var(--txt2); cursor: pointer;
      font-size: 16px; padding: 2px 8px;
      border-radius: 4px;
      transition: color .12s, background .12s;
    }
    .auth-close:hover { color: var(--txt0); background: rgba(255,255,255,.05); }
    .auth-tabs {
      display: flex;
      border-bottom: 1px solid var(--border);
    }
    .auth-tab {
      flex: 1;
      background: transparent;
      border: none; border-bottom: 2px solid transparent;
      color: var(--txt2);
      padding: 10px 12px;
      font-size: 12px; font-weight: 600;
      cursor: pointer;
      transition: all .15s;
    }
    .auth-tab:hover { color: var(--txt0); }
    .auth-tab.active {
      color: var(--accent);
      border-bottom-color: var(--accent);
      background: rgba(79,195,247,.05);
    }
    .auth-form {
      display: flex; flex-direction: column; gap: 14px;
      padding: 20px 22px 22px;
    }
    .auth-field {
      display: flex; flex-direction: column; gap: 5px;
    }
    .auth-field span {
      font-size: 11px; font-weight: 600;
      color: var(--txt2);
      letter-spacing: 0.3px;
    }
    .auth-field input {
      background: var(--navy);
      border: 1px solid var(--border);
      border-radius: 7px;
      color: var(--txt0);
      padding: 9px 12px;
      font-size: 13px;
      transition: border-color .12s, box-shadow .12s;
      outline: none;
    }
    .auth-field input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(79,195,247,.18);
    }
    .auth-error {
      min-height: 18px;
      font-size: 11px; color: #ff8a80;
      font-weight: 600;
    }
    .auth-submit {
      background: var(--accent);
      color: var(--navy);
      border: none;
      border-radius: 7px;
      padding: 11px 16px;
      font-size: 13px; font-weight: 700;
      cursor: pointer;
      transition: filter .12s, transform .08s;
      letter-spacing: 0.3px;
    }
    .auth-submit:hover { filter: brightness(1.1); }
    .auth-submit:active { transform: scale(0.98); }
    .auth-submit:disabled {
      opacity: 0.5; cursor: wait;
    }

    /* ════════════════════════════════════════════════════
       반응형 — 모든 베이스 스타일이 정의된 뒤에 미디어 쿼리를
       선언해, 매칭 시 동일 specificity 기본 규칙을 안전하게 덮어쓴다.
       ════════════════════════════════════════════════════ */

    /* ── 태블릿 / 작은 데스크톱 (1024px 이하) ─────────── */
    @media (max-width: 1024px) {
      #root { padding: 24px 24px 40px; }
      #wsGrid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 14px;
      }
      #userBar { top: 14px; right: 18px; gap: 6px; }
      .user-btn { padding: 6px 12px; font-size: 11px; }
    }

    /* ── 노트북·중간 데스크톱 (높이 1000px 이하) — 카드 공간 확보 ───────
       기본 padding-bottom 280px 가 카드 영역을 잡아먹어 내부 스크롤이 항상
       생기던 문제 해소. wsSection 의 max-height 도 calc 로 늘려 가용 높이를
       거의 그대로 카드에 할당. */
    @media (max-height: 1000px) {
      #root {
        padding-top: 22px;
        padding-bottom: 40px;
      }
      #header { margin-bottom: clamp(12px, 1.8vh, 22px); }
      #wsLabel { margin-bottom: 10px; }
      #wsSection { max-height: calc(100vh - 170px); }
      #footer { margin-top: 12px; }
    }

    /* ── 매우 짧은 높이 (640px 이하) — 고정 100vh + overflow:hidden 해제,
       자연스러운 페이지 스크롤로 전환해 카드 겹침/잘림 완전 차단. */
    @media (max-height: 640px) {
      html, body { overflow: auto; }
      #root {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 24px 32px 36px;
        justify-content: flex-start;
        overflow: visible;
      }
      #header { margin-bottom: 14px; }
      #wsSection { max-height: none; }
      #wsGrid {
        overflow-y: visible;
        max-height: none;
      }
      #footer { margin-top: 18px; }
    }

    /* ── 모바일 반응형 (640px 이하) ───────────────────── */
    @media (max-width: 640px) {
      html, body { overflow: auto; }

      #root {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        /* userBar 가 우상단 fixed 라 헤더와 겹치지 않도록 충분한 top padding.
           env(safe-area-inset-*) 로 노치/홈인디케이터 영역도 회피 */
        padding:
          max(60px, calc(50px + env(safe-area-inset-top)))
          max(14px, env(safe-area-inset-right))
          max(32px, env(safe-area-inset-bottom))
          max(14px, env(safe-area-inset-left));
        justify-content: flex-start;
      }

      #header { margin-bottom: 18px; }
      #logoIcon { width: 32px; height: 32px; }
      #logoRow { gap: 10px; margin-bottom: 8px; }
      #logoText { letter-spacing: 2px; }
      #tagline { font-size: 10px; letter-spacing: 1.5px; }
      .header-divider { width: 48px; margin-top: 8px; }

      #wsSection { max-height: none; }
      #wsLabel { margin-bottom: 10px; font-size: 10px; }

      #wsGrid {
        grid-template-columns: 1fr;
        overflow-y: visible;
        max-height: none;
        gap: 12px;
        padding: 4px 2px 2px;
      }

      /* 우상단 사용자 바 — 모바일 컴팩트 + 노치 회피 */
      #userBar {
        top: max(10px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        gap: 6px;
      }
      .user-btn { padding: 6px 10px; font-size: 11px; }
      #userBadge { padding: 5px 8px 5px 10px; font-size: 12px; }
      .user-btn-mini { font-size: 9px; padding: 2px 7px; }

      /* 터치 디바이스: 오버레이를 썸네일 영역으로만 제한 → 정보 영역이 가려지지 않음 */
      .ws-overlay {
        opacity: 1;
        bottom: auto;
        aspect-ratio: 16/9;
        background: linear-gradient(to top,
          rgba(10,14,26,.88) 0%,
          rgba(10,14,26,.2) 55%,
          transparent 100%);
        align-items: flex-end;
        padding-bottom: 12px;
      }
      .ws-enter-btn { padding: 7px 18px; font-size: 12px; }
      .ws-name { color: #ffffff; font-size: 14px; }
      .ws-date { color: rgba(200,220,245,0.7); }
      /* 터치 탭 시 scale 피드백만 */
      .ws-card:active { transform: scale(.98); }
      .ws-card:hover  { transform: none; box-shadow: none; }
      .ws-card:hover .ws-thumb { transform: none; }

      #footer {
        margin-top: 18px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px 12px;
      }
      #footer span { font-size: 9px; letter-spacing: .8px; }

      /* 인증 모달 — 모바일 패딩 압축 + iOS focus 자동 줌 방지 (input font ≥ 16px) */
      .auth-card { width: min(400px, 94vw); border-radius: 12px; }
      .auth-header { padding: 13px 16px; font-size: 14px; }
      .auth-tab { padding: 9px 10px; font-size: 11px; }
      .auth-form { padding: 16px 16px 18px; gap: 12px; }
      .auth-field input { font-size: 16px; padding: 10px 12px; }
      .auth-submit { padding: 12px 14px; font-size: 14px; }
    }

    /* ── 소형 모바일 (iPhone SE 등 380px 이하) ─────────── */
    @media (max-width: 380px) {
      #root {
        padding:
          max(52px, calc(44px + env(safe-area-inset-top)))
          max(10px, env(safe-area-inset-right))
          max(24px, env(safe-area-inset-bottom))
          max(10px, env(safe-area-inset-left));
      }
      #userBar {
        top: max(8px, env(safe-area-inset-top));
        right: max(8px, env(safe-area-inset-right));
        gap: 4px;
      }
      .user-btn { padding: 5px 8px; font-size: 10px; }
      #userBadge { padding: 4px 6px 4px 8px; font-size: 11px; }
      #logoIcon { width: 28px; height: 28px; }
      #logoRow { gap: 8px; }
      #logoText { letter-spacing: 1.5px; }
      #tagline { font-size: 9px; letter-spacing: 1.2px; }
      .ws-name { font-size: 13px; }
      .ws-date { font-size: 9px; }
      .ws-enter-btn { padding: 6px 16px; font-size: 11px; }
      .ws-add-plus { font-size: 52px; }
    }

    /* ── 가로 모바일 (낮은 높이) — 헤더·여백 압축으로 카드 노출 확보 */
    @media (max-width: 900px) and (orientation: landscape) and (max-height: 480px) {
      #root { padding-top: 48px; padding-bottom: 20px; }
      #header { margin-bottom: 10px; }
      #logoRow { margin-bottom: 4px; }
      .header-divider { margin-top: 6px; }
      #tagline { font-size: 9px; }
      #wsLabel { margin-bottom: 6px; }
    }
