:root {
    color-scheme: light;
    --bg: #f8fafc;
    --bg-soft: #f1f5f9;
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --border: #e2e8f0;
    --ink: #0f172a;
    --ink-soft: #334155;
    --muted: #64748b;
    --accent: #1a3a6e;
    --accent-strong: #0f2548;
    --accent-soft: #eff4ff;
    --accent-mid: #2d5aa0;
    --danger: #dc2626;
    --shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    --panel-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);

    /* text aliases */
    --text: var(--ink);
    --text-muted: var(--muted);
    --text-secondary: var(--ink-soft);

    /* motion */
    --motion-fast: 0.15s;
    --motion-normal: 0.2s;
    --ease-standard: cubic-bezier(0.2, 0, 0, 1);

    /* pressed state */
    --press-scale: scale(0.97);
    --press-shadow: inset 0 1px 3px rgba(0,0,0,0.12);
    --surface-pressed: #e8ecf1;
}

* {
    box-sizing: border-box;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Pretendard Variable", "SUIT", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    overflow-x: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.page {
    display: flex;
    justify-content: center;
    padding: 16px 12px 28px;
}

.shell {
    width: min(980px, 100%);
    padding: 10px 4px 16px;
    position: relative;
    animation: fadeUp 0.5s ease both;
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 0.7rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--muted);
}

h1, .site-title-link {
    margin: 0 0 4px;
    font-size: clamp(2rem, 3vw, 2.5rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.site-title-link {
    text-decoration: none;
    color: var(--ink);
    font-size: 1.32rem;
    font-weight: 800;
    transition: opacity 0.15s ease;
}

.site-title-link:hover {
    opacity: 0.6;
}

#notice-title {
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.hero-compact {
    margin-bottom: 12px;
}

.hero-left {
    width: 100%;
    max-width: 700px;
    text-align: center;
    margin: 0 auto;
}

.admin-hero {
    justify-content: space-between;
    align-items: center;
}

.admin-hero .hero-left {
    width: auto;
    max-width: none;
    margin: 0;
    text-align: left;
}

.admin-hero .hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.topbar-left {
    flex: 0 1 auto;
}

.topbar-title {
    margin: 0;
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 0.88rem;
    color: var(--ink-soft);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease,
        border-color 0.2s ease,
        transform var(--motion-fast) var(--ease-standard),
        box-shadow var(--motion-fast) var(--ease-standard);
}

.topbar-link:hover {
    background: var(--bg-soft);
    color: var(--ink);
    border-color: var(--border);
}

.topbar-link:active {
    background: var(--surface-pressed);
    transform: var(--press-scale);
    box-shadow: var(--press-shadow);
}

.topbar-cta {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}

.topbar-cta:hover {
    background: #1e293b;
    color: #fff;
    border-color: #1e293b;
}

.topbar-cta:active {
    background: #111827;
    border-color: #111827;
}

.topbar-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar-icon svg {
    width: 16px;
    height: 16px;
}

.intro-note {
    margin: 6px 0 12px;
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.5;
    max-width: 720px;
}

#main-intro {
    max-width: 100%;
}

.notice-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0 0 12px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f0f4f8;
    box-shadow: none;
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--accent);
    opacity: 0.75;
}

.notice-icon svg {
    width: 14px;
    height: 14px;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notice-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-banner:hover {
    background: var(--accent-soft);
    color: var(--ink);
}

.notice-dashboard {
    margin-top: 16px;
}

.status-table {
    display: grid;
    gap: 10px;
}

.status-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr);
    gap: 12px;
    align-items: start;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.status-table.has-action .status-row {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) auto;
}

.status-row.status-header {
    background: var(--bg-soft);
    border-color: #e2e8f0;
    box-shadow: none;
}

