/*
Theme Name: MANGAKAIRO Library
Theme URI: https://mangakairo.com/
Author: MANGAKAIRO
Description: Front-end reader theme for Manga Library Connector and MGLB Core.
Version: 1.0.9
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: mangakairo
*/

:root {
  --mk-bg: #111215;
  --mk-bg-soft: #18191e;
  --mk-panel: #202126;
  --mk-panel-strong: #292a31;
  --mk-line: #35363f;
  --mk-text: #f2eee8;
  --mk-muted: #aaa9b0;
  --mk-accent: #c34f58;
  --mk-accent-strong: #dc6670;
  --mk-accent-soft: rgba(195, 79, 88, .16);
  --mk-success: #72b48f;
  --mk-warning: #e2b866;
  --mk-danger: #e67676;
  --mk-radius: 14px;
  --mk-shadow: 0 18px 60px rgba(0, 0, 0, .28);
  --mk-max: 1200px;
  --mk-hero-max: 2200px;
  --mk-font: "Kanit", "Noto Sans Thai", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--mk-bg);
  color: var(--mk-text);
  font-family: var(--mk-font);
  font-size: 16px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}
body.mk-reader-open { background: #090a0c; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--mk-accent-strong); outline-offset: 3px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 99999; top: 12px; left: 12px; width: auto; height: auto; clip: auto; padding: 10px 14px; background: var(--mk-text); color: var(--mk-bg); }
.mk-shell { width: min(calc(100% - 32px), var(--mk-max)); margin-inline: auto; }
.mk-main { min-height: 64vh; }
.mk-section { padding-block: clamp(32px, 6vw, 72px); }
.mk-section + .mk-section { border-top: 1px solid var(--mk-line); }
.mk-eyebrow { margin: 0 0 6px; color: var(--mk-accent-strong); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.mk-section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.mk-section-head h1, .mk-section-head h2 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.25; }
.mk-section-head p { margin: 4px 0 0; color: var(--mk-muted); }
.mk-more { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: var(--mk-accent-strong); font-weight: 700; white-space: nowrap; }

.mk-site-header { position: sticky; z-index: 1000; top: 0; border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(17,18,21,.92); backdrop-filter: blur(18px); }
.admin-bar .mk-site-header { top: 32px; }
.mk-header-inner { min-height: 68px; display: grid; grid-template-columns: auto 1fr minmax(210px, 290px); align-items: center; gap: 24px; }
.mk-brand { display: inline-flex; align-items: center; min-height: 44px; color: var(--mk-text); font-size: 1.55rem; font-weight: 800; letter-spacing: .035em; }
.mk-brand::after { content: ""; width: 30px; height: 5px; margin-left: -24px; margin-top: 26px; border-radius: 999px; background: var(--mk-accent); opacity: .9; }
.mk-nav { display: flex; align-items: center; justify-content: center; gap: 4px; }
.mk-nav-list { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.mk-nav-list > li { margin: 0; }
.mk-nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; color: var(--mk-muted); border-radius: 9px; transition: color .18s ease, background .18s ease; }
.mk-nav a:hover, .mk-nav a[aria-current="page"] { color: var(--mk-text); background: rgba(255,255,255,.055); }
.mk-search { display: flex; align-items: center; min-height: 44px; border: 1px solid var(--mk-line); border-radius: 999px; background: var(--mk-bg-soft); overflow: hidden; }
.mk-search input { min-width: 0; flex: 1; height: 42px; padding: 0 14px; border: 0; outline: 0; background: transparent; color: var(--mk-text); }
.mk-search button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--mk-muted); cursor: pointer; }
.mk-menu-toggle { display: none; width: 44px; height: 44px; place-items: center; border: 1px solid var(--mk-line); border-radius: 10px; background: var(--mk-bg-soft); color: var(--mk-text); }
.mk-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.mk-hero { padding-block: clamp(28px, 5vw, 58px); overflow: hidden; border-bottom: 1px solid var(--mk-line); background: radial-gradient(circle at 76% 50%, rgba(195,79,88,.12), transparent 34%), linear-gradient(180deg, #111215 0%, #0e0f12 100%); }
.mk-hero-stage { position: relative; width: min(calc(100% - 32px), var(--mk-hero-max)); min-height: 470px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); align-items: center; gap: clamp(28px, 6vw, 78px); padding: clamp(30px, 5vw, 64px); overflow: hidden; border: 1px solid #33343c; border-radius: 24px; background: linear-gradient(135deg, rgba(32,33,38,.96), rgba(19,20,24,.98)); box-shadow: var(--mk-shadow); isolation: isolate; }
.mk-hero-stage::before { content: ""; position: absolute; z-index: -1; top: 0; left: 0; width: 5px; height: 100%; background: linear-gradient(180deg, var(--mk-accent-strong), rgba(195,79,88,.08)); }
.mk-hero-stage::after { content: ""; position: absolute; z-index: -2; right: 18%; bottom: -54%; width: 420px; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.05); border-radius: 50%; box-shadow: 0 0 0 64px rgba(255,255,255,.018), 0 0 0 128px rgba(255,255,255,.012); }
.mk-hero-content { position: relative; z-index: 2; max-width: 650px; }
.mk-hero h1 { max-width: 13ch; margin: 0 0 12px; font-size: clamp(2.45rem, 5.2vw, 4.55rem); line-height: 1.02; letter-spacing: -.03em; text-wrap: balance; }
.mk-hero-title-th { max-width: 38ch; margin: 0 0 14px; color: #d8d5d1; font-size: clamp(1.05rem, 2vw, 1.35rem); }
.mk-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.mk-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 10px; border: 1px solid var(--mk-line); border-radius: 999px; background: rgba(17,18,21,.62); color: #d5d3d0; font-size: .85rem; }
.mk-hero-copy { max-width: 62ch; margin: 0 0 26px; color: #c3c1c1; }
.mk-hero-art { position: relative; min-height: 350px; display: grid; place-items: center; }
.mk-hero-media { position: absolute; inset: 8% -18% 0; overflow: hidden; border-radius: 44% 56% 44% 56% / 50% 38% 62% 50%; opacity: .78; transform: rotate(4deg); }
.mk-hero-media img { width: 100%; height: 100%; object-fit: cover; filter: blur(26px) saturate(.78) brightness(.56); transform: scale(1.18); }
.mk-hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(18,19,23,.16), rgba(18,19,23,.8)); }
.mk-hero-cover { position: relative; z-index: 1; width: min(250px, 92%); aspect-ratio: 3 / 4; padding: 8px; border: 1px solid rgba(242,238,232,.2); border-radius: 18px; background: rgba(12,13,16,.82); box-shadow: 0 24px 60px rgba(0,0,0,.48), 18px 18px 0 rgba(195,79,88,.12); transform: rotate(1.5deg); transition: transform .2s ease, border-color .2s ease; }
.mk-hero-cover:hover { border-color: rgba(220,102,112,.72); transform: rotate(0) translateY(-3px); }
.mk-hero-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }
.mk-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mk-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 18px; border: 1px solid var(--mk-line); border-radius: 10px; background: var(--mk-panel); color: var(--mk-text); font-weight: 700; cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.mk-button:hover { transform: translateY(-1px); border-color: #555762; background: var(--mk-panel-strong); }
.mk-button-primary { border-color: var(--mk-accent); background: var(--mk-accent); color: #fff; }
.mk-button-primary:hover { border-color: var(--mk-accent-strong); background: var(--mk-accent-strong); }

.mk-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px 16px; }
.mk-home-shelf { position: relative; }
.mk-swipe-hint { display: none; }
.mk-card { min-width: 0; }
.mk-card-link { display: block; border-radius: var(--mk-radius); }
.mk-cover { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border: 1px solid var(--mk-line); border-radius: var(--mk-radius); background: linear-gradient(145deg, #2d2e36, #1a1b20); box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.mk-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .24s ease, filter .24s ease; }
.mk-card-link:hover .mk-cover img { transform: scale(1.025); }
.mk-cover-placeholder { width: 100%; height: 100%; display: grid; align-content: center; justify-items: center; gap: 8px; padding: 18px; background: radial-gradient(circle at 25% 20%, var(--mk-accent-soft), transparent 44%), linear-gradient(145deg, #292a31, #17181d); color: #bbb9bd; text-align: center; }
.mk-cover-placeholder strong { font-size: 2.1rem; line-height: 1; color: var(--mk-text); }
.mk-cover-placeholder span { font-size: .8rem; }
.mk-adult .mk-cover img { filter: blur(14px) saturate(.55); transform: scale(1.1); }
.mk-adult-gate { position: fixed; z-index: 10000; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(8,9,11,.92); backdrop-filter: blur(18px); }
.mk-adult-gate[hidden] { display: none; }
.mk-adult-gate > div { width: min(100%, 500px); padding: 30px; border: 1px solid var(--mk-line); border-radius: 16px; background: var(--mk-panel); box-shadow: var(--mk-shadow); text-align: center; }
.mk-adult-gate .mk-badge { position: static; margin-bottom: 10px; }
.mk-adult-gate h2 { margin: 0; }
.mk-adult-gate .mk-actions { justify-content: center; }
body.mk-gated { overflow: hidden; }
.mk-badge { position: absolute; z-index: 2; top: 9px; left: 9px; min-height: 28px; display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 7px; background: rgba(12,13,16,.88); color: var(--mk-text); font-size: .76rem; font-weight: 700; }
.mk-badge-accent { background: var(--mk-accent); color: #fff; }
.mk-card-body { padding: 11px 2px 0; }
.mk-card h3 { display: -webkit-box; margin: 0; overflow: hidden; color: var(--mk-text); font-size: 1rem; line-height: 1.42; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.mk-card-subtitle { display: -webkit-box; margin: 2px 0 0; overflow: hidden; color: var(--mk-muted); font-size: .86rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.mk-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; color: var(--mk-muted); font-size: .8rem; }
.mk-badge-new { background: linear-gradient(135deg, var(--mk-accent), #ee7b83); color: #fff; }

.mk-new-arrivals { background: radial-gradient(circle at 12% 0, rgba(195,79,88,.1), transparent 30%), #131418; }
.mk-genre-section { overflow: hidden; background: linear-gradient(180deg, #111215, #0d0e11); }
.mk-genre-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mk-genre-card { position: relative; min-height: 112px; display: grid; align-content: space-between; gap: 18px; padding: 18px; overflow: hidden; border: 1px solid var(--mk-line); border-radius: 14px; background: linear-gradient(145deg, #24252b, #18191e); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.mk-genre-card::after { content: ""; position: absolute; right: -32px; bottom: -52px; width: 116px; aspect-ratio: 1; border: 1px solid rgba(220,102,112,.2); border-radius: 50%; box-shadow: 0 0 0 22px rgba(195,79,88,.04); }
.mk-genre-card:hover { transform: translateY(-2px); border-color: rgba(220,102,112,.6); background: linear-gradient(145deg, #292a31, #1b1c21); }
.mk-genre-card strong { position: relative; z-index: 1; font-size: 1.05rem; line-height: 1.35; }
.mk-genre-card span { position: relative; z-index: 1; color: var(--mk-accent-strong); font-size: .8rem; font-weight: 700; }

.mk-continue { display: none; }
.mk-continue.is-visible { display: block; }
.mk-continue-card { position: relative; display: grid; grid-template-columns: 116px minmax(0, 1fr) auto; align-items: center; gap: clamp(18px, 3vw, 32px); min-height: 194px; padding: 16px 18px; overflow: hidden; border: 1px solid var(--mk-line); border-radius: 18px; background: radial-gradient(circle at 85% 20%, rgba(195,79,88,.13), transparent 28%), linear-gradient(120deg, #222329, #1c1d22 68%); box-shadow: 0 14px 36px rgba(0,0,0,.16); }
.mk-continue-card::after { content: ""; position: absolute; right: -58px; bottom: -88px; width: 220px; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.045); border-radius: 50%; box-shadow: 0 0 0 34px rgba(255,255,255,.018); pointer-events: none; }
.mk-continue-art { position: relative; z-index: 1; width: 116px; padding: 5px; border: 1px solid rgba(242,238,232,.15); border-radius: 13px; background: #15161a; box-shadow: 10px 10px 0 rgba(195,79,88,.1); }
.mk-continue-card img, .mk-continue-cover { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: var(--mk-panel-strong); }
.mk-continue-copy { position: relative; z-index: 1; min-width: 0; }
.mk-continue-kicker { display: block; margin-bottom: 4px; color: var(--mk-accent-strong); font-size: .76rem; font-weight: 700; letter-spacing: .08em; }
.mk-continue-card h3 { display: -webkit-box; margin: 0; overflow: hidden; font-size: clamp(1.05rem, 2.2vw, 1.35rem); line-height: 1.42; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.mk-continue-card p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 7px 0 0; color: var(--mk-muted); }
.mk-continue-chapter { display: inline-flex; min-height: 30px; align-items: center; padding: 2px 10px; border-radius: 999px; background: var(--mk-accent-soft); color: #e18a91; font-weight: 700; }
.mk-continue-card > .mk-button { position: relative; z-index: 1; min-width: 112px; }

.mk-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 26px; padding: 16px; border: 1px solid var(--mk-line); border-radius: var(--mk-radius); background: var(--mk-bg-soft); }
.mk-field { display: grid; gap: 5px; min-width: 150px; }
.mk-field-grow { flex: 1; min-width: min(100%, 230px); }
.mk-field label { color: var(--mk-muted); font-size: .8rem; }
.mk-field input, .mk-field select { min-height: 44px; width: 100%; padding: 0 13px; border: 1px solid var(--mk-line); border-radius: 9px; background: var(--mk-panel); color: var(--mk-text); }
.mk-filter-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.mk-filter-links a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid var(--mk-line); border-radius: 999px; color: var(--mk-muted); }
.mk-filter-links a:hover, .mk-filter-links a.is-active { border-color: var(--mk-accent); color: var(--mk-text); background: var(--mk-accent-soft); }
.mk-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 34px; }
.mk-pagination .page-numbers { min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--mk-line); border-radius: 9px; }
.mk-pagination .current { border-color: var(--mk-accent); background: var(--mk-accent); color: #fff; }

.mk-series { padding-block: clamp(34px, 7vw, 82px); }
.mk-series-grid { display: grid; grid-template-columns: minmax(220px, 310px) 1fr; gap: clamp(28px, 6vw, 74px); align-items: start; }
.mk-series-cover { position: sticky; top: 104px; }
.mk-series-cover .mk-cover { box-shadow: var(--mk-shadow); }
.mk-breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; color: var(--mk-muted); font-size: .85rem; }
.mk-series h1 { margin: 0; font-size: clamp(2rem, 5vw, 4.5rem); line-height: 1.08; letter-spacing: -.025em; }
.mk-series .mk-title-th { margin: 8px 0 0; color: var(--mk-muted); font-size: clamp(1.1rem, 2.6vw, 1.55rem); }
.mk-series-description { max-width: 74ch; margin: 22px 0; color: #c9c7c7; }
.mk-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 26px 0; }
.mk-fact { min-height: 84px; padding: 13px 14px; border: 1px solid var(--mk-line); border-radius: 11px; background: var(--mk-bg-soft); }
.mk-fact dt { color: var(--mk-muted); font-size: .78rem; }
.mk-fact dd { margin: 4px 0 0; font-weight: 700; }
.mk-chapter-panel { margin-top: 48px; padding-top: 30px; border-top: 1px solid var(--mk-line); }
.mk-chapter-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.mk-chapter-tools input { min-width: 230px; min-height: 44px; flex: 1; padding: 0 13px; border: 1px solid var(--mk-line); border-radius: 9px; background: var(--mk-panel); color: var(--mk-text); }
.mk-chapter-list { max-height: 720px; overflow: auto; border: 1px solid var(--mk-line); border-radius: 12px; background: var(--mk-bg-soft); scrollbar-color: #555 var(--mk-bg-soft); }
.mk-chapter { min-height: 58px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; padding: 8px 14px; border-bottom: 1px solid var(--mk-line); content-visibility: auto; contain-intrinsic-size: 58px; }
.mk-chapter:last-child { border-bottom: 0; }
a.mk-chapter:hover { background: rgba(255,255,255,.045); }
.mk-chapter strong { font-weight: 600; }
.mk-chapter small { color: var(--mk-muted); }
.mk-chapter.is-waiting { color: #777880; background: #15161a; }
.mk-empty, .mk-error, .mk-loading { display: grid; justify-items: center; gap: 10px; padding: clamp(34px, 8vw, 78px) 20px; border: 1px dashed var(--mk-line); border-radius: var(--mk-radius); color: var(--mk-muted); text-align: center; background: var(--mk-bg-soft); }
.mk-empty h2, .mk-error h2 { margin: 0; color: var(--mk-text); }
.mk-loader { width: 30px; height: 30px; border: 3px solid var(--mk-line); border-top-color: var(--mk-accent); border-radius: 50%; animation: mk-spin .8s linear infinite; }
@keyframes mk-spin { to { transform: rotate(360deg); } }

.mk-reader-header { position: sticky; z-index: 1001; top: 0; border-bottom: 1px solid #292a30; background: rgba(9,10,12,.94); backdrop-filter: blur(16px); transition: transform .2s ease; }
.admin-bar .mk-reader-header { top: 32px; }
.mk-reader-header-inner { min-height: 62px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; }
.mk-reader-back, .mk-reader-toggle { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #34353b; border-radius: 9px; background: #17181d; color: var(--mk-text); cursor: pointer; }
.mk-reader-title { min-width: 0; }
.mk-reader-title strong, .mk-reader-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-reader-title span { color: #8f9099; font-size: .8rem; }
.mk-reader-pages { width: min(100%, 980px); margin-inline: auto; background: #050607; }
.mk-reader-page { width: 100%; min-height: 65vh; display: grid; place-items: center; background: #08090b; content-visibility: auto; contain-intrinsic-size: auto 1500px; }
.mk-reader-page img { width: 100%; height: auto; }
.mk-reader-end { padding-block: 42px 70px; border-top: 1px solid #27282d; background: #0e0f12; text-align: center; }
.mk-reader-end h2 { margin: 0 0 8px; }
.mk-reader-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.mk-reader-progress { min-height: 65vh; display: grid; place-items: center; padding: 30px; }
body.mk-reader-ui-hidden .mk-reader-header { transform: translateY(-110%); }

.mk-history-grid { display: grid; gap: 12px; }
.mk-history-item { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 15px; padding: 12px; border: 1px solid var(--mk-line); border-radius: 12px; background: var(--mk-bg-soft); }
.mk-history-item img, .mk-history-cover { width: 70px; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; background: var(--mk-panel); }
.mk-history-item h3 { margin: 0; line-height: 1.35; }
.mk-history-item p { margin: 3px 0 0; color: var(--mk-muted); }

.mk-site-footer { margin-top: 50px; border-top: 1px solid var(--mk-line); background: #0c0d10; }
.mk-footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 30px; padding-block: 46px; }
.mk-footer-brand { margin: 0; font-size: 1.45rem; font-weight: 800; }
.mk-footer-copy { max-width: 48ch; color: var(--mk-muted); }
.mk-footer-title { margin: 0 0 10px; font-size: .9rem; }
.mk-footer-links { display: grid; gap: 7px; color: var(--mk-muted); }
.mk-footer-bottom { padding-block: 18px; border-top: 1px solid var(--mk-line); color: #7d7e86; font-size: .82rem; }

@media (max-width: 1040px) {
  .mk-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mk-header-inner { grid-template-columns: auto 1fr auto; }
  .mk-site-header .mk-search { display: none; }
  .mk-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .admin-bar .mk-site-header, .admin-bar .mk-reader-header { top: 46px; }
  .mk-shell { width: min(calc(100% - 24px), var(--mk-max)); }
  .mk-menu-toggle { display: grid; justify-self: end; }
  .mk-header-inner { grid-template-columns: 1fr auto; gap: 10px; }
  .mk-nav { position: absolute; top: calc(100% + 1px); left: 12px; right: 12px; display: none; align-items: stretch; padding: 10px; border: 1px solid var(--mk-line); border-radius: 12px; background: #16171b; box-shadow: var(--mk-shadow); }
  .mk-nav.is-open { display: grid; }
  .mk-nav-list { display: grid; }
  .mk-nav a { justify-content: space-between; }
  .mk-hero-stage { min-height: 430px; grid-template-columns: minmax(0, 1.2fr) minmax(220px, .8fr); gap: 24px; padding: 34px; }
  .mk-hero h1 { font-size: clamp(2.35rem, 7vw, 3.5rem); }
  .mk-hero-art { min-height: 310px; }
  .mk-hero-cover { width: min(210px, 90%); }
  .mk-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mk-genre-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mk-series-grid { grid-template-columns: 180px 1fr; gap: 28px; }
  .mk-series-cover { position: static; }
  .mk-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  body { line-height: 1.68; }
  .mk-section { padding-block: 32px; }
  .mk-section-head { align-items: start; }
  .mk-hero { padding-block: 18px 28px; }
  .mk-hero-stage { min-height: 0; grid-template-columns: 108px minmax(0, 1fr); align-items: start; gap: 16px; padding: 18px; border-radius: 18px; }
  .mk-hero-stage::after { right: -100px; bottom: -110px; width: 260px; }
  .mk-hero-content { min-width: 0; }
  .mk-hero .mk-eyebrow { margin-top: 2px; }
  .mk-hero h1 { max-width: none; font-size: clamp(1.65rem, 8.3vw, 2.2rem); line-height: 1.08; }
  .mk-hero-title-th { font-size: .94rem; line-height: 1.55; }
  .mk-hero-meta { gap: 5px; margin-bottom: 13px; }
  .mk-hero .mk-chip { min-height: 27px; padding: 2px 8px; font-size: .74rem; }
  .mk-hero .mk-actions { display: grid; }
  .mk-hero .mk-button { width: 100%; min-height: 42px; padding-inline: 10px; font-size: .86rem; }
  .mk-hero-art { grid-column: 1; grid-row: 1; min-height: 0; }
  .mk-hero-content { grid-column: 2; grid-row: 1; }
  .mk-hero-media { inset: 8px -9px 12px; filter: none; }
  .mk-hero-cover { width: 100%; padding: 4px; border-radius: 11px; box-shadow: 8px 8px 0 rgba(195,79,88,.11); transform: none; }
  .mk-hero-cover img { border-radius: 7px; }
  .mk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .mk-section-head h2 { font-size: clamp(1.45rem, 7vw, 1.85rem); }
  .mk-home-shelf .mk-section-head { margin-bottom: 16px; }
  .mk-shelf { display: flex; gap: 13px; margin-inline: -12px; padding: 0 12px 12px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: inline mandatory; scroll-padding-inline: 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .mk-shelf::-webkit-scrollbar { display: none; }
  .mk-shelf .mk-card { flex: 0 0 min(39vw, 164px); scroll-snap-align: start; }
  .mk-shelf .mk-card h3 { font-size: .92rem; }
  .mk-shelf .mk-card-meta { font-size: .74rem; }
  .mk-swipe-hint { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; color: #85868d; font-size: .76rem; }
  .mk-swipe-hint .mk-icon { width: 16px; height: 16px; }
  .mk-genre-grid { display: flex; gap: 10px; margin-inline: -12px; padding: 0 12px 10px; overflow-x: auto; scroll-snap-type: inline mandatory; scrollbar-width: none; }
  .mk-genre-grid::-webkit-scrollbar { display: none; }
  .mk-genre-card { flex: 0 0 154px; min-height: 102px; padding: 15px; scroll-snap-align: start; }
  .mk-series-grid { grid-template-columns: 1fr; }
  .mk-series-cover { width: min(62vw, 250px); }
  .mk-series h1 { font-size: clamp(2rem, 10vw, 3.2rem); }
  .mk-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-chapter { grid-template-columns: 1fr; gap: 2px; padding-block: 10px; }
  .mk-continue-card { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; min-height: 0; padding: 12px; }
  .mk-continue-art { grid-row: 1 / span 2; align-self: center; width: 84px; padding: 4px; border-radius: 10px; box-shadow: 6px 6px 0 rgba(195,79,88,.1); }
  .mk-continue-card h3 { font-size: 1rem; }
  .mk-continue-card p { font-size: .82rem; }
  .mk-continue-card > .mk-button { grid-column: 2; width: 100%; min-height: 42px; }
  .mk-history-item { grid-template-columns: 58px 1fr; }
  .mk-history-item img, .mk-history-cover { width: 58px; }
  .mk-history-item .mk-button { grid-column: 1 / -1; width: 100%; }
  .mk-footer-grid { grid-template-columns: 1fr; }
  .mk-reader-title strong { font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
