@charset "utf-8";
/* 작품별 리뷰 타래
   ── 디자인을 바꿀 때는 먼저 아래 토큰부터. 색은 사이트 디자인 설정(var(--primary-color) 등)을 따르고,
      설정이 없을 때만 괄호 안 기본값을 쓴다.
   ── 구획: 토큰 / 공용 조각 / 작성 창 / 목록 / 작품 화면 / 타래 / 기타 / 두 칸 배치 / 좁은 화면 */

/* ============================================================
   토큰
============================================================ */
.ot-board {
    --ot-accent: var(--primary-color, #e2574c);
    --ot-text: var(--text-primary, #1f1f22);
    --ot-muted: var(--text-muted, #8b8b92);
    --ot-line: var(--border-light, rgba(127, 127, 140, .22));
    --ot-surface: var(--card-bg-color, #fff);
    --ot-soft: color-mix(in srgb, var(--ot-text) 5%, var(--ot-surface)); /* 불투명 — 사이트 배경 무늬가 비치지 않게 */
    --ot-radius: var(--card-border-radius, 16px);
    --ot-radius-sm: 10px;
    --ot-star: #f4b400;
    --ot-heart: #f0476a;
    --ot-font-size: 15px;

    /* 판 — 작성 창·카드 목록·옆 칸 묶음·타래처럼 사이트 배경 위에 바로 놓이는 덩어리 */
    --ot-panel-bg: var(--ot-surface);
    --ot-panel-border: 1px solid var(--ot-line);
    --ot-panel-radius: var(--ot-radius);
    --ot-panel-pad: 16px;
    --ot-panel-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    --ot-block-gap: 14px;     /* 판과 판 사이 */

    --ot-avatar: 40px;
    --ot-poster: 64px;        /* 목록 카드 포스터 너비 */
    --ot-poster-head: 108px;  /* 작품 화면 포스터 너비 (한 칸일 때) */
    --ot-gap: 12px;

    /* 두 칸 배치 — 게시판 폭이 --ot-split 이상이면 본문 + 옆 칸 */
    --ot-main-w: 620px;       /* 본문 칸 최대 너비 (리뷰 한 줄이 읽기 편한 길이) */
    --ot-side-w: 260px;       /* 옆 칸 너비 */
    --ot-col-gap: 40px;
    --ot-sticky-top: 16px;    /* 작품 화면 옆 칸이 멈추는 위치 — 사이트 머리가 고정이면 그 높이만큼 */

    container-type: inline-size;
    max-width: var(--ot-width, 960px);
    margin: 0 auto;
    padding: 8px 0 40px;
    color: var(--ot-text);
    font-size: var(--ot-font-size);
}
/* 초기화는 :where() 로 감싸 우선순위 0 — 아래 컴포넌트 규칙이 항상 이긴다 */
:where(.ot-board) *, :where(.ot-board) *::before, :where(.ot-board) *::after { box-sizing: border-box; }
:where(.ot-board) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; box-shadow: none; }
:where(.ot-board) input, :where(.ot-board) select, :where(.ot-board) textarea { font: inherit; color: inherit; }
:where(.ot-board) [hidden] { display: none !important; }

/* ============================================================
   공용 조각 — 아바타 / 포스터 / 별점 / 분류 / 버튼
============================================================ */
.ot-avatar {
    width: var(--ot-avatar);
    height: var(--ot-avatar);
    flex: none;
    border-radius: 50%;
    overflow: hidden;
    background: var(--ot-soft);
    display: grid;
    place-items: center;
    color: var(--ot-muted);
    font-size: calc(var(--ot-avatar) * .9);
}
.ot-avatar img { width: 100%; height: 100%; object-fit: cover; }

.ot-poster {
    width: var(--ot-poster);
    aspect-ratio: 2 / 3;
    flex: none;
    border-radius: 8px;
    overflow: hidden;
    background: var(--ot-soft);
    display: grid;
    place-items: center;
    color: var(--ot-muted);
    font-weight: 700;
    font-size: calc(var(--ot-poster) * .38);
}
.ot-poster img { width: 100%; height: 100%; object-fit: cover; }

.ot-rate { display: inline-flex; gap: 1px; font-size: 11px; color: var(--ot-star); vertical-align: middle; white-space: nowrap; }
.ot-rate .is-off { color: var(--ot-line); }
.ot-rate.is-watching {
    font-size: 11px;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 99px;
    color: var(--ot-accent);
    border: 1px solid color-mix(in srgb, var(--ot-accent) 45%, transparent);
}

.ot-ca { font-size: 12px; color: var(--ot-accent); font-weight: 600; }
.ot-count { color: var(--ot-muted); font-size: 13px; white-space: nowrap; }

.ot-btn {
    height: 34px;
    padding: 0 16px;
    border-radius: 99px;
    background: var(--ot-accent) !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: opacity .15s, transform .1s;
}
.ot-btn:active { transform: scale(.97); }
.ot-btn-ghost { background: transparent !important; color: var(--ot-muted) !important; }

.ot-act {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    min-width: 28px;
    padding: 0 6px;
    border-radius: 99px;
    color: var(--ot-muted) !important;
    font-size: 13px;
    text-decoration: none !important;
    transition: background .15s, color .15s;
}
.ot-act:hover { background: var(--ot-soft); color: var(--ot-text) !important; }

/* ============================================================
   작성 창 — data-mode="new"(목록) | "thread"(이어 쓰기) | "edit"(수정)
============================================================ */
.ot-composer { display: flex; gap: var(--ot-gap); }
.ot-composer-main { flex: 1; min-width: 0; }

.ot-composer[data-mode="thread"] .ot-composer-main,
.ot-composer[data-mode="edit"] {
    padding: 10px 12px;
    border-radius: var(--ot-radius-sm);
    background: var(--ot-soft);
}
.ot-composer[data-mode="edit"] { display: block; margin: 6px 0; }

.ot-composer textarea {
    display: block;
    width: 100%;
    min-height: 26px;
    padding: 4px 0;
    border: 0;
    outline: 0;
    background: transparent;
    resize: none;
    overflow: hidden;
    line-height: 1.6;
}
.ot-composer textarea::placeholder, .ot-title-input::placeholder { color: var(--ot-muted); }

/* 스포일러로 표시한 글 — 작성 중에도 가려질 글임을 보여준다 */
.ot-composer.is-spoiler textarea {
    background: repeating-linear-gradient(-45deg, transparent 0 8px, var(--ot-soft) 8px 16px);
    border-radius: 6px;
    padding: 4px 8px;
}
.ot-composer.is-drop { outline: 2px dashed var(--ot-accent); outline-offset: 2px; }
.ot-composer.is-busy .ot-btn[type="submit"] { opacity: .5; pointer-events: none; }
.ot-composer.is-nudge .ot-composer-main { animation: ot-nudge .3s ease; }
@keyframes ot-nudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* 작품 고르기 줄 (목록 작성 창) */
.ot-composer-work {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--ot-line);
}
.ot-composer-work .ot-poster { --ot-poster: 36px; font-size: 14px; }
.ot-title-input {
    flex: 1;
    min-width: 0;
    height: 34px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 17px;
    font-weight: 700;
}
.ot-ca-select, .ot-work-form select {
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--ot-line);
    border-radius: 99px;
    background: var(--ot-surface);
    font-size: 13px;
}
/* 이미 있는 작품을 고르면 그 작품 포스터가 붙고, 테두리로 '이어 쓰기'임을 알린다 */
.ot-composer.is-linked .ot-composer-work .ot-poster { box-shadow: 0 0 0 2px var(--ot-accent); }

.ot-poster-pick { cursor: pointer; position: relative; }
.ot-poster-pick > i { font-size: 14px; }
.ot-poster-pick img + i { display: none; }
.ot-poster-pick.is-loading img, .ot-composer-img.is-loading img { opacity: .4; }
.ot-composer.is-linked .ot-poster-pick { cursor: default; }

/* 첨부 이미지 */
.ot-composer-imgs { display: flex; flex-wrap: wrap; gap: 6px; }
.ot-composer-imgs:not(:empty) { margin: 6px 0; }
.ot-composer-img { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--ot-soft); }
.ot-composer-img img { width: 100%; height: 100%; object-fit: cover; }
.ot-composer-img button {
    position: absolute; top: 3px; right: 3px;
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(0, 0, 0, .6) !important; color: #fff !important; font-size: 11px;
}