.status-row.status-header .status-cell {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.status-cell {
    min-width: 0;
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1.4;
}

.status-book {
    font-weight: 600;
}

.status-content {
    color: var(--ink-soft);
    white-space: pre-wrap;
}

.status-action {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.status-action-button {
    padding: 8px 12px;
    font-size: 0.84rem;
    border-radius: 10px;
    white-space: nowrap;
}

.notice-status-empty {
    margin-top: 10px;
}

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

.notice-banner.is-disabled {
    opacity: 0.7;
    pointer-events: none;
}

.hero-subtitle {
    margin: 0;
    color: var(--ink-soft);
    font-size: 1rem;
}

.panel {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-top: 12px;
}

.panel + .panel {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.guide-list {
    margin: 0;
    padding-left: 18px;
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.55;
}

.guide-list li {
    margin-bottom: 6px;
}

.guide-list li:last-child {
    margin-bottom: 0;
}

.guide-note {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.panel-results {
    margin-top: 18px;
    min-height: 60px;
}

#results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: opacity 0.15s ease-out;
}

#results.fading {
    opacity: 0;
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.panel-title {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-mid);
}

.guide-markdown,
.notice-markdown {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--ink-soft);
}

.guide-markdown p,
.notice-markdown p {
    margin: 0 0 12px;
}

.guide-markdown strong,
.notice-markdown strong {
    color: var(--ink);
}

.notice-markdown h2,
.notice-markdown h3 {
    margin: 20px 0 8px;
    font-weight: 600;
    color: var(--ink);
}

.notice-markdown h2 {
    font-size: 1.05rem;
}

.notice-markdown h3 {
    font-size: 0.95rem;
}

.notice-markdown ol,
.notice-markdown ul {
    margin: 8px 0 12px;
    padding-left: 20px;
}

.notice-markdown li {
    margin: 4px 0;
    line-height: 1.6;
}

.notice-link {
    color: var(--accent);
}

.notice-link:hover {
    text-decoration: underline;
}

.errata-content {
    white-space: pre-wrap;
    word-break: break-word;
}


.panel-caption {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.book-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.book-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.book-title-row .book-title {
    margin: 0;
}

.book-title {
    margin: 4px 0 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--ink);
    word-break: keep-all;
    min-height: 2.1rem;
    transition: opacity 0.15s ease;
}

.errata-button {
    padding: 4px 0;
    font-size: 0.78rem;
    color: var(--ink-soft);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 2px;
}

a.batch-search-btn {
    display: block;
    width: max-content;
    margin-inline-start: auto;
    margin-bottom: 4px;
}

.book-changelog-inline {
    margin: 0 0 12px;
    font-size: 0.82rem;
    color: var(--text-secondary, #64748b);
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 1.4em;
    transition: opacity 0.15s ease;
}

.book-changelog-inline .skeleton-text {
    color: transparent;
    background: linear-gradient(90deg, var(--border) 25%, transparent 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.changelog-more-btn {
    padding: 2px 0;
    font-size: 0.75rem;
    color: var(--ink-soft);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.changelog-more-btn:hover {
    color: var(--ink);
}

.changelog-line {
    margin: 0;
    padding: 6px 0;
    border-bottom: 1px solid var(--border, #e2e8f0);
    font-size: 0.9rem;
}

.changelog-line:last-child {
    border-bottom: none;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
    transition: border-color var(--motion-fast) var(--ease-standard),
        box-shadow var(--motion-fast) var(--ease-standard);
}

.search-form:focus-within {
    border-color: var(--accent-mid);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-form.is-loading {
    background: var(--bg-soft);
}

.query-field {
    position: relative;
    min-width: 0;
    width: 100%;
}

.search-form input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    padding-right: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--ink);
    background: var(--surface);
    min-width: 0;
    min-height: 48px;
}

.search-form input[type="text"]:focus {
    outline: none;
}

.search-form.is-loading input[type="text"] {
    background: var(--bg-soft);
    color: var(--muted);
    cursor: not-allowed;
}

.search-form.is-loading input[type="text"]::placeholder {
    color: var(--muted);
}

.query-placeholder {
    display: none;
    position: absolute;
    left: 14px;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    overflow: hidden;
    white-space: nowrap;
    pointer-events: none;
    color: #94a3b8;
    opacity: 0;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.query-placeholder > span {
    display: inline-block;
    animation: placeholder-marquee 10s linear infinite;
}

.query-field input:placeholder-shown ~ .query-placeholder {
    opacity: 1;
}

.query-field input:focus ~ .query-placeholder {
    opacity: 0;
}

.search-form input[type="text"]::placeholder {
    color: #94a3b8;
}

.search-form.is-loading .query-placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.primary-button,
.secondary-button,
.vk-toggle,
.vk-delete,
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
    font-family: inherit;
}

.primary-button,
.secondary-button,
.vk-toggle,
.vk-delete,
.vk-key {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 600;
    transition: transform var(--motion-fast) var(--ease-standard),
        background-color 0.2s ease,
        box-shadow var(--motion-fast) var(--ease-standard);
    cursor: pointer;
}

.primary-button:hover {
    transform: translateY(-1px);
    background: #1e293b;
}

.primary-button:active {
    transform: var(--press-scale);
    box-shadow: var(--press-shadow);
}

.primary-button:disabled,
.primary-button.is-loading {
    cursor: not-allowed;
    background: #cbd5e1;
    transform: none;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 600;
    transition: transform var(--motion-fast) var(--ease-standard),
        border-color 0.2s ease,
        box-shadow var(--motion-fast) var(--ease-standard),
        background-color 0.2s ease;
}

.secondary-button:hover {
    transform: translateY(-1px);
    border-color: var(--accent-soft);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
    background: var(--bg-soft);
}

.secondary-button:active {
    transform: var(--press-scale);
    box-shadow: var(--press-shadow);
}

.vk-toggle {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: #fff;
    color: var(--ink);
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    min-height: 48px;
}

.vk-toggle.is-active {
    background-color: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.vk-delete {
    display: inline-flex;
    --hold-progress: 0%;
    padding: 12px 16px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background-color: #fff;
    background-image: linear-gradient(
        to right,
        rgba(220, 38, 38, 0.12),
        rgba(220, 38, 38, 0.12)
    );
    background-repeat: no-repeat;
    background-size: var(--hold-progress) 100%;
    background-position: left center;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.15rem;
    white-space: nowrap;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 48px;
    transition: background-color 0.1s ease, transform 0.1s ease;
}

.vk-delete:disabled {
    background-color: var(--bg-soft);
    background-image: none;
    color: var(--muted);
    border-color: var(--border);
    cursor: not-allowed;
}

.virtual-keyboard {
    display: none;
    margin-top: 8px;
    padding: 12px;
    border: none;
    border-radius: 16px;
    background-color: rgba(226, 232, 240, 0.92);
    backdrop-filter: blur(16px);
    gap: 6px;
    align-items: flex-start;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
}

.virtual-keyboard.is-locked {
    pointer-events: none;
    opacity: 0.6;
}

.virtual-keyboard.is-active {
    display: flex;
    flex-direction: column;
    animation: vk-slide-in 0.2s ease-out;
}

@keyframes vk-slide-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vk-row {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 3fr);
    gap: 8px;
    margin-bottom: 4px;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.vk-row:last-child {
    margin-bottom: 0;
}

.vk-consonants,
.vk-numbers {
    display: flex;
    gap: 6px;
    min-width: 0;
    align-items: center;
}

.vk-consonants {
    justify-content: flex-start;
}

.vk-numbers {
    justify-content: flex-end;
}

.vk-offset-1 {
    padding-left: clamp(6px, 2.2vw, 14px);
}

.vk-offset-2 {
    padding-left: clamp(10px, 3.5vw, 22px);
}

.vk-key {
    flex: 1 1 0;
    min-width: 0;
    min-height: 58px;
    padding: 10px 4px;
    border: none;
    border-radius: 10px;
    background-color: #fff;
    color: #0f172a;
    font-size: clamp(0.88rem, 3.2vw, 1.1rem);
    line-height: 1;
    text-align: center;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08),
        0 2px 6px rgba(15, 23, 42, 0.08);
    transition: background-color 0.1s ease, box-shadow 0.1s ease,
        transform 0.1s ease;
    will-change: transform;
}

.vk-key.vk-num {
    background-color: #f1f5f9;
    color: #0f172a;
}

.vk-key.vk-accent {
    background-color: #fff;
    color: #0f172a;
}

@media (hover: hover) {
    .vk-key:hover {
        background-color: #f1f5f9;
    }
}

.vk-key.is-active,
.vk-key.is-pressed {
    background-color: #e2e8f0;
    color: #0f172a;
    box-shadow: none;
    transform: scale(0.95);
}

.vk-key:active {
    background-color: #e2e8f0;
    box-shadow: none;
    transform: scale(0.95);
}

.vk-key:disabled,
.vk-key[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.vk-key.vk-wide {
    min-width: 88px;
}

.vk-key.vk-space {
    flex: 1 1 auto;
    min-width: 160px;
}

/* 법전 모드 키보드 */
.vk-statute-mode .vk-row-search {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 3fr);
    gap: 8px;
    margin-bottom: 4px;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.vk-statute-mode .vk-search-wrapper {
    min-width: 0;
}

.vk-statute-mode .vk-search-wrapper .search-form {
    margin: 0;
    border-radius: 10px;
    grid-template-columns: minmax(0, 4fr) minmax(0, 1fr);
}

.vk-statute-unit {
    flex: 2 1 0 !important;
    font-size: clamp(0.72rem, 2.8vw, 0.9rem) !important;
    letter-spacing: -0.5px;
}

.turnstile-section {
    display: none;
    padding: 1rem 0;
    text-align: center;
}

.turnstile-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 65px;
    margin-bottom: 0.5rem;
}

.turnstile-status {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0;
}

.turnstile-status.success {
    color: #059669;
}

.loading-indicator {
    text-align: center;
    padding: 14px 0;
    font-size: 1rem;
    color: var(--ink-soft);
    min-height: 1.4em;
    transition: opacity 0.15s ease;
}

.loading-indicator[hidden] {
    display: block !important;
    visibility: hidden;
    opacity: 0;
}

.loading-indicator.is-animated .loading-dots::after {
    content: "...";
    display: inline-block;
    width: 0;
    overflow: hidden;
    vertical-align: bottom;
    animation: loadingDots 1.2s steps(4, end) infinite;
}

.loading-dots {
    display: inline-block;
    margin-left: 2px;
}

@keyframes loadingDots {
    to {
        width: 1.25em;
    }
}

/* ── Skeleton loading ── */

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-soft) 25%, #e8edf3 37%, var(--bg-soft) 63%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
    display: inline-block;
}

.skeleton-text {
    height: 1em;
    width: 100%;
    margin: 4px 0;
}

.skeleton-text-sm {
    height: 0.84em;
    width: 60%;
}

.skeleton-text-lg {
    height: 1.25em;
    width: 80%;
    vertical-align: middle;
}

.skeleton-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 18px;
}

.skeleton-card .skeleton-name {
    flex: 1;
    height: 1em;
}

.skeleton-card .skeleton-button {
    width: 52px;
    height: 36px;
    border-radius: 999px;
    flex-shrink: 0;
}

.skeleton-table-row td {
    padding: 10px 12px;
}

.skeleton-table-row .skeleton-cell {
    height: 1em;
    border-radius: 4px;
}

.skeleton-paragraph {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-paragraph .skeleton {
    height: 1em;
    width: 100%;
}

.skeleton-paragraph .skeleton:last-child {
    width: 60%;
}

@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
        background: var(--bg-soft);
    }

    .book-title,
    .book-changelog-inline {
        transition: none;
    }

    .vk-key {
        transition: none;
    }

    .vk-delete {
        transition: none;
    }

    .virtual-keyboard.is-active {
        animation: none;
    }
}

.no-results {
    color: var(--ink-soft);
    padding: 10px 2px;
}

.result-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 0;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.result-item:last-child {
    border-bottom: 1px solid var(--border);
}

#partial-match {
    border-left: none;
    border-style: dashed;
    background: #f8fafc;
}

