/* ==========================================================================
   Ebookify AI — app styles (Bootstrap 5.3 on top)
   ========================================================================== */

@font-face {
	font-family: 'Plus Jakarta Sans';
	font-style: normal;
	font-display: swap;
	font-weight: 200 800;
	src: url('../vendor/fonts/plus-jakarta-sans-latin-wght.woff2') format('woff2-variations');
}

:root {
	--ebk-primary: #6d4aff;
	--ebk-primary-dark: #5634e8;
	--ebk-primary-soft: #f0ecff;
	--ebk-accent: #ff7a59;
	--ebk-gradient: linear-gradient(135deg, #6d4aff 0%, #a64dff 55%, #ff6fae 100%);
	--ebk-ink: #141833;
	--ebk-muted: #6b7193;
	--ebk-border: #e9e9f3;
	--ebk-bg: #f6f6fb;
	--ebk-card: #ffffff;
	--ebk-radius: 18px;
	--ebk-shadow-sm: 0 1px 2px rgba(20, 24, 51, .04), 0 1px 3px rgba(20, 24, 51, .04);
	--ebk-shadow: 0 10px 30px -12px rgba(52, 33, 140, .18);
	--ebk-sidebar-w: 264px;

	--bs-font-sans-serif: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--bs-body-color: var(--ebk-ink);
	--bs-body-bg: var(--ebk-bg);
	--bs-secondary-color: var(--ebk-muted);
	--bs-border-color: var(--ebk-border);
	--bs-primary: #6d4aff;
	--bs-primary-rgb: 109, 74, 255;
	--bs-link-color: #6d4aff;
	--bs-link-color-rgb: 109, 74, 255;
	--bs-link-hover-color: #5634e8;
	--bs-link-hover-color-rgb: 86, 52, 232;
	--bs-border-radius: 10px;
	--bs-border-radius-sm: 8px;
	--bs-border-radius-lg: 14px;
}

body { background: var(--ebk-bg); -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--ebk-ink); letter-spacing: -.02em; }
.text-secondary { color: var(--ebk-muted) !important; }
::selection { background: #ddd4ff; }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: 12px; padding: .5rem 1rem; transition: transform .12s, box-shadow .15s, background-color .15s; }
.btn-sm { border-radius: 10px; padding: .32rem .72rem; }
.btn-lg { border-radius: 14px; padding: .8rem 1.5rem; }
.btn:active { transform: translateY(1px); }
.btn-primary {
	--bs-btn-bg: var(--ebk-primary); --bs-btn-border-color: transparent;
	--bs-btn-hover-bg: var(--ebk-primary-dark); --bs-btn-hover-border-color: transparent;
	--bs-btn-active-bg: var(--ebk-primary-dark); --bs-btn-active-border-color: transparent;
	--bs-btn-disabled-bg: var(--ebk-primary); --bs-btn-disabled-border-color: transparent;
	background-image: var(--ebk-gradient); background-size: 140% 100%; background-position: 0 0;
	box-shadow: 0 8px 20px -8px rgba(109, 74, 255, .65);
}
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 12px 24px -10px rgba(109, 74, 255, .75); }
.btn-outline-primary {
	--bs-btn-color: var(--ebk-primary); --bs-btn-border-color: #d9d0ff; --bs-btn-bg: #fff;
	--bs-btn-hover-color: var(--ebk-primary-dark); --bs-btn-hover-bg: var(--ebk-primary-soft); --bs-btn-hover-border-color: #c6b8ff;
	--bs-btn-active-color: var(--ebk-primary-dark); --bs-btn-active-bg: #e6dfff; --bs-btn-active-border-color: #c6b8ff;
}
.btn-outline-secondary {
	--bs-btn-color: #474d6d; --bs-btn-border-color: var(--ebk-border); --bs-btn-bg: #fff;
	--bs-btn-hover-color: var(--ebk-ink); --bs-btn-hover-bg: #f3f3f9; --bs-btn-hover-border-color: #dcdcea;
	--bs-btn-active-color: var(--ebk-ink); --bs-btn-active-bg: #ececf5; --bs-btn-active-border-color: #dcdcea;
}
.btn-soft {
	--bs-btn-color: var(--ebk-primary-dark); --bs-btn-bg: var(--ebk-primary-soft); --bs-btn-border-color: transparent;
	--bs-btn-hover-color: var(--ebk-primary-dark); --bs-btn-hover-bg: #e4dcff; --bs-btn-hover-border-color: transparent;
	--bs-btn-active-color: var(--ebk-primary-dark); --bs-btn-active-bg: #d9ceff; --bs-btn-active-border-color: transparent;
}
.btn-white { --bs-btn-bg: #fff; --bs-btn-color: var(--ebk-primary-dark); --bs-btn-hover-bg: #f6f3ff; --bs-btn-hover-color: var(--ebk-primary-dark); --bs-btn-border-color: transparent; --bs-btn-hover-border-color: transparent; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .35); }
.btn .spinner-border { width: 1rem; height: 1rem; border-width: .15em; vertical-align: -2px; }
.btn.disabled, .btn:disabled { opacity: .55; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .9rem; color: #2b3050; }
.form-control, .form-select { border-color: var(--ebk-border); border-radius: 12px; padding: .62rem .9rem; background-color: #fbfbfe; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.form-control-sm, .form-select-sm { border-radius: 10px; padding: .4rem .7rem; }
.form-control:hover, .form-select:hover { border-color: #dcdcec; }
.form-control:focus, .form-select:focus { background-color: #fff; border-color: #b9a8ff; box-shadow: 0 0 0 4px rgba(109, 74, 255, .12); }
.form-control::placeholder { color: #a5a9c2; }
.form-check-input { border-color: #cfd1e2; }
.form-check-input:checked { background-color: var(--ebk-primary); border-color: var(--ebk-primary); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(109, 74, 255, .12); border-color: #b9a8ff; }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #a5a9c2; pointer-events: none; }
.input-icon > .form-control { padding-left: 40px; }
.input-icon > .pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #8a8fae; padding: 6px 10px; border-radius: 8px; }
.input-icon > .pw-toggle:hover { color: var(--ebk-primary); background: var(--ebk-primary-soft); }
.form-hint { font-size: .8rem; color: var(--ebk-muted); font-weight: 500; }

/* ---------- Cards ---------- */
.card { --bs-card-border-color: var(--ebk-border); border-radius: var(--ebk-radius); box-shadow: var(--ebk-shadow-sm); background: var(--ebk-card); }
.card-section-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; margin-bottom: .35rem; }
.icon-chip { width: 36px; height: 36px; flex: none; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--ebk-primary-soft); color: var(--ebk-primary); font-size: 1.05rem; }
.icon-chip.coral { background: #fff0eb; color: #f2603b; }
.icon-chip.green { background: #e7f8ef; color: #17a061; }
.icon-chip.blue { background: #e8f1ff; color: #2f6fe4; }
.icon-chip.amber { background: #fff6e0; color: #d48a00; }

.page-title { font-weight: 800; letter-spacing: -.03em; color: var(--ebk-ink); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 1.6rem; }
.page-head p { margin: .25rem 0 0; color: var(--ebk-muted); }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--ebk-muted); text-decoration: none; margin-bottom: .35rem; }
.back-link:hover { color: var(--ebk-primary); }

.badge { font-weight: 600; border-radius: 999px; padding: .38em .75em; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: .32rem .7rem; border-radius: 999px; background: #f1f1f8; color: #4b5170; }
.pill.violet { background: var(--ebk-primary-soft); color: var(--ebk-primary-dark); }
.pill.green { background: #e7f8ef; color: #128552; }
.pill.amber { background: #fff4d9; color: #a96c00; }

.progress { background: #ececf6; border-radius: 999px; }
.progress-bar { background-image: var(--ebk-gradient); border-radius: 999px; transition: width .4s ease; }

.alert { border-radius: 14px; border: 0; }
.alert-success { background: #e9f9f0; color: #0f6b41; }
.alert-warning { background: #fff6e0; color: #7a5300; }
.alert-danger { background: #ffeded; color: #a32626; }

.toast { border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(20, 24, 51, .35); }

/* ==========================================================================
   App shell: sidebar + content
   ========================================================================== */
.app-sidebar { --bs-offcanvas-width: var(--ebk-sidebar-w); background: #fff; border-right: 1px solid var(--ebk-border); }
.app-sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 22px 16px 16px; height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.app-sidebar .offcanvas-body > * { flex-shrink: 0; }
@media (min-width: 992px) {
	.app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--ebk-sidebar-w); z-index: 1030; }
	.app-main { margin-left: var(--ebk-sidebar-w); }
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--ebk-ink); text-decoration: none; letter-spacing: -.03em; }
.brand:hover { color: var(--ebk-ink); }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--ebk-gradient); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; box-shadow: 0 8px 18px -8px rgba(109, 74, 255, .8); }
.brand-ai { background: var(--ebk-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.side-new { margin: 22px 0 18px; }
.side-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #a5a9c2; padding: 0 12px; margin: 6px 0 8px; }
.side-nav { list-style: none; padding: 0; margin: 0; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #4b5170; font-weight: 600; font-size: .93rem; text-decoration: none; margin-bottom: 2px; transition: background-color .15s, color .15s; }
.side-nav a i { font-size: 1.1rem; color: #9a9fbd; transition: color .15s; }
.side-nav a:hover { background: #f5f4fb; color: var(--ebk-ink); }
.side-nav a:hover i { color: var(--ebk-primary); }
.side-nav a.active { background: var(--ebk-primary-soft); color: var(--ebk-primary-dark); }
.side-nav a.active i { color: var(--ebk-primary); }

.side-promo { margin-top: auto; border-radius: 16px; padding: 16px; background: var(--ebk-gradient); color: #fff; position: relative; overflow: hidden; }
.side-promo::after { content: ''; position: absolute; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .12); right: -50px; top: -60px; }
.side-promo .t { font-weight: 700; margin-bottom: 4px; position: relative; }
.side-promo .d { font-size: .8rem; opacity: .9; position: relative; }

.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; margin-top: 14px; border-top: 1px solid var(--ebk-border); }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #ff9a6b, #ff6fae); }
.side-user .n { font-weight: 700; font-size: .88rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .e { font-size: .75rem; color: var(--ebk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .logout { margin-left: auto; color: #9a9fbd; padding: 6px 8px; border-radius: 10px; }
.side-user .logout:hover { color: #e0443b; background: #fff0ee; }

.app-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(255, 255, 255, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--ebk-border); }
.app-topbar .brand { font-size: 1.05rem; }
.app-topbar .brand-mark { width: 32px; height: 32px; font-size: 1rem; border-radius: 10px; }
.app-content { padding: 32px 36px 56px; max-width: 1320px; }
@media (max-width: 991.98px) { .app-content { padding: 22px 16px 48px; } }

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-hero { position: relative; overflow: hidden; background: var(--ebk-gradient); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; }
.auth-hero::before, .auth-hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.auth-hero::before { width: 520px; height: 520px; right: -200px; bottom: -220px; }
.auth-hero::after { width: 260px; height: 260px; left: -90px; top: 38%; }
.auth-hero .brand { color: #fff; position: relative; z-index: 1; }
.auth-hero .brand-mark { background: rgba(255, 255, 255, .2); box-shadow: none; backdrop-filter: blur(6px); }
.auth-hero-body { margin: auto 0; position: relative; z-index: 1; max-width: 480px; }
.auth-hero h2 { color: #fff; font-size: 2.35rem; font-weight: 800; line-height: 1.12; letter-spacing: -.035em; margin-bottom: 16px; }
.auth-hero p.lead { font-size: 1.05rem; opacity: .9; margin-bottom: 28px; }
.auth-points { list-style: none; padding: 0; margin: 0 0 34px; display: grid; gap: 12px; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.auth-points i { width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, .18); display: inline-flex; align-items: center; justify-content: center; }

.book-stack { display: flex; align-items: flex-end; gap: 14px; }
.mini-book { width: 92px; aspect-ratio: 2 / 3; border-radius: 4px 10px 10px 4px; padding: 12px 10px; display: flex; flex-direction: column; justify-content: flex-end; font-size: .68rem; font-weight: 700; line-height: 1.2; color: #fff; box-shadow: inset 6px 0 0 rgba(0, 0, 0, .12), 0 18px 30px -12px rgba(0, 0, 0, .45); position: relative; }
.mini-book::before { content: ''; position: absolute; left: 10px; right: 10px; top: 12px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .55); }
.mini-book.b1 { background: linear-gradient(160deg, #23194f, #4a2fbf); transform: rotate(-6deg) translateY(6px); }
.mini-book.b2 { background: linear-gradient(160deg, #ff8a5c, #ff5f8f); width: 108px; z-index: 1; }
.mini-book.b3 { background: linear-gradient(160deg, #0ea37a, #0b6e8f); transform: rotate(5deg) translateY(4px); }

.auth-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h1 { font-weight: 800; font-size: 1.75rem; letter-spacing: -.03em; margin-bottom: 6px; }
.auth-form .sub { color: var(--ebk-muted); margin-bottom: 28px; }
.auth-form .btn-lg { width: 100%; }
.auth-switch { text-align: center; margin-top: 22px; font-size: .92rem; color: var(--ebk-muted); }
.auth-switch a { font-weight: 700; text-decoration: none; }
.auth-mobile-brand { display: none; margin-bottom: 28px; }
@media (max-width: 991.98px) {
	.auth-page { grid-template-columns: 1fr; }
	.auth-hero { display: none; }
	.auth-mobile-brand { display: block; }
	.auth-side { background: linear-gradient(180deg, #f4f0ff 0%, #fff 45%); align-items: flex-start; padding-top: 48px; }
}

/* ==========================================================================
   Dashboard (book list)
   ========================================================================== */
.hero-banner { position: relative; overflow: hidden; border-radius: 24px; padding: 30px 34px; background: var(--ebk-gradient); color: #fff; margin-bottom: 24px; box-shadow: var(--ebk-shadow); }
.hero-banner::before { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: rgba(255, 255, 255, .1); right: -90px; top: -170px; }
.hero-banner::after { content: ''; position: absolute; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .08); right: 210px; bottom: -120px; }
.hero-banner > * { position: relative; z-index: 1; }
.hero-banner h1 { color: #fff; font-weight: 800; font-size: 1.85rem; letter-spacing: -.03em; margin-bottom: 6px; }
.hero-banner p { opacity: .9; margin: 0; max-width: 560px; }
.hero-banner .wave { display: inline-block; animation: wave 2.2s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }

.stat-card { display: flex; flex-direction: row; align-items: center; text-align: left; gap: 14px; padding: 18px 20px; height: 100%; }
.stat-card .v { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stat-card .l { font-size: .82rem; color: var(--ebk-muted); font-weight: 600; margin-top: 4px; }
.stat-card .icon-chip { width: 46px; height: 46px; border-radius: 14px; font-size: 1.3rem; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 14px; }
.section-head h2 { font-size: 1.15rem; font-weight: 800; margin: 0; }

.book-card { display: block; height: 100%; text-decoration: none; color: inherit; border-radius: var(--ebk-radius); background: #fff; border: 1px solid var(--ebk-border); padding: 14px; transition: transform .2s, box-shadow .2s, border-color .2s; }
.book-card:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -20px rgba(52, 33, 140, .35); border-color: #ddd5ff; color: inherit; }
.book-cover { position: relative; aspect-ratio: 2 / 3; border-radius: 6px 12px 12px 6px; overflow: hidden; display: flex; align-items: flex-end; padding: 16px 14px; color: #fff; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; box-shadow: inset 7px 0 0 rgba(0, 0, 0, .14), 0 14px 26px -16px rgba(20, 24, 51, .6); margin-bottom: 14px; }
.book-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.book-card:hover .book-cover img { transform: scale(1.04); }
.book-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .55) 100%); }
.book-cover::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, .22); z-index: 2; }
.book-cover span { position: relative; z-index: 1; font-size: 1rem; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.book-cover.c0 { background: linear-gradient(160deg, #6d4aff, #a64dff); }
.book-cover.c1 { background: linear-gradient(160deg, #ff8a5c, #ff5f8f); }
.book-cover.c2 { background: linear-gradient(160deg, #10b38a, #0b6e8f); }
.book-cover.c3 { background: linear-gradient(160deg, #2b2364, #5b3fd6); }
.book-cover.c4 { background: linear-gradient(160deg, #f5b301, #ff7a3d); }
.book-cover.c5 { background: linear-gradient(160deg, #2f6fe4, #00b4d8); }
.book-cover .status { position: absolute; top: 10px; right: 10px; z-index: 2; font-size: .68rem; font-weight: 700; padding: .25rem .55rem; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ebk-ink); text-shadow: none; }
.book-title { font-weight: 700; font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.book-meta { font-size: .78rem; color: var(--ebk-muted); font-weight: 600; margin-top: 4px; }

.new-book-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; height: 100%; min-height: 280px; border-radius: var(--ebk-radius); border: 2px dashed #d6ccff; background: #faf8ff; color: var(--ebk-primary-dark); font-weight: 700; text-decoration: none; transition: background-color .2s, border-color .2s, transform .2s; }
.new-book-tile:hover { background: var(--ebk-primary-soft); border-color: var(--ebk-primary); color: var(--ebk-primary-dark); transform: translateY(-4px); }
.new-book-tile .plus { width: 56px; height: 56px; border-radius: 18px; background: var(--ebk-gradient); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; box-shadow: 0 12px 24px -10px rgba(109, 74, 255, .8); }

.empty-state { text-align: center; padding: 56px 20px; }
.empty-state .art { width: 88px; height: 88px; border-radius: 28px; margin: 0 auto 18px; background: var(--ebk-primary-soft); color: var(--ebk-primary); display: flex; align-items: center; justify-content: center; font-size: 2.4rem; }
.empty-state p { color: var(--ebk-muted); max-width: 440px; margin: 8px auto 22px; }
.how-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 760px; margin: 30px auto 0; text-align: left; }
.how-steps > div { background: #faf9ff; border: 1px solid var(--ebk-border); border-radius: 14px; padding: 14px; font-size: .85rem; font-weight: 600; }
.how-steps b { display: block; color: var(--ebk-primary); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
@media (max-width: 767.98px) { .how-steps { grid-template-columns: 1fr 1fr; } }

/* ==========================================================================
   Create form
   ========================================================================== */
.topic-box { position: relative; }
.topic-box textarea { font-size: 1.05rem; padding: 16px 18px; border-radius: 16px; min-height: 120px; resize: vertical; }
.idea-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.idea-chip { border: 1px solid var(--ebk-border); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: .8rem; font-weight: 600; color: #4b5170; transition: all .15s; }
.idea-chip:hover { border-color: #c6b8ff; color: var(--ebk-primary-dark); background: var(--ebk-primary-soft); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cat-tile { position: relative; cursor: pointer; margin: 0; }
.cat-tile input { position: absolute; opacity: 0; pointer-events: none; }
.cat-tile span { display: flex; align-items: center; gap: 10px; height: 100%; padding: 11px 12px; border-radius: 14px; border: 1.5px solid var(--ebk-border); background: #fff; font-weight: 600; font-size: .84rem; line-height: 1.25; color: #3d4262; transition: all .15s; }
.cat-tile span i { width: 32px; height: 32px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #f4f4fa; color: #7a7f9e; font-size: 1rem; transition: all .15s; }
.cat-tile:hover span { border-color: #c6b8ff; }
.cat-tile input:checked + span { border-color: var(--ebk-primary); background: #faf8ff; color: var(--ebk-primary-dark); box-shadow: 0 0 0 4px rgba(109, 74, 255, .1); }
.cat-tile input:checked + span i { background: var(--ebk-gradient); color: #fff; }
.cat-tile input:focus-visible + span { outline: 2px solid var(--ebk-primary); outline-offset: 2px; }
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; }

/* PDF design picker: tiny CSS-drawn page per template */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tpl-tile { position: relative; cursor: pointer; margin: 0; }
.tpl-tile input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-card { display: flex; flex-direction: column; align-items: center; text-align: center; height: 100%; padding: 14px 10px 12px; border-radius: 14px; border: 1.5px solid var(--ebk-border); background: #fff; transition: all .15s; }
.tpl-card strong { font-size: .86rem; color: #2b2f4a; margin-top: 10px; }
.tpl-card small { font-size: .72rem; color: #7a7f9e; line-height: 1.3; margin-top: 2px; }
.tpl-tile:hover .tpl-card { border-color: #c6b8ff; }
.tpl-tile input:checked + .tpl-card { border-color: var(--ebk-primary); background: #faf8ff; box-shadow: 0 0 0 4px rgba(109, 74, 255, .1); }
.tpl-tile input:focus-visible + .tpl-card { outline: 2px solid var(--ebk-primary); outline-offset: 2px; }
.tpl-page { display: flex; flex-direction: column; gap: 5px; width: 66px; height: 88px; padding: 9px 8px; background: #fff; border-radius: 4px; box-shadow: 0 4px 14px rgba(30, 27, 75, .14), 0 0 0 1px rgba(30, 27, 75, .06); }
.tpl-page b { display: block; height: 10px; margin-bottom: 4px; }
.tpl-page i { display: block; height: 3px; border-radius: 2px; background: #d9dbe7; }
.tpl-page i.short { width: 60%; }
.tpl-classic b { width: 40%; height: 6px; margin: 4px auto 8px; border-top: 2px solid var(--a); border-bottom: 2px solid var(--a); }
.tpl-modern b { width: 42%; height: 12px; background: var(--a); border-radius: 2px; }
.tpl-kids b { height: 16px; background: var(--a); border-radius: 6px; }
.tpl-kids i { height: 4px; }
.tpl-recipe b { height: 14px; background: var(--s); border-top: 2px solid var(--a); border-bottom: 2px solid var(--a); }
.tpl-recipe i { background: var(--s); border-left: 3px solid var(--a); }
.idea-chip.active { background: var(--ebk-primary); border-color: var(--ebk-primary); color: #fff; }
.book-cat { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; color: #128552; background: #e7f8ef; border-radius: 999px; padding: .2rem .55rem; margin-top: 6px; }

.tips-card { background: linear-gradient(180deg, #f6f2ff 0%, #fff 70%); }
.tips-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.tips-card li { display: flex; gap: 12px; font-size: .88rem; color: #3d4262; }
.tips-card li i { color: var(--ebk-primary); font-size: 1.05rem; margin-top: 1px; }
.estimate { border-radius: 14px; background: #fff; border: 1px solid var(--ebk-border); padding: 14px 16px; }
.estimate .v { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }

/* ==========================================================================
   Workspace
   ========================================================================== */
.ws-header { display: flex; flex-direction: row; gap: 22px; align-items: center; padding: 22px; margin-bottom: 20px; }
.ws-cover-thumb { width: 84px; flex: none; aspect-ratio: 2 / 3; border-radius: 4px 10px 10px 4px; overflow: hidden; background: var(--ebk-gradient); box-shadow: inset 5px 0 0 rgba(0, 0, 0, .14), 0 12px 22px -12px rgba(20, 24, 51, .55); display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .85); font-size: 1.6rem; }
.ws-cover-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ws-header h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; margin: 0 0 8px; }
.ws-header .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
@media (max-width: 767.98px) { .ws-header { flex-wrap: wrap; } .ws-actions { margin-left: 0; width: 100%; } .ws-actions .btn { flex: 1; } }

.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.stepper .s { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--ebk-border); font-weight: 700; font-size: .86rem; color: var(--ebk-muted); }
.stepper .s .n { width: 28px; height: 28px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #f1f1f8; color: #8a8fae; font-size: .8rem; }
.stepper .s small { display: block; font-weight: 600; font-size: .72rem; color: #a5a9c2; }
.stepper .s.done { color: var(--ebk-ink); }
.stepper .s.done .n { background: #e7f8ef; color: #17a061; }
.stepper .s.current { border-color: #cdbfff; background: #faf8ff; color: var(--ebk-ink); box-shadow: 0 0 0 4px rgba(109, 74, 255, .07); }
.stepper .s.current .n { background: var(--ebk-gradient); color: #fff; }
@media (max-width: 767.98px) { .stepper { grid-template-columns: 1fr 1fr; } }

.ws-card { padding: 24px; margin-bottom: 20px; }

/* Image studio */
.studio-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 280px; padding: 32px 20px; border: 2px dashed #d6d1f5; border-radius: 20px; background: #fff; text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s; }
.studio-drop:hover, .studio-drop.is-over { border-color: var(--ebk-primary); background: var(--ebk-primary-soft); }
.studio-drop .icon-chip { width: 56px; height: 56px; border-radius: 16px; font-size: 1.6rem; margin-bottom: 6px; }
.studio-drop .t { font-weight: 700; font-size: 1.1rem; color: var(--ebk-ink); }
.studio-drop .d { font-size: .85rem; color: var(--ebk-muted); }
.studio-result { margin-top: 20px; padding: 16px; border: 1px solid var(--ebk-border); border-radius: 16px; background: #fff; }
.studio-result img { display: block; max-width: 100%; max-height: 360px; margin: 0 auto; border-radius: 8px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.ws-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.ws-card-head h2 { display: flex; align-items: center; gap: 12px; font-size: 1.1rem; font-weight: 800; margin: 0; }
.step-badge { width: 32px; height: 32px; border-radius: 10px; background: var(--ebk-gradient); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem; box-shadow: 0 6px 14px -6px rgba(109, 74, 255, .8); }

.outline-row { border: 1px solid var(--ebk-border); border-radius: 14px; padding: 12px; background: #fcfcff; margin-bottom: 10px; align-items: flex-start; transition: border-color .15s, box-shadow .15s; }
.outline-row:hover { border-color: #ddd5ff; }
.outline-row:focus-within { border-color: #c6b8ff; box-shadow: 0 0 0 4px rgba(109, 74, 255, .07); background: #fff; }
.outline-row .num { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--ebk-primary-soft); color: var(--ebk-primary-dark); font-weight: 800; font-size: .85rem; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.outline-row .form-control { background: transparent; border-color: transparent; }
.outline-row .form-control:hover { border-color: var(--ebk-border); }
.outline-row .form-control:focus { background: #fff; border-color: #c6b8ff; }
.outline-row .btn-link { opacity: .45; }
.outline-row:hover .btn-link { opacity: 1; }

.write-meter { display: flex; align-items: center; gap: 14px; margin: 14px 0 18px; padding: 14px 16px; border-radius: 14px; background: #faf9ff; border: 1px solid var(--ebk-border); }
.write-meter .progress { flex: 1; height: 10px; }
.write-meter #write-status { font-size: .82rem; font-weight: 600; color: var(--ebk-muted); white-space: nowrap; }
@media (max-width: 575.98px) { .write-meter { flex-direction: column; align-items: stretch; } }

.chapter-card { border-radius: 16px; box-shadow: none; transition: border-color .15s, box-shadow .15s; }
.chapter-card:hover { border-color: #ddd5ff; box-shadow: 0 10px 24px -18px rgba(52, 33, 140, .45); }
.chapter-card .card-header { background: transparent; border-bottom: 0; padding: 14px 16px !important; border-radius: 16px; }
.chapter-card .card-header .fw-semibold { font-weight: 700 !important; }
.chapter-card .card-header .text-primary { display: inline-flex; width: 26px; height: 26px; border-radius: 8px; align-items: center; justify-content: center; background: var(--ebk-primary-soft); font-size: .8rem; font-weight: 800; margin-right: 8px !important; }
.chapter-card .card-body { border-top: 1px solid var(--ebk-border); padding: 18px; }
.chapter-status { font-size: .72rem; }
.chapter-card .badge.text-bg-success { background: #e7f8ef !important; color: #128552 !important; }
.chapter-card .badge.text-bg-light { background: #f4f4fa !important; color: #7a7f9e !important; border-color: transparent !important; }
.chapter-editor { font-family: ui-monospace, 'Cascadia Code', SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.65; min-height: 320px; background: #fdfdff; }
.chapter-img { max-width: 100%; max-height: 360px; border-radius: 14px; border: 1px solid var(--ebk-border); }

.sticky-side { position: sticky; top: 24px; }
.cover-preview { width: 100%; max-width: 230px; aspect-ratio: 2 / 3; border-radius: 6px 14px 14px 6px; background: linear-gradient(160deg, #f1edff, #fbeaff); display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; overflow: hidden; color: #a99bf0; box-shadow: inset 7px 0 0 rgba(109, 74, 255, .08), 0 20px 36px -22px rgba(52, 33, 140, .55); }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Live cover preview: mirrors the PDF cover (sizes in cqw so they scale with the box) */
.cover-live { position: relative; display: block; container-type: inline-size; color: #fff; }
.cover-live img { position: absolute; inset: 0; }
.cv-band { position: absolute; left: 6.8cqw; right: 6.8cqw; top: 8%; padding: 5.4cqw 6.8cqw; text-align: center; background: rgba(15, 20, 35, .62); transition: top .2s; }
.cv-title { font-weight: 800; font-size: 5.8cqw; line-height: 1.2; word-wrap: break-word; }
.cv-sub { font-size: 2.6cqw; margin-top: 2.7cqw; opacity: .95; }
.cv-sub:empty { display: none; }
.cv-author { position: absolute; left: 0; right: 0; bottom: 9%; text-align: center; font-weight: 700; font-size: 3.1cqw; }
.cv-author span { background: rgba(15, 20, 35, .62); padding: 0 .4em; }
.cv-author span:empty { display: none; }
.cover-live[data-pos="middle"] .cv-band { top: 34%; }
.cover-live[data-pos="bottom"] .cv-band { top: 58%; }
.cover-live[data-size="s"] .cv-title { font-size: 4.6cqw; }
.cover-live[data-size="l"] .cv-title { font-size: 7.2cqw; }
.cover-live[data-font="serif"] .cv-band, .cover-live[data-font="serif"] .cv-author { font-family: Georgia, 'Times New Roman', serif; }
.cover-live[data-noauthor] .cv-author { display: none; }
/* "Design style" band per PDF template */
.cover-live[data-band="template"][data-template="classic"] .cv-band { border-top: 1px solid #a07a2c; border-bottom: 1px solid #a07a2c; }
.cover-live[data-band="template"][data-template="modern"] .cv-band { left: 0; right: 9.5cqw; text-align: left; background: rgba(17, 24, 39, .78); border-left: 2.7cqw solid #6d4aff; }
.cover-live[data-band="template"][data-template="modern"] .cv-author span { background: rgba(17, 24, 39, .78); }
.cover-live[data-band="template"][data-template="kids"] .cv-band { left: 6cqw; right: 6cqw; background: rgba(255, 122, 0, .88); border: .8cqw solid #fff; border-radius: 4.7cqw; }
.cover-live[data-band="template"][data-template="kids"] .cv-author span { background: rgba(37, 99, 235, .85); }
.cover-live[data-band="template"][data-template="recipe"] .cv-band { background: rgba(124, 45, 18, .8); border: 1px dashed #fde7c7; border-radius: 2cqw; }
.cover-live[data-band="template"][data-template="recipe"] .cv-author span { background: rgba(124, 45, 18, .8); }
.cover-live[data-band="light"] .cv-band, .cover-live[data-band="light"] .cv-author span { background: rgba(255, 255, 255, .85); }
.cover-live[data-band="none"] .cv-band, .cover-live[data-band="none"] .cv-author span { background: transparent; }
.brand-logo { max-height: 34px; max-width: 180px; }
.admin-table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: #7a7f9e; background: #fafaff; border-bottom-width: 1px; padding: 12px 16px; }
.admin-table td { padding: 12px 16px; }

/* Billing & pricing */
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.feature-list li { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; color: #3d4262; }
.feature-list li i { color: #16a34a; margin-top: 1px; }
.feature-list li.off { color: #9aa0b8; }
.feature-list li.off i { color: #c3c7d9; }
.plan-card { display: flex; flex-direction: column; }
.plan-card.is-current { border: 2px solid var(--ebk-primary); }
.plan-price { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin: 4px 0; }
.plan-price small { font-size: .85rem; font-weight: 600; color: #7a7f9e; letter-spacing: 0; }
.plan-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--ebk-primary-soft); color: var(--ebk-primary-dark); border-radius: 999px; padding: .15rem .5rem; }
.seg { display: flex; border: 1px solid var(--ebk-border); border-radius: 10px; padding: 3px; gap: 3px; }
.seg .btn { flex: 1; border: 0; border-radius: 7px; font-weight: 600; color: #5b6080; }
.seg .btn-check:checked + .btn { background: var(--ebk-primary); color: #fff; }

/* ==========================================================================
   Settings
   ========================================================================== */
.key-steps { counter-reset: k; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.key-steps li { counter-increment: k; display: flex; gap: 12px; font-size: .88rem; color: #3d4262; }
.key-steps li::before { content: counter(k); width: 24px; height: 24px; flex: none; border-radius: 8px; background: var(--ebk-primary-soft); color: var(--ebk-primary-dark); font-weight: 800; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; }
.key-saved { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #f1fbf5; border: 1px solid #cdeedb; margin-bottom: 14px; }
.key-saved code { color: #1f6b46; background: #fff; padding: 2px 8px; border-radius: 6px; }

/* ---------------------------------------------------------------- public site (landing, legal pages) */
body.public { background: #fff; }
.site-nav { position: sticky; top: 0; z-index: 20; padding: 14px 0; background: rgba(255, 255, 255, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--ebk-border); }
.site-nav .brand { font-size: 1.15rem; }
.hero { padding: 72px 0 56px; background: radial-gradient(700px 380px at 90% 10%, rgba(166, 77, 255, .14), transparent 70%), radial-gradient(600px 360px at 0% 100%, rgba(109, 74, 255, .10), transparent 70%); }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.08; margin: 14px 0 16px; }
.hero .lead { color: var(--ebk-muted); font-size: 1.1rem; max-width: 560px; }
.hero-kicker { display: inline-flex; gap: 6px; align-items: center; font-size: .8rem; font-weight: 700; color: var(--ebk-primary-dark); background: var(--ebk-primary-soft); border-radius: 999px; padding: .35rem .8rem; }
.hero-proof { margin-top: 22px; font-size: .85rem; color: var(--ebk-muted); font-weight: 600; }
.hero-proof span { margin: 0 6px; }
.hero-books { position: relative; height: 380px; max-width: 460px; margin: 0 auto; }
.hb { position: absolute; width: 190px; aspect-ratio: 2 / 3; border-radius: 6px 16px 16px 6px; padding: 26px 18px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: inset 8px 0 0 rgba(0, 0, 0, .15), 0 30px 50px -24px rgba(30, 20, 90, .6); }
.hb b { font-size: 1.15rem; line-height: 1.2; }
.hb small { opacity: .85; margin-top: 6px; font-size: .8rem; }
.hb1 { left: 0; top: 40px; background: linear-gradient(160deg, #6d4aff, #a64dff); transform: rotate(-7deg); }
.hb2 { left: 32%; top: 0; z-index: 2; background: linear-gradient(160deg, #16a34a, #0e7490); }
.hb3 { right: 0; top: 60px; background: linear-gradient(160deg, #f97316, #c2410c); transform: rotate(6deg); padding-left: 70px; text-align: right; }
.hb1 { padding-right: 72px; }
.section { padding: 72px 0; }
.section.alt { background: var(--ebk-bg); }
.lp-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.lp-head h2 { font-weight: 800; letter-spacing: -.03em; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.lp-head p { color: var(--ebk-muted); margin: 0; }
.step-card, .feature-card, .design-card { height: 100%; background: #fff; border: 1px solid var(--ebk-border); border-radius: 18px; padding: 24px; }
.step-card { position: relative; }
.step-card .n { position: absolute; top: 18px; right: 20px; font-weight: 800; color: #d9d4ff; font-size: 1.6rem; }
.step-card > i { font-size: 1.6rem; color: var(--ebk-primary); }
.step-card h3, .feature-card h3, .design-card h3 { font-size: 1.02rem; font-weight: 700; margin: 12px 0 6px; }
.step-card p, .feature-card p, .design-card p { color: var(--ebk-muted); font-size: .9rem; margin: 0; }
.design-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.design-card .tpl-page { width: 96px; height: 128px; padding: 14px 12px; gap: 7px; }
.design-card .tpl-page b { height: 14px; }
.lang-cloud { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 36px; }
.lang-cloud span { font-size: .82rem; font-weight: 600; color: #4b5170; background: var(--ebk-bg); border: 1px solid var(--ebk-border); border-radius: 999px; padding: .3rem .75rem; }
.faq { max-width: 760px; }
.faq .accordion-item { border: 1px solid var(--ebk-border); border-radius: 14px !important; margin-bottom: 10px; overflow: hidden; }
.faq .accordion-button { font-weight: 700; }
.faq .accordion-button:not(.collapsed) { background: var(--ebk-primary-soft); color: var(--ebk-primary-dark); box-shadow: none; }
.cta-band { background: var(--ebk-gradient); color: #fff; border-radius: 24px; padding: 48px 32px; text-align: center; }
.cta-band h2 { font-weight: 800; letter-spacing: -.03em; margin-bottom: 20px; }
.site-footer { border-top: 1px solid var(--ebk-border); padding: 28px 0; color: var(--ebk-muted); }
.site-footer a { color: var(--ebk-muted); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--ebk-primary); }
.legal-page { max-width: 760px; padding-top: 56px; padding-bottom: 72px; }
.legal-page h1 { font-weight: 800; letter-spacing: -.03em; margin-bottom: 28px; }
.legal-body h2 { font-size: 1.2rem; font-weight: 700; margin-top: 28px; }
.legal-body p, .legal-body li { color: #3d4262; line-height: 1.7; }
@media (max-width: 575.98px) {
	.hero { padding: 44px 0 32px; }
	.hero-books { height: 300px; }
	.hb { width: 150px; }
	.section { padding: 52px 0; }
}
/* Installer */
.install-wrap { max-width: 760px; margin: 40px auto; padding: 0 16px; }


/* ---------------------------------------------------------------- image editor */
.img-editor .modal-content { border-radius: 18px; overflow: hidden; }
.ie-layout { display: grid; grid-template-columns: 1fr 330px; min-height: 60vh; }
.ie-stage { display: flex; align-items: center; justify-content: center; padding: 12px; background-color: #e9e9f1; background-image: linear-gradient(45deg, #d9d9e3 25%, transparent 25%), linear-gradient(-45deg, #d9d9e3 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d9d9e3 75%), linear-gradient(-45deg, transparent 75%, #d9d9e3 75%); background-size: 22px 22px; background-position: 0 0, 0 11px, 11px -11px, -11px 0; min-width: 0; }
.ie-stage-inner { position: relative; display: inline-block; line-height: 0; }
.ie-stage canvas { max-width: 100%; box-shadow: 0 10px 30px -12px rgba(20, 20, 50, .45); touch-action: none; }
.ie-crop { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(15, 15, 30, .55); cursor: move; touch-action: none; }
.ie-crop::before, .ie-crop::after { content: ''; position: absolute; border: 0 dashed rgba(255, 255, 255, .6); pointer-events: none; }
.ie-crop::before { left: 33.33%; right: 33.33%; top: 0; bottom: 0; border-left-width: 1px; border-right-width: 1px; }
.ie-crop::after { top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-top-width: 1px; border-bottom-width: 1px; }
.ie-crop i { position: absolute; width: 16px; height: 16px; background: #fff; border-radius: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.ie-crop i[data-h="nw"] { left: -8px; top: -8px; cursor: nwse-resize; }
.ie-crop i[data-h="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.ie-crop i[data-h="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.ie-crop i[data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.ie-tools { border-left: 1px solid var(--ebk-border); display: flex; flex-direction: column; min-height: 0; max-height: 75vh; }
.ie-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--ebk-border); }
.ie-tabs button { border: 0; background: none; padding: 10px 4px; font-size: .74rem; font-weight: 700; color: #6b7193; display: flex; flex-direction: column; align-items: center; gap: 3px; border-bottom: 2px solid transparent; }
.ie-tabs button i { font-size: 1.1rem; }
.ie-tabs button.active { color: var(--ebk-primary); border-bottom-color: var(--ebk-primary); }
.ie-panel { padding: 14px 16px; overflow-y: auto; }
.ie-group { margin-bottom: 18px; }
.ie-label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #7a7f9e; margin-bottom: 8px; }
.ie-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ie-chips .btn.active { background: var(--ebk-primary); border-color: var(--ebk-primary); color: #fff; }
.ie-slider { display: block; margin-bottom: 6px; font-size: .84rem; font-weight: 600; }
.ie-slider span { display: flex; justify-content: space-between; }
.ie-slider b { color: var(--ebk-primary); font-weight: 700; }
.ie-color { display: flex; align-items: center; gap: 10px; font-size: .84rem; font-weight: 600; margin: 6px 0; }
.ie-color input { width: 42px; height: 32px; padding: 2px; }
.ie-swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ie-swatch { width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .15); }
.ie-stickers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.ie-stickers button { border: 1px solid var(--ebk-border); background: #fff; border-radius: 10px; font-size: 1.35rem; line-height: 1; padding: 6px 0; }
.ie-stickers button:hover { background: var(--ebk-primary-soft); }
.ie-text-edit { background: #faf8ff; border: 1px solid #e6e0ff; border-radius: 12px; padding: 12px; }
.ie-text-edit .btn.active { background: var(--ebk-primary); border-color: var(--ebk-primary); color: #fff; }
@media (max-width: 991.98px) {
	.ie-layout { grid-template-columns: 1fr; }
	.ie-tools { border-left: 0; border-top: 1px solid var(--ebk-border); max-height: none; }
}
/* Picture history */
.studio-recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.studio-recent-item { aspect-ratio: 1; padding: 0; border: 1px solid var(--ebk-border); border-radius: 12px; overflow: hidden; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.studio-recent-item img { width: 100%; height: 100%; object-fit: cover; }
.studio-recent-item:hover { border-color: var(--ebk-primary); box-shadow: 0 0 0 3px var(--ebk-primary-soft); }
.hist-thumb { position: relative; background: repeating-conic-gradient(#eceaf3 0 25%, #f7f6fb 0 50%) 0 0 / 14px 14px; }
.hist-tool { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .68rem; font-weight: 700; color: #fff; background: rgba(20, 24, 51, .78); }
.hist-tool.tool-bg { background: rgba(15, 118, 110, .9); }
.hist-tool.tool-design { background: rgba(109, 74, 255, .9); }

/* Demo mode */
.demo-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 18px; border-radius: 12px; background: #fff7e6; border: 1px solid #fde3a7; color: #7a4b00; font-size: .85rem; }
.demo-strip { padding: 8px 16px; text-align: center; background: #141833; color: #fff; font-size: .85rem; }
.demo-strip a { color: #ffd166; font-weight: 700; }
.demo-logins { padding: 12px; border-radius: 12px; background: #fff7e6; border: 1px solid #fde3a7; }
.demo-logins .btn { text-align: left; }

/* ==========================================================================
   Remove background page
   ========================================================================== */
.rb { max-width: 1040px; margin: 0 auto; }
.rb-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.rb-kicker { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--ebk-primary-soft); color: var(--ebk-primary-dark); font-size: .74rem; font-weight: 700; margin-bottom: 8px; }
.rb .checker, .rb-after.checker { background-color: #fff; background-image: repeating-conic-gradient(#e7e5ef 0 25%, #fff 0 50%); background-size: 22px 22px; }

.rb-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 380px; padding: 40px 20px; border-radius: 28px; cursor: pointer; text-align: center;
	background: radial-gradient(ellipse at top, #f3efff 0%, #fff 60%); border: 2px dashed #d6cffb; transition: border-color .15s, box-shadow .15s, transform .15s; }
.rb-drop:hover, .rb-drop.is-over { border-color: var(--ebk-primary); box-shadow: 0 24px 50px -30px rgba(109, 74, 255, .55); }
.rb-drop.is-over { transform: scale(1.01); }
.rb-drop-art { position: relative; width: 120px; height: 120px; margin-bottom: 6px; }
.rb-drop-art .a, .rb-drop-art .b { position: absolute; inset: 0; border-radius: 30px; }
.rb-drop-art .a { background: var(--ebk-gradient); transform: rotate(-8deg); opacity: .25; }
.rb-drop-art .b { background-color: #fff; background-image: repeating-conic-gradient(#ece9f8 0 25%, #fff 0 50%); background-size: 16px 16px; box-shadow: 0 16px 30px -18px rgba(52, 33, 140, .6); transform: rotate(5deg); }
.rb-drop-art i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--ebk-primary); }
.rb-upload-btn { pointer-events: none; border-radius: 999px; padding-left: 28px; padding-right: 28px; }
.rb-drop-hint { color: var(--ebk-muted); font-size: .92rem; }
.rb-drop-hint kbd { font-size: .72rem; background: #fff; color: var(--ebk-ink); border: 1px solid var(--ebk-border); box-shadow: none; }
.rb-drop-small { color: #9a9fbd; font-size: .78rem; max-width: 420px; }

.rb-work { text-align: center; padding: 20px 0; }
.rb-scan { position: relative; display: inline-block; max-width: 100%; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 50px -30px rgba(20, 24, 51, .6); }
.rb-scan img { display: block; max-width: 100%; max-height: 460px; filter: saturate(.85) brightness(1.03); }
.rb-scan::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(109, 74, 255, .14), rgba(255, 111, 174, .14)); }
.rb-scan-line { position: absolute; left: 0; right: 0; height: 90px; top: -90px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .75), rgba(255, 255, 255, 0)); animation: rb-scan 1.6s ease-in-out infinite; z-index: 1; }
@keyframes rb-scan { 0% { top: -90px; } 100% { top: 100%; } }
.rb-work-text { margin-top: 16px; font-weight: 600; }

.rb-result { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.rb-stage { background: #fff; border: 1px solid var(--ebk-border); border-radius: 24px; padding: 16px; }
.rb-compare { position: relative; overflow: hidden; border-radius: 16px; user-select: none; touch-action: none; cursor: ew-resize; line-height: 0; margin: 0 auto; max-height: 560px; }
.rb-compare.no-before { cursor: default; }
.rb-before { display: block; width: 100%; height: 100%; object-fit: contain; background: #f4f3f9; }
.rb-after { position: absolute; inset: 0; }
.rb-after img { width: 100%; height: 100%; object-fit: contain; }
.rb-handle { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(20, 24, 51, .15); pointer-events: none; }
.rb-handle span { position: absolute; top: 50%; left: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; background: #fff; box-shadow: 0 6px 18px rgba(20, 24, 51, .25); display: flex; align-items: center; justify-content: center; color: var(--ebk-primary); font-size: .8rem; }
.rb-compare.no-before .rb-handle, .rb-compare.no-before .rb-tag { display: none; }
.rb-tag { position: absolute; top: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(20, 24, 51, .65); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.4; }
.rb-tag.left { left: 12px; }
.rb-tag.right { right: 12px; }

.rb-side { background: #fff; border: 1px solid var(--ebk-border); border-radius: 24px; padding: 20px; position: sticky; top: 24px; }
.rb-side-title { font-weight: 800; font-size: .95rem; margin-bottom: 12px; }
.rb-bgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rb-bg { position: relative; aspect-ratio: 1; padding: 4px; border-radius: 14px; border: 2px solid transparent; background: #f6f5fb; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.rb-bg span { width: 100%; height: 100%; border-radius: 10px; border: 1px solid rgba(0, 0, 0, .08); }
.rb-bg:hover { border-color: #d6cffb; }
.rb-bg.active { border-color: var(--ebk-primary); box-shadow: 0 0 0 3px var(--ebk-primary-soft); }
.rb-bg-custom { background: conic-gradient(#ff6b6b, #ffd166, #06d6a0, #4cc9f0, #7b2ff7, #ff6b6b); color: #fff; font-size: 1.1rem; }
.rb-bg-custom i { text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.rb-bg-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rb-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ebk-border); font-size: .78rem; color: var(--ebk-muted); }

.rb-error { text-align: center; padding: 48px 20px; border-radius: 24px; background: #fff7f7; border: 1px solid #fde0e0; }
.rb-error > i { font-size: 2.4rem; color: #e0443b; display: block; margin-bottom: 8px; }

@media (max-width: 991.98px) {
	.rb-result { grid-template-columns: 1fr; }
	.rb-side { position: static; }
	.rb-drop { min-height: 300px; }
}

/* ---------------------------------------------------------------- Photo Lab (full-screen photo editor) */
.pl-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.pl-features span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--ebk-border); font-size: .8rem; font-weight: 600; color: #4a4f6a; }
.pl-features i { color: var(--ebk-primary); }
body.pl-open { overflow: hidden; }

.pl { --pl-bg: #121418; --pl-panel: #1b1e24; --pl-line: #2a2e37; --pl-soft: #252932; --pl-ink: #e8eaee; --pl-mut: #8d93a1; --pl-acc: #ffb020;
	position: fixed; inset: 0; z-index: 1080; display: flex; flex-direction: column; background: var(--pl-bg); color: var(--pl-ink); font-size: .86rem; }
.pl[hidden] { display: none; }
.pl-muted { color: var(--pl-mut); }
.pl-top { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px; background: var(--pl-panel); border-bottom: 1px solid var(--pl-line); flex-shrink: 0; }
.pl-brand { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; letter-spacing: .02em; color: var(--pl-acc); }
.pl-name { font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-dim { color: var(--pl-mut); font-size: .76rem; font-variant-numeric: tabular-nums; }
.pl-top-mid { display: flex; align-items: center; gap: 2px; margin: 0 auto; }
.pl-top-end { display: flex; align-items: center; gap: 6px; }
.pl-sep { width: 1px; height: 22px; background: var(--pl-line); margin: 0 6px; }
.pl-ibtn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 34px; height: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--pl-ink); }
.pl-ibtn:hover:not(:disabled) { background: var(--pl-soft); }
.pl-ibtn:disabled { opacity: .35; }
.pl-ibtn.active, .pl-compare:active { background: var(--pl-acc); color: #1b1300; }
.pl-danger:hover { color: #ff6b6b !important; }
.pl-zoomval { min-width: 58px; height: 30px; border: 1px solid var(--pl-line); border-radius: 8px; background: var(--pl-bg); color: var(--pl-ink); font-variant-numeric: tabular-nums; font-size: .78rem; }
.pl-export, .pl-primary { background: var(--pl-acc); color: #1b1300; font-weight: 700; border: 0; }
.pl-export:hover, .pl-primary:hover { background: #ffc24d; color: #1b1300; }
.pl-export { padding: 6px 14px; border-radius: 8px; }
.pl-ghost { background: var(--pl-soft); color: var(--pl-ink); border: 1px solid var(--pl-line); }
.pl-ghost:hover { background: #2f3440; color: #fff; border-color: #3a404c; }
.pl .btn:disabled { opacity: .6; }
.pl .btn .spinner-border { width: 1rem; height: 1rem; border-width: .15em; }

.pl-export-wrap { position: relative; }
.pl-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 290px; padding: 16px; border-radius: 14px; background: var(--pl-panel); border: 1px solid var(--pl-line); box-shadow: 0 24px 60px rgba(0, 0, 0, .55); z-index: 5; }
.pl-pop-title { font-weight: 800; font-size: 1rem; margin-bottom: 10px; }
.pl-label { display: block; color: var(--pl-mut); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 6px; }
.pl-label b { color: var(--pl-ink); }
.pl-input { background: var(--pl-bg); color: var(--pl-ink); border: 1px solid var(--pl-line); border-radius: 8px; padding: 6px 9px; font-size: .84rem; min-width: 0; width: 100%; }
.pl-input:focus { outline: 0; border-color: var(--pl-acc); }
.pl-seg { display: flex; gap: 3px; padding: 3px; background: var(--pl-bg); border: 1px solid var(--pl-line); border-radius: 10px; }
.pl-seg button { flex: 1; border: 0; background: transparent; color: var(--pl-mut); border-radius: 7px; padding: 5px 6px; font-size: .8rem; font-weight: 600; }
.pl-seg button:hover { color: var(--pl-ink); }
.pl-seg button.active { background: var(--pl-soft); color: var(--pl-acc); box-shadow: inset 0 0 0 1px #3a404c; }

.pl-body { flex: 1; display: flex; min-height: 0; }
.pl-rail { width: 74px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; background: var(--pl-panel); border-right: 1px solid var(--pl-line); overflow-y: auto; }
.pl-rail button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; border-radius: 10px; background: transparent; color: var(--pl-mut); font-size: .66rem; font-weight: 600; }
.pl-rail button i { font-size: 1.15rem; }
.pl-rail button:hover { color: var(--pl-ink); background: var(--pl-soft); }
.pl-rail button.active { color: var(--pl-acc); background: rgba(255, 176, 32, .1); box-shadow: inset 3px 0 0 var(--pl-acc); }
.pl-panel { width: 290px; flex-shrink: 0; overflow-y: auto; background: var(--pl-panel); border-right: 1px solid var(--pl-line); padding: 6px 14px 24px; scrollbar-width: thin; scrollbar-color: #3a404c transparent; }
.pl-sec { padding: 12px 0; border-bottom: 1px solid var(--pl-line); }
.pl-sec:last-child { border-bottom: 0; }
.pl-sec-title { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; color: #c9cdd6; }
.pl-hint { color: var(--pl-mut); font-size: .76rem; margin: 10px 0 0; line-height: 1.45; }
.pl-warn { padding: 10px 12px; border-radius: 10px; background: rgba(255, 176, 32, .1); color: #ffd27a; font-size: .8rem; }

.pl-slider { margin-bottom: 10px; }
.pl-slider-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.pl-slider-top span { color: #c9cdd6; cursor: default; user-select: none; }
.pl-slider.changed .pl-slider-top span { color: var(--pl-acc); }
.pl-num { width: 52px; text-align: right; background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--pl-ink); font-size: .78rem; font-variant-numeric: tabular-nums; padding: 1px 4px; -moz-appearance: textfield; }
.pl-num::-webkit-inner-spin-button { -webkit-appearance: none; }
.pl-num:hover, .pl-num:focus { border-color: var(--pl-line); outline: 0; background: var(--pl-bg); }
.pl-range { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; }
.pl-range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: #343944; }
.pl-range::-moz-range-track { height: 4px; border-radius: 4px; background: #343944; }
.pl-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 3px solid var(--pl-acc); }
.pl-range::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid var(--pl-acc); }
.pl-histo { display: block; width: 100%; height: 70px; border-radius: 10px; background: #0d0f12; border: 1px solid var(--pl-line); }

.pl-looks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pl-look { padding: 0; border: 0; background: transparent; color: var(--pl-mut); font-size: .7rem; font-weight: 600; text-align: center; }
.pl-look img { display: block; width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover; margin-bottom: 4px; border: 2px solid transparent; background: var(--pl-soft); }
.pl-look:hover img { border-color: #4a505e; }
.pl-look.active { color: var(--pl-acc); }
.pl-look.active img { border-color: var(--pl-acc); }

.pl-ratios { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pl-ratios button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0; border: 1px solid var(--pl-line); border-radius: 9px; background: var(--pl-bg); color: var(--pl-mut); font-size: .64rem; font-weight: 600; }
.pl-ratios button i { font-size: 1rem; }
.pl-ratios button:hover { color: var(--pl-ink); }
.pl-ratios button.active { border-color: var(--pl-acc); color: var(--pl-acc); }
.pl-iconrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.pl-tile { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 !important; background: var(--pl-bg); color: var(--pl-ink); border: 1px solid var(--pl-line); font-size: .68rem; }
.pl-tile i { font-size: 1.1rem; }
.pl-tile:hover { border-color: var(--pl-acc); color: var(--pl-acc); }

.pl-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-sw { position: relative; width: 26px; height: 26px; padding: 0; border-radius: 8px; border: 2px solid var(--pl-panel); box-shadow: 0 0 0 1px #3a404c; cursor: pointer; }
.pl-sw.active { box-shadow: 0 0 0 2px var(--pl-acc); }
.pl-sw-none { background: linear-gradient(135deg, transparent 45%, #ff6b6b 45% 55%, transparent 55%), var(--pl-bg) !important; }
.pl-sw-pick { display: inline-flex; align-items: center; justify-content: center; background: conic-gradient(#ff6b6b, #ffd166, #06d6a0, #4cc9f0, #7b2ff7, #ff6b6b); color: #fff; font-size: .75rem; }
.pl-sw-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.pl-add { display: block; text-align: left; background: var(--pl-bg); border: 1px solid var(--pl-line); color: var(--pl-ink); margin-bottom: 6px; padding: 8px 12px; }
.pl-add:hover { border-color: var(--pl-acc); color: #fff; }
.pl-add-h { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.15rem; }
.pl-add-s { font-family: 'Poppins', sans-serif; font-weight: 600; font-size: .95rem; }
.pl-add-b { font-size: .8rem; }
.pl-tstyles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pl-tstyle { padding: 10px 4px; border-radius: 10px; border: 1px solid var(--pl-line); background: #2b303a; color: #fff; font-size: 1rem; line-height: 1.1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pl-tstyle:hover { border-color: var(--pl-acc); }
.pl-tstyle.k-shadow { text-shadow: 0 2px 6px rgba(0, 0, 0, .7); font-weight: 700; }
.pl-tstyle.k-outline { color: #fff; -webkit-text-stroke: 1px #000; font-size: 1.1rem; letter-spacing: .02em; }
.pl-tstyle.k-label span, .pl-tstyle.k-label { background: #111827; font-weight: 700; }
.pl-tstyle.k-neon { color: #fff7fd; text-shadow: 0 0 8px #ff2bd6, 0 0 16px #ff2bd6; }
.pl-tstyle.k-classic { background: #f4efe6; color: #111827; font-weight: 700; }
.pl-tstyle.k-hand { color: #fde047; font-weight: 700; font-size: 1.15rem; }
.pl-tstyle.k-poster { color: #facc15; -webkit-text-stroke: .6px #000; font-size: 1.15rem; letter-spacing: .04em; }
.pl-shapes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pl-shapes button, .pl-stickers button { aspect-ratio: 1; border: 1px solid var(--pl-line); border-radius: 9px; background: var(--pl-bg); color: var(--pl-ink); font-size: 1.1rem; padding: 0; }
.pl-shapes button:hover, .pl-stickers button:hover { border-color: var(--pl-acc); color: var(--pl-acc); }
.pl-stickers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pl-stickers button { font-size: 1.25rem; }

.pl-layers { display: flex; flex-direction: column; gap: 4px; }
.pl-layer { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border-radius: 9px; background: var(--pl-bg); border: 1px solid var(--pl-line); cursor: pointer; }
.pl-layer > i { color: var(--pl-mut); }
.pl-layer .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-layer .pl-ibtn { min-width: 28px; height: 28px; padding: 0; color: var(--pl-mut); }
.pl-layer:hover { border-color: #3a404c; }
.pl-layer.active { border-color: var(--pl-acc); }
.pl-layer.off .nm { opacity: .45; text-decoration: line-through; }
.pl-layer.fixed { cursor: default; }

.pl-stage { position: relative; flex: 1; min-width: 0; display: flex; overflow: auto; background: radial-gradient(circle at 50% 40%, #1d2027, #121418 70%); }
.pl-page { position: relative; margin: auto; flex-shrink: 0; overflow: hidden; background-color: #fff; background-image: repeating-conic-gradient(#d9dbe1 0 25%, #fff 0 50%); background-size: 18px 18px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06); }
.pl-objbar { position: sticky; top: 12px; left: 50%; align-self: flex-start; margin: 12px 0 0 auto; transform: none; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; background: rgba(27, 30, 36, .94); border: 1px solid var(--pl-line); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); z-index: 3; }
.pl-objbar[hidden] { display: none; }
.pl-objbar-op { display: flex; align-items: center; gap: 6px; padding: 0 8px; color: var(--pl-mut); }
.pl-objbar-op input { width: 80px; accent-color: var(--pl-acc); }
.pl-stage > .pl-objbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); margin: 0; }

.pl-crop { position: absolute; box-shadow: 0 0 0 9999px rgba(10, 11, 14, .62); outline: 1px solid rgba(255, 255, 255, .9); cursor: move; touch-action: none; z-index: 2; }
.pl-crop .g { position: absolute; background: rgba(255, 255, 255, .35); pointer-events: none; }
.pl-crop .g1, .pl-crop .g2 { top: 0; bottom: 0; width: 1px; }
.pl-crop .g1 { left: 33.33%; }
.pl-crop .g2 { left: 66.66%; }
.pl-crop .g3, .pl-crop .g4 { left: 0; right: 0; height: 1px; }
.pl-crop .g3 { top: 33.33%; }
.pl-crop .g4 { top: 66.66%; }
.pl-crop i { position: absolute; width: 16px; height: 16px; background: #fff; border: 3px solid var(--pl-acc); border-radius: 50%; }
.pl-crop i[data-h="nw"] { left: -8px; top: -8px; cursor: nwse-resize; }
.pl-crop i[data-h="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.pl-crop i[data-h="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.pl-crop i[data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.pl-crop i[data-h="n"], .pl-crop i[data-h="s"] { left: 50%; margin-left: -14px; width: 28px; height: 10px; border-radius: 6px; cursor: ns-resize; }
.pl-crop i[data-h="n"] { top: -5px; }
.pl-crop i[data-h="s"] { bottom: -5px; }
.pl-crop i[data-h="e"], .pl-crop i[data-h="w"] { top: 50%; margin-top: -14px; width: 10px; height: 28px; border-radius: 6px; cursor: ew-resize; }
.pl-crop i[data-h="e"] { right: -5px; }
.pl-crop i[data-h="w"] { left: -5px; }
.pl-crop-size { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: .72rem; font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap; }

.pl-busy { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(18, 20, 24, .72); color: #fff; font-weight: 600; z-index: 4; }
.pl-busy[hidden] { display: none; }
.pl-busy .spinner-border { color: var(--pl-acc); }
.pl-dialog { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); z-index: 10; }
.pl-dialog[hidden] { display: none; }
.pl-dialog-box { width: min(360px, 92vw); padding: 18px; border-radius: 14px; background: var(--pl-panel); border: 1px solid var(--pl-line); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
body.pl-open .toast-container { z-index: 1090; }

@media (max-width: 991.98px) {
	.pl-name, .pl-dim, .pl-brand span { display: none; }
	.pl-body { flex-direction: column-reverse; }
	.pl-rail { width: auto; flex-direction: row; border-right: 0; border-top: 1px solid var(--pl-line); padding: 4px; overflow-x: auto; overflow-y: hidden; }
	.pl-rail button { min-width: 62px; }
	.pl-rail button.active { box-shadow: inset 0 -3px 0 var(--pl-acc); }
	.pl-panel { width: auto; max-height: 38vh; border-right: 0; border-top: 1px solid var(--pl-line); }
	.pl-stage { min-height: 0; }
	.pl-pop { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; }
	.pl-top-mid .pl-sep, #pl-zoom-1 { display: none; }
}
