.ytb_board,
.ytb_view,
.ytb_write {
    margin: 0;
    color: #1f2937;
    font-family: inherit;
}

.ytb_view,
.ytb_write,
.ytb_write #fwrite {
    width: auto;
    max-width: none;
}

.ytb_board *,
.ytb_view *,
.ytb_write * {
    box-sizing: border-box;
}

.ytb_toolbar,
.ytb_view_tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.ytb_total {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
}

.ytb_total strong {
    color: #111827;
    font-size: 24px;
}

.ytb_actions,
.ytb_nav_btns,
.ytb_share {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ytb_icon_btn,
.ytb_write_btn,
.ytb_manage_btn,
.ytb_share_btn,
.ytb_cancel,
.ytb_submit button,
.ytb_small_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.ytb_icon_btn {
    width: 38px;
    padding: 0;
}

.ytb_write_btn,
.ytb_submit button {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff;
}

.ytb_category ul {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.ytb_category a {
    display: block;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    color: #374151;
    text-decoration: none;
}

.ytb_category #bo_cate_on {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.ytb_grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ytb_card {
    position: relative;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.ytb_card.is-current {
    border-color: #dc2626;
}

.ytb_card_check {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
}

.ytb_thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111827;
    color: #fff;
    text-decoration: none;
}

.ytb_thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.ytb_card:hover .ytb_thumb img {
    transform: scale(1.04);
}

.ytb_play {
    position: absolute;
    left: 50%;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(220, 38, 38, .94);
    color: #fff;
    transform: translate(-50%, -50%);
}

.ytb_notice,
.ytb_no_video {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 8px;
    color: #d1d5db;
}

.ytb_card_body {
    padding: 16px;
}

.ytb_cate {
    display: inline-flex;
    margin-bottom: 8px;
    color: #dc2626;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.ytb_title {
    display: block;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    word-break: keep-all;
}

.ytb_new,
.ytb_comment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
}

.ytb_card_body p {
    min-height: 0;
    margin: 10px 0 14px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.ytb_sermon_info {
    display: grid;
    gap: 8px;
    margin: 12px 0 0;
}

.ytb_sermon_info div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ytb_sermon_info dt {
    flex: 0 0 auto;
    margin: 0;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.ytb_sermon_info dd {
    min-width: 0;
    margin: 0;
    color: #111827;
    font-size: 14px;
    line-height: 1.4;
    word-break: keep-all;
}

.ytb_sermon_info_card {
    padding: 12px 0 0;
}

.ytb_sermon_info_view {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 16px 0;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}

.ytb_meta,
.ytb_view_meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: #6b7280;
    font-size: 13px;
}

.ytb_meta i,
.ytb_view_meta i {
    margin-right: 5px;
}

.ytb_empty {
    grid-column: 1 / -1;
    padding: 48px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    text-align: center;
}

.ytb_manage {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.ytb_search_layer {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(17, 24, 39, .55);
}

.ytb_search_layer.is-open {
    display: flex;
}

.ytb_search_box {
    display: grid;
    grid-template-columns: 160px minmax(180px, 420px) 44px 44px;
    gap: 8px;
    width: min(720px, 100%);
    padding: 16px;
    border-radius: 8px;
    background: #fff;
}

.ytb_search_box select,
.ytb_search_box input,
.ytb_search_box button,
.ytb_field input,
.ytb_field select,
.ytb_field textarea {
    min-height: 44px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #111827;
}

.ytb_search_box input,
.ytb_field input,
.ytb_field select {
    width: 100%;
    padding: 0 12px;
}

.ytb_view_head {
    margin-bottom: 20px;
}

.ytb_view_head h1 {
    margin: 6px 0 10px;
    color: #111827;
    font-size: 32px;
    line-height: 1.25;
    letter-spacing: 0;
    word-break: keep-all;
}

.ytb_share_btn {
    min-height: 34px;
    padding: 0 11px;
    font-size: 13px;
}

.ytb_player_area {
    margin-bottom: 28px;
}

.ytb_player {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
    aspect-ratio: 16 / 9;
}

.ytb_player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.ytb_player_empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    text-align: center;
}

.ytb_player_empty strong {
    color: #111827;
    font-size: 20px;
}

.ytb_content {
    padding: 24px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    line-height: 1.75;
}

.ytb_files {
    margin-top: 24px;
}

.ytb_files ul,
.ytb_prevnext {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ytb_files li,
.ytb_prevnext a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    text-decoration: none;
}

.ytb_prevnext {
    margin-top: 24px;
}

.ytb_prevnext span {
    flex: 0 0 auto;
    color: #dc2626;
    font-weight: 700;
}

.ytb_write_panel {
    display: grid;
    gap: 18px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.ytb_sermon_fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ytb_field_grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ytb_field {
    display: grid;
    gap: 8px;
}

.ytb_field label {
    color: #111827;
    font-weight: 700;
}

.ytb_field label strong {
    margin-left: 3px;
    color: #dc2626;
}

.ytb_field .wr_content textarea,
.ytb_field textarea {
    width: 100%;
    min-height: 220px;
    padding: 12px;
}

.ytb_options {
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ytb_submit {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

#autosave_wrapper {
    position: relative;
    display: grid;
    gap: 8px;
}

#autosave_pop {
    display: none;
}

.pg_wrap {
    margin-top: 26px;
    text-align: center;
}

@media (max-width: 980px) {
    .ytb_grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ytb_toolbar,
    .ytb_view_tools {
        align-items: stretch;
        flex-direction: column;
    }

    .ytb_actions,
    .ytb_nav_btns,
    .ytb_share {
        width: 100%;
    }

    .ytb_grid,
    .ytb_field_grid,
    .ytb_sermon_fields,
    .ytb_sermon_info_view {
        grid-template-columns: 1fr;
    }

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

    .ytb_view_head h1 {
        font-size: 24px;
    }

    .ytb_write_panel {
        padding: 16px;
    }
}