.case-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--ink);
}

.case-title b {
    font-weight: 800;
    background: var(--accent-soft);
    color: var(--ink);
    padding: 0 4px;
    border-radius: 4px;
}

.result-book {
    margin: 0 0 6px;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.result-book-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 6px 0 8px;
}

.result-book-item {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 8px;
    font-size: 0.96rem;
}

.result-book-name {
    color: var(--ink);
    font-weight: 500;
}

.result-book-pages {
    color: var(--ink);
    font-weight: 800;
    font-size: 1.04rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.case-details,
.case-pages {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.result-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.no-results-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px 8px;
    flex-wrap: wrap;
    white-space: normal;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--ink);
}

.no-results-or {
    color: var(--muted);
}

.no-results-actions .lbox-button {
    font-size: 0.82rem;
    padding: 6px 10px;
}

.page-info {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.3rem, 2.6vw, 1.9rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.lbox-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background-color: var(--accent-soft);
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
}

.lbox-button:hover {
    background-color: color-mix(in srgb, var(--accent-mid) 12%, transparent);
    color: #1a1a1a;
}

/* 법제처 한글주소 버튼 */
.moleg-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px 10px;
	background-color: var(--accent-soft);
	color: #1a1a1a;
	text-decoration: none;
	border-radius: 10px;
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1;
}

.moleg-button:hover {
	background-color: color-mix(in srgb, var(--accent) 10%, transparent);
	color: #1a1a1a;
}

/* 결과 카드 버튼 그룹 */
.result-buttons-group {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

/* 참조판례 버튼 */
.ref-cases-button {
	margin-left: 0;
	cursor: pointer;
	border: none;
	line-height: 1;
	min-width: 8.5em;
	background-color: var(--accent-soft);
	color: #1a1a1a;
	transition: background-color 0.2s ease;
}

.ref-cases-button:hover {
	background-color: color-mix(in srgb, var(--accent-mid) 12%, transparent);
}

.ref-cases-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* 참조판례 검색 결과 - 페이지 하단 (기존) */
#referenced-cases-results {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-soft) 100%);
    border-left: 4px solid var(--accent-mid);
    border-radius: 14px;
}

/* 참조판례 검색 결과 - 카드별 인라인 (새로 추가) */
.referenced-cases-inline {
    margin: 1rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-soft) 100%);
    border-left: 4px solid var(--accent-mid);
    border-radius: 14px;
    border-top: 2px dashed var(--border);
}

.referenced-cases-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.referenced-cases-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--ink);
    line-height: 1.5;
    word-break: break-all;
}

.ref-icon {
    font-size: 1.5rem;
}

.ref-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.referenced-cases-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.referenced-case-item {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05);
    margin-bottom: 0;
}

.referenced-case-item:hover {
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.1);
    border-color: var(--accent-mid);
}

.referenced-cases-not-found {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
    border-radius: 10px;
}

.referenced-cases-not-found p {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: #495057;
}

.referenced-cases-not-found ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #495057;
}

/* 참조판례 없음 표시 */
.referenced-cases-empty {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
    border-radius: 10px;
    color: #495057;
}

.referenced-cases-empty p {
    margin: 0;
    font-weight: 500;
}

/* 참조판례 에러 표시 */
.referenced-cases-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #dc2626;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    color: #991b1b;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
}

.error-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.highlight {
    background-color: #e2e8f0;
    padding: 0 3px;
    border-radius: 4px;
}

.load-more {
    display: flex;
    justify-content: center;
    margin: 16px 0 4px;
}

#partial-match,
#no-results,
.load-more {
    opacity: 0;
}

