.dk_page { --dk-blue: #183E98; --dk-blue2: #3b78b9; --dk-green: #78B82A; --dk-line: #e3e8f2; --dk-soft: #eef3fb; --dk-muted: #66728a;
    max-width: 1240px; margin: 0 auto; padding: 8px 16px 40px; color: #142033; }
.dk_page h1, .dk_page h2, .dk_page h3 { color: #101b30; }
.dk_crumbs { font-size: 14px; color: var(--dk-muted); margin: 6px 0 12px; }
.dk_crumbs a { color: var(--dk-blue2); }

.dk_hero, .dk_filters { background: #fff; border: 1px solid var(--dk-line); border-radius: 22px; padding: 28px; margin-bottom: 20px; }
.dk_hero h1 { font-size: clamp(28px, 4.5vw, 48px); line-height: 1.12; margin: 0 0 14px; font-weight: 800; letter-spacing: -.5px; }
.dk_hero p { max-width: 720px; font-size: 17px; line-height: 1.6; color: #3c475c; margin: 0 0 22px; }
.dk_stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dk_stats div { background: var(--dk-soft); border: 1px solid #dbe5f5; border-radius: 16px; padding: 16px 18px; }
.dk_stats b { display: block; font-size: 30px; color: var(--dk-blue); font-weight: 800; }
.dk_stats span { color: #4a5568; font-size: 14px; }

.dk_pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dk_pill { padding: 9px 18px; border: 1px solid var(--dk-line); border-radius: 999px; color: #142033 !important; text-decoration: none; font-weight: 600; background: #fff; }
.dk_pill_num { min-width: 46px; text-align: center; padding: 9px 0; }
.dk_pill:hover { border-color: var(--dk-blue2); }
.dk_pill.active { background: var(--dk-blue); border-color: var(--dk-blue); color: #fff !important; }
.dk_controls { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.dk_controls input, .dk_controls select { height: 50px; border: 1px solid #d5dceb; border-radius: 14px; padding: 0 16px; font-size: 16px; background: #fff; width: 100%; }
.dk_controls input:focus, .dk_controls select:focus { outline: 2px solid rgba(59,120,185,.35); border-color: var(--dk-blue2); }
.dk_found { margin: 14px 0 0; color: #4a5568; }

.dk_group { margin: 30px 0; }
.dk_group_head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 26px 0 14px; }
.dk_group_head h2 { font-size: 26px; margin: 0; font-weight: 800; }
.dk_group_head small { font-size: 15px; color: var(--dk-muted); font-weight: 500; }
.dk_group_head a { color: var(--dk-blue2); font-weight: 600; white-space: nowrap; }
.dk_grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }

.dk_card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--dk-line); border-radius: 18px; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.dk_card:hover { box-shadow: 0 10px 28px rgba(24,62,152,.12); transform: translateY(-2px); }
.dk_card[hidden], .dk_group[hidden] { display: none; }
.dk_cover { position: relative; display: block; aspect-ratio: 3 / 4.2; background: var(--dk-soft); overflow: hidden; }
.dk_cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.dk_cover_ph { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; padding: 16px; text-align: center;
    background: linear-gradient(150deg, var(--dk-blue), var(--dk-blue2)); color: #fff; font-weight: 700; font-size: 18px; }
.dk_cover_ph b { font-size: 56px; }
.dk_chips { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.dk_chips span { background: rgba(255,255,255,.95); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; color: #142033; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.dk_kind { position: absolute; bottom: 10px; left: 10px; border-radius: 8px; padding: 3px 9px; font-size: 12px; font-weight: 700; }
.dk_kind_metodika { background: #e9f6da; color: #3f6d10; }
.dk_kind_mashq { background: #fff1db; color: #8a5200; }
.dk_body { display: flex; flex-direction: column; gap: 8px; padding: 14px; flex: 1; }
.dk_title { font-size: 17px; margin: 0; line-height: 1.3; font-weight: 700; }
.dk_meta { margin: 0 0 4px; color: var(--dk-muted); font-size: 14px; flex: 1; }
.dk_btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px;
    background: var(--dk-blue); color: #fff !important; font-weight: 700; text-decoration: none; transition: background .15s; }
.dk_btn:hover { background: #12307a; }
.dk_btn_light { background: var(--dk-soft); color: var(--dk-blue) !important; }
.dk_btn_light:hover { background: #dfe8f7; }
.dk_empty { text-align: center; padding: 40px; color: var(--dk-muted); }
.dk_source { font-size: 13px; color: var(--dk-muted); margin-top: 28px; }

.dk_reader_head h1 { font-size: clamp(24px, 3.5vw, 34px); margin: 4px 0 4px; font-weight: 800; }
.dk_reader_head p { margin: 0 0 12px; color: var(--dk-muted); }
.dk_tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.dk_tag { background: #f1f4f9; border-radius: 999px; padding: 5px 12px; font-size: 14px; font-weight: 600; }
.dk_tag_main { background: var(--dk-soft); color: var(--dk-blue); }
.dk_toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff;
    border: 1px solid var(--dk-line); border-radius: 16px; padding: 10px 12px; margin-bottom: 12px; }
.dk_toolbar button { width: 44px; height: 44px; border: 1px solid var(--dk-line); border-radius: 12px; background: #fff; font-size: 22px; cursor: pointer; }
.dk_toolbar button:hover { border-color: var(--dk-blue2); }
.dk_toolbar input { width: 70px; height: 44px; border: 1px solid #d5dceb; border-radius: 12px; text-align: center; font-size: 16px; }
.dk_total { color: var(--dk-muted); }
.dk_sep { width: 10px; }
#dk_zoom { min-width: 52px; text-align: center; font-weight: 600; }
.dk_toolbar_dl { margin-left: auto; }
.dk_viewer { position: relative; background: #e9eef6; border-radius: 18px; padding: 12px; min-height: 60vh; text-align: center; overflow: auto; }
.dk_viewer canvas { background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.12); max-width: none; cursor: pointer; }
.dk_viewer canvas { visibility: hidden; }
.dk_viewer.ready canvas { visibility: visible; }
.dk_loading { position: absolute; top: 40%; left: 0; right: 0; color: var(--dk-muted); }

@media (max-width: 760px) {
    .dk_hero, .dk_filters { padding: 18px; border-radius: 18px; }
    .dk_stats { grid-template-columns: repeat(2, 1fr); }
    .dk_stats b { font-size: 24px; }
    .dk_controls { grid-template-columns: 1fr; }
    .dk_grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .dk_body { padding: 10px; }
    .dk_title { font-size: 15px; }
    .dk_btn { height: 40px; padding: 0 10px; font-size: 14px; }
    .dk_group_head h2 { font-size: 21px; }
    .dk_toolbar_dl { margin-left: 0; width: 100%; }
    .dk_viewer { padding: 6px; }
}

/* Kitob sahifasi */
.dk_info { display: grid; grid-template-columns: 260px 1fr; gap: 32px; background: #fff; border: 1px solid var(--dk-line); border-radius: 22px; padding: 28px; }
.dk_info_cover { display: block; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 4.2; background: var(--dk-soft); box-shadow: 0 10px 30px rgba(24,62,152,.15); }
.dk_info_cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.dk_info_body h1 { font-size: clamp(24px, 3.5vw, 36px); margin: 0 0 6px; font-weight: 800; line-height: 1.2; }
.dk_info_sub { margin: 0 0 14px; color: var(--dk-muted); }
.dk_info_text { line-height: 1.65; margin: 0 0 22px; max-width: 620px; }
.dk_info_actions { display: flex; flex-wrap: wrap; gap: 12px; }
.dk_btn_big { height: 52px; padding: 0 28px; font-size: 17px; border-radius: 14px; }

/* Faqat o'qish sahifasi */
.dk_read_body { margin: 0; background: #f4f7fb; font-family: Inter, -apple-system, "Segoe UI", Roboto, sans-serif; }
html[data-theme="dark"] .dk_read_body { background: var(--d-bg); }
.dk_read { max-width: 1240px; padding: 0 16px 16px; }
.dk_read_bar { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 3px solid #f5b81f; margin-bottom: 12px; }
.dk_back { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 44px;
    border: 1px solid var(--dk-line); border-radius: 12px; color: inherit !important; background: #fff; }
.dk_read_logo { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 44px;
    border-radius: 12px; background: linear-gradient(135deg, var(--dk-blue), var(--dk-blue2)); color: #fff !important; }
.dk_read_title { flex: 1; min-width: 0; }
.dk_read_title h1 { font-size: 20px; margin: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk_read_title p { margin: 2px 0 0; color: var(--dk-muted); font-size: 14px; }
.dk_read .dk_viewer { min-height: calc(100vh - 170px); }
.dk_read .theme_btn { margin-left: 0; }
html[data-theme="dark"] .dk_back { background: var(--d-surface); }
html[data-theme="dark"] .dk_read_bar { border-bottom-color: #8a6a12; }

@media (max-width: 760px) {
    .dk_info { grid-template-columns: 1fr; padding: 18px; gap: 18px; }
    .dk_info_cover { max-width: 220px; margin: 0 auto; }
    .dk_info_actions .dk_btn { flex: 1 1 100%; }
    .dk_read_title h1 { font-size: 16px; }
    .dk_read_logo { display: none; }
    .dk_toolbar button { width: 40px; height: 40px; }
    .dk_toolbar :is(#dk_out, #dk_in, #dk_zoom, .dk_sep) { display: none; }
    .dk_toolbar { gap: 6px; padding: 8px; }
}