/* 아래 막대: 별점 · 도구 · 게시 */
.ot-composer-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }
.ot-rate-pick { display: inline-flex; align-items: center; }
.ot-rate-pick button { width: 24px; height: 28px; color: var(--ot-line) !important; font-size: 15px; transition: color .1s, transform .1s; }
.ot-rate-pick button.is-on, .ot-rate-pick button.is-hover { color: var(--ot-star) !important; }
.ot-rate-pick button:active { transform: scale(.85); }
.ot-rate-pick .ot-rate-watching {
    width: auto;
    height: 24px;
    margin-left: 6px;
    padding: 0 9px;
    border-radius: 99px;
    border: 1px solid var(--ot-line) !important;
    color: var(--ot-muted) !important;
    font-size: 12px;
}
.ot-rate-pick .ot-rate-watching.is-on,
.ot-rate-pick .ot-rate-watching.is-hover { color: var(--ot-accent) !important; border-color: var(--ot-accent) !important; }

.ot-tools { display: inline-flex; gap: 2px; }
.ot-tool { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--ot-muted) !important; cursor: pointer; }
.ot-tool:hover { background: var(--ot-soft); }
.ot-tool[aria-pressed="true"] { color: var(--ot-accent) !important; background: color-mix(in srgb, var(--ot-accent) 12%, transparent); }