#partial-match.is-entered,
#no-results.is-entered,
.load-more.is-entered {
    opacity: 1;
    transition: opacity var(--motion-normal) var(--ease-standard);
}

#partial-match.is-exiting,
#no-results.is-exiting,
.load-more.is-exiting {
    opacity: 0;
    transition: opacity var(--motion-fast) var(--ease-standard);
}

.book-toolbar {
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 10px 0 6px;
    flex-wrap: wrap;
    width: 100%;
}

.book-section {
    margin-top: 12px;
}

.book-section + .book-section {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.book-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.book-section-header.is-search {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.book-section-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
}

.book-section-row .book-toolbar {
    position: relative;
    padding-left: 12px;
    margin-left: 2px;
}

.book-section-row .book-toolbar::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--border);
    opacity: 0.7;
}

.book-section-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink-soft);
}

.request-rail {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 2px 10px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    animation: request-rail-fade-in 0.25s ease-out both;
}

.request-rail::-webkit-scrollbar {
    display: none;
}

.request-rail::-webkit-scrollbar-thumb {
    background: transparent;
}

.request-rail::-webkit-scrollbar-track {
    background: transparent;
}

.request-rail.request-hint {
    animation: request-rail-bounce 1.8s ease-in-out 0.6s 2;
}

.request-rail-wrap {
    position: relative;
}

.request-rail-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(248, 250, 252, 0), rgba(248, 250, 252, 0.95));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.request-rail-wrap.is-scrollable::after {
    opacity: 1;
}

.request-rail-wrap::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 52px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(270deg, rgba(248, 250, 252, 0), rgba(248, 250, 252, 0.95));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.request-rail-wrap.is-scrollable-start::before {
    opacity: 1;
}

.request-rail-next {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0f172a;
    z-index: 2;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.request-rail-next::before {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    display: block;
    margin-left: -1px;
    opacity: 0.7;
}

.request-rail-prev {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0f172a;
    z-index: 2;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.request-rail-prev::before {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(135deg);
    display: block;
    margin-right: -1px;
    opacity: 0.7;
}

.request-rail-prev:hover {
    transform: translateY(-50%) translateX(-1px);
    opacity: 0.95;
}

.request-rail-next:hover {
    transform: translateY(-50%) translateX(1px);
    opacity: 0.95;
}

.request-rail-prev.is-hidden,
.request-rail-next.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.book-search {
    flex: 1 1 220px;
    min-width: 180px;
}

.book-search.search-form {
    grid-template-columns: minmax(0, 1fr);
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.book-search.search-form:focus-within {
    border-color: var(--accent-mid);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.book-search.search-form input[type="text"] {
    border: none;
    background: transparent;
    padding: 12px 14px 12px 40px;
    padding-right: clamp(6rem, 18vw, 8.5rem);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='11' cy='11' r='6.5' fill='none' stroke='%2394a3b8' stroke-width='1.6' opacity='0.45'/><line x1='16.2' y1='16.2' x2='20.5' y2='20.5' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' opacity='0.45'/></svg>");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 18px 18px;
}

.book-search.search-form input[type="text"]::placeholder {
    color: #94a3b8;
    font-style: italic;
}

.book-search .query-placeholder {
    left: 40px;
}

.book-search .query-placeholder > span {
    animation: book-placeholder-slide 12s ease-in-out infinite;
}

.book-section-header .book-toolbar {
    margin: 0;
    width: auto;
}

.book-toolbar-action {
    display: none;
}

.book-toolbar-toggle.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: #fff;
}

.book-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 6px;
}

.book-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
    transition: transform var(--motion-fast) var(--ease-standard),
        box-shadow var(--motion-fast) var(--ease-standard),
        border-color 0.2s ease;
}

.book-card .primary-button,
.book-card .secondary-button {
    align-self: center;
    flex-shrink: 0;
}

.book-card.is-request {
    background: #edf2f7;
    border-color: transparent;
    box-shadow: none;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 120px;
    flex: 0 0 auto;
    width: fit-content;
    min-width: 180px;
    max-width: 200px;
    scroll-snap-align: start;
}

.book-card.is-request:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.book-card.is-preparing {
    background: #f1f5f9;
    border-color: transparent;
    box-shadow: none;
    opacity: 0.7;
}

.book-card.is-preparing:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.book-card.is-preparing .book-name {
    color: #94a3b8;
}

.preparing-label {
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #94a3b8;
}

.request-intro {
    background: #f9fafb;
    border: 1px dashed #d8e0ea;
    max-width: 170px;
}

.request-intro-text {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.45;
}

.request-upload-button {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    border: 1px solid var(--accent);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.request-upload-button:hover {
    background: #1e293b;
    border-color: #1e293b;
}

.request-upload-button:active {
    background: #111827;
    border-color: #111827;
}

.request-intro-footer {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.request-intro-arrow {
    font-size: 1.1rem;
    color: var(--muted);
}

@keyframes request-rail-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes request-rail-bounce {
    0% {
        transform: translateX(0);
    }
    40% {
        transform: translateX(-12px);
    }
    60% {
        transform: translateX(0);
    }
    80% {
        transform: translateX(-6px);
    }
    100% {
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .request-rail {
        animation: none;
    }

    .request-rail.request-hint {
        animation: none;
    }
}

@media (hover: none) and (pointer: coarse) {
    .request-rail-wrap::after,
    .request-rail-wrap::before,
    .request-rail-prev,
    .request-rail-next {
        display: none;
    }
}

.book-request-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
    width: 100%;
}

.request-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #e2e8f0;
    color: var(--muted);
    align-self: flex-start;
    max-width: 100%;
}

.request-status--pending {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.request-status--processing {
    background: #fef3c7;
    color: #92400e;
}

.request-status--neutral {
    background: #e2e8f0;
    color: var(--muted);
}

.request-action {
    white-space: nowrap;
    align-self: flex-end;
    width: 100%;
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 999px;
}

.request-action.is-disabled {
    pointer-events: none;
    background: #e2e8f0;
    border-color: #d1d9e6;
    color: #94a3b8;
    box-shadow: none;
    opacity: 0.8;
}

.book-card.is-selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px var(--accent-mid);
}

.book-card:hover {
    transform: none;
    border-color: var(--accent-mid);
    background: var(--accent-soft);
    box-shadow: 0 2px 8px rgba(26, 58, 110, 0.08);
}

.book-card:active {
    transform: var(--press-scale);
    box-shadow: var(--press-shadow);
}

.book-card:last-child {
    border-bottom: 1px solid var(--border);
}

.book-card:last-child:hover {
    border-color: var(--accent-mid);
}

.book-name {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    color: var(--ink);
    margin: 0;
    line-height: 1.4;
    word-break: keep-all;
}

.book-select-toggle {
    min-width: 5.5em;
}

.book-select-toggle.is-selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upload-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.upload-actions.is-hidden {
    display: none;
}

.upload-actions-center {
    justify-content: center;
}

.upload-actions .is-hidden {
    display: none;
}

.turnstile-wrap {
    display: flex;
    align-items: center;
    min-height: 60px;
}

.upload-file-list {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 12px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #f8fafc;
    max-height: 360px;
    overflow-y: auto;
}

.upload-file-list.is-dragover {
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
    background-color: color-mix(in srgb, var(--accent) 5%, transparent);
}

.upload-file-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
    position: relative;
    cursor: grab;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.upload-file-item.is-dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: scale(0.98);
}

.upload-file-item.is-drop-target {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.upload-drop-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.9);
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.upload-file-placeholder {
    grid-column: 1 / -1;
    padding: 18px 16px;
    border-radius: 12px;
    color: var(--ink-soft);
    background: rgba(148, 163, 184, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-order-hint {
    grid-column: 1 / -1;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.04);
    color: var(--ink-soft);
    font-size: 0.85rem;
}

.upload-file-placeholder-text {
    margin: 0;
    text-align: center;
    font-size: 0.9rem;
}

.upload-file-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    overflow: hidden;
    background: #eef2f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-file-doc {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.upload-file-index {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: rgba(15, 23, 42, 0.8);
}

.upload-file-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upload-file-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
    word-break: break-word;
}

