/* 논문 찾기 화면(시안 mockups/platform-search.html A안 + B안). 내 서재 표와 같은 말투(가는 줄, 옅은 바탕, 글자로만 표시).
   색은 tokens.css를 그대로 쓴다. 채운 단추·알약 배지·둥근 카드 없이 줄과 글자로. */

.paper-search {
    display: grid;
    gap: 16px;
    padding: 32px 56px 34px;
    font-size: 15px;
    line-height: 1.5;
}

.paper-search [hidden] {
    display: none !important;
}

/* 방식별 구역: 키워드(.paper-k-only) · 연구 질문(.paper-q-only) */
.paper-search[data-mode="keyword"] .paper-q-only,
.paper-search[data-mode="question"] .paper-k-only {
    display: none !important;
}

/* 글자 모양만 물려받는다(:where라 아래 클래스 규칙이 이긴다) */
:where(.paper-search) :where(button, input, textarea, select) {
    font: inherit;
    color: inherit;
}

.paper-search :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* 머리: 서재와 같은 28px 제목 */
.paper-h {
    margin: 0 0 4px;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: -.02em;
    line-height: 1.3;
}

.paper-sub {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
}

/* 글자 고르기(한국어 · 원문, 목록 · 시간선, 인용 형식): 고른 것만 진한 글자 */
.paper-tg {
    color: var(--ink-faint);
    font-size: 13px;
    white-space: nowrap;
}

.paper-tg button {
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--ink-faint);
    cursor: pointer;
}

.paper-tg button:hover {
    color: var(--ink-soft);
}

.paper-tg button[aria-pressed="true"] {
    color: var(--ink);
}

/* 찾는 방식: 밑줄 탭(논문 검색 · 연구 질문으로 찾기). 이름 아래 한 줄 설명, 고른 탭만 진한 글자와 밑줄 */
.paper-modes {
    display: flex;
    gap: 30px;
    margin: 6px 0 2px;
    border-bottom: 1px solid var(--line);
}

.paper-mode-tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
    margin-bottom: -1px;
    padding: 0 0 11px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--ink-soft);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.paper-mode-name {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
}

.paper-mode-desc {
    color: var(--ink-faint);
    font-size: 12.5px;
}

.paper-mode-tab:hover {
    color: var(--ink);
}

.paper-mode-tab[aria-pressed="true"] {
    border-bottom-color: var(--ink);
    color: var(--ink);
}

.paper-mode-tab[aria-pressed="true"] .paper-mode-name {
    font-weight: 600;
}

.paper-mode-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.paper-sep {
    margin: 0 7px;
    color: var(--ink-faint);
}

/* 글자 링크(밑줄 옅게) */
.paper-tl {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: inherit;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    cursor: pointer;
}

.paper-tl:hover {
    text-decoration-color: currentColor;
}

.paper-tl.is-faint {
    color: var(--ink-faint);
}

.paper-plain {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: inherit;
    text-align: left;
    cursor: pointer;
}

.paper-search-top {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

/* 검색창(서재 '제목으로 찾기'와 같은 칸)과 자동완성 */
.paper-search-form {
    position: relative;
    flex: 1 1 420px;
    min-width: 0;
    margin: 0;
}

/* 검색칸: 상자 없이 아래 줄 하나(시안 A). 고르면 줄이 진해진다(두께는 그대로라 글이 움직이지 않는다) */
.paper-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0;
    border-bottom: 1px solid var(--line-strong);
    color: var(--ink-faint);
}

.paper-search-box:focus-within {
    border-bottom-color: var(--ink);
}

/* 찾을 곳(제목·키워드 / 저자): 검색칸 왼쪽 글자 선택 */
.paper-field {
    flex: none;
    width: auto;
    height: 24px;
    margin-right: 2px;
    padding: 0 18px 0 0;
    border: 0;
    border-radius: 0;
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5' fill='none'%3E%3Cpath d='M1 1l3.5 3L8 1' stroke='%2327261e' stroke-opacity='.45' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center;
    color: var(--ink-soft);
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
}