.ot-composer-submit { margin-left: auto; display: inline-flex; gap: 4px; }

/* ============================================================
   목록 — 머리말 / 분류·검색 / 작품 카드
============================================================ */
.ot-board-head { margin-bottom: 16px; }

.ot-filter { display: flex; align-items: center; gap: 10px; }
.ot-cats { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.ot-cats::-webkit-scrollbar { display: none; }
.ot-cats a {
    flex: none;
    padding: 6px 12px;
    border-radius: 99px;
    color: var(--ot-muted);
    font-size: 13px;
    text-decoration: none;
    background: var(--ot-soft);
    transition: background .15s, color .15s;
}
.ot-cats a small { font-size: 11px; opacity: .7; margin-left: 2px; }
.ot-cats a.is-on { background: var(--ot-text); color: var(--ot-surface); }

.ot-search { position: relative; margin-left: auto; flex: none; }
.ot-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ot-muted); font-size: 12px; pointer-events: none; }
.ot-search input {
    width: 120px;
    height: 32px;
    padding: 0 10px 0 30px;
    border-radius: 99px;
    border: 1px solid var(--ot-line);
    background: var(--ot-surface);
    outline: 0;
    font-size: 13px;
    transition: width .2s, border-color .2s;
}
.ot-search input:focus { width: 180px; border-color: var(--ot-accent); }

.ot-cards { display: flex; flex-direction: column; }
.ot-card {
    display: flex;
    gap: 14px;
    padding: 14px 8px;
    border-bottom: 1px solid var(--ot-line);
    color: inherit !important;
    text-decoration: none !important;
    border-radius: var(--ot-radius-sm);
    transition: background .15s;
}
.ot-card:hover { background: var(--ot-soft); }
.ot-card.is-notice .ot-card-title::before { content: "\f08d"; font: var(--fa-font-solid); margin-right: 6px; color: var(--ot-accent); }
.ot-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ot-card-head { display: flex; align-items: center; gap: 8px; }
.ot-card-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ot-card-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ot-muted); }
.ot-card-snippet {
    margin: 2px 0 0;
    color: var(--ot-text);
    opacity: .8;
    line-height: 1.55;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ot-card-snippet.is-spoiler, .ot-card-imgs.is-spoiler { filter: blur(5px); transition: filter .2s; }
.ot-card:hover .ot-card-snippet.is-spoiler, .ot-card:hover .ot-card-imgs.is-spoiler { filter: none; }
.ot-card-imgs { display: flex; gap: 4px; margin-top: 4px; }
.ot-card-imgs img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--ot-soft); }

.ot-empty { padding: 48px 0; text-align: center; color: var(--ot-muted); font-size: 28px; }
.ot-pages { text-align: center; }
.ot-admin { align-self: flex-end; color: var(--ot-muted) !important; }

/* ============================================================
   작품 화면 — 머리
============================================================ */
.ot-back {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 8px;
    border-radius: 50%;
    color: var(--ot-text) !important;
}
.ot-back:hover { background: var(--ot-soft); }