.upload-file-size {
    font-size: 0.78rem;
    color: var(--ink-soft);
    word-break: break-word;
}

.label-note {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--ink-soft);
    margin-left: 6px;
}

.feedback-status.is-hidden {
    display: none;
}

.panel-sub {
    margin-top: 16px;
}

.feedback-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.feedback-callout-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
}

.feedback-callout-desc {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.feedback-callout-button {
    white-space: nowrap;
}

.feedback-case-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-case-fields.is-hidden {
    display: none;
}

.feedback-field.feedback-inline-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 10px;
}

.feedback-inline-label {
    color: var(--muted);
    font-size: 0.9rem;
    white-space: nowrap;
    text-align: right;
    min-width: 92px;
}

.feedback-note {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.feedback-status {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ink-soft);
    align-self: flex-end;
    min-height: 1.2em;
}

.feedback-status.is-success {
    color: var(--accent-mid);
}

.feedback-status.is-error {
    color: #dc2626;
}

.feedback-form.is-complete .feedback-field,
.feedback-form.is-complete .feedback-note,
.feedback-form.is-complete .upload-actions,
.feedback-form.is-complete input[type="submit"] {
    display: none;
}

.feedback-form.is-complete .feedback-status {
    align-self: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin-top: 8px;
}

.feedback-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feedback-field label {
    font-size: 0.85rem;
    color: var(--muted);
}

.feedback-field input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
}

.feedback-form textarea {
    width: 100%;
    min-height: 220px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    background: #fff;
    color: var(--ink);
}

.feedback-form input[type="submit"] {
    align-self: flex-end;
    padding: 12px 24px;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.feedback-form input[type="submit"]:disabled {
    cursor: not-allowed;
    background: #cbd5e1;
    color: #f8fafc;
    box-shadow: none;
}

.page-footer {
    margin-top: 8px;
}

.panel-caption:empty {
    display: none;
}

.footer-actions {
    text-align: center;
    margin: 0 0 6px;
}

.footer-actions.footer-actions-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--ink);
}

.footer {
    text-align: center;
    font-size: 0.84rem;
    color: var(--muted);
    margin: 0;
}

.admin-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-list li {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    font-size: 0.9rem;
    color: var(--ink);
}

.admin-list .admin-muted {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}

.admin-panel {
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border-radius: 14px;
}

.admin-quick-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 8px;
}

.admin-quick-link {
    display: block;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-quick-link:hover {
    border-color: var(--accent-mid);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.admin-quick-link-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0 0 4px;
}

.admin-quick-link-desc {
    font-size: 0.76rem;
    color: var(--muted);
    margin: 0;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-grid > .admin-panel-full {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .admin-quick-links {
        grid-template-columns: 1fr;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.admin-panel .panel-head {
    margin-bottom: 10px;
}

.admin-panel .panel-title {
    font-size: 1rem;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.admin-table thead th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted);
    background: #f8fafc;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--ink);
    vertical-align: top;
}

.admin-table .admin-input {
    width: 100%;
    min-width: 140px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
}

.admin-table textarea.admin-input {
    min-height: 64px;
    resize: vertical;
}

.admin-table .admin-row-actions {
    white-space: nowrap;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table-compact tbody td {
    padding: 8px 12px;
}

.admin-number {
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.admin-subtle {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--muted);
}

.admin-code {
    font-size: 0.8rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.admin-table .admin-empty {
    text-align: center;
    color: var(--muted);
    padding: 14px 12px;
}

.admin-table .admin-session-item {
    cursor: pointer;
}

.admin-table .admin-session-item:hover td {
    background: #f1f5f9;
}

.admin-table .admin-session-item.is-active td {
    background: #e2e8f0;
}

.admin-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.admin-controls input {
    flex: 1;
    min-width: 180px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    font-family: inherit;
}

.admin-controls select {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
}

.admin-feedback-controls {
    justify-content: flex-end;
    margin-top: 12px;
}

.admin-feedback-row {
    cursor: pointer;
}

.admin-feedback-row:hover td {
    background: #f1f5f9;
}

.admin-feedback-row.is-active td {
    background: #e2e8f0;
}

.admin-feedback-message-cell {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-feedback-detail.is-hidden {
    display: none;
}

.admin-feedback-detail-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-feedback-detail-meta {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

.admin-feedback-detail-message {
    white-space: pre-wrap;
    line-height: 1.6;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.admin-feedback-screenshots-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    margin: 4px 0 0;
}

.admin-feedback-screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.admin-feedback-screenshot-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}

.admin-feedback-screenshot-img {
    width: 100%;
    display: block;
    cursor: pointer;
}

.admin-feedback-screenshot-img:hover {
    opacity: 0.9;
}

.admin-feedback-screenshot-info {
    padding: 6px 8px;
    font-size: 0.8rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-feedback-screenshots-status {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 4px 0 0;
}

.admin-session-item {
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-session-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.admin-session-item.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(26, 58, 110, 0.12);
}

.admin-status {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 10px 0 0;
}

.site-footer {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    text-align: center;
}

.site-footer .intro-note {
    margin: 0;
    text-align: center;
}

.site-footer .site-footer-maker {
    margin-top: 0;
}

.site-footer-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.site-footer .site-footer-update {
    margin-top: 0;
}

.site-footer-admin {
    margin-top: 0;
    align-self: center;
}

.admin-toggle {
    color: var(--muted);
    font-size: 0.75rem;
    text-decoration: none;
    padding: 4px 6px;
}

.admin-toggle:hover {
    color: var(--ink-soft);
    text-decoration: underline;
}

.share-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 40;
}

.share-modal.is-open {
    display: flex;
}

.share-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(6px);
}

.share-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    background: #fff;
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
}

.share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.share-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.share-caption {
    margin: 8px 0 12px;
    font-size: 0.88rem;
    color: var(--ink-soft);
}

.share-content {
    margin: 0;
    padding: 12px;
    background: #f1f5f9;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--ink);
    white-space: pre-wrap;
    word-break: break-word;
}

.share-countdown {
    font-weight: 700;
    color: var(--ink);
}

.guide-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 45;
}

.guide-modal.is-open {
    display: flex;
}

.guide-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(6px);
}

.guide-dialog {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: 82dvh;
    background: #fff;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: guide-slide-up 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes guide-slide-up {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.guide-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.guide-close {
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--ink);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
}

.guide-close:hover {
    background: #e2e8f0;
}

.lbox-button,
.moleg-button,
.ref-cases-button,
.guide-close,
#load-more-button {
    transition: background-color 0.2s ease,
        transform var(--motion-fast) var(--ease-standard),
        box-shadow var(--motion-fast) var(--ease-standard);
}

