/* 서비스 공통 셸 (site-shell.js) — 탑툰챗형: 위 고정 헤더 64px · 왼쪽 메뉴 256px · 모바일 하단 탭 64px. 다른 CSS보다 뒤에 읽는다. */
body.site-shell{background:var(--bg);color:var(--fg)}
body.site-shell .discovery{max-width:none;margin:0;padding:88px 24px 48px 280px;overflow-x:clip;--soft:var(--fg-2)}
body.site-shell .discovery-content{max-width:2060px;margin:0 auto}
body.site-shell .browse-nav,body.site-shell .discovery-footer{display:none}
/* 새로고침 때 화면이 여러 번 바뀌지 않게(10-22 고객): browse-shell.js의 옛 틀이 먼저 그려지지 않도록 모든 스크립트가 끝날 때까지(site-shell.js shell-ready) 숨긴다.
   화면 모듈이 첫 데이터까지 기다리게 할 땐 body.shell-wait(character-page.js). 스크립트가 실패해도 3초 뒤엔 보인다 */
body.browsing:is(:not(.shell-ready),.shell-wait) .discovery{visibility:hidden;animation:shell-reveal 0s 3s forwards}
@keyframes shell-reveal{to{visibility:visible}}
/* 자리 표시: 캐릭터 목록이 오기 전 빈 카드 — home-rails.js placeholder · discover.js 목록 · 왼쪽 '추천 캐릭터' */
.skeleton-card,.skeleton-line{background:var(--card);animation:skeleton-pulse 1.6s ease-in-out infinite}
.skeleton-card::before,.skeleton-card .story-cover::after{display:none}
.story-card.skeleton-card{pointer-events:none}
.skeleton-line{display:block;width:140px;max-width:100%;border-radius:6px;color:transparent}
.shell-row .skeleton-line{width:64px;margin:1px 0}.shell-row small.skeleton-line{width:96px}
@keyframes skeleton-pulse{50%{opacity:.5}}
@media(prefers-reduced-motion:reduce){.skeleton-card,.skeleton-line{animation:none}}