.paper-field:hover,
.paper-field:focus-visible {
    color: var(--ink);
    outline: 0;
}

.paper-field:disabled {
    cursor: default;
}

.paper-search-box svg {
    flex: none;
    width: 15px;
    height: 15px;
}

.paper-search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
}

.paper-search-box input:focus-visible {
    outline: 0;
}

.paper-search-box input::-webkit-search-cancel-button {
    display: none;
}

.paper-search-go {
    flex: none;
    border: 0;
    padding: 0;
    background: none;
    color: var(--ink-soft);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.paper-search-go:hover {
    color: var(--ink);
}

.paper-search-form.is-locked .paper-search-box {
    opacity: .55;
}

.paper-search-form.is-locked .paper-search-go {
    pointer-events: none;
}

.paper-search-hint {
    margin: 8px 2px 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.paper-suggest {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    padding: 4px 0;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(39, 38, 30, .08);
}

.paper-suggest-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 14px;
    padding: 8px 12px;
    cursor: pointer;
}

.paper-suggest-item:hover,
.paper-suggest-item[aria-selected="true"] {
    background: var(--card);
}

.paper-suggest-title,
.paper-suggest-hint {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.paper-suggest-title {
    font-size: 14px;
}

.paper-suggest-hint {
    grid-column: 1;
    color: var(--ink-soft);
    font-size: 12.5px;
}

.paper-suggest-cited {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    color: var(--ink-faint);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.paper-suggest-foot {
    margin-top: 4px;
    padding: 8px 12px 4px;
    border-top: 1px solid var(--line);
    color: var(--ink-faint);
    font-size: 12.5px;
}

.paper-suggest-foot kbd {
    font: inherit;
    color: var(--ink-soft);
}

/* 거르기: 서재 거르기 칩처럼 글자 버튼, 켜진 것만 옅은 바탕 */
.paper-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
    min-height: 40px;
}

.paper-filter-toggle,
.paper-filter-select {
    flex: none;
    width: auto;
    height: 32px;
    border: 0;
    border-radius: 7px;
    padding: 0 10px;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}

.paper-filter-select {
    appearance: none;
    padding-right: 22px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5' fill='none'%3E%3Cpath d='M1 1l3.5 3L8 1' stroke='%2327261e' stroke-opacity='.45' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center;
}

.paper-filter-toggle:hover,
.paper-filter-select:hover {
    color: var(--ink);
}

.paper-filter-toggle[aria-pressed="true"] {
    background: var(--pill);
    color: var(--ink);
}

.paper-filter-toggle:disabled,
.paper-filter-select:disabled {
    opacity: .5;
    cursor: default;
}

/* 학술지 거름 한 줄 */
.paper-venue-line {
    margin: -6px 2px 0;
    color: var(--ink-soft);
    font-size: 13.5px;
}

/* 목록(서재 표) + 상세 */
.paper-search-body {
    display: grid;
    grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
    align-items: start;
    transition: opacity .15s;
}

.paper-search-body.is-loading {
    opacity: .5;
}

.paper-list-col {
    min-width: 0;
}

.paper-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.paper-table th {
    padding: 6px 10px;
    border-bottom: 1px solid var(--line);
    color: var(--ink-faint);
    font-size: 12.5px;
    font-weight: 400;
    text-align: left;
    white-space: nowrap;
}

.paper-table td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.paper-table .num {
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.paper-cell-title {
    width: 100%;
    max-width: 0;
}

.paper-row {
    cursor: pointer;
}

.paper-row:hover td,
.paper-row[aria-selected="true"] td {
    background: var(--card);
}

.paper-row:focus-visible {
    outline: 2px solid var(--ink-faint);
    outline-offset: -2px;
}

.paper-row-title {
    display: block;
    color: var(--ink);
    font-weight: 500;
    line-height: 1.4;
}

.paper-row[aria-selected="true"] .paper-row-title {
    font-weight: 600;
}

.paper-row-foot {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-top: 3px;
}

.paper-row-meta {
    display: block;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 12.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* 연구 질문 표의 '질문과의 관계' 한 줄 */
.paper-rq {
    display: block;
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.5;
}

.paper-rq span {
    color: var(--ink-faint);
}

.paper-pdf-link,
.paper-page-link {
    color: var(--accent-text);
    font-size: 12.5px;
    text-decoration: none;
    white-space: nowrap;
}

.paper-page-link {
    color: var(--ink-soft);
}

.paper-pdf-link:hover,
.paper-page-link:hover,
.paper-inlib:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 서재에 있는 논문: 원문 칸의 진한 '서재' */
.paper-inlib {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.paper-none {
    color: var(--ink-faint);
    font-size: 12.5px;
}

/* 읽을 논문에 담기: 검색 줄은 메타 줄 끝의 글자 단추(담은 줄은 진하게 '담음') */
.paper-save-link {
    flex: none;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-soft);
    font: inherit;
    font-size: 12.5px;
    white-space: nowrap;
    cursor: pointer;
}

.paper-save-link:hover,
.paper-save-link[aria-pressed="true"] {
    color: var(--ink);
}

.paper-save-link:disabled {
    opacity: .6;
    cursor: default;
}

.paper-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* 한국어 검색어를 영어로 바꿔 찾았을 때 결과 위 한 줄 */
.paper-translated {
    margin: 0 0 6px;
    padding: 0 10px;
    color: var(--ink-faint);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.paper-translated-query {
    color: var(--ink-soft);
}

.paper-state .paper-state-translated {
    color: var(--ink-faint);
    font-size: 13px;
}

.paper-count {
    margin-left: 2px;
}

.paper-more {
    display: block;
    height: 32px;
    margin: 16px auto 4px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
}

.paper-more:disabled {
    color: var(--ink-faint);
    cursor: default;
}

/* ---- 상세 ---- */
.paper-detail {
    position: sticky;
    top: 80px;
    min-width: 0;
    max-height: calc(100vh - 100px);
    overflow: auto;
    margin-left: 32px;
    padding: 4px 4px 24px 32px;
    border-left: 1px solid var(--line);
}

.paper-d-bar {
    display: none;
}

.paper-d-back {
    margin: 0 0 14px;
    color: var(--ink-soft);
    font-size: 13px;
}

.paper-d-title {
    margin: 0 0 10px;
    font-size: 21px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -.01em;
    overflow-wrap: anywhere;
}

.paper-d-who {
    margin: 0 0 3px;
    color: var(--ink-soft);
    font-size: 13.5px;
}

.paper-d-where {
    margin: 0 0 12px;
    color: color-mix(in srgb, var(--ink) 70%, transparent);
    font-size: 13px;
}

.paper-jump {
    margin: 0 0 18px;
    color: var(--ink-faint);
    font-size: 13.5px;
}

.paper-jump .paper-tl {
    color: var(--ink-soft);
}

.paper-qrel {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-left: 2px solid var(--line-strong);
    background: var(--card);
    font-size: 14px;
    line-height: 1.6;
}

.paper-qrel b {
    display: block;
    margin-bottom: 2px;
    color: var(--ink-soft);
    font-size: 12.5px;
    font-weight: 400;
}

/* 문제 · 방법 · 결과 세 줄 */
.paper-judge {
    display: grid;
    gap: 6px;
    margin: 0 0 16px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.paper-judge div {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    font-size: 14.5px;
    line-height: 1.55;
}

.paper-judge dt {
    padding-top: 1px;
    color: var(--ink-soft);
    font-size: 13px;
}

.paper-judge dd {
    margin: 0;
}

.paper-judge-wait {
    margin: 0 0 16px;
    color: var(--ink-faint);
    font-size: 12px;
}

.paper-judge-wait {
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

/* 읽기 단추 + 글자 링크 줄 */
.paper-acts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    font-size: 13.5px;
}

.paper-links {
    color: var(--ink-soft);
}

/* 보이는 링크 사이에만 가운뎃점(무료면 담기가 숨는다) */
.paper-links > :not([hidden]) ~ :not([hidden])::before {
    content: "·";
    display: inline-block;
    margin: 0 7px;
    color: var(--ink-faint);
    text-decoration: none;
}

.paper-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font-size: 13.5px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.paper-btn:hover {
    background: var(--card);
}

.paper-btn.is-main {
    border-color: var(--ink);
}

.paper-btn:disabled {
    cursor: default;
    opacity: .7;
}

.paper-nopdf {
    color: var(--ink-soft);
    font-size: 13.5px;
}

.paper-acts-note {
    margin: 8px 0 0;
    color: color-mix(in srgb, var(--ink) 70%, transparent);
    font-size: 12.5px;
}

.paper-acts-note.is-error {
    color: var(--accent-text);
}

.paper-cite {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--card);
    font-size: 12.5px;
}

.paper-cite .paper-tg {
    display: block;
    margin-bottom: 6px;
}

.paper-cite code {
    display: block;
    color: var(--ink-soft);
    font-family: inherit;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.paper-cite-ok {
    display: block;
    margin-top: 6px;
    color: var(--ink);
}

/* 초록·관련 논문 구역 */
.paper-d-sec {
    margin-top: 26px;
}

.paper-sec-h {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.paper-sec-h h4 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 500;
}

.paper-abs {
    margin: 0;
    color: color-mix(in srgb, var(--ink) 88%, transparent);
    font-size: 14.5px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.paper-abs.is-wait,
.paper-abs.is-none {
    color: var(--ink-faint);
    font-size: 13.5px;
}

.paper-abs.is-clamped {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
}

.paper-abs-note {
    margin: 8px 0 0;
    color: var(--ink-faint);
    font-size: 12px;
}

.paper-more-line {
    margin: 10px 0 0;
    color: var(--ink-soft);
    font-size: 13px;
}

/* 상세 안 관련 논문(paper-related.js): 뷰어 패널과 같은 모듈을 시안 A 글자로 */
.paper-detail .rel-tabs {
    gap: 18px;
    margin-bottom: 4px;
    border-bottom: 0;
    font-size: 13.5px;
}

.paper-detail .rel-tab {
    padding: 4px 0;
    color: var(--ink-faint);
}

.paper-detail .rel-tab:hover {
    color: var(--ink-soft);
}

.paper-detail .rel-tab[aria-selected="true"] {
    color: var(--ink);
    font-weight: 400;
    box-shadow: none;
}

.paper-detail .rel-count {
    margin-left: 4px;
    color: inherit;
}

.paper-detail .rel-note {
    margin: 2px 0 6px;
    color: color-mix(in srgb, var(--ink) 70%, transparent);
    font-size: 12.5px;
}

.paper-detail .rel-row {
    padding: 9px 0;
}

.paper-detail .rel-link.is-lib {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
}

/* 인용 시간선 */
.paper-chart {
    position: relative;
}

.paper-chart svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.paper-chart-grid {
    stroke: var(--line);
    stroke-width: 1;
}

.paper-chart-axis {
    stroke: var(--line-strong);
    stroke-width: 1;
}

.paper-chart-ax {
    fill: color-mix(in srgb, var(--ink) 70%, transparent);
    font-size: 10.5px;
    font-family: var(--font-sans);
}

.paper-chart-cap {
    fill: var(--ink-soft);
    font-size: 11px;
    font-family: var(--font-sans);
}

.paper-chart-mid {
    stroke: var(--line-strong);
    stroke-width: 1;
    stroke-dasharray: 2 3;
}

.paper-chart-edge {
    fill: none;
    stroke: var(--line-strong);
    stroke-width: 1;
}

.paper-chart-pt {
    fill: var(--bg);
    stroke: var(--ink-soft);
    stroke-width: 1.2;
    cursor: pointer;
}

.paper-chart-pt.is-lib {
    fill: var(--accent);
    stroke: var(--accent);
}

.paper-chart-pt.is-current {
    stroke: var(--ink);
    stroke-width: 2;
    cursor: default;
}

.paper-chart-pt:hover,
.paper-chart-pt:focus-visible {
    stroke: var(--ink);
    stroke-width: 2.2;
    outline: none;
}

.paper-chart-label {
    fill: var(--ink-soft);
    font-size: 10.5px;
    font-family: var(--font-sans);
    pointer-events: none;
}

.paper-chart-label.is-strong {
    fill: var(--ink);
    font-weight: 500;
}

.paper-chart-tip {
    position: absolute;
    z-index: 5;
    width: 250px;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--ink) 7%, transparent);
    font-size: 12.5px;
    line-height: 1.45;
    pointer-events: none;
}

.paper-chart-tip b {
    display: block;
    color: var(--ink);
    font-weight: 500;
}

.paper-chart-tip span {
    display: block;
    margin-top: 3px;
    color: color-mix(in srgb, var(--ink) 70%, transparent);
}

.paper-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 8px;
    color: color-mix(in srgb, var(--ink) 70%, transparent);
    font-size: 12px;
}

.paper-chart-legend svg {
    width: 11px;
    height: 11px;
    margin-right: 4px;
    vertical-align: -1px;
}

.paper-chart-key {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.2;
}

.paper-chart-key.is-current {
    stroke-width: 2;
}

.paper-chart-key.is-lib {
    fill: var(--accent);
    stroke: var(--accent);
}

.paper-rel-note {
    margin: 2px 0 6px;
    color: color-mix(in srgb, var(--ink) 70%, transparent);
    font-size: 12.5px;
}

/* ---- 연구 질문(B안) ---- */
/* 질문 칸: 논문 검색칸과 같은 한 줄(왼쪽 말풍선 아이콘), 길게 쓰면 아래로 늘어난다. 찾기는 줄 끝의 밑줄 글자 */
.paper-qbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-strong);
}

.paper-qbox::before {
    content: "";
    flex: none;
    width: 15px;
    height: 15px;
    margin-top: 5px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 3.5h10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H8l-3 2.5v-2.5H3a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1z' stroke='%2327261e' stroke-opacity='.45' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

.paper-qbox:focus-within {
    border-bottom-color: var(--ink);
}

.paper-qbox textarea:focus-visible {
    outline: 0;
}

.paper-qbox textarea {
    flex: 1;
    min-height: 0;
    max-height: 168px;
    border: 0;
    outline: 0;
    background: none;
    padding: 0;
    font-size: 16px;
    line-height: 1.6;
    overflow-y: auto;
    resize: none;
}

.paper-qbox textarea:disabled {
    opacity: .55;
}

.paper-q-go {
    flex: none;
    margin-top: 2px;
    color: var(--ink);
    font-size: 14.5px;
    white-space: nowrap;
}

.paper-q-go:disabled {
    color: var(--ink-faint);
    text-decoration: none;
    cursor: default;
}

/* 질문 칸 줄 아래 한 줄: 왼쪽 Enter 안내, 오른쪽 남은 횟수 */
.paper-q-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
    margin: 7px 2px 0;
}

.paper-q-keys {
    color: var(--ink-faint);
    font-size: 12px;
}

/* 손가락으로 쓰는 기기에는 Enter 안내가 맞지 않아 뺀다 */
@media (hover: none) {
    .paper-q-keys {
        display: none;
    }
}

.paper-q-status {
    margin: 0 0 0 auto;
    color: var(--ink-soft);
    font-size: 12.5px;
}

.paper-q-status.is-locked {
    margin-left: 0;
    color: var(--ink-soft);
}

.paper-terms {
    margin: 12px 0 0;
    color: color-mix(in srgb, var(--ink) 70%, transparent);
    font-size: 13.5px;
    line-height: 2;
}

.paper-lab {
    margin-right: 8px;
    color: var(--ink-faint);
}

.paper-term {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    text-decoration: underline dotted;
    text-decoration-color: var(--ink-faint);
    text-underline-offset: 4px;
    cursor: pointer;
}

.paper-term:hover {
    text-decoration-color: var(--ink);
}

.paper-term-in {
    width: 24ch;
    padding: 0 2px;
    border: 0;
    border-bottom: 1px solid var(--ink);
    outline: 0;
    background: none;
    font-size: 13.5px;
}

.paper-edited {
    margin-left: 10px;
    color: var(--ink);
}

.paper-log {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    margin: 12px 0 0;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 13px;
}

.paper-log ol {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.paper-log li + li::before {
    content: "›";
    margin: 0 9px;
    color: var(--ink-faint);
}

.paper-log li:last-child {
    color: var(--ink);
}

.paper-again {
    margin-left: auto;
}

.paper-q-error {
    margin: 10px 0 0;
    color: var(--accent-text);
    font-size: 13.5px;
}

.paper-q-wait,
.paper-q-empty {
    margin: 8px 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.paper-land-wrap > summary {
    display: none;
}

.paper-land {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 36px;
    margin: 6px 0 18px;
}

.paper-land-col h3 {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 13.5px;
    font-weight: 500;
}

.paper-land-col h3 small {
    color: var(--ink-faint);
    font-size: 12px;
    font-weight: 400;
}

.paper-mini {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.paper-mini + .paper-mini {
    margin-top: 10px;
}

.paper-mini th {
    padding: 4px 0;
    border-bottom: 1px solid var(--line);
    color: color-mix(in srgb, var(--ink) 70%, transparent);
    font-size: 12px;
    font-weight: 400;
    text-align: left;
}

.paper-mini td {
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
}

.paper-mini .num {
    padding-left: 10px;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.paper-mini .paper-tl[aria-pressed="true"] {
    font-weight: 600;
    text-decoration-color: currentColor;
}

.paper-mini-h {
    margin: 14px 0 0;
    color: color-mix(in srgb, var(--ink) 70%, transparent);
    font-size: 12px;
}

.paper-bars rect {
    fill: color-mix(in srgb, var(--ink) 20%, transparent);
}

.paper-bars rect.is-recent {
    fill: color-mix(in srgb, var(--ink) 42%, transparent);
}

.paper-res-h {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    margin-bottom: 4px;
}

.paper-res-h h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

.paper-res-h h3 span {
    margin-left: 6px;
    color: var(--ink-faint);
    font-size: 13px;
    font-weight: 400;
}

.paper-res-h .paper-filters {
    min-height: 0;
}

.paper-topic-filter {
    margin: 0 0 6px;
    color: var(--ink-soft);
    font-size: 13px;
}

/* ---- 검색 전 빈 화면 ---- */
.paper-examples {
    margin: -6px 2px 0;
    color: color-mix(in srgb, var(--ink) 70%, transparent);
    font-size: 13px;
    line-height: 1.9;
}

.paper-start {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 56px;
    margin-top: 14px;
}

.paper-blk-h {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 500;
}

.paper-blk-h small {
    color: var(--ink-faint);
    font-size: 12.5px;
    font-weight: 400;
}

.paper-start-empty {
    margin: 10px 0 0;
    color: var(--ink-soft);
    font-size: 13.5px;
}

.paper-start-table td.paper-cell-thumb {
    width: 52px;
    padding-right: 4px;
}

.paper-start-table .paper-row-title {
    font-size: 14px;
}

.paper-start-table .num .paper-tl {
    color: var(--ink-soft);
    font-size: 13px;
}

.paper-thumb {
    display: block;
    width: 36px;
    height: 48px;
    object-fit: cover;
}

.paper-thumb svg {
    display: block;
    width: 36px;
    height: 48px;
}

.paper-th-pg {
    fill: #fff;
    stroke: var(--line-strong);
}

.paper-th-t {
    fill: color-mix(in srgb, var(--ink) 55%, transparent);
}

.paper-th-l {
    fill: color-mix(in srgb, var(--ink) 20%, transparent);
}

.paper-recent {
    margin: 0;
    padding: 0;
    list-style: none;
}

.paper-recent li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.paper-recent li:first-child {
    border-top: 1px solid var(--line);
}

.paper-recent .paper-tl {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.paper-recent small {
    flex: none;
    color: var(--ink-faint);
    font-size: 12px;
}

/* 상태(잠금·예산 바닥·결과 없음·오류): 서재 빈 화면처럼 */
.paper-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 36px 20px;
    text-align: center;
}

.paper-state strong {
    font-size: 16px;
    font-weight: 500;
}

.paper-state p {
    max-width: 52ch;
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.6;
}

.paper-state-cta {
    height: 32px;
    margin-top: 8px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
}

.paper-state-cta:hover {
    background: var(--card);
}

/* 좁은 노트북: 바깥 여백·목록 폭을 줄인다 */
@media (max-width: 1100px) {
    .paper-search {
        padding: 28px 24px 30px;
    }

    .paper-search-body {
        grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
    }

    .paper-detail {
        margin-left: 24px;
        padding-left: 24px;
    }

    .paper-land {
        gap: 24px;
    }
}

/* 휴대폰·좁은 태블릿: 한 칸. 상세는 주소가 있는 한 화면(.is-detail)으로 목록 대신 보인다. */
@media (max-width: 860px) {
    .paper-search {
        padding: 18px 0 24px;
    }

    .paper-h {
        font-size: 24px;
    }

    .paper-modes {
        gap: 20px;
    }

    .paper-mode-tab {
        flex: 1 1 0;
    }

    .paper-mode-desc {
        font-size: 12px;
    }

    .paper-search-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .paper-filters {
        min-height: 0;
    }

    .paper-table th,
    .paper-table td {
        padding-left: 6px;
        padding-right: 6px;
    }

    /* 폰: 줄이 좁아 담기는 빼고, 상세 화면의 글자 단추로 담는다 */
    .paper-row-foot .paper-save-link {
        display: none;
    }

    .paper-translated {
        padding: 0 6px;
    }

    .paper-detail {
        display: none;
        position: static;
        max-height: none;
        overflow: visible;
        margin: 0;
        padding: 0;
        border-left: 0;
    }

    .paper-search.is-detail > :not(.paper-search-body),
    .paper-search.is-detail .paper-list-col {
        display: none !important;
    }

    .paper-search.is-detail {
        padding-top: 0;
    }

    .paper-search.is-detail .paper-detail {
        display: block;
    }

    .paper-d-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 48px;
        margin: 0 0 14px;
        border-bottom: 1px solid var(--line);
        color: var(--ink-soft);
        font-size: 14px;
    }

    .paper-d-title {
        font-size: 18px;
    }

    .paper-judge div {
        font-size: 14px;
    }

    .paper-acts {
        display: grid;
        gap: 10px;
    }

    .paper-acts .paper-btn.is-main {
        width: 100%;
        height: 40px;
        font-size: 14.5px;
    }

    .paper-acts .paper-nopdf {
        text-align: center;
    }

    .paper-links {
        text-align: center;
        font-size: 13.5px;
    }

    .paper-acts-note {
        text-align: center;
    }

    .paper-detail .rel-row .rel-meta {
        white-space: normal;
    }

    .paper-land-wrap > summary {
        display: list-item;
        margin: 4px 0 0;
        color: var(--ink-soft);
        font-size: 13.5px;
        cursor: pointer;
    }

    .paper-land {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .paper-again {
        margin-left: 0;
    }

    .paper-start {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .paper-search-body {
        transition: none;
    }
}