.lbox-button:active,
.moleg-button:active,
.ref-cases-button:active,
.guide-close:active,
#load-more-button:active {
    transform: var(--press-scale);
    box-shadow: var(--press-shadow);
    background-color: var(--surface-pressed);
}

.guide-body {
    padding: 16px 18px 20px;
    overflow-y: auto;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
}

.toast.is-visible {
    animation: toastFade 2.4s ease forwards;
}

.copy-toast {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink, #0f172a);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.88rem;
    z-index: 9999;
    animation: copy-toast-in 0.2s ease-out, copy-toast-out 0.3s ease-in 2s forwards;
    pointer-events: none;
}

.admin-entry {
    text-align: center;
    margin-top: 8px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardRise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastFade {
    0% {
        opacity: 0;
        transform: translate(-50%, 6px);
    }
    12% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, 6px);
    }
}

@keyframes copy-toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes copy-toast-out {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
}

@keyframes placeholder-marquee {
    0% {
        transform: translateX(0);
    }
    35% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

@keyframes book-placeholder-slide {
    0% {
        transform: translateX(0);
    }
    45% {
        transform: translateX(0);
    }
    80% {
        transform: translateX(-35%);
    }
    100% {
        transform: translateX(0);
    }
}

@media (max-width: 820px) {
    .shell {
        padding: 12px 6px 18px;
    }

    .book-section-row .book-toolbar {
        padding-left: 0;
        margin-left: 0;
    }

    .book-section-row .book-toolbar::before {
        display: none;
    }

    .hero {
        align-items: flex-start;
    }

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

@media (max-width: 640px) {
    .page {
        padding: 10px 6px 20px;
    }

    .shell {
        padding: 6px 2px 12px;
    }

    .hero {
        margin-bottom: 14px;
    }

    .panel {
        margin-top: 10px;
    }

    .panel-head {
        margin-bottom: 6px;
    }

    .search-form {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        padding: 6px;
    }

    .query-placeholder {
        display: block;
    }

    .query-field input[type="text"]::placeholder {
        color: transparent;
    }

    .book-search.search-form input[type="text"]::placeholder {
        color: transparent;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding-bottom: 8px;
    }

    .topbar-actions {
        gap: 10px;
        flex-wrap: wrap;
    }

    .intro-note {
        margin-bottom: 10px;
    }

    .book-card {
        align-items: center;
    }

    .feedback-callout {
        flex-direction: column;
        align-items: flex-start;
    }

    .feedback-callout-button {
        width: 100%;
        justify-content: center;
    }

    .status-row,
    .status-table.has-action .status-row {
        grid-template-columns: 1fr;
    }

    .status-action {
        width: 100%;
        justify-content: flex-start;
    }

    .status-action-button {
        width: 100%;
        justify-content: center;
    }

    .virtual-keyboard {
        margin-top: 6px;
        padding: 10px;
    }

    .vk-row {
        gap: 6px;
    }

    .vk-key {
        min-height: 56px;
        font-size: 0.92rem;
    }

    .guide-dialog {
        margin: 0 8px;
        max-height: 88dvh;
        border-radius: 16px;
    }

    .guide-body {
        padding: 12px 14px 16px;
    }

    .fm-cards {
        grid-template-columns: 1fr;
    }

    .fm-field-row {
        grid-template-columns: 1fr;
    }

    .fm-field-label {
        text-align: left;
        min-width: auto;
    }
}

@media (min-width: 641px) {
    .guide-dialog {
        animation: guide-scale-in 0.22s cubic-bezier(0.32, 0.72, 0, 1);
    }
}

@keyframes guide-scale-in {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .query-placeholder > span {
        animation: none;
    }
}

@media (max-width: 360px) {
    .shell {
        padding: 4px 0 10px;
    }

    .vk-row {
        gap: 6px;
    }

    .vk-key {
        min-height: 52px;
        font-size: 0.88rem;
    }
}

/* Book Categories */
.book-category {
    margin-bottom: 2rem;
}

.category-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.book-category .book-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ============================================================================
   Screenshot Upload Styles (Error Reports)
   ============================================================================ */

.feedback-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    display: block;
    margin-bottom: 8px;
}

.feedback-screenshots-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-screenshots-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.feedback-screenshots-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.feedback-screenshots-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.feedback-screenshot-item {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: #f8fafc;
}

.feedback-screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feedback-screenshot-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

.feedback-screenshot-remove:hover {
    background: rgba(0, 0, 0, 0.8);
}

.feedback-screenshots-status {
    font-size: 13px;
    margin: 0;
    min-height: 20px;
}

.feedback-screenshots-status.is-uploading {
    color: var(--accent);
}

.feedback-screenshots-status.is-error {
    color: #dc2626;
}

/* ============================================================================
   Batch Search
   ============================================================================ */

.batch-search-entry {
    margin: 16px 0;
    text-align: center;
}

.batch-label {
    display: block;
    font-size: 0.9rem;
    color: var(--ink-soft);
    font-weight: 500;
    margin-bottom: 8px;
}

.batch-textarea {
    width: 100%;
    min-height: 280px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    background: #fff;
    color: var(--ink);
    line-height: 1.6;
    box-sizing: border-box;
}

.batch-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.batch-hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 8px 0;
}