.ot-work {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 18px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--ot-line);
}
.ot-work-poster { --ot-poster: var(--ot-poster-head); border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.ot-work-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ot-work-title { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 800; word-break: keep-all; }
.ot-work-meta { display: flex; align-items: center; gap: 10px; }
.ot-work-meta .ot-rate { font-size: 14px; }
.ot-work-tools { position: absolute; top: 0; right: 0; display: flex; gap: 2px; }

.ot-work.is-editing > :not(.ot-work-form) { display: none; }
.ot-work-form { display: flex; gap: 14px; width: 100%; }
.ot-work-form .ot-poster { --ot-poster: 72px; }
.ot-work-form-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ot-work-form input[type="text"] {
    height: 40px;
    border: 0;
    border-bottom: 1px solid var(--ot-line);
    background: transparent;
    outline: 0;
    font-size: 20px;
    font-weight: 700;
}
.ot-work-form select { align-self: flex-start; }
.ot-row-end { display: flex; justify-content: flex-end; gap: 4px; margin-top: auto; }

/* ============================================================
   타래 — 리뷰가 세로선으로 이어지고, 마지막에 작성 창이 붙는다
============================================================ */
.ot-thread { display: flex; flex-direction: column; }

.ot-entry { position: relative; display: flex; gap: var(--ot-gap); padding-bottom: 18px; border-radius: var(--ot-radius-sm); }
.ot-entry::before {
    content: "";
    position: absolute;
    left: calc(var(--ot-avatar) / 2 - 1px);
    top: calc(var(--ot-avatar) + 4px);
    bottom: 2px;
    width: 2px;
    border-radius: 2px;
    background: var(--ot-line);
}
.ot-entry:last-child::before { display: none; }
.ot-entry-main { flex: 1; min-width: 0; }

.ot-entry-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-height: 24px; }
.ot-entry-name { font-weight: 700; }
.ot-entry-time { color: var(--ot-muted) !important; font-size: 13px; text-decoration: none !important; }
.ot-entry-secret { color: var(--ot-muted); font-size: 11px; }

.ot-entry-body { position: relative; margin-top: 2px; }
.ot-text { line-height: 1.65; word-break: break-word; overflow-wrap: anywhere; }
.ot-text img { max-width: 100%; height: auto; border-radius: var(--ot-radius-sm); cursor: zoom-in; }
.ot-text iframe { max-width: 100%; border-radius: var(--ot-radius-sm); }

/* 이미지 묶음 — 1장 / 2장 / 3장(왼쪽 큰 것) / 4장 */
.ot-imgs { display: grid; gap: 4px; margin-top: 8px; border-radius: 14px; overflow: hidden; grid-template-columns: 1fr 1fr; grid-auto-rows: 160px; }
.ot-imgs img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; background: var(--ot-soft); }
.ot-imgs[data-count="1"] { grid-template-columns: 1fr; grid-auto-rows: auto; width: fit-content; max-width: 100%; }
.ot-imgs[data-count="1"] img { max-height: 460px; width: auto; max-width: 100%; }
.ot-imgs[data-count="3"] img:first-child { grid-row: span 2; }

/* 스포일러 — 가린 채로 두고 누르면 열린다 */
.ot-entry.is-spoiler:not(.is-revealed) .ot-entry-body { min-height: 52px; }
.ot-entry.is-spoiler:not(.is-revealed) .ot-text,
.ot-entry.is-spoiler:not(.is-revealed) .ot-imgs,
.ot-entry.is-spoiler:not(.is-revealed) .ot-quote { filter: blur(9px); user-select: none; pointer-events: none; }
.ot-spoiler-cover {
    position: absolute;
    inset: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--ot-muted) !important;
    font-size: 13px;
}
.ot-entry.is-revealed .ot-spoiler-cover { display: none !important; }

.ot-entry-actions { display: flex; gap: 2px; margin: 4px 0 0 -6px; }
.ot-like.is-on { color: var(--ot-heart) !important; }
.ot-like.is-on i { animation: ot-pop .3s var(--motion-ease-pop, ease); }
@media (hover: hover) {
    .ot-entry-actions [data-act="edit"], .ot-entry-actions [data-act="delete"] { opacity: 0; transition: opacity .15s; }
    .ot-entry:hover .ot-entry-actions [data-act] { opacity: 1; }
}
.ot-entry.is-editing .ot-entry-body,
.ot-entry.is-editing .ot-entry-actions { display: none; }