/* 헤더 */
body.site-shell .site-top{position:fixed;z-index:50;top:0;left:0;right:0;height:64px;min-height:0;box-sizing:border-box;display:flex;align-items:center;gap:8px;padding:0 16px;margin:0;background:#14151799;backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border-bottom:1px solid var(--line)}
body.site-shell .site-top>.top-ticket{margin-right:0}
body.site-shell .site-top>.brand{display:flex;flex:none;align-items:center;min-width:0;margin-right:auto;font-size:0}
body.site-shell .site-top>.brand .allochat-logo{display:block;height:32px;width:auto;max-width:none}
/* 툰인 전용 주소(html[data-site=drama], ADR-030): 로고 자리 글자 · 캐릭터 검색·만들기 숨김 */
body.site-shell .toon-brand{font:800 22px/1 var(--font-sans);letter-spacing:-.03em;color:var(--fg)}
html[data-site=drama] body.site-shell .story-search,html[data-site=drama] body.site-shell .site-top .studio-button{display:none}
body.site-shell .site-top .brand-tagline{display:none}
.top-menu{display:none;place-items:center;width:32px;height:32px;margin-left:-4px;padding:0;border:0;border-radius:10px;background:none;color:var(--fg);cursor:pointer}
.top-menu svg{width:20px;height:20px}
/* 검색창은 헤더 흐름 안에서 남는 폭만 쓴다(가운데 고정이면 좁은 창에서 오른쪽 코인·버튼을 덮음) */
body.site-shell .story-search{position:relative;flex:0 1 416px;min-width:150px;margin:0 auto;height:40px;box-sizing:border-box;padding:0 16px;gap:12px;border:0;border-radius:999px;background:var(--card);transition:background .15s}
body.site-shell .story-search:hover{background:#2a2c2f}
body.site-shell .story-search:focus-within{outline:0;box-shadow:0 0 0 2px #e637404d}
body.site-shell .story-search>span{display:grid;place-items:center;color:var(--fg-2);font-size:0}
body.site-shell .story-search>span svg{width:16px;height:16px}
body.site-shell .story-search input{font:500 13.5px var(--font-sans);letter-spacing:-.01em;color:var(--fg)}
body.site-shell .story-search input::placeholder{color:#c9cedc99}
body.site-shell .story-search kbd{flex:none;height:24px;display:inline-flex;align-items:center;padding:0 8px;border:0;border-radius:8px;background:var(--tile);color:var(--fg-2);font:700 11px ui-monospace,Consolas,monospace}
.top-coin{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 14px 0 10px;border-radius:14px;background:var(--card);font-size:14px;font-weight:700;white-space:nowrap}
.top-coin[hidden]{display:none}
.coin-mark{width:20px;height:20px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff1b8,#f7bd22 55%,#c88a05);box-shadow:inset 0 0 0 2px #ffd862}
body.site-shell .site-top .studio-button,body.site-shell .site-top .account-button,body.site-shell .site-top .allochat-manage{display:inline-flex;align-items:center;gap:6px;height:40px;padding:0 16px;border:0;border-radius:14px;background:none;color:var(--fg);font:700 13.5px var(--font-sans);white-space:nowrap;cursor:pointer;text-decoration:none}
body.site-shell .site-top .studio-button:hover,body.site-shell .site-top .account-button:hover,body.site-shell .site-top .allochat-manage:hover{background:var(--tile)}
body.site-shell .site-top .studio-button svg{width:16px;height:16px}
body.site-shell .site-top .account-button{order:5}
body.site-shell .site-top .allochat-manage{order:4;color:var(--fg-2)}

/* 왼쪽 메뉴 */
body.site-shell .platform-rail{top:64px;left:0;width:256px;box-sizing:border-box;padding:12px 0 16px;gap:0;background:var(--bg);border-right:1px solid #373a3f80;overflow-y:auto;scrollbar-width:none;z-index:30}
body.site-shell .platform-rail::-webkit-scrollbar{display:none}
.shell-nav{display:flex;flex-direction:column;gap:4px;padding:0 16px}
body.site-shell .shell-nav a.shell-link{display:flex;align-items:center;gap:12px;height:40px;box-sizing:border-box;padding:0 12px;border-radius:10px;color:var(--fg-2);font-size:14px;font-weight:700;text-decoration:none}
.shell-link svg{width:20px;height:20px;flex:none}
body.site-shell .shell-nav a.shell-link:hover{background:var(--card);color:var(--fg)}
body.site-shell .shell-nav a.shell-link[aria-current]{background:var(--tile);color:var(--fg)}
.shell-divider{height:1px;margin:16px 20px;border:0;background:var(--line)}
.shell-widgets{display:flex;flex-direction:column;gap:12px;padding:0 16px}
.shell-widget{padding:12px;border-radius:14px}
.shell-widget[hidden]{display:none}
.shell-widget+.shell-widget{border-top:1px solid var(--line);border-radius:0 0 14px 14px;padding-top:20px}
.shell-widget-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.shell-widget-head strong{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:700}
.live-dot{width:6px;height:6px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 3px #e6374033}
.shell-more-link{font-size:11px;font-weight:600;color:var(--fg-2);text-decoration:none}
.shell-more-link:hover{color:var(--fg)}
.shell-rows{display:flex;flex-direction:column;gap:4px}
.shell-row{display:flex;align-items:center;gap:10px;margin:0 -6px;padding:6px;border-radius:10px;color:var(--fg);text-decoration:none}
.shell-row:hover{background:var(--card)}
.shell-avatar{flex:none;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;overflow:hidden;background:var(--card);color:var(--fg-2);font-size:12px}
.shell-avatar img{width:100%;height:100%;object-fit:cover;object-position:center top}
.shell-row-copy{min-width:0;flex:1;display:flex;flex-direction:column}
.shell-row-name{display:flex;align-items:center;gap:4px;min-width:0}
.shell-row-name b{font-size:13px;font-weight:700;line-height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shell-row-copy small{font-size:11px;font-weight:500;color:var(--fg-2);line-height:17px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shell-more{display:flex;align-items:center;justify-content:center;height:32px;margin-top:8px;border:1px solid var(--line);border-radius:999px;color:var(--fg-2);font-size:12px;font-weight:600;text-decoration:none}
.shell-more:hover{background:var(--card);color:var(--fg)}
.shell-foot{display:flex;flex-wrap:wrap;gap:6px 12px;padding:20px 28px 8px;margin-top:auto}
.shell-company{flex-basis:100%;font-size:10.5px;line-height:1.5;color:var(--fg-3);word-break:keep-all}
.shell-foot a{font-size:11px;color:var(--fg-3);text-decoration:none}
.shell-foot a:hover{color:var(--fg-2)}
.shell-scrim{display:none}

/* 공통 뱃지(탑툰형: 검정 바탕 · 색 테두리 · 6px 0 모서리) */
.tt-badge{display:inline-flex;align-items:center;width:fit-content;padding:2px 6px;border:1px solid;border-radius:6px 0;background:#0a0a0a;font-size:10px;font-style:normal;font-weight:900;line-height:1.1;white-space:nowrap}
.tt-badge.new{color:#ff416f;border-color:#ff416f80}
.tt-badge.original{color:#00ddca;border-color:#00ddca80}
.tt-badge.multi{color:#ffc11b;border-color:#ffc11b80}
.tt-badge.ep{color:#00ddca;border-color:#00ddca80}
/* SALE 표지(10-19): 탑툰처럼 카드 오른쪽 위 대각선 띠 — 부모(카드 그림)가 overflow:hidden이라 띠 끝이 잘려 모서리에 걸린다 */
.tt-sale{position:absolute;z-index:2;top:12px;right:-28px;width:104px;padding:3px 0;transform:rotate(45deg);background:#ff5a1f;color:#fff;font-size:11px;font-weight:900;line-height:1.2;letter-spacing:.5px;text-align:center;box-shadow:0 1px 4px #0006;pointer-events:none}
.tt-badges .cover-label{position:static}

/* 이야기 목록(발견·홈 아래 · 내 서재): 탑툰형 3:4 카드, 글자는 그림 위 */
body.site-shell .catalog-heading{margin:0 0 12px;align-items:center}
body.site-shell .catalog-heading h2{font-size:22px;font-weight:700;letter-spacing:-.025em}
body.site-shell .catalog-heading .catalog-create{border-radius:14px}
body.site-shell .catalog-modes,body.site-shell .shelf-tabs{display:flex;gap:8px;padding:12px 0;margin:0 0 24px;border-bottom:1px solid #373a3f4d;overflow-x:auto;scrollbar-width:none}
body.site-shell .catalog-modes button,body.site-shell .shelf-tabs button{display:inline-flex;align-items:center;gap:6px;flex:none;height:36px;padding:0 16px;border:0;border-radius:999px;background:#2123259a;color:var(--fg-2);font:500 14px var(--font-sans);white-space:nowrap;cursor:pointer}
body.site-shell .catalog-modes button::after,body.site-shell .shelf-tabs button::after{display:none}
body.site-shell .catalog-modes button svg,body.site-shell .shelf-tabs button svg{display:none}
body.site-shell .catalog-modes button[aria-pressed=true],body.site-shell .shelf-tabs button[aria-pressed=true]{background:#fff;color:var(--bg)}
body.site-shell .catalog-controls{display:none}
body.site-shell .catalog .catalog-note{margin:-12px 0 16px;font-size:13px;color:var(--fg-2)}
body.site-shell .story-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}
body.site-shell .story-card{position:relative;display:block;border-radius:14px;overflow:hidden;background:var(--card);transition:transform .3s ease-out,box-shadow .3s}
body.site-shell .story-card:hover{transform:translateY(-4px);box-shadow:0 10px 15px -3px #00000040}
body.site-shell .story-cover{aspect-ratio:3/4;border-radius:14px;background:var(--card)}
body.site-shell .story-cover img{object-position:center top;transition:transform .5s ease-out}
body.site-shell .story-card:hover .story-cover img{transform:none}
body.site-shell .story-cover::after{inset:50% 0 0;background:linear-gradient(to top,#000c,#0006 50%,transparent)}
body.site-shell .cover-label{top:8px;left:8px;padding:2px 6px;border:1px solid #00ddca80;border-radius:6px 0;background:#0a0a0a;color:#00ddca;font-size:10px;font-weight:900;letter-spacing:0;line-height:1.1}
body.site-shell .cover-action,body.site-shell .card-character,body.site-shell .card-tags{display:none}
body.site-shell .story-card h3{position:absolute;z-index:1;left:12px;right:12px;bottom:39px;margin:0;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0;color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.site-shell .card-description{position:absolute;z-index:1;left:12px;right:12px;bottom:20px;min-height:0;margin:0;font-size:11px;font-weight:600;line-height:1.375;color:#fff9;-webkit-line-clamp:1}
body.site-shell .story-card:has(.rank-count) .card-description{bottom:34px}
body.site-shell .story-card:has(.rank-count) h3{bottom:53px}
body.site-shell .rank-count{position:absolute;z-index:1;left:12px;bottom:12px;font-size:10px;font-weight:700;color:#ffffff80}
body.site-shell .rank-number{z-index:1}
body.site-shell .catalog-empty{grid-column:1/-1}
body.site-shell .shelf-archives h1{margin:0 0 6px;font-size:22px;letter-spacing:-.025em}
body.site-shell .shelf-archives h2{margin:32px 0 8px}
body.site-shell .shelf-archives .shelf-entry,body.site-shell .reading-shelf .shelf-entry{border-radius:14px;background:var(--card);border:0}

/* 버튼 글자: 빨강 위 흰 글자 */
body.site-shell :is(.feature-cta,.banner-cta,.cp-cta,.character-talk,.model-apply,.chat-settings-save){color:var(--on-accent)}

@media(max-width:1279px){body.site-shell .story-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1023px){body.site-shell .story-grid{grid-template-columns:repeat(3,minmax(0,1fr))}body.site-shell .story-search kbd{display:none}body.site-shell .site-top .studio-button span{display:none}body.site-shell .site-top .studio-button{padding:0 12px}}
@media(max-width:767px){
  body.site-shell .discovery{padding:80px 16px 96px}
  .top-menu{display:grid}
  body.site-shell .site-top{gap:4px}
  body.site-shell .site-top>.brand .allochat-logo{height:28px}
  body.site-shell .story-search,body.site-shell .site-top .allochat-manage,body.site-shell .site-top .studio-button{display:none}
  body.site-shell[data-view=stories] .story-search{display:flex;position:fixed;top:72px;left:16px;right:16px;width:auto;transform:none;z-index:40}
  body.site-shell[data-view=stories] .discovery{padding-top:128px}
  .top-coin{height:36px;padding:0 10px 0 8px;font-size:13px}
  body.site-shell .site-top .account-button{padding:0 12px}
  body.site-shell .platform-rail{display:flex;top:0;bottom:0;transform:translateX(-100%);transition:transform .2s ease;z-index:60;padding-top:20px;width:min(280px,82vw)}
  body.site-shell.rail-open .platform-rail{transform:none;box-shadow:0 0 40px #000a}
  body.site-shell.rail-open .shell-scrim{display:block;position:fixed;inset:0;z-index:55;border:0;background:#0009}
  body.site-shell .mobile-nav{display:flex;position:fixed;z-index:50;left:0;right:0;bottom:0;height:auto;box-sizing:content-box;padding:0 0 env(safe-area-inset-bottom);background:#141517e6;backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border-top:1px solid #373a3f80;justify-content:space-around}
  body.site-shell .mobile-nav a.mobile-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:64px;height:64px;padding:0;color:var(--fg-2);font-size:10px;text-decoration:none}
  body.site-shell .mobile-nav a.mobile-tab svg{width:24px;height:24px}
  body.site-shell .mobile-nav a.mobile-tab span{font-size:10px}
  body.site-shell .mobile-nav a.mobile-tab[aria-current]{color:var(--fg);font-weight:600}
  body.site-shell .story-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  body.site-shell .catalog-heading h2{font-size:18px}
}
/* 웹툰·웹소설 준비 중 안내(10-19): 메뉴 클릭 토스트 + reader 페이지 빈 상태 */
.shell-toast{position:fixed;left:50%;bottom:calc(84px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:1000;max-width:calc(100vw - 32px);padding:12px 20px;border-radius:var(--radius-pill);background:var(--card);border:1px solid var(--line);color:var(--fg);font-size:14px;font-weight:600;box-shadow:0 8px 24px rgba(0,0,0,.25);pointer-events:none}
.shell-toast[hidden]{display:none}
.coming-soon{display:flex;flex-direction:column;align-items:center;gap:12px;padding:120px 16px;text-align:center}
.coming-soon h1{margin:0;font-size:22px}
.coming-soon p{margin:0;color:var(--fg-3)}
.coming-soon-link{margin-top:8px;padding:10px 20px;border-radius:999px;background:var(--accent);color:var(--on-accent);font-weight:700;text-decoration:none}
