body:has(.case-list-page) { background: #fff; }

/* The shared page CSS sets several element fonts with !important. */
@layer albup-case-list {
    .case-list-page {
        font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif !important;
    }
    .case-list-page * { font-family: inherit !important; }
}

.case-list-page {
    --case-ink: #202c39;
    --case-text: #445362;
    --case-meta: #586779;
    --case-line: #e6ebf1;
    box-sizing: border-box;
    width: min(850px, calc(100% - 48px));
    margin: 0 auto;
    padding: 38px 0 55px;
    color: var(--case-ink);
    font-size: 15px;
    line-height: 1.55;
}

.case-list-page * { box-sizing: border-box; }
.case-list-page :focus-visible { outline: 2px solid #0062df; outline-offset: 2px; }

.case-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.case-list-heading h1 {
    margin: 0;
    color: var(--case-ink);
    font-size: 32px;
    font-weight: 750;
    line-height: 1.24;
    letter-spacing: -.035em;
}

.case-list-search {
    display: flex;
    align-items: center;
    width: 280px;
    min-height: 44px;
    margin: 0;
    border-radius: 10px;
    background: #f2f5f8;
    color: var(--case-meta);
}

.case-list-search:focus-within { outline: 2px solid #0062df; }

.case-list-search input[type="search"] {
    flex: 1;
    min-width: 0;
    width: auto;
    height: 44px;
    padding: 0 12px 0 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    color: var(--case-ink);
}

.case-list-search input::placeholder { color: var(--case-meta); opacity: 1; }

.case-list-search button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    padding: 0;
    color: inherit;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.case-list-search button span {
    position: relative;
    width: 13px;
    height: 13px;
    margin: 0 2px 2px 0;
    border: 1.5px solid currentColor;
    border-radius: 50%;
}

.case-list-search button span::after {
    content: "";
    position: absolute;
    right: -4px;
    bottom: -2px;
    width: 5px;
    border-top: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.case-list-results {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--case-line);
}

.case-list-item { position: relative; padding: 34px 0; border-bottom: 1px solid var(--case-line); }

.case-list-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px 6px;
    color: var(--case-meta);
    font-size: 13px;
}

.case-list-legal-area { color: var(--case-text); font-weight: 650; }
.case-list-dot { color: #6b7885; }

.case-list-item h2 {
    margin: 12px 0 10px;
    color: var(--case-ink);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.37;
    letter-spacing: -.024em;
}

.case-list-title {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    color: inherit;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    text-decoration: none;
    word-break: break-all;
    cursor: pointer;
}

.case-list-title::after { content: ""; position: absolute; inset: 0; }
.case-list-title:hover { color: #145aa8; }

.case-list-summary {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--case-text);
    font-size: 15px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.case-list-footer,
.case-list-byline,
.case-list-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

.case-list-footer { justify-content: space-between; gap: 10px 12px; margin-top: 18px; }
.case-list-tags { gap: 5px; }
.case-list-byline { gap: 4px 7px; color: var(--case-meta); font-size: 13px; }
.case-list-byline strong { color: var(--case-ink); font-weight: 650; }
.case-list-byline strong + span { border-left: 1px solid #c7d2dc; padding-left: 7px; }
.case-list-byline:only-child { margin-left: auto; }

.case-list-tags span {
    padding: 3px 7px;
    border-radius: 5px;
    background: #edf5ff;
    color: #145aa8;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.case-list-empty { margin: 0; padding: 30px 0; border-top: 1px solid var(--case-line); color: var(--case-meta); }
.case-list-page .case-list-paging { display: block; width: auto; height: auto; margin: 24px 0; }
.case-list-guide { margin: 22px 0 0; font-size: 13px; }
.case-list-guide a { color: #145aa8; text-decoration: none; }
.case-list-guide a:hover { text-decoration: underline; }

@media (max-width: 767px) {
    .case-list-page { width: calc(100% - 32px); padding: 17px 0 calc(80px + env(safe-area-inset-bottom)); }
    .case-list-heading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 16px; }
    .case-list-heading h1 { font-size: 26px; }
    .case-list-search { width: 100%; }
    .case-list-item { padding-block: 27px; }
    .case-list-item h2 { margin: 10px 0 8px; font-size: 18px; }
    .case-list-summary { font-size: 14px; }
    .case-list-footer { align-items: flex-start; flex-direction: column; margin-top: 14px; }
    .case-list-byline { align-self: flex-end; justify-content: flex-end; }
    body:has(.case-list-page) #albup-ai-launcher { display: none !important; }
}

.qna-list-page .case-list-legal-area { color: #6b7785; font-weight: 500; }
.qna-list-page .case-list-item h2:first-child { margin-top: 0; }
.qna-list-answer { margin-top: 12px; }
.qna-list-answer-label {
    margin-bottom: 4px;
    color: #1665b5;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}
.qna-list-answer .case-list-summary { color: #344454; }