.ot-locked { display: flex; align-items: center; gap: 8px; color: var(--ot-muted); padding: 4px 0; }
.ot-unlock { display: flex; gap: 4px; }
.ot-unlock input { width: 120px; height: 28px; padding: 0 10px; border: 1px solid var(--ot-line); border-radius: 99px; background: var(--ot-surface); outline: 0; }
.ot-unlock button { width: 28px; height: 28px; border-radius: 50%; background: var(--ot-soft) !important; }

/* 이어 쓰기 창도 타래의 한 칸 */
.ot-thread > .ot-composer { margin-top: 0; }

/* ── 인용 — 리뷰 안 작은 카드 / 이어 쓰기 창 위 칩 ── */
.ot-quote {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
    padding: 8px 12px;
    border: 1px solid var(--ot-line);
    border-radius: var(--ot-radius-sm);
    color: inherit !important;
    text-decoration: none !important;
    font-size: 13px;
    transition: background .15s;
}
.ot-quote:hover { background: var(--ot-soft); }
.ot-quote-meta { color: var(--ot-muted); font-size: 12px; }
.ot-quote-meta i, .ot-quote-chip > i { color: var(--ot-accent); margin-right: 2px; }
.ot-quote-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.ot-quote.is-spoiler .ot-quote-text { filter: blur(4px); }

.ot-quote-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 4px 6px 4px 10px;
    border-radius: 99px;
    background: var(--ot-surface);
    border: 1px solid var(--ot-line);
    font-size: 12px;
    color: var(--ot-muted);
}
.ot-quote-chip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ot-quote-chip button { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.ot-quote-chip button:hover { background: var(--ot-soft); }

/* ── 답글 — 리뷰 아래 접혀 있다가 펼치면 들여쓴 목록 + 한 줄 입력 ── */
.ot-reply-toggle[aria-expanded="true"] { color: var(--ot-accent) !important; }
.ot-replies {
    margin: 6px 0 2px;
    padding-left: 12px;
    border-left: 2px solid var(--ot-line);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ot-reply { --ot-avatar: 24px; display: flex; gap: 8px; font-size: 14px; border-radius: 8px; }
.ot-reply.is-editing { opacity: .45; }
.ot-reply-main { flex: 1; min-width: 0; }
.ot-reply-meta { display: flex; align-items: center; gap: 6px; min-height: 24px; }
.ot-reply-meta time { color: var(--ot-muted); font-size: 12px; }
.ot-reply-acts { display: inline-flex; margin-left: auto; }
.ot-reply-acts .ot-act { height: 24px; min-width: 24px; font-size: 11px; }
@media (hover: hover) {
    .ot-reply-acts { opacity: 0; transition: opacity .15s; }
    .ot-reply:hover .ot-reply-acts { opacity: 1; }
}
.ot-reply-text { line-height: 1.55; word-break: break-word; overflow-wrap: anywhere; }
.ot-reply-text > .fa-lock { color: var(--ot-muted); font-size: 12px; }

.ot-reply-form {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 4px 4px 4px 12px;
    border-radius: 18px;
    background: var(--ot-soft);
}
.ot-reply-form.is-editing { box-shadow: 0 0 0 1.5px var(--ot-accent); }
.ot-reply-form textarea {
    flex: 1;
    min-width: 0;
    min-height: 28px;
    padding: 4px 0;
    border: 0;
    outline: 0;
    background: transparent;
    resize: none;
    overflow: hidden;
    line-height: 1.45;
    font-size: 14px;
}
.ot-reply-form textarea::placeholder { color: var(--ot-muted); }
.ot-reply-form .ot-tool { width: 28px; height: 28px; flex: none; }
.ot-reply-send { color: var(--ot-accent) !important; }

/* ============================================================
   기타 — 방금 쓴 글 / 링크로 찾아온 글 / 이미지 확대 / 예전 글 꾸밈
============================================================ */
.ot-entry:target, .is-new { animation: ot-flash 1.6s ease; }
@keyframes ot-flash {
    0%, 30% { background: color-mix(in srgb, var(--ot-accent) 12%, transparent); }
    100% { background: transparent; }
}
@keyframes ot-pop {
    50% { transform: scale(1.35); }
}

.ot-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, .85);
    cursor: zoom-out;
}
.ot-lightbox[hidden] { display: none; }
.ot-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