.batch-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

/* Batch Progress Bar */
.batch-progress {
    margin-bottom: 16px;
}

.batch-progress-bar {
    height: 8px;
    background: var(--bg-soft);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.batch-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.batch-progress-text {
    margin: 8px 0 0;
    font-size: 0.88rem;
    color: var(--ink-soft);
    text-align: center;
}

/* Batch Results List */
.batch-results-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.92rem;
}

.batch-result-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.batch-result-case {
    font-weight: 600;
    color: var(--ink);
    min-width: 140px;
}

.batch-result-arrow {
    color: var(--muted);
}

.batch-result-pages {
    color: var(--ink);
    font-weight: 700;
}

.batch-result-item.is-not-found .batch-result-pages {
    color: var(--muted);
    font-weight: 400;
}

.batch-result-index {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.88rem;
    min-width: 40px;
    text-align: right;
}

.batch-result-heading {
    font-weight: 700;
    font-size: 1rem;
    color: var(--ink);
    flex: 1;
}

.batch-result-item.is-heading {
    background: var(--bg-soft);
    border-color: var(--border);
}

/* 참조판례 버튼 */
.batch-ref-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 6px;
    margin-left: auto;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.batch-ref-button:hover {
    opacity: 1;
}

/* 참조판례 결과 영역 */
.batch-ref-results {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--bg-soft);
    border-radius: 6px;
    font-size: 0.88rem;
    width: 100%;
}

.batch-ref-loading,
.batch-ref-empty,
.batch-ref-error {
    color: var(--muted);
    margin: 0;
}

.batch-ref-error {
    color: var(--danger);
}

.batch-ref-title {
    font-weight: 600;
    margin: 0 0 6px 0;
    color: var(--ink);
}

.batch-ref-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.batch-ref-item {
    padding: 4px 0;
}

.batch-ref-item.is-not-found {
    color: var(--muted);
}

/* 구조 라인 (헤딩, 페이지 마커 등) */
.batch-result-item.is-structure {
    background: transparent;
    border: none;
    padding: 4px 0;
}

.batch-result-structure {
    white-space: pre;
    color: var(--ink);
}

.batch-result-item.is-heading .batch-result-structure {
    font-weight: 700;
}

@media (max-width: 640px) {
    .batch-textarea {
        min-height: 200px;
    }

    .batch-result-item {
        flex-wrap: wrap;
    }

    .batch-result-case {
        min-width: 100%;
    }
}

/* ===== 여러 책 선택 UI ===== */
.book-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.book-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.book-select-item:hover {
    background: var(--surface);
    border-color: var(--ink-soft);
}

.book-select-item.is-selected {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.book-select-item.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.book-select-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.book-select-item.is-disabled input[type="checkbox"] {
    cursor: not-allowed;
}

.book-select-label {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.3;
}

.book-select-category {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 2px;
}

.book-select-status {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
}

@media (max-width: 640px) {
    .book-select-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Feedback Modal ── */

.fm-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    z-index: 50;
}

.fm-overlay.is-open {
    display: flex;
}

.fm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.fm-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fm-slide-up 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes fm-slide-up {
    from { transform: translateY(100%); opacity: 0.5; }
    to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 641px) {
    .fm-overlay {
        align-items: center;
        padding: 20px;
    }
    .fm-dialog {
        border-radius: 20px;
        box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
        animation: fm-scale-in 0.22s cubic-bezier(0.32, 0.72, 0, 1);
    }
    @keyframes fm-scale-in {
        from { transform: scale(0.95); opacity: 0; }
        to { transform: scale(1); opacity: 1; }
    }
}

.fm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.fm-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
}

.fm-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--ink-soft);
    cursor: pointer;
    transition: background 0.15s;
}

.fm-close:hover {
    background: var(--border);
}

.fm-body {
    padding: 20px;
    overflow-y: auto;
}

.fm-step.is-hidden {
    display: none;
}

.fm-step-enter {
    animation: fm-fade-in 0.2s ease;
}

@keyframes fm-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fm-subtitle {
    margin: 0 0 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
}

.fm-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.fm-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.fm-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(26, 58, 110, 0.08);
    transform: translateY(-1px);
}

.fm-card:active {
    transform: translateY(0);
}

.fm-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--bg-soft);
    color: var(--accent);
}

.fm-card-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
}

.fm-card-desc {
    font-size: 0.8rem;
    color: var(--ink-soft);
    text-align: center;
}

.fm-footer-link {
    margin-top: 20px;
    text-align: center;
}

.fm-footer-link a,
.fm-footer-link .fm-email-copy {
    font-size: 0.82rem;
    color: var(--ink-soft);
    text-decoration: none;
}

.fm-footer-link .fm-email-copy {
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}

.fm-footer-link a:hover,
.fm-footer-link .fm-email-copy:hover {
    color: var(--accent);
    text-decoration: underline;
}

.fm-footer-link .fm-email-copy:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 4px;
}

.fm-back {
    background: none;
    border: none;
    color: var(--ink-soft);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 12px;
}

.fm-back:hover {
    color: var(--accent);
}

.fm-error-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.fm-error-fields.is-hidden {
    display: none;
}

.fm-field-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
}

.fm-field-label {
    color: var(--ink-soft);
    font-size: 0.85rem;
    white-space: nowrap;
    min-width: 50px;
    text-align: right;
}

.fm-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.fm-input:focus {
    outline: none;
    border-color: var(--accent);
}

.fm-textarea {
    width: 100%;
    min-height: 140px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    background: #fff;
    color: var(--ink);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.fm-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.fm-screenshots {
    margin-top: 12px;
}

.fm-screenshots.is-hidden {
    display: none;
}

.fm-screenshots-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fm-screenshot-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--ink);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s;
}

.fm-screenshot-btn:hover {
    background: var(--border);
}

.fm-screenshot-hint {
    font-size: 0.78rem;
    color: var(--ink-soft);
}

.fm-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.fm-preview-item {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-soft);
}

.fm-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-preview-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