.ot-toggle { margin: 6px 0; padding: 8px 12px; border-radius: var(--ot-radius-sm); background: var(--ot-soft); }
.ot-toggle summary { cursor: pointer; font-weight: 600; }
.ot-inline-img { max-width: 100%; }

/* ============================================================
   판 — 사이트 배경(무늬·사진 등) 위에 바로 놓이는 덩어리는 모두 같은 판을 깐다
   모양은 토큰(--ot-panel-*)에서만 바꾼다
============================================================ */
.ot-composer[data-mode="new"],
.ot-cards,
.ot-empty,
.ot-shelf,
.ot-filter,
.ot-stats,
.ot-board--view .ot-side-sticky,
.ot-thread {
    background: var(--ot-panel-bg);
    border: var(--ot-panel-border);
    border-radius: var(--ot-panel-radius);
    box-shadow: var(--ot-panel-shadow);
    padding: var(--ot-panel-pad);
}
.ot-cards { padding: 4px 8px; }
.ot-empty { padding: 40px 0; }
.ot-cards:not(:has(.ot-card)) { display: none; }
.ot-card:last-child { border-bottom: 0; }
.ot-filter { padding: 10px 12px; }
.ot-stats .ot-side-label { margin-bottom: 22px; } /* 막대 위 숫자 자리 */

/* 작은 동그라미 버튼과 쪽 번호도 판 위에 */
.ot-back, .ot-admin {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ot-panel-bg);
    border: var(--ot-panel-border);
    box-shadow: var(--ot-panel-shadow);
}
.ot-back:hover, .ot-admin:hover { background: var(--ot-soft); }
.ot-pages:not(:has(*)) { display: none; }
.ot-pages .pg {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;
    border-radius: 99px;
    background: var(--ot-panel-bg);
    border: var(--ot-panel-border);
}

/* 작품 화면: 작품 머리는 옆 칸 판 안에 — 목차와는 간격으로만 나눈다 */
.ot-board--view .ot-work { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.ot-side-sticky .ot-toc { margin-top: 16px; }

/* ============================================================
   옆 칸 조각 — 감상 중 / 올해 기록 / 타래 목차
============================================================ */
.ot-side-label { display: flex; align-items: baseline; gap: 6px; margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--ot-muted); }
.ot-side-label strong { color: var(--ot-text); font-size: 16px; }

.ot-shelf-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.ot-shelf-row::-webkit-scrollbar { display: none; }
.ot-shelf-row .ot-poster { --ot-poster: 52px; font-size: 18px; text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.ot-shelf-row .ot-poster:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, .12); }

.ot-stats-bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ot-stats-bar { display: grid; grid-template-rows: 56px auto; gap: 4px; justify-items: center; }
.ot-stats-bar > span {
    position: relative;
    align-self: end;
    width: 100%;
    height: var(--h);
    min-height: 3px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--ot-star) 70%, transparent);
}
.ot-stats-bar em { position: absolute; top: -17px; left: 0; right: 0; text-align: center; font-style: normal; font-size: 11px; color: var(--ot-muted); }
.ot-stats-bar small { font-size: 11px; color: var(--ot-muted); }
.ot-stats-bar small i { font-size: 9px; margin-left: 1px; color: var(--ot-star); }

.ot-toc { display: none; flex-direction: column; border-left: 2px solid var(--ot-line); }
.ot-toc-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: -2px;
    padding: 5px 0 5px 10px;
    border-left: 2px solid transparent;
    color: var(--ot-muted) !important;
    font-size: 12px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}
.ot-toc-item time { flex: none; min-width: 34px; font-variant-numeric: tabular-nums; }
.ot-toc-item .ot-rate { flex: none; font-size: 9px; }
.ot-toc-item .ot-rate.is-watching { font-size: 10px; padding: 2px 5px; }
.ot-toc-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ot-toc-item:hover, .ot-toc-item.is-current { color: var(--ot-text) !important; }
.ot-toc-item.is-current { border-left-color: var(--ot-accent); }

/* ============================================================
   두 칸 배치
   기본(한 칸): 목록은 옆 칸 조각이 본문 사이로 흩어진다 — 작성 창 → 감상 중 → 분류·검색 → 카드 → 쪽 → 올해 기록
   게시판 폭이 880px 이상: 목록은 [본문 | 옆 칸], 작품 화면은 [작품 머리 + 목차(고정) | 타래]
   (화면 폭이 아니라 게시판 폭 기준 — 사이트가 게시판을 좁은 칸에 넣어도 알맞게)
============================================================ */
.ot-layout { display: flex; flex-direction: column; gap: var(--ot-block-gap); }
.ot-board--list .ot-main, .ot-board--list .ot-side { display: contents; }
.ot-board--list #ot-compose { order: 1; }
.ot-board--list .ot-shelf { order: 2; }
.ot-board--list .ot-filter { order: 3; }
.ot-board--list .ot-cards, .ot-board--list .ot-empty { order: 4; }
.ot-board--list .ot-pages { order: 5; }
.ot-board--list .ot-stats { order: 6; }
.ot-board--list .ot-admin { order: 7; }
.ot-filter .ot-cats { order: 1; }
.ot-filter .ot-search { order: 2; }

@container (min-width: 880px) {
    .ot-layout {
        display: grid;
        grid-template-columns: minmax(0, var(--ot-main-w)) var(--ot-side-w);
        justify-content: center;
        align-items: start;
        gap: var(--ot-col-gap);
    }
    .ot-layout.is-single { display: block; }

    /* 목록 — 본문 칸도 판 사이 간격을 그대로 */
    .ot-board--list .ot-main { display: flex; flex-direction: column; gap: var(--ot-block-gap); min-width: 0; }
    .ot-board--list .ot-side {
        position: sticky;
        top: var(--ot-sticky-top);
        display: flex;
        flex-direction: column;
        gap: var(--ot-block-gap);
    }
    .ot-side .ot-filter { padding: var(--ot-panel-pad); }
    .ot-side .ot-shelf-row { display: grid; grid-template-columns: repeat(4, 1fr); overflow: visible; }
    .ot-side .ot-shelf-row .ot-poster { --ot-poster: 100%; }

    .ot-side .ot-filter { flex-direction: column; align-items: stretch; gap: 10px; margin: 0; }
    .ot-side .ot-search { order: 0; margin: 0; }
    .ot-side .ot-search input, .ot-side .ot-search input:focus { width: 100%; }
    .ot-side .ot-cats { flex-direction: column; gap: 1px; overflow: visible; padding: 0; }
    .ot-side .ot-cats a { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 8px; background: transparent; }
    .ot-side .ot-cats a:hover { background: var(--ot-soft); color: var(--ot-text); }
    .ot-side .ot-cats a.is-on { background: var(--ot-soft); color: var(--ot-text); font-weight: 600; }

    /* 작품 화면 옆 칸 — 포스터를 크게, 스크롤해도 따라온다 */
    .ot-board--view .ot-layout { grid-template-columns: var(--ot-side-w) minmax(0, var(--ot-main-w)); }
    .ot-board--view .ot-side { align-self: stretch; } /* 타래 높이만큼 늘어나야 안쪽이 따라 내려온다 */
    .ot-side-sticky {
        position: sticky;
        top: var(--ot-sticky-top);
        max-height: calc(100vh - var(--ot-sticky-top) - 16px);
        overflow-y: auto;
        scrollbar-width: thin;
    }
    .ot-board--view .ot-work { flex-direction: column; align-items: stretch; gap: 14px; }
    .ot-board--view .ot-work-poster { --ot-poster: 100%; font-size: 56px; }
    .ot-board--view .ot-work-title { font-size: 22px; }
    .ot-board--view .ot-work-tools { position: static; order: 3; }
    .ot-board--view .ot-work-form { flex-direction: column; }
    .ot-board--view .ot-work-form .ot-poster { --ot-poster: 96px; }
    .ot-toc { display: flex; }
}

/* ============================================================
   좁은 화면
============================================================ */
@media (max-width: 600px) {
    .ot-board { --ot-avatar: 34px; --ot-poster: 52px; --ot-poster-head: 84px; --ot-gap: 10px; --ot-panel-pad: 12px; --ot-block-gap: 10px; padding-left: 4px; padding-right: 4px; }
    .ot-composer[data-mode="new"] > .ot-avatar { display: none; }
    .ot-filter { flex-wrap: wrap; }
    .ot-search, .ot-search input, .ot-search input:focus { width: 100%; }
    .ot-work { gap: 14px; }
    .ot-work-title { font-size: 20px; }
    .ot-imgs { grid-auto-rows: 120px; }
}