.fm-preview-remove:hover {
    background: rgba(0, 0, 0, 0.8);
}

.fm-screenshot-status {
    font-size: 0.78rem;
    margin: 4px 0 0;
    min-height: 1em;
}

.fm-screenshot-status.is-uploading {
    color: var(--accent);
}

.fm-screenshot-status.is-error {
    color: #dc2626;
}

.fm-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.fm-submit {
    padding: 10px 28px;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.fm-submit:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.fm-submit:not(:disabled):hover {
    filter: brightness(1.08);
}

.fm-status {
    margin: 8px 0 0;
    font-size: 0.82rem;
    text-align: right;
    min-height: 1.2em;
}

.fm-status.is-error {
    color: #dc2626;
}

.fm-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 20px;
}

.fm-checkmark {
    animation: fm-check-pop 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes fm-check-pop {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.fm-check-circle {
    stroke-dasharray: 140;
    stroke-dashoffset: 140;
    animation: fm-circle-draw 0.5s 0.1s ease forwards;
}

@keyframes fm-circle-draw {
    to { stroke-dashoffset: 0; }
}

.fm-check-path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: fm-check-draw 0.35s 0.35s ease forwards;
}

@keyframes fm-check-draw {
    to { stroke-dashoffset: 0; }
}

.fm-done-text {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
}

.fm-done-sub {
    margin: 0;
    font-size: 0.88rem;
    color: var(--ink-soft);
}

.fm-done-email-notice {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* === Statute Search === */

.statute-guide-header {
    margin-bottom: 10px;
}

.statute-hint {
    padding: 8px 0;
    margin: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.statute-hint-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.82rem;
    color: var(--ink-soft);
    cursor: pointer;
    border-radius: 4px;
}

.statute-hint-item:hover {
    color: var(--ink);
}

.statute-hint--confirmed .statute-hint-item {
    cursor: default;
}

.statute-hint--confirmed .statute-hint-name {
    color: var(--accent);
    font-weight: 600;
}

.statute-hint--confirmed .statute-hint-key {
    color: var(--accent);
}

.statute-hint-name {
    color: var(--ink-soft);
}

.statute-hint-key {
    font-weight: 600;
    color: var(--accent-mid);
    min-width: 2.5em;
}

/* ─── Case Guide (빈 상태 검색 예시) ─── */

.case-guide {
    padding: 6px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: case-guide-in 0.18s ease both;
    transition: opacity 0.15s ease-out;
}

.case-guide.fade-out {
    opacity: 0;
    pointer-events: none;
}

@keyframes case-guide-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === OCR Upload Page (ou-*) === */

.ou-shell {
    max-width: 560px;
    margin: 0 auto;
    padding-top: 24px;
    padding-bottom: 32px;
}

.ou-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.ou-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--border);
}

.ou-header h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.ou-desc {
    margin: 6px 0 0;
    font-size: 0.88rem;
    color: var(--ink-soft);
    line-height: 1.5;
}

.ou-body {
    padding: 24px;
}

.ou-body .feedback-field input[list]::-webkit-calendar-picker-indicator {
    display: none !important;
}

.ou-body .feedback-field input[type="text"],
.ou-body .feedback-form textarea {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: border-color 0.15s;
}

.ou-body .feedback-field input[type="text"]:focus,
.ou-body .feedback-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.ou-body .feedback-form textarea {
    min-height: 80px;
}

.ou-body .feedback-form input[type="submit"] {
    width: 100%;
    padding: 12px 28px;
    border-radius: 999px;
    transition: background 0.15s, opacity 0.15s;
}

.ou-body .feedback-form input[type="submit"]:disabled {
    opacity: 0.4;
    background: var(--accent);
    color: #fff;
}

.ou-body .feedback-form input[type="submit"]:not(:disabled):hover {
    filter: brightness(1.08);
}

.ou-tip {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--accent-soft);
    font-size: 0.82rem;
    color: var(--ink-soft);
    line-height: 1.5;
}

.ou-tip-icon {
    flex-shrink: 0;
    color: var(--accent-mid);
    margin-top: 1px;
}

.ou-tip-link {
    margin-left: auto;
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ou-tip-link:hover {
    filter: brightness(1.08);
}

.ou-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 20px;
    animation: fm-fade-in 0.2s ease;
}

.ou-done.is-hidden {
    display: none;
}

.ou-done-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding: 10px 24px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.ou-done-home:hover {
    background: var(--bg-soft);
    border-color: color-mix(in srgb, var(--border) 80%, var(--accent));
}

.ou-body .feedback-form.is-complete {
    display: none;
}

@media (max-width: 640px) {
    .ou-shell {
        padding-top: 12px;
        padding-bottom: 20px;
    }

    .ou-card {
        border-radius: 16px;
    }

    .ou-header {
        padding: 20px 18px 16px;
    }

    .ou-body {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .case-guide {
        animation: none;
    }
}

.case-guide-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.case-guide-heading {
    margin: 0 0 3px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.case-guide-desc {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.5;
}

.case-guide-examples {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.case-guide-examples li {
    font-size: 0.82rem;
    color: var(--ink-soft);
    letter-spacing: 0.01em;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .case-guide {
        gap: 14px;
        padding: 4px 0 8px;
    }
}

.statute-result {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.statute-result-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.statute-result-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--ink);
}

.statute-result-path {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin: 0;
}

.statute-article {
    margin-bottom: 8px;
}

.statute-level-jo {
    margin-bottom: 12px;
}

.statute-article-content {
    margin: 4px 0 0;
    line-height: 1.7;
    color: var(--ink);
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.statute-article-children {
    padding-left: 16px;
    margin-top: 6px;
}

.statute-result-empty {
    color: var(--ink-soft);
    font-size: 0.92rem;
    margin: 8px 0;
}

/* --- book list badges & date --- */
.book-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}
.book-badge.pub { background: #dcfce7; color: #166534; }
.book-badge.priv { background: #f1f5f9; color: #64748b; }

.book-date-cell { color: var(--muted, #64748b); font-size: 0.82rem; white-space: nowrap; }

.add-book-cta {
    text-align: center;
    padding: 28px 20px;
    margin: 24px 0 0;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.add-book-cta-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

.add-book-cta-button {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.15s;
}

.add-book-cta-button:hover {
    opacity: 0.9;
}

.ou-scanner-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1.5px solid var(--accent);
    border-radius: 10px;
    background: var(--accent-soft, #eef4ff);
    font-size: 0.9rem;
    color: var(--ink);
    cursor: pointer;
    user-select: none;
}
.ou-scanner-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}
