:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --panel-soft: #f8f9fc;
    --text: #182033;
    --muted: #737b8e;
    --muted-2: #99a0af;
    --line: #e7eaf1;
    --line-strong: #dce1eb;
    --primary: #6657ee;
    --primary-dark: #5142db;
    --primary-soft: #f1efff;
    --navy: #121628;
    --navy-2: #1a1f37;
    --success: #16966e;
    --success-soft: #eaf8f3;
    --danger: #c84b4b;
    --danger-soft: #fff1f1;
    --warning: #b97716;
    --shadow-sm: 0 8px 28px rgba(26, 33, 52, .06);
    --shadow: 0 18px 55px rgba(26, 33, 52, .10);
    --shadow-lg: 0 28px 80px rgba(23, 29, 48, .16);
    --radius: 18px;
    --radius-lg: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 100% 0%, rgba(115, 91, 244, .09), transparent 28%),
        linear-gradient(180deg, #f8f9fc 0%, var(--bg) 100%);
    min-width: 320px;
}
body.sidebar-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
svg { display: block; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4, strong { font-family: "Manrope", "DM Sans", sans-serif; }

/* ---------- Global shell ---------- */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 50;
    display: flex;
    flex-direction: column;
    padding: 24px 18px 18px;
    color: #fff;
    background:
        radial-gradient(circle at 30% 0%, rgba(119, 101, 255, .18), transparent 25%),
        linear-gradient(180deg, #171b31 0%, #101323 100%);
    border-right: 1px solid rgba(255,255,255,.05);
    box-shadow: 14px 0 45px rgba(14, 18, 34, .06);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(145deg, #8b7aff, #5b4be5);
    box-shadow: 0 12px 28px rgba(99, 81, 236, .30), inset 0 1px 0 rgba(255,255,255,.2);
    font: 800 19px/1 "Manrope", sans-serif;
}
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.brand-copy small { display: block; margin-top: 2px; color: #949bb7; font-size: 10px; }
.sidebar-close { display: none; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(255,255,255,.06); color: #fff; font-size: 23px; cursor: pointer; }
.sidebar-label { padding: 0 11px 9px; color: #6f7797; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; }
.sidebar-label.second { margin-top: 27px; }
.sidebar-nav { display: grid; gap: 6px; }
.sidebar-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding: 9px 12px;
    border-radius: 12px;
    color: #b6bdd5;
    font-size: 12px;
    font-weight: 700;
    transition: .2s ease;
}
.sidebar-nav a::before { content: ""; position: absolute; left: -18px; width: 3px; height: 0; border-radius: 4px; background: #8b7cff; transition: .2s ease; }
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.055); transform: translateX(2px); }
.sidebar-nav a.active { color: #fff; background: linear-gradient(90deg, rgba(112,95,238,.22), rgba(255,255,255,.045)); }
.sidebar-nav a.active::before { height: 24px; }
.nav-icon { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: #aaa4ff; background: rgba(255,255,255,.055); }
.nav-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-nav a.active .nav-icon { color: #fff; background: linear-gradient(145deg, #7161f2, #5d4de4); box-shadow: 0 8px 18px rgba(87, 70, 221, .28); }
.engine-card { margin: 0 4px; padding: 15px; border: 1px solid rgba(255,255,255,.07); border-radius: 15px; background: rgba(255,255,255,.035); }
.engine-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.engine-orb { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #c4bdff; background: rgba(121,104,246,.14); }
.engine-card-head > div { min-width: 0; display: grid; gap: 2px; }
.engine-card strong { font-size: 11px; }
.engine-status { color: #9ba3bd; font-size: 9px; }
.engine-status i, .status-live i, .auth-kicker i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #39d39a; box-shadow: 0 0 0 4px rgba(57,211,154,.08); margin-right: 5px; }
.engine-card small { display: block; color: #7f879f; font-size: 9px; line-height: 1.55; }
.sidebar-note { margin-top: auto; padding: 14px; display: flex; gap: 10px; border: 1px solid rgba(255,255,255,.07); border-radius: 14px; background: rgba(255,255,255,.03); }
.spark { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: #bdb6ff; background: rgba(119,103,240,.12); }
.sidebar-note strong { display: block; margin: 1px 0 4px; font-size: 10px; }
.sidebar-note span { display: block; color: #838ba5; font-size: 9px; line-height: 1.5; }
.sidebar-user { margin-top: 12px; padding: 11px; display: flex; align-items: center; gap: 9px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-user .user-avatar { color: #fff; background: rgba(116,98,242,.26); }
.sidebar-user > div { min-width: 0; }
.sidebar-user strong { display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user small { display: block; margin-top: 2px; color: #7f879f; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-overlay { display: none; }

.main { min-width: 0; padding: 28px 32px 64px; }
.page-content { max-width: 1560px; margin: 0 auto; }
.topbar { max-width: 1560px; margin: 0 auto 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.eyebrow { color: #9097a7; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.topbar h1 { margin: 4px 0 0; font-size: 29px; line-height: 1.1; letter-spacing: -.035em; }
.mobile-menu-button { display: none; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); cursor: pointer; }
.mobile-menu-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.date-chip { height: 43px; padding: 0 12px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.86); color: #71798a; font-size: 10px; font-weight: 600; }
.date-chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.profile-menu { position: relative; }
.profile-trigger { min-width: 184px; height: 43px; padding: 5px 8px 5px 6px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; transition: .2s; }
.profile-trigger:hover { border-color: #d8d3ff; box-shadow: 0 8px 22px rgba(43, 50, 72, .06); }
.user-avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: #5144cf; background: var(--primary-soft); font-size: 11px; font-weight: 800; }
.profile-copy { min-width: 0; flex: 1; text-align: left; }
.profile-copy strong { display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-copy small { display: block; margin-top: 1px; color: #989ead; font-size: 8px; }
.chevron { width: 14px; height: 14px; fill: none; stroke: #8e95a4; stroke-width: 1.8; transition: .2s; }
.profile-menu.open .chevron { transform: rotate(180deg); }
.profile-dropdown { position: absolute; right: 0; top: calc(100% + 8px); z-index: 90; width: 220px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .18s; }
.profile-menu.open .profile-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.profile-dropdown-head { padding: 10px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
.profile-dropdown-head strong, .profile-dropdown-head span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-dropdown-head strong { font-size: 11px; }
.profile-dropdown-head span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.profile-dropdown a, .profile-dropdown button { width: 100%; display: block; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: #5e6678; text-align: left; font-size: 10px; cursor: pointer; }
.profile-dropdown a:hover { background: #f5f5fb; color: var(--primary-dark); }
.profile-dropdown button:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- Buttons / alerts ---------- */
.btn { min-height: 42px; padding: 10px 15px; border: 1px solid transparent; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-size: 11px; font-weight: 800; line-height: 1; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .7; cursor: wait; transform: none; }
.btn-primary { color: #fff; background: linear-gradient(135deg, #6c5cf2, #5a4be3); box-shadow: 0 9px 22px rgba(92, 74, 225, .22); }
.btn-primary:hover { background: linear-gradient(135deg, #5f50e8, #4d3ed2); box-shadow: 0 12px 25px rgba(92, 74, 225, .28); }
.btn-secondary { color: #50586a; background: #fff; border-color: var(--line-strong); }
.btn-secondary:hover { border-color: #ccc6fb; color: var(--primary-dark); }
.btn-white { color: #5547d8; background: #fff; box-shadow: 0 10px 25px rgba(36, 29, 111, .14); }
.btn-ghost { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.24); }
.btn.full { width: 100%; }
.btn-icon { font-size: 15px; line-height: 0; }
.top-create .btn-icon { display: inline-grid; flex: 0 0 auto; place-items: center; font-size: 17px; line-height: 1; }
.top-create-label { white-space: nowrap; }
.button-loader { display: none; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .65s linear infinite; }
[data-loading-form].is-loading .button-loader { display: inline-block; }
[data-loading-form].is-loading .button-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { position: relative; max-width: 1560px; margin: 0 auto 18px; padding: 12px 40px 12px 13px; display: flex; align-items: flex-start; gap: 10px; border-radius: 13px; font-size: 11px; line-height: 1.55; transition: .25s; }
.alert ul { margin: 5px 0 0; padding-left: 17px; }
.alert-icon { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; font-weight: 800; }
.alert.success { color: #14694f; background: #effaf6; border: 1px solid #d2eee4; }
.alert.success .alert-icon { background: #d9f3ea; }
.alert.error { color: #9e3939; background: #fff3f3; border: 1px solid #f0d2d2; }
.alert.error .alert-icon { background: #f6dddd; }
.alert-close { position: absolute; right: 9px; top: 8px; width: 27px; height: 27px; border: 0; background: transparent; color: currentColor; opacity: .6; cursor: pointer; font-size: 18px; }
.alert.is-hiding { opacity: 0; transform: translateY(-7px); }

/* ---------- Dashboard ---------- */
.hero-banner { position: relative; overflow: hidden; min-height: 275px; margin-bottom: 18px; padding: 38px 42px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); border-radius: 25px; color: #fff; background: linear-gradient(120deg, #4c43cf 0%, #6655ea 50%, #9268f4 100%); box-shadow: 0 22px 60px rgba(91, 72, 235, .20); }
.hero-banner::before, .hero-banner::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.09); }
.hero-banner::before { width: 380px; height: 380px; right: -130px; top: -160px; box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.018); }
.hero-banner::after { width: 200px; height: 200px; left: 42%; bottom: -160px; box-shadow: 0 0 0 55px rgba(255,255,255,.025); }
.hero-copy { position: relative; z-index: 2; max-width: 720px; }
.hero-kicker { display: inline-flex; padding: 7px 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; background: rgba(255,255,255,.09); font-size: 10px; font-weight: 700; }
.hero-copy h2 { max-width: 650px; margin: 16px 0 13px; font-size: clamp(30px, 3.2vw, 43px); line-height: 1.08; letter-spacing: -.04em; }
.hero-copy p { max-width: 650px; margin-bottom: 0; color: #e8e6ff; font-size: 12px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.hero-visual { position: relative; z-index: 2; min-height: 190px; }
.book-mockup { position: absolute; width: 132px; height: 182px; right: 60px; top: 8px; border-radius: 9px 18px 18px 9px; transform: rotate(7deg); box-shadow: 0 25px 45px rgba(40,22,102,.34); }
.book-back { right: 92px; top: 14px; background: #352c91; transform: rotate(-8deg); }
.book-front { padding: 24px 18px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; color: #3b347b; background: linear-gradient(160deg, #fff, #e8e3ff); }
.book-front::before { content: ""; position: absolute; inset: 0; border-left: 8px solid rgba(78,61,164,.15); border-radius: inherit; }
.book-front span { font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.book-front strong { font-size: 23px; line-height: 1; }
.book-front small { margin-top: 8px; color: #766da7; font-size: 7px; }
.floating-badge { position: absolute; padding: 8px 11px; border-radius: 10px; color: #4a4098; background: #fff; box-shadow: 0 10px 24px rgba(39,25,100,.2); font-size: 8px; font-weight: 800; }
.badge-one { right: 18px; top: 28px; }
.badge-two { right: 178px; bottom: 20px; }
.stats-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.stat-card { min-width: 0; padding: 18px; display: flex; align-items: center; gap: 13px; border: 1px solid rgba(228,231,240,.9); border-radius: 16px; background: rgba(255,255,255,.92); box-shadow: var(--shadow-sm); }
.stat-card > div:last-child { min-width: 0; flex: 1; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: end; }
.stat-card span { color: var(--muted); font-size: 10px; font-weight: 700; }
.stat-card strong { grid-column: 2; grid-row: 1 / 3; font-size: 26px; }
.stat-card small { grid-column: 1; color: var(--muted-2); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; font-weight: 900; }
.stat-icon.violet { color: #6558e9; background: #f0edff; }
.stat-icon.blue { color: #3784d4; background: #eaf4ff; }
.stat-icon.green { color: #1a9b6d; background: #eaf8f2; }

/* ---------- Panels / cards ---------- */
.panel { padding: 22px; border: 1px solid rgba(229,232,240,.96); border-radius: var(--radius); background: rgba(255,255,255,.95); box-shadow: var(--shadow-sm); }
.panel-head { margin-bottom: 19px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-head h2 { margin: 4px 0 5px; font-size: 20px; letter-spacing: -.025em; }
.panel-head p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.text-link { color: #6155df; font-size: 10px; font-weight: 800; }
.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; }
.book-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: .2s ease; }
.book-card:hover { transform: translateY(-3px); border-color: #d9d3ff; box-shadow: 0 15px 35px rgba(37, 44, 64, .10); }
.book-card-cover { position: relative; overflow: hidden; height: 118px; padding: 17px; display: flex; align-items: flex-end; gap: 12px; color: #fff; background: linear-gradient(135deg, #282d4a, #5148a7); }
.book-card-cover::after { content: ""; position: absolute; width: 125px; height: 125px; right: -30px; top: -40px; border-radius: 50%; background: rgba(255,255,255,.07); box-shadow: 0 0 0 34px rgba(255,255,255,.025); }
.book-card-cover > span:first-child { width: 39px; height: 52px; display: grid; place-items: center; flex: 0 0 auto; z-index: 2; border-radius: 5px 9px 9px 5px; background: linear-gradient(150deg, #8e79ff, #6656f0); box-shadow: 0 10px 18px rgba(0,0,0,.2); font-size: 21px; font-weight: 800; }
.book-card-cover > div { min-width: 0; z-index: 2; }
.book-card-cover small { display: block; color: #c3c6e0; font-size: 7px; text-transform: uppercase; letter-spacing: .09em; }
.book-card-cover strong { display: block; margin-top: 3px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-status { position: absolute; z-index: 3; right: 12px; top: 12px; padding: 5px 7px; border-radius: 999px; background: rgba(255,255,255,.12); backdrop-filter: blur(8px); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.book-card-body { padding: 14px; }
.book-card-body p { min-height: 32px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pill { max-width: 100%; padding: 5px 8px; display: inline-flex; border-radius: 999px; color: #574ad1; background: var(--primary-soft); font-size: 8px; font-weight: 800; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pill.light { color: #6e7584; background: #f1f3f7; }
.book-progress { height: 5px; margin: 12px 0 8px; overflow: hidden; border-radius: 999px; background: #edf0f5; }
.book-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7060f4, #a276ff); }
.book-meta { display: flex; justify-content: space-between; gap: 10px; color: #7e8594; font-size: 8px; }
.book-meta b { color: #5d4fda; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 46px; height: 46px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 14px; color: #6558df; background: #f0edff; font-size: 17px; }
.empty h3 { margin-bottom: 6px; color: var(--text); font-size: 17px; }
.empty p { max-width: 500px; margin: 0 auto 16px; font-size: 10px; line-height: 1.6; }

/* ---------- Library ---------- */
.library-hero { margin-bottom: 16px; padding: 24px 26px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #e8e7f5; border-radius: 18px; background: linear-gradient(135deg, #fff, #f8f6ff); box-shadow: var(--shadow-sm); }
.library-hero h2 { margin: 5px 0 6px; font-size: 23px; letter-spacing: -.03em; }
.library-hero p { margin: 0; color: var(--muted); font-size: 10px; }
.library-panel { padding-top: 16px; }
.library-toolbar { margin-bottom: 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.search-box { position: relative; flex: 1; max-width: 430px; }
.search-box svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: #9299a8; stroke-width: 1.8; stroke-linecap: round; }
.search-box input { width: 100%; height: 42px; padding: 0 13px 0 37px; border: 1px solid var(--line-strong); border-radius: 11px; outline: none; background: #fbfcfe; color: var(--text); font-size: 10px; transition: .2s; }
.search-box input:focus { border-color: #8879f5; background: #fff; box-shadow: 0 0 0 4px rgba(111, 94, 237, .08); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chips button { min-height: 35px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #737b8d; font-size: 9px; font-weight: 800; cursor: pointer; }
.filter-chips button.active, .filter-chips button:hover { color: #5749d7; border-color: #d9d3ff; background: #f4f2ff; }
.search-empty { padding: 45px 15px; text-align: center; color: var(--muted); }
.search-empty h3 { margin-bottom: 4px; color: var(--text); font-size: 16px; }
.search-empty p { font-size: 10px; }
.pagination-simple { margin-top: 20px; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.pagination-simple a, .pagination-simple .disabled { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-weight: 700; }
.pagination-simple a:hover { color: var(--primary-dark); border-color: #d5cff9; }
.pagination-simple .disabled { opacity: .45; }

/* ---------- Forms ---------- */
.create-layout { display: grid; grid-template-columns: 285px minmax(0,1fr); gap: 18px; align-items: start; }
.create-guide { position: sticky; top: 20px; overflow: hidden; padding: 26px; border-radius: 19px; color: #fff; background: linear-gradient(160deg, #1e233d, #15192e 70%); box-shadow: var(--shadow); }
.create-guide::after { content: ""; position: absolute; width: 180px; height: 180px; right: -90px; top: -85px; border-radius: 50%; background: rgba(118,98,244,.12); box-shadow: 0 0 0 35px rgba(118,98,244,.045); }
.guide-badge { position: relative; z-index: 2; display: inline-flex; padding: 6px 9px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; color: #b9b2ff; background: rgba(119,102,241,.09); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.create-guide h2 { position: relative; z-index: 2; margin: 17px 0 10px; font-size: 25px; line-height: 1.16; letter-spacing: -.035em; }
.create-guide > p { position: relative; z-index: 2; color: #a4abc3; font-size: 10px; line-height: 1.65; }
.step-list { margin-top: 27px; display: grid; gap: 4px; }
.step { position: relative; display: flex; align-items: center; gap: 11px; min-height: 54px; padding: 7px 9px; border-radius: 12px; color: #848ca6; }
.step > span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: rgba(255,255,255,.04); font-size: 9px; font-weight: 800; }
.step strong { display: block; margin-bottom: 2px; font-size: 10px; }
.step small { display: block; font-size: 8px; }
.step.active { color: #fff; background: rgba(117,101,239,.12); }
.step.active > span { color: #fff; border-color: transparent; background: linear-gradient(145deg, #7565f1, #5b4ade); }
.step.active-soft { color: #c6caDA; }
.step.active-soft > span { color: #bdb5ff; border-color: rgba(128,109,246,.25); background: rgba(117,101,239,.08); }
.guide-tip { margin-top: 24px; padding: 13px; display: flex; gap: 9px; border: 1px solid rgba(255,255,255,.07); border-radius: 13px; background: rgba(255,255,255,.035); }
.guide-tip > span { flex: 0 0 auto; }
.guide-tip strong { display: block; margin-bottom: 3px; font-size: 9px; }
.guide-tip p { margin: 0; color: #858da7; font-size: 8px; line-height: 1.5; }
.form-panel { padding: 26px; }
.form-section-head { display: flex; align-items: center; gap: 13px; margin-bottom: 17px; }
.section-number { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: #5e50d9; background: var(--primary-soft); font-size: 11px; font-weight: 800; }
.form-section-head h2 { margin: 3px 0 4px; font-size: 21px; }
.form-section-head p { margin: 0; color: var(--muted); font-size: 9px; }
.form-completion { margin-left: auto; min-width: 58px; text-align: right; }
.form-completion span { display: block; color: #5c4edc; font-size: 15px; font-weight: 800; }
.form-completion small { color: var(--muted-2); font-size: 8px; }
.form-progress-track { height: 4px; margin: 0 0 24px; overflow: hidden; border-radius: 999px; background: #f0f1f6; }
.form-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6e5ef0, #9b74fa); transition: width .25s; }
.field-group-title { margin: 22px 0 12px; padding-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.field-group-title:first-of-type { margin-top: 0; }
.field-group-title span { color: #384052; font-size: 10px; font-weight: 800; }
.field-group-title small { color: var(--muted-2); font-size: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid.compact { gap: 11px; }
.span-2 { grid-column: span 2; }
.form-field { display: block; min-width: 0; }
.field-label, .form-grid > label:not(.form-field) { color: #475064; font-size: 9px; font-weight: 800; }
.field-label { display: block; margin-bottom: 7px; }
.field-label b { color: #8c6df3; }
.form-field input, .form-field select, .form-field textarea, .form-grid > label input, .form-grid > label select, .form-grid > label textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    outline: none;
    color: var(--text);
    background: #fbfcfe;
    font-size: 10px;
    transition: .18s;
}
.form-field input, .form-field select, .form-grid > label input, .form-grid > label select { height: 43px; padding: 0 12px; }
.form-field textarea, .form-grid > label textarea { min-height: 100px; padding: 11px 12px; resize: vertical; line-height: 1.55; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .form-grid > label input:focus, .form-grid > label select:focus, .form-grid > label textarea:focus { border-color: #8272ef; background: #fff; box-shadow: 0 0 0 4px rgba(105,87,232,.08); }
.form-field input::placeholder, .form-field textarea::placeholder { color: #b0b6c2; }
.field-hint { display: block; margin-top: 6px; color: #9299a8; font-size: 8px; line-height: 1.45; }
.actions { margin-top: 18px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.actions.no-margin { margin: 0; }
.form-actions { margin-top: 26px; padding-top: 17px; border-top: 1px solid var(--line); }
.sticky-actions { position: sticky; bottom: 0; z-index: 8; margin-left: -26px; margin-right: -26px; margin-bottom: -26px; padding: 14px 26px; border-radius: 0 0 var(--radius) var(--radius); background: rgba(255,255,255,.93); backdrop-filter: blur(12px); }
.settings-layout { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 18px; align-items: start; }
.settings-summary { position: sticky; top: 18px; text-align: center; }
.settings-book-cover { width: 104px; height: 140px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 8px 15px 15px 8px; color: #fff; background: linear-gradient(145deg, #302d69, #6955e1); box-shadow: 0 18px 30px rgba(63,50,145,.22); font-size: 37px; font-weight: 800; }
.settings-summary h2 { margin: 12px 0 6px; font-size: 18px; }
.settings-summary > p { color: var(--muted); font-size: 9px; line-height: 1.55; }
.summary-list { margin: 18px 0; padding: 4px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; }
.summary-list > div { padding: 9px 0; display: flex; justify-content: space-between; gap: 10px; }
.summary-list span { color: var(--muted); font-size: 8px; }
.summary-list strong { max-width: 58%; font-size: 8px; text-align: right; }

/* ---------- Book editor ---------- */
.project-header { margin-bottom: 14px; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #e8e7f2; border-radius: 19px; background: linear-gradient(135deg, #fff, #f8f7ff); box-shadow: var(--shadow-sm); }
.project-title-wrap { min-width: 0; display: flex; align-items: center; gap: 14px; }
.project-avatar { width: 57px; height: 72px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px 12px 12px 7px; color: #fff; background: linear-gradient(145deg, #3b377a, #6956dc); box-shadow: 0 12px 25px rgba(70,57,157,.20); font-size: 21px; font-weight: 800; }
.project-title-content { min-width: 0; }
.project-title-content .tags { margin-bottom: 7px; }
.project-header h2 { margin: 0 0 5px; font-size: 22px; letter-spacing: -.03em; }
.project-header p { margin: 0; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-actions { flex: 0 0 auto; }
.mini-stats { margin-bottom: 14px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.mini-stats > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.92); box-shadow: 0 7px 22px rgba(34,41,61,.045); }
.mini-stats span, .mini-stats small { display: block; }
.mini-stats > div > span { margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 700; }
.mini-stats strong { display: block; font-size: 17px; }
.mini-stats small { margin-top: 2px; color: var(--muted-2); font-size: 7px; }
.status-text.status-completed { color: var(--success); }
.status-text.status-writing { color: #5d51da; }
.status-text.status-review { color: var(--warning); }
.workspace { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 14px; align-items: start; }
.structure-panel { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.workspace-title { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.workspace-title h2 { margin: 4px 0 4px; font-size: 17px; }
.workspace-title p { margin: 0; color: var(--muted); font-size: 8px; }
.structure-scroll { max-height: calc(100vh - 130px); overflow: auto; padding: 10px 12px 16px; scrollbar-width: thin; scrollbar-color: #dadde7 transparent; }
.section-group { margin: 15px 0 7px; display: flex; align-items: center; gap: 8px; color: #636b7c; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.section-group span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; color: #6254dc; background: #f0edff; font-size: 7px; }
.section-item { min-height: 36px; margin: 3px 0; padding: 5px 5px 5px 9px; display: flex; align-items: center; justify-content: space-between; gap: 7px; border-radius: 9px; color: #535b6c; background: transparent; font-size: 9px; transition: .18s; }
.section-item:hover { background: #f8f8fc; }
.section-item.level-1 { margin-left: 12px; }
.section-item.level-2 { margin-left: 24px; }
.section-item-title { min-width: 0; display: flex; align-items: center; gap: 7px; }
.section-item-title > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #c5cad4; }
.status-dot.completed { background: #2bb27e; box-shadow: 0 0 0 3px rgba(43,178,126,.08); }
.status-dot.writing, .status-dot.generated { background: #7565ed; box-shadow: 0 0 0 3px rgba(117,101,237,.08); }
.section-item form { flex: 0 0 auto; }
.section-generate { width: 27px; height: 27px; padding: 0; display: grid; place-items: center; border: 1px solid #e2defb; border-radius: 8px; color: #6254dc; background: #f6f4ff; cursor: pointer; }
.section-generate:hover { color: #fff; border-color: transparent; background: #6657ea; }
.section-generate .button-loader { width: 11px; height: 11px; }
.section-item form.is-loading .section-generate > span { display: none; }
.section-item form.is-loading .button-loader { display: inline-block; }
.empty-small { margin: 8px 3px; padding: 18px 12px; text-align: center; border: 1px dashed #dbdce5; border-radius: 11px; background: #fafafd; color: var(--muted); }
.empty-small > span { width: 29px; height: 29px; margin: 0 auto 7px; display: grid; place-items: center; border-radius: 9px; color: #6759df; background: #efedff; }
.empty-small strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 9px; }
.empty-small p { margin: 0; font-size: 8px; }
.editor-panel { min-width: 0; display: grid; gap: 14px; }
.generator-bar { padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.generator-bar > div:first-child { display: flex; align-items: center; gap: 9px; min-width: 0; }
.generator-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #6253d9; background: var(--primary-soft); }
.generator-bar strong, .generator-bar span { display: block; }
.generator-bar strong { font-size: 10px; }
.generator-bar div > div > span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.generator-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.generator-actions form { margin: 0; }
.editor-card { overflow: hidden; border: 1px solid #e2e4eb; border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.paper-toolbar { min-height: 42px; padding: 0 14px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid #eceef3; background: #f7f8fb; color: #8a91a0; font-size: 8px; }
.paper-toolbar > span:last-child { justify-self: end; }
.dot { width: 7px; height: 7px; display: inline-block; margin-right: 4px; border-radius: 50%; }
.dot.red { background: #ff766f; }.dot.yellow { background: #f8c45a; }.dot.green { background: #65c98f; }
.paper-content { min-height: 480px; padding: clamp(30px, 5vw, 68px); background: linear-gradient(90deg, #fafafa 0, #fff 9%, #fff 91%, #fafafa 100%); }
.paper-title-block { max-width: 750px; margin: 0 auto 38px; text-align: center; }
.paper-title-block h2 { margin: 7px 0 10px; font-size: clamp(26px, 3vw, 40px); line-height: 1.12; letter-spacing: -.04em; }
.lead { margin: 0; color: #757c8b; font-size: 11px; line-height: 1.65; }
.manuscript { max-width: 790px; margin: 0 auto; padding: 30px 0; border-top: 1px solid #eceef2; }
.manuscript-head { margin-bottom: 15px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.manuscript-head h3 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.manuscript-head span { flex: 0 0 auto; color: #9aa0ad; font-size: 8px; }
.manuscript .content { color: #3e4554; font-family: Georgia, "Times New Roman", serif; font-size: 14px; line-height: 1.85; white-space: pre-wrap; }
.manuscript-empty { padding: 60px 20px; }
.reference-box { margin-top: 0; }
.secure-badge { padding: 7px 9px; border: 1px solid #d9eee6; border-radius: 999px; color: #177355; background: #eff9f5; font-size: 8px; font-weight: 800; white-space: nowrap; }
.reference-list { margin-top: 18px; border-top: 1px solid var(--line); }
.reference-item { min-height: 54px; padding: 10px 2px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.reference-item > div { min-width: 0; }
.reference-item strong { display: block; font-size: 9px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.reference-item div span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.ref-type { padding: 5px 7px; border-radius: 999px; color: #5e53ce; background: #f2f0ff; font-size: 7px; font-weight: 800; }
.link-danger { padding: 5px 7px; border: 0; border-radius: 7px; color: #b94a4a; background: transparent; font-size: 8px; cursor: pointer; }
.link-danger:hover { background: var(--danger-soft); }

/* ---------- Login ---------- */
.auth-body { min-height: 100vh; overflow-x: hidden; background: #eef1f7; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.12fr) minmax(420px,.88fr); }
.auth-showcase { position: relative; overflow: hidden; min-height: 100vh; padding: 42px clamp(38px, 5vw, 76px); display: flex; flex-direction: column; color: #fff; background: linear-gradient(150deg, #171b31 0%, #222748 55%, #302b65 100%); }
.auth-showcase::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 75% 25%, rgba(127,103,255,.22), transparent 22%), linear-gradient(120deg, transparent 65%, rgba(255,255,255,.02)); }
.auth-showcase-bg span { position: absolute; border: 1px solid rgba(255,255,255,.055); border-radius: 50%; }
.auth-showcase-bg span:nth-child(1) { width: 460px; height: 460px; right: -190px; top: -160px; box-shadow: 0 0 0 75px rgba(255,255,255,.018), 0 0 0 150px rgba(255,255,255,.012); }
.auth-showcase-bg span:nth-child(2) { width: 260px; height: 260px; left: -120px; bottom: 50px; box-shadow: 0 0 0 60px rgba(107,88,231,.035); }
.auth-showcase-bg span:nth-child(3) { width: 70px; height: 70px; right: 25%; bottom: 16%; background: rgba(116,96,239,.08); }
.auth-brand { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; }
.auth-brand > span:last-child strong { display: block; font-size: 16px; }
.auth-brand > span:last-child small { display: block; margin-top: 2px; color: #9aa2bd; font-size: 9px; }
.auth-copy { position: relative; z-index: 2; width: 100%; max-width: 760px; margin: auto 0; padding: 55px 0; }
.auth-kicker { display: inline-flex; align-items: center; padding: 7px 10px; border: 1px solid rgba(255,255,255,.10); border-radius: 999px; color: #c8c5ff; background: rgba(255,255,255,.05); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.auth-copy h1 { max-width: 740px; margin: 22px 0 19px; font-size: clamp(43px, 5.2vw, 72px); line-height: 1.01; letter-spacing: -.055em; }
.auth-copy > p { max-width: 620px; margin-bottom: 0; color: #b8bfd3; font-size: 14px; line-height: 1.75; }
.auth-feature-grid { margin-top: 34px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.auth-feature-grid > div { min-height: 126px; padding: 16px; border: 1px solid rgba(255,255,255,.075); border-radius: 15px; background: rgba(255,255,255,.045); backdrop-filter: blur(8px); }
.auth-feature-grid span { display: block; margin-bottom: 17px; color: #978eff; font-size: 9px; font-weight: 800; }
.auth-feature-grid strong { display: block; margin-bottom: 5px; font-size: 11px; }
.auth-feature-grid small { display: block; color: #969db5; font-size: 9px; line-height: 1.5; }
.auth-showcase-footer { position: relative; z-index: 2; padding-top: 17px; display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid rgba(255,255,255,.075); color: #78819e; font-size: 8px; }
.status-live { color: #9ea5ba; }
.auth-form-side { min-height: 100vh; padding: 38px; display: grid; place-items: center; align-content: center; background: linear-gradient(180deg, #f7f8fb, #edf0f6); }
.auth-mobile-brand { display: none; }
.login-card { width: min(100%, 475px); padding: 38px; border: 1px solid #e5e8f0; border-radius: 23px; background: #fff; box-shadow: var(--shadow-lg); }
.login-heading { margin-bottom: 27px; display: flex; align-items: flex-start; gap: 13px; }
.login-icon { width: 45px; height: 45px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #715ff1, #5543d7); box-shadow: 0 10px 22px rgba(88,70,219,.22); }
.login-heading h2 { margin: 4px 0 6px; font-size: 25px; letter-spacing: -.035em; }
.login-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.login-form { display: grid; gap: 17px; }
.auth-input-wrap { position: relative; }
.auth-input-wrap input { width: 100%; height: 50px; padding: 0 48px 0 42px; border: 1px solid #dce1eb; border-radius: 12px; outline: none; background: #fbfcfe; color: var(--text); font-size: 11px; transition: .2s; }
.auth-input-wrap input:focus { border-color: #8172ef; background: #fff; box-shadow: 0 0 0 4px rgba(105,87,232,.09); }
.auth-input-icon { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: #8d95a5; }
.auth-input-icon svg, .password-toggle svg, .secure-note svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle { position: absolute; right: 9px; top: 50%; width: 34px; height: 34px; transform: translateY(-50%); display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: #7869e8; cursor: pointer; }
.password-toggle:hover { background: #f2f0ff; }
.password-toggle svg { width: 17px; height: 17px; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.remember-row { display: flex; align-items: center; gap: 7px; color: #606879; font-size: 9px; cursor: pointer; }
.remember-row input { width: 15px; height: 15px; accent-color: #6253df; }
.secure-note { display: inline-flex; align-items: center; gap: 5px; color: #8b92a1; font-size: 8px; }
.secure-note svg { width: 13px; height: 13px; }
.login-submit { width: 100%; min-height: 50px; justify-content: space-between; padding: 0 17px; font-size: 11px; }
.login-security { margin-top: 22px; padding: 12px; display: flex; gap: 9px; border: 1px solid #edf0f4; border-radius: 12px; background: #fafbfc; }
.login-security > span { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: #147858; background: #e8f7f1; font-size: 10px; font-weight: 800; }
.login-security strong { display: block; margin-bottom: 2px; color: #505869; font-size: 9px; }
.login-security small { display: block; color: #9399a7; font-size: 8px; line-height: 1.45; }
.login-footer { margin-top: 15px; color: #9aa0ad; font-size: 8px; text-align: center; }

/* ---------- Assistant ---------- */
.assistant-launcher { position: fixed; right: 24px; bottom: 22px; z-index: 90; padding: 9px 13px 9px 9px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 17px; color: #fff; background: linear-gradient(135deg, #5d50e8, #765ffc); box-shadow: 0 18px 48px rgba(73,59,202,.32); cursor: pointer; transition: .2s; }
.assistant-launcher:hover { transform: translateY(-2px); }
.assistant-launcher.hidden { opacity: 0; pointer-events: none; transform: translateY(10px); }
.assistant-launcher-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,.15); }
.assistant-launcher-copy { display: grid; gap: 2px; text-align: left; }
.assistant-launcher-copy strong { font-size: 10px; }.assistant-launcher-copy small { color: #e2dfff; font-size: 8px; }
.assistant-launcher-dot { width: 7px; height: 7px; border-radius: 50%; background: #49e2a7; box-shadow: 0 0 0 4px rgba(73,226,167,.12); }
.assistant-panel { position: fixed; right: 22px; bottom: 20px; z-index: 100; width: min(390px, calc(100vw - 28px)); height: min(650px, calc(100vh - 40px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #e5e8f1; border-radius: 21px; background: #fff; box-shadow: 0 28px 90px rgba(25,29,52,.24); opacity: 0; pointer-events: none; transform: translateY(18px) scale(.97); transform-origin: bottom right; transition: .2s; }
.assistant-panel.open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.assistant-header { padding: 14px 15px; display: flex; align-items: center; gap: 9px; color: #fff; background: linear-gradient(135deg, #171a31, #292d50); }
.assistant-avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: linear-gradient(135deg,#7767ff,#a27aff); }
.assistant-header > div:nth-child(2) { display: grid; gap: 2px; }.assistant-header strong { font-size: 10px; }.assistant-header small { color: #b9bfd5; font-size: 8px; }
.assistant-header small span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: #43d69c; }
.assistant-close { margin-left: auto; width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; color: #fff; background: rgba(255,255,255,.06); font-size: 19px; cursor: pointer; }
.assistant-context { padding: 9px 14px; display: grid; gap: 2px; border-bottom: 1px solid #edf0f5; background: #fafbfe; }
.assistant-context span { color: #9298a8; font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }.assistant-context strong { font-size: 9px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.assistant-quick { padding: 9px 11px; display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid #edf0f5; }
.assistant-quick button { padding: 7px 9px; border: 1px solid #e3e5ef; border-radius: 999px; color: #5b6071; background: #fff; font-size: 8px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.assistant-quick button:hover { color: #5548d6; border-color: #cfc9ff; background: #f7f5ff; }
.assistant-messages { flex: 1; overflow-y: auto; padding: 14px; background: linear-gradient(180deg,#fbfcff,#f7f8fc); scroll-behavior: smooth; }
.assistant-welcome { margin-bottom: 11px; display: flex; align-items: flex-start; gap: 8px; }
.assistant-mini-avatar { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: #5c50dd; background: #ebe8ff; }
.assistant-welcome > div:last-child { padding: 10px; border: 1px solid #e8eaf1; border-radius: 5px 13px 13px 13px; background: #fff; }
.assistant-welcome strong { font-size: 9px; }.assistant-welcome p { margin: 4px 0 0; color: #6f7687; font-size: 9px; line-height: 1.55; }
.assistant-message { max-width: 88%; margin: 8px 0; display: flex; flex-direction: column; }.assistant-message.user { margin-left: auto; align-items: flex-end; }.assistant-message.assistant { margin-right: auto; align-items: flex-start; }
.assistant-message-bubble { padding: 9px 11px; border-radius: 13px; font-size: 9.5px; line-height: 1.6; }.assistant-message.user .assistant-message-bubble { color: #fff; background: linear-gradient(135deg,#6256ee,#7665fa); border-bottom-right-radius: 4px; }.assistant-message.assistant .assistant-message-bubble { color: #343a4a; border: 1px solid #e7eaf1; border-bottom-left-radius: 4px; background: #fff; }
.assistant-message small { margin-top: 3px; padding: 0 3px; color: #a0a5b2; font-size: 7px; }
.assistant-typing { width: 52px; padding: 9px 11px; display: flex; gap: 4px; border: 1px solid #e7eaf1; border-radius: 4px 13px 13px 13px; background: #fff; }.assistant-typing span { width: 5px; height: 5px; border-radius: 50%; background: #8e94a5; animation: assistantPulse 1s infinite alternate; }.assistant-typing span:nth-child(2){animation-delay:.2s}.assistant-typing span:nth-child(3){animation-delay:.4s}@keyframes assistantPulse{to{opacity:.25;transform:translateY(-2px)}}
.assistant-form { margin: 0; padding: 9px 10px; display: flex; align-items: flex-end; gap: 7px; border-top: 1px solid #e8ebf2; background: #fff; }.assistant-form textarea { min-height: 41px; max-height: 110px; flex: 1; padding: 10px 11px; resize: none; border: 1px solid #dde1eb; border-radius: 11px; outline: none; background: #fafbfe; font-size: 9px; line-height: 1.45; }.assistant-form textarea:focus { border-color: #8175f5; box-shadow: 0 0 0 3px rgba(98,84,239,.08); background: #fff; }.assistant-form button { width: 41px; height: 41px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#6256ee,#7867ff); cursor: pointer; }.assistant-form button:disabled { opacity: .5; cursor: not-allowed; }.assistant-disclaimer { padding: 0 10px 9px; color: #a0a5b1; background: #fff; text-align: center; font-size: 7px; }

/* ---------- Responsive ---------- */
@media (max-width: 1260px) {
    .book-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .workspace { grid-template-columns: 270px minmax(0,1fr); }
    .top-create-label { display: none; }
    .top-create { width: 43px; padding: 0; }
}

@media (max-width: 1050px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; left: 0; top: 0; width: 278px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 22px 0 65px rgba(12,16,30,.25); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-close { display: grid; place-items: center; }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 45; display: block; background: rgba(12,16,28,.48); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: .2s; }
    body.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
    .main { padding: 22px 24px 56px; }
    .mobile-menu-button { display: grid; }
    .profile-trigger { min-width: 0; }
    .profile-copy { display: none; }
    .profile-trigger .chevron { display: none; }
    .hero-banner { grid-template-columns: 1fr 280px; }
    .create-layout, .settings-layout { grid-template-columns: 1fr; }
    .create-guide, .settings-summary { position: relative; top: auto; }
    .create-guide { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,.9fr); gap: 18px 28px; align-items: start; }
    .create-guide .step-list { grid-column: 2; grid-row: 1 / 5; margin-top: 0; }
    .guide-tip { grid-column: 1; }
    .settings-summary { display: grid; grid-template-columns: 100px 1fr; gap: 0 18px; text-align: left; }
    .settings-book-cover { grid-row: 1 / 5; width: 90px; height: 122px; margin: 0; }
    .settings-summary > .pill { align-self: end; justify-self: start; }.settings-summary h2 { margin-top: 8px; }.settings-summary > p { margin-bottom: 0; }
    .settings-summary .summary-list, .settings-summary .btn { grid-column: 1 / -1; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-showcase { min-height: 470px; padding: 34px; }
    .auth-copy { padding: 48px 0 30px; }
    .auth-copy h1 { max-width: 800px; font-size: 48px; }
    .auth-form-side { min-height: auto; padding: 36px 24px 48px; }
}

@media (max-width: 820px) {
    .main { padding: 18px 16px 48px; }
    .topbar { align-items: flex-start; }
    .date-chip { display: none; }
    .topbar h1 { font-size: 24px; }
    .hero-banner { min-height: auto; padding: 30px; grid-template-columns: 1fr; }
    .hero-visual { display: none; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card > div:last-child { grid-template-columns: 1fr auto; }
    .library-hero { align-items: flex-start; }
    .library-toolbar { align-items: stretch; flex-direction: column; }
    .search-box { max-width: none; }
    .book-grid { grid-template-columns: 1fr 1fr; }
    .workspace { grid-template-columns: 1fr; }
    .structure-panel { position: relative; top: auto; max-height: none; }
    .structure-scroll { max-height: 440px; }
    .project-header { align-items: flex-start; flex-direction: column; }
    .project-actions { width: 100%; }
    .project-actions .btn, .project-actions form { flex: 1; }
    .project-actions form .btn { width: 100%; }
    .mini-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .paper-content { padding: 32px 24px; }
    .create-guide { display: block; }
    .create-guide .step-list, .guide-tip { grid-column: auto; grid-row: auto; }
    .auth-showcase { min-height: 420px; }
    .auth-feature-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .topbar { gap: 10px; }
    .top-actions { gap: 6px; }
    .mobile-menu-button, .profile-trigger, .top-create { width: 40px; height: 40px; min-height: 40px; }
    .profile-trigger { padding: 4px; }
    .profile-trigger .user-avatar { width: 30px; height: 30px; }
    .topbar-title { gap: 9px; }
    .topbar .eyebrow { display: none; }
    .topbar h1 { margin: 0; font-size: 21px; }
    .profile-dropdown { position: fixed; right: 12px; top: 64px; }
    .hero-banner { padding: 25px 22px; border-radius: 19px; }
    .hero-copy h2 { font-size: 29px; }
    .hero-actions .btn { flex: 1; }
    .book-grid { grid-template-columns: 1fr; }
    .panel { padding: 18px; }
    .panel-head, .library-hero { flex-direction: column; }
    .library-hero .btn { width: 100%; }
    .filter-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
    .filter-chips button { flex: 0 0 auto; }
    .pagination-simple { flex-wrap: wrap; justify-content: center; }
    .pagination-simple > span:nth-child(2) { order: -1; width: 100%; text-align: center; }
    .form-panel { padding: 19px; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .form-section-head { align-items: flex-start; }
    .form-completion { display: none; }
    .sticky-actions { margin-left: -19px; margin-right: -19px; margin-bottom: -19px; padding: 12px 19px; }
    .form-actions .btn { flex: 1; }
    .settings-summary { display: block; text-align: center; }
    .settings-book-cover { margin: 0 auto 15px; }
    .summary-list { text-align: left; }
    .project-title-wrap { align-items: flex-start; }
    .project-avatar { width: 48px; height: 62px; }
    .project-header h2 { font-size: 19px; }
    .project-actions { flex-direction: column; }
    .project-actions .btn, .project-actions form { width: 100%; }
    .mini-stats { gap: 7px; }
    .mini-stats > div { padding: 12px; }
    .generator-bar { align-items: stretch; flex-direction: column; }
    .generator-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .generator-actions .btn { width: 100%; }
    .paper-toolbar { grid-template-columns: auto 1fr; }
    .paper-toolbar > span:nth-child(2) { text-align: center; }
    .paper-toolbar > span:last-child { display: none; }
    .paper-content { padding: 26px 18px; }
    .manuscript .content { font-size: 13px; }
    .panel-head .secure-badge { align-self: flex-start; }
    .reference-item { grid-template-columns: minmax(0,1fr) auto; }
    .reference-item form { grid-column: 2; }
    .auth-showcase { display: none; }
    .auth-form-side { min-height: 100vh; padding: 24px 16px; align-content: center; }
    .auth-mobile-brand { width: min(100%, 465px); margin: 0 auto 16px; display: flex; align-items: center; gap: 10px; color: #293149; font-size: 12px; }
    .auth-mobile-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; }
    .login-card { padding: 27px 20px; border-radius: 19px; box-shadow: 0 18px 50px rgba(31,37,58,.10); }
    .login-heading h2 { font-size: 22px; }
    .login-heading p { font-size: 9px; }
    .assistant-launcher { right: 13px; bottom: 13px; }
    .assistant-launcher-copy { display: none; }
    .assistant-panel { right: 7px; bottom: 7px; width: calc(100vw - 14px); height: calc(100vh - 14px); border-radius: 17px; }
}


/* ---------- Book writing targets & print specifications ---------- */
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.input-suffix { position: relative; display: flex; align-items: stretch; }
.input-suffix input { width: 100%; padding-right: 58px; }
.input-suffix > span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 9px; font-weight: 800; pointer-events: none; }
.word-target-field { padding: 15px; border: 1px solid #ececf5; border-radius: 14px; background: linear-gradient(180deg, #fff, #fbfbff); }
.word-target-field .field-hint { min-height: 28px; }
.conditional-fields { min-width: 0; }
.conditional-fields[hidden] { display: none !important; }
.nested-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-self: end; }
.margin-grid { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 13px; border: 1px dashed #dcd9f7; border-radius: 14px; background: #faf9ff; }
.book-spec-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.book-spec-stats > div { min-width: 0; }
.book-spec-stats strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-item-title { min-width: 0; flex-wrap: wrap; }
.section-item-title > span:nth-child(2) { min-width: 0; flex: 1 1 120px; }
.section-word-target { flex: 0 0 auto; padding: 2px 6px; border-radius: 999px; color: #685be2; background: #f0eeff; font-size: 7px; font-weight: 800; white-space: nowrap; }
.paper-content { min-height: calc(min(100%, 850px) * var(--book-page-ratio, 1.42)); padding: var(--book-pad-top, 44px) var(--book-pad-right, 44px) var(--book-pad-bottom, 44px) var(--book-pad-left, 44px); font-family: var(--book-font-family, "Noto Sans"), serif; font-size: var(--book-font-size, 11pt); }
.paper-content .manuscript .content { font-family: inherit; font-size: inherit; }
.paper-content .manuscript .content, .paper-content .lead { line-height: 1.7; }
.book-card-wrap { position: relative; min-width: 0; }
.book-card-wrap .book-card { height: 100%; }
.book-spec-line { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 10px 0 12px; }
.book-spec-line span { padding: 4px 7px; border: 1px solid #ececf3; border-radius: 999px; color: #777e8f; background: #fafbfe; font-size: 8px; font-weight: 700; }
.draft-delete-form { position: absolute; right: 12px; bottom: 12px; z-index: 4; }
.draft-delete-button { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 9px; border: 1px solid #f0caca; border-radius: 9px; color: #b93e48; background: rgba(255, 248, 248, .96); box-shadow: 0 5px 16px rgba(173, 50, 59, .08); font-size: 8px; font-weight: 800; cursor: pointer; transition: .18s ease; }
.draft-delete-button:hover { border-color: #e9aeb3; color: #9e2732; background: #fff1f2; transform: translateY(-1px); }
.draft-delete-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.draft-delete-form.is-loading .draft-delete-button > svg, .draft-delete-form.is-loading .draft-delete-button > span { display: none; }
.draft-delete-form .button-loader { display: none; }
.draft-delete-form.is-loading .button-loader { display: inline-block; }
.book-card-wrap:has(.draft-delete-form) .book-card-body { padding-bottom: 48px; }

@media (max-width: 1260px) {
    .book-spec-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .form-grid-3 { grid-template-columns: 1fr; }
    .margin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .nested-grid, .margin-grid { grid-template-columns: 1fr; }
    .book-spec-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .draft-delete-form { right: 10px; bottom: 10px; }
}

/* Keep AI action loaders hidden until the related form is submitted. */
.generator-bar .button-loader { display: none; }
.generator-bar form.is-loading .button-loader { display: inline-block; }

/* ---------- Medium typography for Create Book form ---------- */
/* Scoped to .create-layout so the editor, library, and login keep their existing scale. */
.create-layout .form-section-head p {
    font-size: 11px;
    line-height: 1.55;
}

.create-layout .form-completion small {
    font-size: 10px;
}

.create-layout .field-group-title span {
    font-size: 13px;
    line-height: 1.4;
}

.create-layout .field-group-title small {
    font-size: 10.5px;
    line-height: 1.45;
}

.create-layout .field-label,
.create-layout .form-grid > label:not(.form-field) {
    font-size: 12px;
    line-height: 1.4;
}

.create-layout .form-field input,
.create-layout .form-field select,
.create-layout .form-field textarea,
.create-layout .form-grid > label input,
.create-layout .form-grid > label select,
.create-layout .form-grid > label textarea {
    font-size: 13px;
}

.create-layout .form-field input,
.create-layout .form-field select,
.create-layout .form-grid > label input,
.create-layout .form-grid > label select {
    height: 47px;
    padding-right: 14px;
    padding-left: 14px;
}

.create-layout .form-field textarea,
.create-layout .form-grid > label textarea {
    min-height: 112px;
    padding: 13px 14px;
    line-height: 1.65;
}

.create-layout .field-hint {
    margin-top: 7px;
    font-size: 10.5px;
    line-height: 1.55;
}

.create-layout .input-suffix > span {
    font-size: 10.5px;
}

.create-layout .create-guide > p {
    font-size: 11.5px;
    line-height: 1.7;
}

.create-layout .step strong {
    font-size: 11px;
}

.create-layout .step small {
    font-size: 9.5px;
    line-height: 1.45;
}

.create-layout .guide-tip strong {
    font-size: 10.5px;
}

.create-layout .guide-tip p {
    font-size: 9.5px;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .create-layout .field-group-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .create-layout .form-field input,
    .create-layout .form-field select,
    .create-layout .form-field textarea {
        font-size: 13px;
    }
}


/* ---------- Medium typography for Book Editor ---------- */
/* Scoped to the editor page so Dashboard, Library, Create, and Login stay unchanged. */
.book-editor-page .project-title-content .pill {
    padding: 6px 9px;
    font-size: 10px;
}

.book-editor-page .project-header p {
    font-size: 12px;
    line-height: 1.5;
}

.book-editor-page .project-actions .btn,
.book-editor-page .generator-actions .btn,
.book-editor-page .reference-box .btn {
    font-size: 12px;
}

.book-editor-page .mini-stats > div {
    padding: 15px 16px;
}

.book-editor-page .mini-stats > div > span {
    font-size: 10.5px;
    line-height: 1.4;
}

.book-editor-page .mini-stats strong {
    font-size: 18px;
    line-height: 1.35;
}

.book-editor-page .mini-stats small {
    margin-top: 4px;
    font-size: 9.5px;
    line-height: 1.4;
}

.book-editor-page .workspace {
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 16px;
}

.book-editor-page .workspace-title {
    padding: 20px 19px 16px;
}

.book-editor-page .workspace-title .eyebrow,
.book-editor-page .paper-title-block .eyebrow,
.book-editor-page .reference-box .eyebrow {
    font-size: 10px;
}

.book-editor-page .workspace-title h2 {
    font-size: 20px;
}

.book-editor-page .workspace-title p {
    font-size: 11px;
    line-height: 1.55;
}

.book-editor-page .structure-scroll {
    padding: 11px 13px 18px;
}

.book-editor-page .section-group {
    margin-top: 17px;
    margin-bottom: 9px;
    font-size: 11px;
    line-height: 1.4;
}

.book-editor-page .section-group span {
    width: 27px;
    height: 27px;
    font-size: 9px;
}

.book-editor-page .section-item {
    min-height: 44px;
    margin: 4px 0;
    padding: 7px 6px 7px 10px;
    gap: 8px;
    font-size: 11.5px;
    line-height: 1.4;
}

.book-editor-page .section-item-title {
    gap: 8px;
}

.book-editor-page .section-item-title > span:nth-child(2) {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.book-editor-page .status-dot {
    width: 7px;
    height: 7px;
}

.book-editor-page .section-word-target {
    padding: 3px 7px;
    font-size: 9px;
}

.book-editor-page .section-generate {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

.book-editor-page .empty-small strong {
    font-size: 11px;
}

.book-editor-page .empty-small p {
    font-size: 10px;
    line-height: 1.5;
}

.book-editor-page .generator-bar {
    padding: 14px 15px;
}

.book-editor-page .generator-icon {
    width: 38px;
    height: 38px;
    font-size: 15px;
}

.book-editor-page .generator-bar strong {
    font-size: 12px;
}

.book-editor-page .generator-bar div > div > span {
    font-size: 10.5px;
    line-height: 1.45;
}

.book-editor-page .paper-toolbar {
    min-height: 46px;
    padding-right: 16px;
    padding-left: 16px;
    font-size: 10px;
}

.book-editor-page .paper-content {
    font-size: calc(var(--book-font-size, 11pt) * 1.08);
}

.book-editor-page .paper-title-block .lead {
    font-size: 13px;
    line-height: 1.7;
}

.book-editor-page .manuscript {
    padding-top: 34px;
    padding-bottom: 34px;
}

.book-editor-page .manuscript-head h3 {
    font-size: 21px;
    line-height: 1.35;
}

.book-editor-page .manuscript-head span {
    font-size: 10.5px;
}

.book-editor-page .paper-content .manuscript .content {
    font-size: inherit;
    line-height: 1.8;
}

.book-editor-page .reference-box .panel-head h2 {
    font-size: 22px;
}

.book-editor-page .reference-box .panel-head p {
    font-size: 11px;
    line-height: 1.6;
}

.book-editor-page .secure-badge {
    padding: 8px 10px;
    font-size: 10px;
}

.book-editor-page .reference-box .field-label,
.book-editor-page .reference-box .form-grid > label:not(.form-field) {
    font-size: 12px;
    line-height: 1.4;
}

.book-editor-page .reference-box .form-field input,
.book-editor-page .reference-box .form-field select,
.book-editor-page .reference-box .form-field textarea,
.book-editor-page .reference-box .form-grid > label input,
.book-editor-page .reference-box .form-grid > label select,
.book-editor-page .reference-box .form-grid > label textarea {
    font-size: 13px;
}

.book-editor-page .reference-box .form-field input,
.book-editor-page .reference-box .form-field select,
.book-editor-page .reference-box .form-grid > label input,
.book-editor-page .reference-box .form-grid > label select {
    height: 47px;
    padding-right: 14px;
    padding-left: 14px;
}

.book-editor-page .reference-item {
    min-height: 62px;
}

.book-editor-page .reference-item strong {
    font-size: 11.5px;
}

.book-editor-page .reference-item div span {
    font-size: 10px;
}

.book-editor-page .ref-type,
.book-editor-page .link-danger {
    font-size: 9.5px;
}

@media (max-width: 1280px) {
    .book-editor-page .workspace {
        grid-template-columns: 310px minmax(0, 1fr);
    }
}

@media (max-width: 980px) {
    .book-editor-page .workspace {
        grid-template-columns: 1fr;
    }

    .book-editor-page .structure-panel {
        position: static;
        max-height: none;
    }

    .book-editor-page .structure-scroll {
        max-height: 520px;
    }
}

@media (max-width: 640px) {
    .book-editor-page .project-title-content .pill {
        font-size: 9px;
    }

    .book-editor-page .mini-stats > div > span {
        font-size: 9.5px;
    }

    .book-editor-page .mini-stats strong {
        font-size: 16px;
    }

    .book-editor-page .section-item {
        font-size: 11px;
    }

    .book-editor-page .paper-content {
        font-size: calc(var(--book-font-size, 11pt) * 1.02);
    }

    .book-editor-page .manuscript-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .book-editor-page .manuscript-head h3 {
        font-size: 19px;
    }

    .book-editor-page .reference-box .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* ---------- Medium typography for Dashboard and Book Library ---------- */
/* Scoped per page so Create, Editor, Auth, and Settings retain their own scale. */
.dashboard-page,
.library-page {
    font-size: 13px;
}

.dashboard-page .eyebrow,
.library-page .eyebrow {
    font-size: 10.5px;
    line-height: 1.4;
}

/* Dashboard hero */
.dashboard-page .hero-kicker {
    padding: 8px 12px;
    font-size: 11.5px;
}

.dashboard-page .hero-copy p {
    font-size: 13px;
    line-height: 1.75;
}

.dashboard-page .hero-actions .btn {
    min-height: 44px;
    padding-right: 17px;
    padding-left: 17px;
    font-size: 12px;
}

.dashboard-page .book-front span {
    font-size: 9.5px;
}

.dashboard-page .book-front small,
.dashboard-page .floating-badge {
    font-size: 9.5px;
}

/* Dashboard statistic cards */
.dashboard-page .stat-card {
    min-height: 92px;
    padding: 20px;
    gap: 15px;
}

.dashboard-page .stat-icon {
    width: 46px;
    height: 46px;
    font-size: 17px;
}

.dashboard-page .stat-card span {
    font-size: 12px;
}

.dashboard-page .stat-card strong {
    font-size: 28px;
}

.dashboard-page .stat-card small {
    font-size: 10.5px;
    line-height: 1.45;
}

/* Shared panel headings */
.dashboard-page .panel-head h2,
.library-page .panel-head h2 {
    font-size: 22px;
}

.dashboard-page .panel-head p,
.library-page .panel-head p {
    font-size: 11.5px;
    line-height: 1.6;
}

.dashboard-page .text-link {
    font-size: 11.5px;
}

/* Library hero and controls */
.library-page .library-hero h2 {
    font-size: 25px;
}

.library-page .library-hero p {
    font-size: 12px;
    line-height: 1.6;
}

.library-page .library-hero .btn {
    min-height: 44px;
    padding-right: 16px;
    padding-left: 16px;
    font-size: 12px;
}

.library-page .search-box input {
    height: 46px;
    padding-left: 41px;
    font-size: 12.5px;
}

.library-page .search-box svg {
    left: 14px;
    width: 17px;
    height: 17px;
}

.library-page .filter-chips button {
    min-height: 39px;
    padding-right: 14px;
    padding-left: 14px;
    font-size: 11px;
}

/* Book cards on Dashboard and Book Library */
.dashboard-page .book-card-cover,
.library-page .book-card-cover {
    height: 130px;
    padding: 19px;
}

.dashboard-page .book-card-cover > span:first-child,
.library-page .book-card-cover > span:first-child {
    width: 43px;
    height: 57px;
    font-size: 23px;
}

.dashboard-page .book-card-cover small,
.library-page .book-card-cover small {
    font-size: 9px;
    line-height: 1.4;
}

.dashboard-page .book-card-cover strong,
.library-page .book-card-cover strong {
    margin-top: 4px;
    font-size: 16px;
    line-height: 1.35;
}

.library-page .cover-status {
    padding: 6px 9px;
    font-size: 9px;
}

.dashboard-page .book-card-body,
.library-page .book-card-body {
    padding: 17px;
}

.dashboard-page .pill,
.library-page .pill {
    padding: 6px 9px;
    font-size: 10px;
}

.dashboard-page .book-card-body p,
.library-page .book-card-body p {
    min-height: 42px;
    font-size: 12px;
    line-height: 1.65;
}

.library-page .book-spec-line span {
    padding: 5px 8px;
    font-size: 9.5px;
}

.dashboard-page .book-meta,
.library-page .book-meta {
    font-size: 10.5px;
    line-height: 1.45;
}

.library-page .draft-delete-button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 10px;
}

.library-page .draft-delete-button svg {
    width: 14px;
    height: 14px;
}

.library-page .book-card-wrap:has(.draft-delete-form) .book-card-body {
    padding-bottom: 54px;
}

/* Empty states and pagination */
.dashboard-page .empty h3,
.library-page .empty h3,
.library-page .search-empty h3 {
    font-size: 19px;
}

.dashboard-page .empty p,
.library-page .empty p,
.library-page .search-empty p {
    font-size: 11.5px;
    line-height: 1.65;
}

.library-page .pagination-simple {
    font-size: 11px;
}

.library-page .pagination-simple a,
.library-page .pagination-simple .disabled {
    padding: 9px 12px;
}

@media (max-width: 820px) {
    .dashboard-page .stat-card small {
        white-space: normal;
    }

    .dashboard-page .book-card-cover,
    .library-page .book-card-cover {
        height: 124px;
    }
}

@media (max-width: 640px) {
    .dashboard-page .hero-copy p {
        font-size: 12.5px;
    }

    .dashboard-page .stat-card {
        min-height: 86px;
        padding: 17px;
    }

    .dashboard-page .stat-card strong {
        font-size: 25px;
    }

    .library-page .library-hero h2 {
        font-size: 23px;
    }

    .library-page .filter-chips button {
        font-size: 10.5px;
    }

    .dashboard-page .book-card-cover strong,
    .library-page .book-card-cover strong {
        font-size: 15px;
    }

    .dashboard-page .book-card-body p,
    .library-page .book-card-body p {
        min-height: 0;
    }
}


/* Medium shell typography only while Dashboard or Book Library is open. */
body.dashboard-medium-page .sidebar-label,
body.library-medium-page .sidebar-label {
    font-size: 10px;
}

body.dashboard-medium-page .sidebar-nav a,
body.library-medium-page .sidebar-nav a {
    font-size: 13px;
}

body.dashboard-medium-page .engine-card strong,
body.library-medium-page .engine-card strong,
body.dashboard-medium-page .sidebar-note strong,
body.library-medium-page .sidebar-note strong,
body.dashboard-medium-page .sidebar-user strong,
body.library-medium-page .sidebar-user strong {
    font-size: 11.5px;
}

body.dashboard-medium-page .engine-status,
body.library-medium-page .engine-status,
body.dashboard-medium-page .engine-card small,
body.library-medium-page .engine-card small,
body.dashboard-medium-page .sidebar-note span,
body.library-medium-page .sidebar-note span {
    font-size: 10px;
    line-height: 1.55;
}

body.dashboard-medium-page .sidebar-user small,
body.library-medium-page .sidebar-user small {
    font-size: 9px;
}

body.dashboard-medium-page .topbar .eyebrow,
body.library-medium-page .topbar .eyebrow {
    font-size: 10px;
}

body.dashboard-medium-page .date-chip,
body.library-medium-page .date-chip,
body.dashboard-medium-page .profile-copy strong,
body.library-medium-page .profile-copy strong {
    font-size: 11px;
}

body.dashboard-medium-page .profile-copy small,
body.library-medium-page .profile-copy small {
    font-size: 9px;
}

body.dashboard-medium-page .top-create,
body.library-medium-page .top-create {
    font-size: 11.5px;
}

/* =========================================================
   PROFESSIONAL FRONTEND V2
   Dashboard, Library, Create Wizard, and Manuscript Editor
   ========================================================= */

:root {
    --v2-primary: #6254e8;
    --v2-primary-dark: #4d40cf;
    --v2-primary-soft: #efedff;
    --v2-ink: #101828;
    --v2-muted: #667085;
    --v2-line: #e4e7ec;
    --v2-bg: #f5f6fa;
    --v2-success: #12b76a;
    --v2-warning: #f79009;
    --v2-danger: #d92d20;
    --editor-zoom: 1;
}

/* Dashboard V2 */
.dashboard-page-v2 { display: grid; gap: 20px; }
.hero-banner-v2 {
    min-height: 320px;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr);
    align-items: center;
    gap: 42px;
    padding: 42px;
    border-radius: 26px;
    overflow: hidden;
    background:
        radial-gradient(circle at 78% 5%, rgba(255,255,255,.18), transparent 27%),
        linear-gradient(135deg, #332c79 0%, #5848dc 58%, #765cf0 100%);
    box-shadow: 0 24px 58px rgba(63, 50, 161, .22);
}
.hero-banner-v2 .hero-copy { max-width: 760px; }
.hero-banner-v2 .hero-kicker { font-size: 13px; letter-spacing: .1em; }
.hero-banner-v2 h2 { max-width: 760px; font-size: clamp(30px, 3vw, 48px); line-height: 1.09; letter-spacing: -.045em; }
.hero-banner-v2 p { max-width: 680px; font-size: 16px; line-height: 1.75; }
.hero-banner-v2 .btn { min-height: 46px; padding-inline: 19px; font-size: 14px; }
.hero-workflow-card {
    padding: 22px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 20px;
    background: rgba(18, 15, 52, .34);
    color: #fff;
    backdrop-filter: blur(14px);
    box-shadow: inset 0 1px rgba(255,255,255,.12);
}
.hero-workflow-card > span { display: block; margin-bottom: 14px; color: #d8d3ff; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.workflow-line { display: grid; grid-template-columns: 34px 1fr 20px; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.12); }
.workflow-line b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.13); font-size: 12px; }
.workflow-line strong { display: block; font-size: 13px; }
.workflow-line small { display: block; margin-top: 2px; color: #c8c4ea; font-size: 11px; }
.workflow-line i { color: #b8ffdb; font-style: normal; font-weight: 800; }
.stats-grid-v2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-grid-v2 .stat-card { min-height: 118px; padding: 22px; }
.stats-grid-v2 .stat-card span { font-size: 13px; }
.stats-grid-v2 .stat-card strong { font-size: 29px; }
.stats-grid-v2 .stat-card small { font-size: 11px; }
.stat-icon.amber { background: #fff4e5; color: #dc6803; }
.dashboard-insight-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; }
.dashboard-insight-grid .panel { margin: 0; padding: 24px; }
.compact-head { margin-bottom: 18px; }
.compact-head h2 { font-size: 20px; }
.compact-head p { font-size: 13px; }
.status-progress-list { display: grid; gap: 17px; }
.status-progress-row > div:first-child { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 9px; margin-bottom: 7px; }
.status-progress-row strong { color: var(--v2-ink); font-size: 13px; }
.status-progress-row b { color: var(--v2-muted); font-size: 13px; }
.status-progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #f0f1f5; }
.status-progress-track span { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: #98a2b3; }
.status-progress-track span.draft { background: #98a2b3; }
.status-progress-track span.outline { background: #7f70f5; }
.status-progress-track span.writing { background: #2e90fa; }
.status-progress-track span.completed { background: #12b76a; }
.recent-activity-list { display: grid; }
.recent-activity-list > a { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 12px 0; color: inherit; border-top: 1px solid #eff1f5; text-decoration: none; }
.recent-activity-list > a:first-child { border-top: 0; }
.activity-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--v2-primary-soft); color: var(--v2-primary); font-size: 12px; font-weight: 800; }
.recent-activity-list strong { display: block; overflow: hidden; color: var(--v2-ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.recent-activity-list small { display: block; margin-top: 3px; color: var(--v2-muted); font-size: 11px; }
.recent-activity-list time { color: #98a2b3; font-size: 10px; white-space: nowrap; }
.empty-activity { display: flex; gap: 10px; align-items: center; min-height: 130px; justify-content: center; color: var(--v2-muted); font-size: 13px; }
.dashboard-quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dashboard-quick-actions > a { display: grid; grid-template-columns: 44px 1fr auto; gap: 13px; align-items: center; min-height: 88px; padding: 17px; color: inherit; border: 1px solid var(--v2-line); border-radius: 17px; background: #fff; text-decoration: none; box-shadow: 0 10px 25px rgba(16,24,40,.05); transition: .2s ease; }
.dashboard-quick-actions > a:hover { transform: translateY(-2px); border-color: #cfc9ff; box-shadow: 0 16px 32px rgba(81,63,192,.11); }
.dashboard-quick-actions > a > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--v2-primary-soft); color: var(--v2-primary); font-size: 20px; }
.dashboard-quick-actions strong { display: block; color: var(--v2-ink); font-size: 14px; }
.dashboard-quick-actions small { display: block; margin-top: 3px; color: var(--v2-muted); font-size: 11px; }
.dashboard-quick-actions b { color: var(--v2-primary); }
.dashboard-project-panel { margin: 0; }
.dashboard-book-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-book-card .book-card-cover { min-height: 145px; }

/* Library V2 */
.library-page-v2 { display: grid; gap: 16px; }
.library-hero-v2 { margin: 0; padding: 25px 28px; border: 1px solid var(--v2-line); border-radius: 21px; background: linear-gradient(130deg, #fff, #f8f7ff); box-shadow: 0 12px 32px rgba(16,24,40,.055); }
.library-hero-v2 h2 { font-size: 27px; }
.library-hero-v2 p { font-size: 14px; }
.library-summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.library-summary-strip > div { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px; border: 1px solid var(--v2-line); border-radius: 14px; background: #fff; }
.library-summary-strip span { color: var(--v2-muted); font-size: 12px; }
.library-summary-strip strong { color: var(--v2-ink); font-size: 18px; }
.library-panel-v2 { margin: 0; padding: 22px; }
.library-toolbar-v2 { align-items: center; }
.library-toolbar-actions { display: flex; align-items: center; gap: 12px; }
.view-switcher { display: inline-grid; grid-template-columns: repeat(2, 36px); gap: 4px; padding: 4px; border: 1px solid var(--v2-line); border-radius: 11px; background: #f8f9fb; }
.view-switcher button { width: 36px; height: 34px; border: 0; border-radius: 8px; color: #667085; background: transparent; cursor: pointer; font-size: 17px; }
.view-switcher button.active { color: var(--v2-primary); background: #fff; box-shadow: 0 2px 8px rgba(16,24,40,.08); }
.library-result-meta { display: flex; justify-content: space-between; align-items: center; padding: 8px 1px 16px; color: var(--v2-muted); }
.library-result-meta span { font-size: 12px; font-weight: 700; }
.library-result-meta small { font-size: 11px; }
.library-grid-v2 { gap: 18px; }
.book-card-wrap-v2 { position: relative; display: grid; border-radius: 19px; }
.book-card-v2 { height: 100%; }
.book-card-v2 .book-list-heading { display: none; }
.book-card-actions { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border: 1px solid var(--v2-line); border-top: 0; border-radius: 0 0 16px 16px; background: #fff; }
.book-card-actions a, .book-card-actions button { min-height: 31px; padding: 7px 9px; border: 0; border-radius: 8px; color: #586174; background: #f7f8fa; font-family: inherit; font-size: 10px; font-weight: 700; text-decoration: none; cursor: pointer; }
.book-card-actions form { margin-left: auto; }
.book-card-actions form button { color: var(--v2-danger); background: #fff1f1; }
.library-grid-v2[data-view="list"] { display: grid; grid-template-columns: 1fr; gap: 10px; }
.library-grid-v2[data-view="list"] .book-card-wrap-v2 { grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; border: 1px solid var(--v2-line); border-radius: 15px; background: #fff; box-shadow: 0 6px 17px rgba(16,24,40,.04); }
.library-grid-v2[data-view="list"] .book-card-v2 { display: grid; grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 15px 0 0 15px; box-shadow: none; }
.library-grid-v2[data-view="list"] .book-card-cover { display: none; }
.library-grid-v2[data-view="list"] .book-card-body { display: grid; grid-template-columns: minmax(240px, 1.4fr) minmax(180px, .8fr) minmax(190px, .8fr) minmax(150px, .6fr); gap: 18px; align-items: center; min-height: 98px; padding: 16px 18px; }
.library-grid-v2[data-view="list"] .book-list-heading { display: block; }
.library-grid-v2[data-view="list"] .book-list-heading h3 { margin: 5px 0 0; overflow: hidden; color: var(--v2-ink); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.library-grid-v2[data-view="list"] .book-list-heading > span { display: none; }
.library-grid-v2[data-view="list"] .book-card-body > p { margin: 0; font-size: 12px; line-height: 1.45; }
.library-grid-v2[data-view="list"] .book-spec-line { margin: 0; }
.library-grid-v2[data-view="list"] .book-progress { margin: 0 0 5px; }
.library-grid-v2[data-view="list"] .book-meta { grid-column: 4; }
.library-grid-v2[data-view="list"] .book-card-actions { flex-direction: column; align-items: stretch; justify-content: center; width: 115px; padding: 10px; border: 0; border-left: 1px solid var(--v2-line); border-radius: 0 15px 15px 0; }
.library-grid-v2[data-view="list"] .book-card-actions form { width: 100%; margin: 0; }
.library-grid-v2[data-view="list"] .book-card-actions a, .library-grid-v2[data-view="list"] .book-card-actions button { display: block; width: 100%; text-align: center; }

/* Create Wizard V2 */
.create-layout-v2 { align-items: start; grid-template-columns: 310px minmax(0, 1fr); gap: 20px; }
.create-guide-v2 { position: sticky; top: 18px; min-height: calc(100vh - 118px); padding: 28px; }
.create-guide-v2 h2 { font-size: 27px; line-height: 1.18; }
.create-guide-v2 > p { font-size: 13px; line-height: 1.7; }
.wizard-step-list { gap: 7px; }
.wizard-step-list .step { width: 100%; border: 0; color: inherit; text-align: left; cursor: pointer; }
.wizard-step-list .step:disabled { cursor: not-allowed; opacity: .48; }
.wizard-step-list .step.active { background: rgba(109, 91, 239, .22); }
.wizard-step-list .step.complete > span { background: #12b76a; }
.wizard-step-list .step strong { font-size: 13px; }
.wizard-step-list .step small { font-size: 10px; }
.guide-progress-card { margin-top: 20px; padding: 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 13px; background: rgba(255,255,255,.055); }
.guide-progress-card > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.guide-progress-card span { color: #a9afc9; font-size: 10px; }
.guide-progress-card strong { color: #fff; font-size: 10px; }
.guide-progress-track { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.1); }
.guide-progress-track span { display: block; width: 25%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8175ff, #b6abff); transition: width .25s ease; }
.wizard-form-panel { min-width: 0; padding: 28px 30px 0; }
.wizard-form-head { position: sticky; z-index: 4; top: 0; margin: -28px -30px 0; padding: 26px 30px 20px; border-radius: 19px 19px 0 0; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.wizard-form-head h2 { font-size: 23px; }
.wizard-step-panel { min-height: 560px; padding: 22px 0 30px; animation: wizardPanelIn .24s ease; }
.wizard-step-panel[hidden], .wizard-actions [hidden] { display: none !important; }
@keyframes wizardPanelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.wizard-panel-heading { display: flex; align-items: flex-start; gap: 13px; padding: 15px 17px; border: 1px solid #e8e6ff; border-radius: 14px; background: #faf9ff; }
.wizard-panel-heading > span { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--v2-primary); background: var(--v2-primary-soft); font-size: 11px; font-weight: 800; }
.wizard-panel-heading h3 { margin: 0; color: var(--v2-ink); font-size: 16px; }
.wizard-panel-heading p { margin: 4px 0 0; color: var(--v2-muted); font-size: 12px; }
.target-preview-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 16px 18px; border: 1px solid #dcd8ff; border-radius: 14px; background: linear-gradient(135deg, #f7f5ff, #fff); }
.target-preview-card span { display: block; color: var(--v2-muted); font-size: 11px; }
.target-preview-card strong { display: block; margin-top: 4px; color: var(--v2-primary-dark); font-size: 20px; }
.target-preview-card p { max-width: 520px; margin: 0; color: var(--v2-muted); font-size: 11px; line-height: 1.6; }
.wizard-summary { margin-top: 22px; padding: 18px; border: 1px solid #dedaff; border-radius: 15px; background: #faf9ff; }
.wizard-summary-head { display: flex; gap: 10px; align-items: center; }
.wizard-summary-head > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--v2-primary); }
.wizard-summary-head strong { display: block; color: var(--v2-ink); font-size: 14px; }
.wizard-summary-head p { margin: 2px 0 0; color: var(--v2-muted); font-size: 11px; }
.wizard-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.wizard-summary-grid > div { padding: 12px; border: 1px solid #e6e3f7; border-radius: 11px; background: #fff; }
.wizard-summary-grid span { display: block; color: var(--v2-muted); font-size: 10px; }
.wizard-summary-grid strong { display: block; margin-top: 4px; color: var(--v2-ink); font-size: 12px; }
.wizard-actions { position: sticky; z-index: 5; bottom: 0; margin: 0 -30px; padding: 15px 30px; background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
.wizard-actions .btn { min-height: 43px; font-size: 12px; }

/* Manuscript Editor V2 */
.book-editor-v2 { display: grid; gap: 14px; }
.editor-project-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 19px 22px; border: 1px solid var(--v2-line); border-radius: 20px; background: linear-gradient(120deg, #fff, #faf9ff); box-shadow: 0 10px 28px rgba(16,24,40,.055); }
.editor-project-identity { display: flex; align-items: center; min-width: 0; gap: 15px; }
.editor-project-identity h2 { margin: 7px 0 3px; overflow: hidden; color: var(--v2-ink); font-size: 23px; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.editor-project-identity p { margin: 0; overflow: hidden; color: var(--v2-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.editor-project-actions { display: flex; gap: 9px; flex: 0 0 auto; }
.editor-project-actions form { margin: 0; }
.editor-overview-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.editor-overview-cards > div { padding: 13px 15px; border: 1px solid var(--v2-line); border-radius: 13px; background: #fff; }
.editor-overview-cards span { display: block; color: var(--v2-muted); font-size: 10px; }
.editor-overview-cards strong { display: block; margin-top: 4px; color: var(--v2-ink); font-size: 16px; }
.editor-overview-cards small { display: block; margin-top: 2px; overflow: hidden; color: #98a2b3; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.editor-mobile-switcher { display: none; }
.editor-studio { display: grid; grid-template-columns: 300px minmax(500px, 1fr) 270px; min-height: 720px; overflow: hidden; border: 1px solid var(--v2-line); border-radius: 19px; background: #fff; box-shadow: 0 15px 40px rgba(16,24,40,.07); }
.editor-sidebar-panel { min-width: 0; background: #fbfcfe; }
.editor-structure-panel { display: flex; flex-direction: column; border-right: 1px solid var(--v2-line); }
.editor-ai-panel { padding: 17px; border-left: 1px solid var(--v2-line); }
.editor-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px; border-bottom: 1px solid var(--v2-line); }
.editor-ai-panel .editor-panel-head { margin: -17px -17px 16px; }
.editor-panel-head h3 { margin: 4px 0 0; color: var(--v2-ink); font-size: 17px; }
.mobile-panel-close { display: none; border: 0; background: transparent; color: #667085; font-size: 24px; cursor: pointer; }
.structure-search-v2 { display: flex; align-items: center; gap: 8px; margin: 13px 14px 8px; padding: 0 11px; height: 39px; border: 1px solid var(--v2-line); border-radius: 11px; background: #fff; }
.structure-search-v2 svg { width: 16px; fill: none; stroke: #98a2b3; stroke-width: 1.8; }
.structure-search-v2 input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--v2-ink); background: transparent; font: inherit; font-size: 11px; }
.editor-structure-scroll { flex: 1; min-height: 0; padding: 0 9px 10px; overflow-y: auto; }
.editor-structure-group { border-top: 1px solid #eceef3; }
.editor-structure-group:first-child { border-top: 0; }
.structure-group-title { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 12px 5px 8px; border: 0; color: #667085; background: transparent; font: inherit; font-size: 10px; font-weight: 800; text-transform: uppercase; cursor: pointer; }
.structure-group-title span { display: flex; align-items: center; gap: 8px; }
.structure-group-title b { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: var(--v2-primary); background: var(--v2-primary-soft); font-size: 8px; }
.structure-group-title i { font-style: normal; transition: .18s; }
.editor-structure-group.collapsed .structure-group-content { display: none; }
.editor-structure-group.collapsed .structure-group-title i { transform: rotate(180deg); }
.editor-section-item { display: grid; grid-template-columns: minmax(0, 1fr) 32px; align-items: center; gap: 3px; margin: 2px 0; border-radius: 9px; }
.editor-section-item.level-2 { margin-left: 12px; }
.editor-section-item.level-3 { margin-left: 25px; }
.editor-section-select { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px; border: 0; border-radius: 9px; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.editor-section-select:hover { background: #f1f2f7; }
.editor-section-select.active { background: #eeecff; box-shadow: inset 0 0 0 1px #dcd7ff; }
.editor-section-copy { min-width: 0; display: grid; gap: 3px; }
.editor-section-copy strong { overflow: hidden; color: #344054; font-size: 10.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.editor-section-copy small { color: #98a2b3; font-size: 8.5px; }
.editor-section-generate { margin: 0; }
.editor-section-generate button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #dedaff; border-radius: 8px; color: var(--v2-primary); background: #fff; cursor: pointer; }
.editor-section-generate button:hover { color: #fff; background: var(--v2-primary); }
.editor-section-generate.is-quick-generating button > span { display: none; }
.editor-section-generate.is-quick-generating .button-loader { display: inline-block; }
.editor-section-item.is-ai-generating { background: #f7f5ff; box-shadow: inset 3px 0 0 #7c5cff; }
.editor-section-item.is-ai-generated { background: #f1fff7; box-shadow: inset 3px 0 0 #22a06b; }
.editor-section-item.is-ai-generate-error { background: #fff4f4; box-shadow: inset 3px 0 0 #d64545; }
.editor-section-item.is-ai-generating .editor-section-copy small::after { content: ' · AI sedang menulis'; color: #6d50e7; font-weight: 700; }
.status-dot.edited { background: #2e90fa; box-shadow: 0 0 0 3px #eaf4ff; }
.structure-footer-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; padding: 11px; border-top: 1px solid var(--v2-line); background: #fff; }
.structure-footer-actions .btn { width: 100%; min-height: 36px; padding: 8px; font-size: 10px; }
.editor-document-panel { min-width: 0; display: flex; flex-direction: column; background: #f4f5f8; }
.document-topbar { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 14px; border-bottom: 1px solid var(--v2-line); background: #fff; }
.document-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: #f3f4f7; }
.document-tabs button { min-width: 74px; padding: 7px 11px; border: 0; border-radius: 7px; color: #667085; background: transparent; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.document-tabs button.active { color: var(--v2-primary); background: #fff; box-shadow: 0 2px 7px rgba(16,24,40,.08); }
.document-save-state { display: flex; align-items: center; gap: 6px; color: #667085; }
.document-save-state > span { width: 7px; height: 7px; border-radius: 50%; background: #12b76a; }
.document-save-state strong { font-size: 10px; }
.document-save-state small { font-size: 9px; }
.document-save-state[data-state="saving"] > span { background: #f79009; animation: savePulse 1s infinite; }
.document-save-state[data-state="dirty"] > span { background: #98a2b3; }
.document-save-state[data-state="error"] > span { background: #f04438; }
.document-save-state[data-state="error"] { color: #b42318; }
@keyframes savePulse { 50% { opacity: .35; } }
.document-toolbar { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 7px 14px; border-bottom: 1px solid var(--v2-line); background: #fff; }
.document-toolbar-group { display: flex; gap: 3px; padding-right: 9px; border-right: 1px solid var(--v2-line); }
.document-toolbar button:not(.btn) { min-width: 32px; height: 31px; padding: 0 8px; border: 0; border-radius: 7px; color: #596174; background: #f6f7f9; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.document-toolbar button:hover:not(.btn) { color: var(--v2-primary); background: var(--v2-primary-soft); }
.zoom-control { margin-left: auto; align-items: center; }
.zoom-control span { min-width: 40px; color: #667085; font-size: 9px; text-align: center; }
.btn-small { min-height: 31px; padding: 7px 12px; font-size: 10px; }
.document-meta-bar { display: flex; align-items: center; gap: 12px; padding: 10px 15px; border-bottom: 1px solid var(--v2-line); background: #fff; }
.document-meta-bar input { min-width: 0; flex: 1; padding: 4px 0; border: 0; outline: 0; color: var(--v2-ink); background: transparent; font: 700 14px/1.3 'Manrope', sans-serif; }
.document-meta-bar > div { display: flex; gap: 7px; align-items: center; }
.document-meta-bar span { padding: 4px 7px; border-radius: 6px; color: #667085; background: #f5f6f8; font-size: 8.5px; white-space: nowrap; }
.document-canvas-wrap { flex: 1; min-height: 0; padding: 25px; overflow: auto; }
.document-page { width: min(100%, 820px); min-height: 630px; margin: 0 auto; padding: calc(var(--book-pad-top) * var(--editor-zoom)) calc(var(--book-pad-right) * var(--editor-zoom)) calc(var(--book-pad-bottom) * var(--editor-zoom)) calc(var(--book-pad-left) * var(--editor-zoom)); border: 1px solid #e7e8ec; border-radius: 3px; background: #fff; box-shadow: 0 13px 32px rgba(16,24,40,.11); transform-origin: top center; }
.document-page textarea { width: 100%; min-height: 540px; resize: none; border: 0; outline: 0; color: #1d2939; background: transparent; font-family: var(--book-font-family), Georgia, serif; font-size: calc(var(--book-font-size) * var(--editor-zoom)); line-height: 1.75; white-space: pre-wrap; }
.document-preview-page article { font-family: var(--book-font-family), Georgia, serif; font-size: calc(var(--book-font-size) * var(--editor-zoom)); }
.document-preview-page h1 { margin: 18px 0 26px; color: #101828; font-size: 2em; line-height: 1.18; }
.document-preview-content { color: #1d2939; line-height: 1.8; white-space: pre-wrap; }
.document-statusbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 51px; padding: 10px 15px; border-top: 1px solid var(--v2-line); background: #fff; }
.document-statusbar > div { width: min(360px, 55%); }
.document-statusbar span { color: #667085; font-size: 9px; }
.section-target-track { height: 5px; margin-top: 6px; overflow: hidden; border-radius: 999px; background: #eef0f4; }
.section-target-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6254e8, #9b8dff); transition: width .25s ease; }
.ai-section-card { padding: 14px; border: 1px solid #ddd9ff; border-radius: 13px; background: linear-gradient(140deg, #f6f4ff, #fff); }
.ai-section-card > span { color: #7f70e9; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.ai-section-card strong { display: block; margin-top: 7px; color: var(--v2-ink); font-size: 13px; line-height: 1.4; }
.ai-section-card p { margin: 5px 0 10px; color: var(--v2-muted); font-size: 9px; line-height: 1.5; }
.ai-target-progress { height: 6px; overflow: hidden; border-radius: 999px; background: #e9e6ff; }
.ai-target-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--v2-primary); }
.btn-block { width: 100%; justify-content: center; margin-top: 11px; }
.ai-tool-list { display: grid; gap: 7px; margin-top: 14px; }
.ai-tool-list button { display: grid; grid-template-columns: 34px 1fr; gap: 9px; align-items: center; padding: 10px; border: 1px solid var(--v2-line); border-radius: 11px; color: inherit; background: #fff; text-align: left; cursor: pointer; }
.ai-tool-list button:hover { border-color: #cfc9ff; background: #faf9ff; }
.ai-tool-list button > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--v2-primary); background: var(--v2-primary-soft); font-size: 14px; }
.ai-tool-list strong { display: block; color: var(--v2-ink); font-size: 10.5px; }
.ai-tool-list small { display: block; margin-top: 2px; color: var(--v2-muted); font-size: 8.5px; }
.ai-context-note { margin-top: 14px; padding: 12px; border-radius: 11px; background: #f2f4f7; }
.ai-context-note strong { display: block; color: #344054; font-size: 10px; }
.ai-context-note p { margin: 4px 0 0; color: #667085; font-size: 8.5px; line-height: 1.5; }
.reference-box-v2 { margin: 0; overflow: hidden; }
.reference-box-v2 > summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 22px; cursor: pointer; list-style: none; }
.reference-box-v2 > summary::-webkit-details-marker { display: none; }
.reference-box-v2 > summary h2 { margin: 4px 0 2px; font-size: 18px; }
.reference-box-v2 > summary p { margin: 0; color: var(--v2-muted); font-size: 11px; }
.reference-box-v2 > summary > span { padding: 7px 10px; border-radius: 8px; color: var(--v2-primary); background: var(--v2-primary-soft); font-size: 10px; font-weight: 800; }
.reference-box-content { padding: 0 22px 22px; border-top: 1px solid var(--v2-line); }

@media (max-width: 1500px) {
    .editor-studio { grid-template-columns: 275px minmax(460px, 1fr) 245px; }
    .dashboard-book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
    .hero-banner-v2 { grid-template-columns: 1fr; }
    .hero-workflow-card { display: none; }
    .stats-grid-v2 { grid-template-columns: repeat(2, 1fr); }
    .dashboard-insight-grid { grid-template-columns: 1fr; }
    .dashboard-quick-actions { grid-template-columns: 1fr; }
    .library-toolbar-v2 { align-items: stretch; flex-direction: column; }
    .library-toolbar-actions { justify-content: space-between; }
    .library-grid-v2[data-view="list"] .book-card-body { grid-template-columns: minmax(230px, 1.2fr) minmax(170px, .8fr) minmax(150px, .6fr); }
    .library-grid-v2[data-view="list"] .book-card-body > p { display: none; }
    .library-grid-v2[data-view="list"] .book-meta { grid-column: 3; }
    .create-layout-v2 { grid-template-columns: 260px minmax(0, 1fr); }
    .editor-mobile-switcher { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; border: 1px solid var(--v2-line); border-radius: 12px; background: #fff; }
    .editor-mobile-switcher button { padding: 9px; border: 0; border-radius: 8px; color: #667085; background: transparent; font: inherit; font-size: 10px; font-weight: 700; }
    .editor-mobile-switcher button.active { color: var(--v2-primary); background: var(--v2-primary-soft); }
    .editor-studio { position: relative; display: block; min-height: 700px; overflow: visible; }
    .editor-document-panel { min-height: 700px; border-radius: 18px; overflow: hidden; }
    .editor-sidebar-panel { position: fixed; z-index: 100; top: 0; bottom: 0; width: min(360px, 88vw); transition: transform .25s ease; box-shadow: 0 0 42px rgba(16,24,40,.22); }
    .editor-structure-panel { left: 0; transform: translateX(-105%); }
    .editor-ai-panel { right: 0; padding: 17px; transform: translateX(105%); }
    .book-editor-v2.show-structure .editor-structure-panel { transform: translateX(0); }
    .book-editor-v2.show-assistant .editor-ai-panel { transform: translateX(0); }
    .mobile-panel-close { display: block; }
}

@media (max-width: 900px) {
    .hero-banner-v2 { min-height: auto; padding: 29px; }
    .hero-banner-v2 h2 { font-size: 32px; }
    .library-summary-strip { grid-template-columns: repeat(2, 1fr); }
    .library-toolbar-actions { align-items: flex-start; flex-direction: column; }
    .filter-chips { width: 100%; overflow-x: auto; }
    .library-grid-v2[data-view="list"] .book-card-wrap-v2 { grid-template-columns: 1fr; }
    .library-grid-v2[data-view="list"] .book-card-body { grid-template-columns: 1fr 1fr; }
    .library-grid-v2[data-view="list"] .book-meta { grid-column: auto; }
    .library-grid-v2[data-view="list"] .book-card-actions { width: auto; flex-direction: row; border: 0; border-top: 1px solid var(--v2-line); border-radius: 0 0 15px 15px; }
    .create-layout-v2 { display: block; }
    .create-guide-v2 { position: static; min-height: 0; margin-bottom: 14px; padding: 22px; }
    .create-guide-v2 > h2, .create-guide-v2 > p, .create-guide-v2 .guide-tip { display: none; }
    .wizard-step-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .wizard-step-list .step { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; text-align: center; }
    .wizard-step-list .step > div small { display: none; }
    .wizard-step-list .step strong { font-size: 9px; }
    .guide-progress-card { margin-top: 12px; }
    .editor-project-header { align-items: flex-start; flex-direction: column; }
    .editor-project-actions { width: 100%; }
    .editor-project-actions .btn, .editor-project-actions form { flex: 1; }
    .editor-project-actions form .btn { width: 100%; }
    .editor-overview-cards { grid-template-columns: repeat(2, 1fr); }
    .document-statusbar { align-items: flex-start; flex-direction: column; }
    .document-statusbar > div { width: 100%; }
}

@media (max-width: 650px) {
    html { scroll-behavior: auto; }
    .dashboard-page-v2 { gap: 13px; }
    .hero-banner-v2 { padding: 23px 20px; border-radius: 20px; }
    .hero-banner-v2 h2 { font-size: 27px; }
    .hero-banner-v2 p { font-size: 13px; }
    .hero-banner-v2 .hero-actions { align-items: stretch; flex-direction: column; }
    .stats-grid-v2 { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stats-grid-v2 .stat-card { min-height: 100px; padding: 14px; }
    .stats-grid-v2 .stat-card strong { font-size: 22px; }
    .stats-grid-v2 .stat-icon { display: none; }
    .dashboard-insight-grid .panel { padding: 18px; }
    .dashboard-book-grid { grid-template-columns: 1fr; }
    .library-hero-v2 { align-items: flex-start; flex-direction: column; padding: 20px; }
    .library-summary-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
    .library-summary-strip > div { padding: 12px; }
    .library-summary-strip span { font-size: 10px; }
    .library-panel-v2 { padding: 14px; }
    .library-result-meta small { display: none; }
    .library-grid-v2[data-view="list"] .book-card-body { display: block; min-height: 0; }
    .library-grid-v2[data-view="list"] .book-card-body .tags, .library-grid-v2[data-view="list"] .book-card-body .book-spec-line { margin-top: 10px; }
    .library-grid-v2[data-view="list"] .book-card-actions { flex-wrap: wrap; }
    .wizard-form-panel { padding: 19px 17px 88px; }
    .wizard-form-head { margin: -19px -17px 0; padding: 20px 17px 16px; }
    .wizard-step-list .step strong { display: none; }
    .wizard-step-list .step > span { width: 31px; height: 31px; }
    .wizard-summary-grid { grid-template-columns: 1fr; }
    .target-preview-card { align-items: flex-start; flex-direction: column; }
    .create-book-v2-page .wizard-step-panel {
        min-height: 0;
        padding-bottom: 24px;
        animation: none;
    }
    /* Keep the primary mobile controls above every form field. The form gets
       matching bottom space so the fixed bar never hides editable content. */
    .create-book-v2-page .wizard-actions.is-mobile-portal {
        position: fixed !important;
        inset: auto 0 0 !important;
        z-index: 1200;
        width: auto;
        margin: 0 !important;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        border-radius: 0;
        background: #fff;
        backdrop-filter: none;
        box-shadow: 0 -10px 30px rgba(16,24,40,.12);
        pointer-events: auto;
        transform: none !important;
    }
    .create-book-v2-page .wizard-actions .btn {
        position: relative;
        z-index: 1;
        pointer-events: auto;
    }
    .wizard-actions .btn { flex: 1; padding-inline: 10px; }
    .editor-project-header { padding: 16px; }
    .editor-project-identity { align-items: flex-start; }
    .editor-project-identity .project-avatar { width: 44px; height: 55px; }
    .editor-project-identity h2 { font-size: 18px; }
    .editor-project-actions { flex-direction: column; }
    .editor-overview-cards { grid-template-columns: 1fr 1fr; }
    .editor-overview-cards > div { padding: 11px; }
    .editor-mobile-switcher button { font-size: 9px; }
    .document-topbar, .document-toolbar, .document-meta-bar { padding-inline: 10px; }
    .document-toolbar-group:first-child button:nth-child(3) { display: none; }
    .document-canvas-wrap { padding: 12px; }
    .document-page { min-height: 560px; padding: 35px 25px; }
    .document-page textarea { min-height: 490px; }
    .document-meta-bar { align-items: flex-start; flex-direction: column; }
    .document-meta-bar input { width: 100%; }
    .document-statusbar > span:last-child { display: none; }
    .reference-box-v2 > summary { padding: 16px; }
    .reference-box-content { padding: 0 16px 16px; }
}

/* Book structure hierarchy: BAB is visually stronger than subbab and child subbab. */
.book-editor-v2-page .editor-section-item.type-chapter .editor-section-copy strong {
    color: #1d2939;
    font-weight: 800;
    letter-spacing: .01em;
}

.book-editor-v2-page .editor-section-item.type-subchapter .editor-section-copy strong {
    font-weight: 650;
}

.book-editor-v2-page .editor-section-item.type-child_subchapter .editor-section-copy strong {
    font-weight: 550;
}


/* Structure numbering labels: BAB 1, A, A.1 are displayed separately from titles. */
.book-editor-v2-page .editor-section-heading {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.book-editor-v2-page .section-number-label {
    flex: 0 0 auto;
    color: #344054;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.35;
}

.book-editor-v2-page .editor-section-heading .section-title-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-editor-v2-page .editor-section-item.type-chapter .section-number-label,
.book-editor-v2-page .editor-section-item.type-chapter .section-title-text {
    color: #101828;
    font-weight: 800;
}

.book-editor-v2-page .editor-section-item.type-subchapter .section-number-label {
    color: #475467;
    font-weight: 750;
}

.book-editor-v2-page .editor-section-item.type-child_subchapter .section-number-label {
    color: #667085;
    font-weight: 700;
}

/* ===== Book export controls ===== */
.book-card-actions .book-export-link {
    color: #5748d8;
    background: #f3f1ff;
    border-color: #e4e0ff;
    font-weight: 750;
}
.book-card-actions .book-export-link:hover {
    background: #ebe7ff;
    color: #4638c3;
}
.editor-export-group {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.editor-project-actions .export-btn {
    white-space: nowrap;
    font-weight: 750;
}
.editor-project-actions .export-pdf {
    color: #c2413a;
    border-color: #f0d5d2;
    background: #fffafa;
}
.editor-project-actions .export-word {
    color: #3559b7;
    border-color: #d9e1f5;
    background: #f9fbff;
}
@media (max-width: 1180px) {
    .editor-project-actions {
        flex-wrap: wrap;
    }
}
@media (max-width: 760px) {
    .editor-export-group {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .editor-export-group .btn {
        justify-content: center;
    }
}

/* =========================================================
   AI Paraphrase Studio
   ========================================================= */
body.paraphrase-open { overflow: hidden; }
.paraphrase-modal[hidden] { display: none !important; }
.paraphrase-modal { position: fixed; z-index: 260; inset: 0; display: grid; place-items: center; padding: 24px; }
.paraphrase-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(15, 20, 38, .58); backdrop-filter: blur(4px); cursor: default; }
.paraphrase-dialog { position: relative; z-index: 1; width: min(1080px, 96vw); max-height: 92vh; overflow: auto; border: 1px solid #e1e4eb; border-radius: 20px; background: #fff; box-shadow: 0 28px 80px rgba(15, 23, 42, .28); }
.paraphrase-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px 17px; border-bottom: 1px solid #eaecf0; background: linear-gradient(120deg, #fff, #faf9ff); }
.paraphrase-dialog-head h2 { margin: 4px 0 4px; color: #101828; font-size: 22px; }
.paraphrase-dialog-head p { margin: 0; color: #667085; font-size: 12px; }
.paraphrase-close { width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid #e4e7ec; border-radius: 10px; color: #667085; background: #fff; font-size: 20px; cursor: pointer; }
.paraphrase-controls { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(300px, 1.15fr); align-items: end; gap: 16px; padding: 16px 22px; border-bottom: 1px solid #eef0f4; }
.paraphrase-controls label { display: grid; gap: 7px; color: #344054; font-size: 12px; font-weight: 700; }
.paraphrase-controls select { width: 100%; height: 42px; border: 1px solid #d9dde7; border-radius: 10px; padding: 0 11px; outline: none; color: #1d2939; background: #fff; font-size: 13px; }
.paraphrase-controls select:focus { border-color: #7868f5; box-shadow: 0 0 0 3px #efedff; }
.paraphrase-status { min-height: 42px; display: flex; align-items: center; padding: 9px 12px; border-radius: 10px; color: #667085; background: #f7f8fb; font-size: 11px; line-height: 1.45; }
.paraphrase-status[data-state="loading"] { color: #5548cd; background: #f0edff; }
.paraphrase-status[data-state="success"] { color: #067647; background: #ecfdf3; }
.paraphrase-status[data-state="error"] { color: #b42318; background: #fef3f2; }
.paraphrase-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px 22px 12px; }
.paraphrase-compare article { min-width: 0; overflow: hidden; border: 1px solid #e4e7ec; border-radius: 13px; background: #fbfcfe; }
.paraphrase-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #e9ecf2; background: #fff; }
.paraphrase-pane-head strong { color: #344054; font-size: 12px; }
.paraphrase-pane-head span { color: #98a2b3; font-size: 10px; }
.paraphrase-compare textarea { width: 100%; min-height: 300px; resize: vertical; border: 0; padding: 14px 15px; outline: 0; color: #1d2939; background: transparent; font-family: Georgia, 'Times New Roman', serif; font-size: 13px; line-height: 1.7; }
.paraphrase-compare textarea[readonly] { color: #475467; background: #f8f9fb; }
.paraphrase-note { margin: 0 22px 14px; padding: 10px 12px; border: 1px solid #e9e5ff; border-radius: 10px; color: #655b7a; background: #faf9ff; font-size: 10.5px; line-height: 1.5; }
.paraphrase-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px 20px; border-top: 1px solid #eef0f4; }
.ai-tool-list .ai-tool-paraphrase { border-color: #dcd7ff; background: linear-gradient(120deg, #f8f6ff, #fff); }
.ai-tool-list .ai-tool-paraphrase > span { color: #5f52e6; background: #ece9ff; }

@media (max-width: 800px) {
    .paraphrase-modal { padding: 10px; align-items: end; }
    .paraphrase-dialog { width: 100%; max-height: 95vh; border-radius: 18px 18px 10px 10px; }
    .paraphrase-controls, .paraphrase-compare { grid-template-columns: 1fr; }
    .paraphrase-dialog-head, .paraphrase-controls, .paraphrase-compare { padding-left: 15px; padding-right: 15px; }
    .paraphrase-compare textarea { min-height: 190px; }
    .paraphrase-note { margin-left: 15px; margin-right: 15px; }
    .paraphrase-actions { position: sticky; bottom: 0; padding: 12px 15px; background: #fff; }
    .paraphrase-actions .btn { flex: 1; }
}

/* ===== Nested Struktur Buku Accordion: BAB -> Subbab -> Anak Subbab ===== */
.book-editor-v2-page .structure-chapter-tree {
    display: grid;
    gap: 4px;
}
.book-editor-v2-page .structure-tree-node {
    min-width: 0;
}
.book-editor-v2-page .structure-tree-node > .structure-tree-children {
    display: block;
    overflow: hidden;
}
.book-editor-v2-page .structure-tree-node.collapsed:not(.search-open) > .structure-tree-children {
    display: none;
}
.book-editor-v2-page .structure-tree-chapter {
    margin: 3px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0f1f5;
}
.book-editor-v2-page .structure-tree-chapter:last-child {
    border-bottom: 0;
}
.book-editor-v2-page .structure-tree-subchapter {
    margin-left: 9px;
}
.book-editor-v2-page .editor-section-item.has-tree-children {
    grid-template-columns: minmax(0, 1fr) 28px 32px;
}
.book-editor-v2-page .structure-tree-toggle {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #667085;
    background: transparent;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.book-editor-v2-page .structure-tree-toggle:hover {
    color: var(--v2-primary);
    background: var(--v2-primary-soft);
}
.book-editor-v2-page .structure-tree-toggle span {
    display: block;
    font-size: 13px;
    line-height: 1;
    transition: transform .18s ease;
}
.book-editor-v2-page .structure-tree-node.collapsed > .editor-section-item .structure-tree-toggle span {
    transform: rotate(180deg);
}
.book-editor-v2-page .structure-tree-chapter > .editor-section-item {
    background: #fafaff;
}
.book-editor-v2-page .structure-tree-chapter > .editor-section-item:hover {
    background: #f4f2ff;
}
.book-editor-v2-page .structure-tree-chapter > .editor-section-item .editor-section-select {
    padding-top: 9px;
    padding-bottom: 9px;
}
.book-editor-v2-page .structure-tree-subchapter > .editor-section-item.has-tree-children {
    margin-left: 0;
}
.book-editor-v2-page .structure-tree-subchapter > .structure-tree-children .editor-section-item {
    margin-left: 21px;
}
.book-editor-v2-page .structure-tree-node[hidden],
.book-editor-v2-page .editor-section-item[hidden] {
    display: none !important;
}

@media (max-width: 1180px) {
    .book-editor-v2-page .editor-section-item.has-tree-children {
        grid-template-columns: minmax(0, 1fr) 30px 34px;
    }
    .book-editor-v2-page .structure-tree-toggle {
        width: 30px;
        height: 30px;
    }
}
.book-editor-v2-page .editor-structure-group.collapsed.search-open > .structure-group-content {
    display: block;
}

/* =========================================================
   VISUAL AI — Cover & Book Illustration workspace
   ========================================================= */
.visual-ai-shell,.book-visual-shell{display:grid;gap:18px}.visual-ai-hero,.visual-project-head{border:1px solid var(--line);background:linear-gradient(120deg,#fff 0%,#fbfaff 70%,#f3f0ff 100%);border-radius:22px;padding:25px 27px;display:flex;align-items:center;justify-content:space-between;gap:24px;box-shadow:var(--shadow-sm)}.visual-ai-hero h2,.visual-project-head h2{font-size:26px;line-height:1.15;margin:5px 0 8px}.visual-ai-hero p,.visual-project-head p{margin:0;color:var(--muted);font-size:13px;line-height:1.65;max-width:760px}.visual-book-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.visual-book-card{background:#fff;border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:var(--shadow-sm);display:grid;grid-template-rows:120px 1fr auto}.visual-book-thumb{background:linear-gradient(135deg,#282c5c,#6e5ee9);display:grid;place-items:center;color:#fff}.visual-book-thumb span{width:50px;height:50px;border-radius:14px;background:rgba(255,255,255,.16);display:grid;place-items:center;font-weight:800;font-size:20px}.visual-book-copy{padding:17px}.visual-book-copy h3{font-size:16px;margin:5px 0 7px}.visual-book-copy p{font-size:12px;color:var(--muted);line-height:1.55;margin:0}.visual-counts{display:flex;gap:7px;flex-wrap:wrap;margin-top:13px}.visual-counts span{font-size:10px;padding:6px 8px;border-radius:999px;background:#f3f1ff;color:#6457d9;font-weight:700}.visual-book-actions{display:flex;gap:8px;padding:0 17px 17px}.visual-book-actions .btn{flex:1;justify-content:center}.visual-empty{padding:50px;text-align:center}.visual-project-head{padding:22px 24px}.visual-back{display:inline-flex;color:#6f63d8;font-size:11px;font-weight:700;margin-bottom:8px}.visual-project-tabs{display:flex;gap:7px;padding:5px;background:#f5f4fa;border:1px solid #ebe9f4;border-radius:13px}.visual-project-tabs a{padding:9px 12px;border-radius:9px;font-size:11px;font-weight:800;color:#73798a}.visual-project-tabs a.active{background:#fff;color:#574bdd;box-shadow:0 5px 15px rgba(58,46,131,.09)}.visual-workspace-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);gap:16px}.illustration-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(300px,.85fr);gap:16px}.visual-form-panel,.visual-preview-panel,.illustration-guide-panel,.visual-gallery-panel{border-radius:20px;padding:22px}.visual-panel-title{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-bottom:17px;border-bottom:1px solid var(--line);margin-bottom:18px}.visual-panel-title>div{display:flex;align-items:center;gap:12px}.visual-panel-title>div>span{width:37px;height:37px;border-radius:11px;background:#efecff;color:#6255e3;display:grid;place-items:center;font-size:10px;font-weight:900}.visual-panel-title small{display:block;font-size:8px;letter-spacing:.12em;color:#9a91ba;font-weight:800}.visual-panel-title h3{font-size:16px;margin:2px 0 0}.visual-panel-title>strong{font-size:10px;border:1px solid #e5e1ff;color:#6a5cdd;border-radius:999px;padding:6px 9px;background:#faf9ff}.visual-panel-title.compact{justify-content:flex-start}.visual-generate-form{display:grid;gap:15px}.visual-generate-form>label,.visual-form-row label{display:grid;gap:7px;color:#3d4558;font-size:12px;font-weight:800}.visual-generate-form input,.visual-generate-form select,.visual-generate-form textarea{width:100%;border:1px solid #dde1eb;border-radius:11px;background:#fbfcfe;padding:12px 13px;outline:none;font:inherit;font-size:13px;color:#172033;transition:.18s}.visual-generate-form select{height:46px}.visual-generate-form textarea{line-height:1.55;resize:vertical;min-height:120px}.visual-generate-form input:focus,.visual-generate-form select:focus,.visual-generate-form textarea:focus{background:#fff;border-color:#8175f5;box-shadow:0 0 0 3px #f0edff}.visual-generate-form label>span small{font-weight:500;color:#969cab}.visual-form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.visual-check-row{display:flex!important;align-items:flex-start;gap:10px!important;padding:12px;border:1px solid #e3e1ef;border-radius:12px;background:#faf9ff}.visual-check-row input[type=checkbox]{width:18px;height:18px;margin-top:2px;flex:none;accent-color:#6757ed}.visual-check-row>span{display:grid;gap:2px}.visual-check-row small{font-size:10px;line-height:1.5;color:#888fa0;font-weight:500}.visual-api-note{display:flex;gap:9px;align-items:flex-start;border-radius:12px;background:#f7f7fb;padding:11px 12px}.visual-api-note span{width:25px;height:25px;border-radius:8px;background:#e9e6ff;color:#5d51df;display:grid;place-items:center;flex:none}.visual-api-note p{font-size:10px;color:#747c8d;line-height:1.55;margin:2px 0 0}.visual-generate-btn{min-height:46px;justify-content:center}.active-cover-frame{position:relative;border-radius:16px;overflow:hidden;background:#f2f2f6;aspect-ratio:2/3;max-height:515px;margin:auto}.active-cover-frame img{width:100%;height:100%;object-fit:cover;display:block}.active-cover-frame>span{position:absolute;top:12px;right:12px;background:#6354e8;color:#fff;border-radius:999px;padding:6px 9px;font-size:9px;font-weight:800;box-shadow:0 7px 22px rgba(61,48,151,.2)}.active-cover-meta{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;margin:13px 0}.active-cover-meta span{font-size:9px;padding:5px 7px;background:#f4f5f8;border-radius:999px;color:#687084}.btn.full{width:100%;justify-content:center}.visual-empty-preview{min-height:340px;display:grid;place-items:center;align-content:center;text-align:center;color:#858ca0;padding:30px}.visual-empty-preview>div{width:54px;height:54px;background:#f0edff;color:#6558e7;border-radius:16px;display:grid;place-items:center;font-size:22px;margin-bottom:12px}.visual-empty-preview h3{font-size:15px;color:#20283a;margin:0 0 6px}.visual-empty-preview p{font-size:11px;line-height:1.6;max-width:330px;margin:0 0 15px}.visual-gallery-panel{padding:20px}.visual-gallery-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:15px}.visual-gallery-head h3{font-size:17px;margin:3px 0 0}.visual-gallery-head small{font-size:10px;color:#8d94a3}.visual-gallery-empty{padding:34px;text-align:center;color:#959baa;border:1px dashed #dfe2ea;border-radius:14px;font-size:12px}.ai-image-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}.ai-image-card{border:1px solid #e2e5ed;border-radius:15px;overflow:hidden;background:#fff;transition:.18s}.ai-image-card:hover{transform:translateY(-2px);box-shadow:0 12px 30px rgba(42,45,80,.08)}.ai-image-card.selected{border-color:#7568ed;box-shadow:0 0 0 2px #eeecff}.ai-image-media{aspect-ratio:1/1;position:relative;background:#f3f4f8;overflow:hidden}.cover-image-grid .ai-image-media{aspect-ratio:2/3}.ai-image-media img{width:100%;height:100%;object-fit:cover;display:block}.ai-image-media span{position:absolute;top:8px;right:8px;background:#6354e8;color:#fff;border-radius:999px;padding:5px 7px;font-size:8px;font-weight:800}.ai-image-info{padding:10px 11px;display:grid;gap:3px}.ai-image-info strong{font-size:11px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-image-info small{font-size:8.5px;color:#969ca9}.ai-image-actions{display:flex;gap:4px;flex-wrap:wrap;border-top:1px solid #edf0f4;padding:8px}.ai-image-actions a,.ai-image-actions button{border:0;background:#f5f5fa;color:#5e6374;border-radius:7px;padding:6px 7px;font-size:8.5px;font-weight:800;cursor:pointer}.ai-image-actions button:hover,.ai-image-actions a:hover{background:#ece9ff;color:#5e51df}.ai-image-actions button.danger:hover{background:#fff0f0;color:#c63d3d}.illustration-guide-panel{background:linear-gradient(145deg,#1d2245,#262a53);color:#fff;border:0;align-self:start}.illustration-guide-panel .eyebrow{color:#aaa5ff}.illustration-guide-panel h3{font-size:19px;margin:7px 0 10px}.illustration-guide-panel>p{font-size:11px;line-height:1.75;color:#b8bed1}.illustration-guide-flow{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:20px 0;padding:13px;border:1px solid rgba(255,255,255,.1);border-radius:13px;background:rgba(255,255,255,.04)}.illustration-guide-flow span,.illustration-guide-flow strong{font-size:9px;padding:6px 7px;border-radius:7px;background:rgba(255,255,255,.08)}.illustration-guide-flow strong{background:#6a5bf0}.illustration-guide-flow b{color:#787fa0}.visual-safety-note{margin-top:17px;padding:13px;border-radius:12px;background:rgba(255,255,255,.06)}.visual-safety-note strong{font-size:10px}.visual-safety-note p{font-size:9px;color:#aeb5ca;line-height:1.6;margin:5px 0 0}.book-card-cover.has-ai-cover{background-position:center!important;background-size:cover!important;background-repeat:no-repeat!important}.book-card-cover.has-ai-cover>span:first-child{background:rgba(255,255,255,.16);backdrop-filter:blur(3px)}
@media(max-width:1180px){.visual-book-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ai-image-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:900px){.visual-ai-hero,.visual-project-head{align-items:flex-start;flex-direction:column}.visual-workspace-grid,.illustration-layout{grid-template-columns:1fr}.visual-preview-panel{order:-1}.active-cover-frame{max-width:310px}.illustration-guide-panel{order:-1}.visual-project-tabs{width:100%}.visual-project-tabs a{flex:1;text-align:center}.ai-image-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.visual-ai-hero,.visual-project-head{padding:19px}.visual-ai-hero h2,.visual-project-head h2{font-size:21px}.visual-book-grid{grid-template-columns:1fr}.visual-form-panel,.visual-preview-panel,.illustration-guide-panel,.visual-gallery-panel{padding:16px}.visual-form-row{grid-template-columns:1fr}.ai-image-grid{grid-template-columns:1fr 1fr}.visual-book-actions{flex-direction:column}.visual-panel-title{align-items:flex-start}.visual-panel-title>strong{display:none}}
@media(max-width:420px){.ai-image-grid{grid-template-columns:1fr}}

/* =========================================================
   PAGE BUDGET CONTROL — target halaman mengendalikan isi
   ========================================================= */
.page-budget-preview{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:18px 0;padding:14px;border:1px solid #e4e1ff;background:linear-gradient(135deg,#faf9ff,#fff);border-radius:16px}.page-budget-preview>div{display:grid;gap:3px;padding:12px;border:1px solid #ecebf5;background:#fff;border-radius:12px}.page-budget-preview span{font-size:11px;color:#7d8495;font-weight:700}.page-budget-preview strong{font-size:18px;color:#171b2d}.page-budget-preview small{font-size:10px;color:#9298a8}.page-budget-preview.compact{margin:12px 0 22px}.form-field.is-auto-budget input{background:#f2f1ff;color:#5c54cc;border-color:#dedaff}.form-field.is-auto-budget .field-hint:after{content:" · dihitung otomatis";color:#6254e8;font-weight:700}
.page-budget-overview{grid-template-columns:repeat(6,minmax(0,1fr))}.page-budget-panel{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:17px 20px;margin-bottom:14px;border:1px solid #e1e4ec;border-radius:17px;background:#fff;box-shadow:var(--shadow-sm)}.page-budget-panel-copy{max-width:650px}.page-budget-panel-copy h3{margin:3px 0 5px;font-size:16px}.page-budget-panel-copy p{margin:0;color:#697185;font-size:12px;line-height:1.6}.page-budget-meter{min-width:330px}.page-budget-meter>div{height:10px;border-radius:999px;background:#eceef4;overflow:hidden}.page-budget-meter>div>span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#6756ed,#9a70ff);transition:width .25s}.page-budget-meter small{display:block;text-align:right;margin-top:7px;color:#7f8799;font-size:10px}.page-budget-panel.budget-over{border-color:#fed4d2;background:#fffafa}.page-budget-panel.budget-over .page-budget-meter>div>span{background:linear-gradient(90deg,#e5484d,#ff8d78)}.page-budget-panel.budget-under{border-color:#f7dfa7;background:#fffdf8}.page-budget-panel.budget-under .page-budget-meter>div>span{background:linear-gradient(90deg,#d99a18,#ffc45b)}.page-budget-panel.budget-on_target{border-color:#aee9cf;background:#f8fffb}.page-budget-panel.budget-on_target .page-budget-meter>div>span{background:linear-gradient(90deg,#19a974,#5bd6a6)}
.document-page textarea,.document-preview-content{line-height:var(--book-line-spacing,1.35)}
.fit-book-modal{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:24px}.fit-book-modal[hidden]{display:none}.fit-book-dialog{position:relative;z-index:2;width:min(720px,96vw);max-height:90vh;overflow:auto;background:#fff;border-radius:22px;box-shadow:0 28px 80px rgba(20,23,48,.24);padding:22px}.fit-book-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:18px 0}.fit-book-summary>div{display:grid;gap:4px;padding:14px;border:1px solid #e7e8ef;border-radius:12px;background:#fafbfe}.fit-book-summary span{font-size:10px;color:#80889a}.fit-book-summary strong{font-size:15px}.fit-book-progress{height:11px;border-radius:999px;background:#eceef4;overflow:hidden}.fit-book-progress span{display:block;height:100%;width:0;background:linear-gradient(90deg,#6553eb,#9c73ff);transition:width .25s}.fit-book-log{min-height:72px;margin:13px 0;padding:13px;border-radius:12px;background:#f7f6ff;color:#4f5770;font-size:12px;line-height:1.6}.fit-book-open{overflow:hidden}
@media(max-width:1380px){.page-budget-overview{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:900px){.page-budget-preview{grid-template-columns:repeat(2,minmax(0,1fr))}.page-budget-panel{align-items:stretch;flex-direction:column}.page-budget-meter{min-width:0}.page-budget-overview{grid-template-columns:repeat(2,minmax(0,1fr))}.fit-book-summary{grid-template-columns:1fr}}
@media(max-width:560px){.page-budget-preview,.page-budget-overview{grid-template-columns:1fr}}

/* =========================================================
   Dynamic Editor Header Actions
   ========================================================= */
.editor-project-header{
    align-items:flex-start;
}
.editor-project-identity{
    flex:1 1 360px;
    max-width:min(680px,52vw);
}
.editor-project-identity>div:last-child{
    min-width:0;
}
.editor-project-actions{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    flex:0 1 auto;
    min-width:0;
    gap:8px;
}
.editor-project-actions>.btn,
.editor-project-actions>form>.btn,
.editor-more-trigger{
    min-height:42px;
    padding-inline:14px;
    white-space:nowrap;
}
.editor-target-chip{
    min-width:82px;
    min-height:42px;
    display:grid;
    grid-template-columns:auto auto;
    grid-template-rows:auto auto;
    align-content:center;
    column-gap:5px;
    padding:6px 11px;
    border:1px solid #dedaff;
    border-radius:12px;
    background:linear-gradient(135deg,#f6f4ff,#fff);
}
.editor-target-chip span{
    grid-column:1/-1;
    color:#7d8495;
    font-size:8px;
    font-weight:800;
    letter-spacing:.08em;
    line-height:1;
    text-transform:uppercase;
}
.editor-target-chip strong{
    color:#5144d6;
    font-size:15px;
    line-height:1.15;
}
.editor-target-chip small{
    align-self:end;
    padding-bottom:1px;
    color:#8f96a6;
    font-size:8px;
}
.editor-primary-action,
.editor-primary-action .btn{
    flex:0 0 auto;
}
.editor-more-menu{
    position:relative;
    flex:0 0 auto;
}
.editor-more-dropdown{
    position:absolute;
    z-index:130;
    top:calc(100% + 9px);
    right:0;
    width:248px;
    padding:8px;
    border:1px solid #e1e4ec;
    border-radius:14px;
    background:#fff;
    box-shadow:0 18px 44px rgba(16,24,40,.16);
    opacity:0;
    visibility:hidden;
    transform:translateY(-7px) scale(.985);
    transform-origin:top right;
    transition:opacity .16s ease,transform .16s ease,visibility .16s;
}
.editor-more-menu.open .editor-more-dropdown{
    opacity:1;
    visibility:visible;
    transform:none;
}
.editor-more-menu.open .editor-more-trigger{
    color:var(--v2-primary);
    border-color:#d8d3ff;
    background:#f4f2ff;
}
.editor-more-heading{
    padding:7px 9px 5px;
    color:#9aa1b1;
    font-size:8px;
    font-weight:850;
    letter-spacing:.1em;
    text-transform:uppercase;
}
.editor-more-dropdown>a,
.editor-more-dropdown form>button{
    width:100%;
    min-height:39px;
    display:grid;
    grid-template-columns:25px minmax(0,1fr) auto;
    align-items:center;
    gap:7px;
    padding:8px 9px;
    border:0;
    border-radius:9px;
    color:#4f586b;
    background:transparent;
    font:inherit;
    text-align:left;
    cursor:pointer;
}
.editor-more-dropdown>a:hover,
.editor-more-dropdown form>button:hover{
    color:#4f43cf;
    background:#f5f3ff;
}
.editor-more-dropdown>a>span,
.editor-more-dropdown form>button>span{
    width:25px;
    height:25px;
    display:grid;
    place-items:center;
    border-radius:7px;
    color:#6254e8;
    background:#f0eeff;
    font-size:11px;
}
.editor-more-dropdown b{
    overflow:hidden;
    font-size:10px;
    font-weight:750;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.editor-more-dropdown form{
    margin:0;
}
.editor-more-dropdown .button-loader{
    width:13px;
    height:13px;
}
.editor-more-divider{
    height:1px;
    margin:6px 5px;
    background:#eceef3;
}
.editor-more-dropdown .export-pdf{color:#b73c36}
.editor-more-dropdown .export-word{color:#3559b7}

@media(max-width:1280px){
    .editor-project-identity{max-width:48vw}
    .editor-project-actions>.editor-target-chip{display:none}
    .editor-project-actions>.btn,
    .editor-project-actions>form>.btn,
    .editor-more-trigger{padding-inline:12px}
}
@media(max-width:1050px){
    .editor-project-header{align-items:stretch;flex-direction:column}
    .editor-project-identity{max-width:none;width:100%}
    .editor-project-actions{width:100%;justify-content:flex-start;flex-wrap:wrap}
    .editor-project-actions>.editor-target-chip{display:grid;margin-right:auto}
}
@media(max-width:650px){
    .editor-project-actions{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:8px;
    }
    .editor-project-actions>.editor-target-chip{
        width:100%;
        grid-column:1/-1;
        margin:0;
    }
    .editor-project-actions>.editor-fit-action,
    .editor-project-actions>.editor-primary-action,
    .editor-project-actions>.editor-more-menu{
        width:100%;
    }
    .editor-project-actions>.editor-primary-action{
        grid-column:1/-1;
        order:1;
    }
    .editor-project-actions>.editor-fit-action{order:2}
    .editor-project-actions>.editor-more-menu{order:3}
    .editor-project-actions .btn,
    .editor-project-actions form .btn,
    .editor-more-trigger{
        width:100%;
        justify-content:center;
    }
    .editor-more-dropdown{
        position:fixed;
        z-index:280;
        left:12px;
        right:12px;
        top:auto;
        bottom:12px;
        width:auto;
        max-height:min(72vh,520px);
        overflow:auto;
        transform:translateY(18px);
        transform-origin:bottom center;
    }
    .editor-more-menu.open:before{
        content:"";
        position:fixed;
        z-index:270;
        inset:0;
        background:rgba(15,20,38,.48);
        backdrop-filter:blur(3px);
    }
}


/* Library destructive action */
.book-card-actions .book-delete-form {
    margin-left: auto;
}
.book-card-actions .book-delete-button {
    color: #b42318;
    background: #fff2f0;
    border: 1px solid #ffd5cf;
}
.book-card-actions .book-delete-button:hover {
    color: #8f1d14;
    background: #ffe5e1;
    border-color: #ffb8ae;
}
.book-card-actions .book-delete-button:disabled {
    opacity: .65;
    cursor: wait;
}
.library-grid-v2[data-view="list"] .book-card-actions .book-delete-form {
    width: 100%;
    margin: 0;
}
@media (max-width: 820px) {
    .book-card-actions .book-delete-form {
        margin-left: 0;
    }
}

/* ---------- Medium typography for Book Settings ---------- */
/* Scoped to .settings-layout so other pages keep their existing scale. */
.settings-layout .form-section-head p {
    font-size: 11px;
    line-height: 1.55;
}

.settings-layout .field-group-title span {
    font-size: 13px;
    line-height: 1.4;
}

.settings-layout .field-group-title small {
    font-size: 10.5px;
    line-height: 1.45;
}

.settings-layout .field-label,
.settings-layout .form-grid > label:not(.form-field) {
    font-size: 12px;
    line-height: 1.4;
}

.settings-layout .form-field input,
.settings-layout .form-field select,
.settings-layout .form-field textarea,
.settings-layout .form-grid > label input,
.settings-layout .form-grid > label select,
.settings-layout .form-grid > label textarea {
    font-size: 13px;
}

.settings-layout .form-field input,
.settings-layout .form-field select,
.settings-layout .form-grid > label input,
.settings-layout .form-grid > label select {
    height: 47px;
    padding-right: 14px;
    padding-left: 14px;
}

.settings-layout .form-field textarea,
.settings-layout .form-grid > label textarea {
    min-height: 112px;
    padding: 13px 14px;
    line-height: 1.65;
}

.settings-layout .field-hint {
    margin-top: 7px;
    font-size: 10.5px;
    line-height: 1.55;
}

.settings-layout .input-suffix > span {
    font-size: 10.5px;
}

.settings-layout .settings-summary > .pill {
    font-size: 10.5px;
    padding: 6px 10px;
}

.settings-layout .settings-summary h2 {
    font-size: 20px;
    line-height: 1.3;
}

.settings-layout .settings-summary > p {
    font-size: 11px;
    line-height: 1.6;
}

.settings-layout .summary-list > div {
    padding: 10px 0;
}

.settings-layout .summary-list span {
    font-size: 10.5px;
    line-height: 1.45;
}

.settings-layout .summary-list strong {
    font-size: 10.5px;
    line-height: 1.45;
}

.settings-layout .btn {
    font-size: 12px;
}

.settings-layout .page-budget-preview span {
    font-size: 11.5px;
}

.settings-layout .page-budget-preview strong {
    font-size: 19px;
}

.settings-layout .page-budget-preview small {
    font-size: 10.5px;
}

@media (max-width: 640px) {
    .settings-layout .field-group-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .settings-layout .field-group-title small {
        max-width: 100%;
    }
}


/* ===== Visual AI card actions: compact, dynamic & responsive ===== */
.ai-image-card{position:relative;isolation:isolate}.ai-image-card:hover .ai-image-media img{transform:scale(1.018)}.ai-image-media img{transition:transform .25s ease}.ai-image-card.selected .ai-image-info{background:linear-gradient(180deg,#fff 0%,#fbfaff 100%)}
.ai-image-actionbar{min-height:52px;display:flex;align-items:center;justify-content:space-between;gap:9px;border-top:1px solid #edf0f4;padding:9px 10px;background:#fff;position:relative;z-index:4}.ai-image-primary-action{min-width:0;flex:1}.ai-image-primary-action form{margin:0}.ai-image-quick-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.media-primary-button,.media-status-button,.media-download-button{min-height:34px;border-radius:9px;padding:8px 11px;display:inline-flex;align-items:center;justify-content:center;gap:6px;font-size:9.5px;font-weight:800;line-height:1;border:1px solid transparent;white-space:nowrap;text-decoration:none;transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease}.media-primary-button{width:100%;cursor:pointer;color:#fff;background:linear-gradient(135deg,#7162f4,#5c4ee3);box-shadow:0 7px 15px rgba(89,73,218,.16)}.media-primary-button:hover{transform:translateY(-1px);box-shadow:0 9px 20px rgba(89,73,218,.22)}.media-status-button.is-active{width:100%;color:#5648cc;background:#f0edff;border-color:#dfd9ff}.media-status-button.is-active>span{width:16px;height:16px;border-radius:50%;display:grid;place-items:center;background:#6757e9;color:#fff;font-size:8px}.media-download-button{flex:1;color:#5d51d8;background:#f5f3ff;border-color:#e7e2ff}.media-download-button:hover{background:#ece8ff;border-color:#d9d1ff}.media-icon-button,.media-more-menu>summary{width:34px;height:34px;border:1px solid #e5e7ef;border-radius:9px;display:grid;place-items:center;color:#646b7b;background:#fff;font-size:13px;font-weight:900;cursor:pointer;text-decoration:none;transition:.16s ease}.media-icon-button:hover,.media-more-menu>summary:hover{border-color:#d8d2ff;color:#5d50dc;background:#f8f7ff;transform:translateY(-1px)}
.media-more-menu{position:relative}.media-more-menu>summary{list-style:none;letter-spacing:1px}.media-more-menu>summary::-webkit-details-marker{display:none}.media-more-menu[open]>summary{background:#efecff;border-color:#d8d1ff;color:#584bd5}.media-more-popover{position:absolute;right:0;bottom:42px;z-index:30;width:168px;padding:6px;border:1px solid #e4e5ed;border-radius:12px;background:#fff;box-shadow:0 16px 38px rgba(30,33,62,.16);animation:mediaMenuIn .14s ease}.media-more-popover:after{content:"";position:absolute;right:12px;bottom:-5px;width:9px;height:9px;background:#fff;border-right:1px solid #e4e5ed;border-bottom:1px solid #e4e5ed;transform:rotate(45deg)}.media-more-popover a,.media-more-popover button{width:100%;min-height:34px;padding:8px 9px;border:0;border-radius:8px;background:transparent;color:#4e5668;display:flex;align-items:center;gap:8px;text-align:left;font:inherit;font-size:9.5px;font-weight:750;text-decoration:none;cursor:pointer}.media-more-popover a:hover,.media-more-popover button:hover{background:#f5f4fb;color:#584bd5}.media-more-popover form{margin:0}.media-more-popover button.danger{color:#b74848}.media-more-popover button.danger:hover{background:#fff2f2;color:#bd3535}.media-more-popover a>span:first-child,.media-more-popover button>span:first-child{width:18px;height:18px;display:grid;place-items:center;border-radius:6px;background:#f2f1f8;font-size:10px;flex:none}@keyframes mediaMenuIn{from{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
.illustration-actionbar .media-more-menu{margin-left:auto}.cover-actionbar .media-icon-button{display:grid}
@media(max-width:760px){.ai-image-actionbar{padding:9px}.media-more-popover{position:fixed;left:12px;right:12px;bottom:18px;width:auto;border-radius:16px;padding:9px;box-shadow:0 18px 52px rgba(27,30,57,.24)}.media-more-popover:after{display:none}.media-more-popover a,.media-more-popover button{min-height:42px;font-size:11px}.cover-actionbar .media-icon-button{display:none}}
@media(max-width:420px){.ai-image-actionbar{gap:7px}.media-primary-button,.media-status-button,.media-download-button{font-size:9px;padding:8px 9px}.media-more-menu>summary{width:33px;height:33px}.ai-image-grid{grid-template-columns:1fr}}

/* =========================================================
   EDITOR PAPER — DYNAMIC ROUNDED SHEET
   Rounded manuscript surface without changing book layout.
   ========================================================= */
.book-editor-v2 .document-canvas-wrap {
    padding: clamp(16px, 2.2vw, 30px);
    background:
        radial-gradient(circle at 12% 8%, rgba(109, 76, 246, .06), transparent 30%),
        linear-gradient(180deg, #f4f5f9 0%, #eef0f5 100%);
}

.book-editor-v2 .document-page {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(218, 221, 231, .95);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,1)),
        #fff;
    box-shadow:
        0 2px 4px rgba(16, 24, 40, .03),
        0 18px 48px rgba(24, 32, 56, .10),
        0 0 0 1px rgba(255,255,255,.8) inset;
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

.book-editor-v2 .document-page::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
        linear-gradient(90deg, rgba(99, 77, 232, .025), transparent 8%, transparent 92%, rgba(99, 77, 232, .025)),
        linear-gradient(180deg, rgba(255,255,255,.55), transparent 18%);
}

.book-editor-v2 .document-page::after {
    content: "";
    position: absolute;
    z-index: -2;
    left: 18px;
    right: 18px;
    bottom: -11px;
    height: 24px;
    border-radius: 0 0 20px 20px;
    background: rgba(255,255,255,.72);
    box-shadow: 0 12px 28px rgba(24,32,56,.12);
}

.book-editor-v2 .document-page:focus-within {
    border-color: rgba(99, 77, 232, .35);
    box-shadow:
        0 2px 4px rgba(16, 24, 40, .03),
        0 20px 54px rgba(63, 52, 145, .14),
        0 0 0 4px rgba(99, 77, 232, .055);
}

.book-editor-v2 .document-page textarea,
.book-editor-v2 .document-preview-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 104, 118, .58) transparent;
}

.book-editor-v2 .document-page textarea::-webkit-scrollbar,
.book-editor-v2 .document-preview-content::-webkit-scrollbar {
    width: 8px;
}

.book-editor-v2 .document-page textarea::-webkit-scrollbar-track,
.book-editor-v2 .document-preview-content::-webkit-scrollbar-track {
    background: transparent;
    margin-block: 12px;
}

.book-editor-v2 .document-page textarea::-webkit-scrollbar-thumb,
.book-editor-v2 .document-preview-content::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(99, 102, 112, .56);
    background-clip: padding-box;
}

.book-editor-v2 .document-preview-page article {
    border-radius: 14px;
}

@media (max-width: 768px) {
    .book-editor-v2 .document-canvas-wrap {
        padding: 12px;
    }

    .book-editor-v2 .document-page {
        border-radius: 16px;
        box-shadow: 0 12px 32px rgba(24, 32, 56, .10);
    }

    .book-editor-v2 .document-page::after {
        left: 12px;
        right: 12px;
        bottom: -8px;
    }
}

/* ---------- Assistant Chat: medium typography ---------- */
/* Menyamakan keterbacaan Asisten Penulis dengan UI utama tanpa mengubah fungsi chat. */
.assistant-panel {
    width: min(420px, calc(100vw - 28px));
}
.assistant-launcher-copy strong { font-size: 12px; line-height: 1.25; }
.assistant-launcher-copy small { font-size: 10px; line-height: 1.3; }
.assistant-header strong { font-size: 13px; line-height: 1.3; }
.assistant-header small { font-size: 10.5px; line-height: 1.3; }
.assistant-context { padding: 11px 14px; gap: 4px; }
.assistant-context span { font-size: 9px; line-height: 1.25; }
.assistant-context strong { font-size: 11px; line-height: 1.35; }
.assistant-quick { padding: 10px 11px; gap: 7px; }
.assistant-quick button {
    padding: 8px 11px;
    font-size: 10.5px;
    line-height: 1.25;
}
.assistant-messages { padding: 15px; }
.assistant-welcome { gap: 9px; }
.assistant-welcome > div:last-child { padding: 12px 13px; }
.assistant-welcome strong { font-size: 11.5px; line-height: 1.35; }
.assistant-welcome p { margin-top: 6px; font-size: 11px; line-height: 1.6; }
.assistant-message { margin: 9px 0; }
.assistant-message-bubble {
    padding: 11px 13px;
    font-size: 11.5px;
    line-height: 1.6;
}
.assistant-message small { margin-top: 4px; font-size: 9px; }
.assistant-form { padding: 11px 11px 9px; gap: 8px; }
.assistant-form textarea {
    min-height: 47px;
    max-height: 132px;
    padding: 12px 13px;
    border-radius: 13px;
    font-size: 11.5px;
    line-height: 1.5;
}
.assistant-form button {
    width: 47px;
    height: 47px;
    border-radius: 13px;
    font-size: 17px;
}
.assistant-disclaimer {
    padding: 0 12px 10px;
    font-size: 9px;
    line-height: 1.4;
}

@media (max-width: 520px) {
    .assistant-header strong { font-size: 12.5px; }
    .assistant-context strong { font-size: 10.5px; }
    .assistant-quick button { font-size: 10px; }
    .assistant-welcome strong,
    .assistant-message-bubble { font-size: 11px; }
    .assistant-welcome p,
    .assistant-form textarea { font-size: 10.8px; }
}

/* =========================================================
   Create Wizard — Soft Premium Lighting
   Visual-only enhancement. Keeps wizard behavior/layout intact.
   ========================================================= */
.create-book-v2-page .create-guide-v2 {
    --guide-light-x: 76%;
    --guide-light-y: 12%;
    isolation: isolate;
    border: 1px solid rgba(170, 164, 255, .12);
    background:
        radial-gradient(circle at var(--guide-light-x) var(--guide-light-y), rgba(133, 111, 255, .24) 0%, rgba(112, 91, 239, .10) 18%, transparent 39%),
        radial-gradient(circle at 6% 92%, rgba(76, 134, 255, .12) 0%, transparent 34%),
        linear-gradient(158deg, #20264a 0%, #171c39 48%, #11162f 100%);
    box-shadow:
        0 24px 60px rgba(20, 25, 61, .22),
        0 8px 24px rgba(57, 48, 130, .12),
        inset 0 1px 0 rgba(255, 255, 255, .055);
    transition: box-shadow .35s ease, border-color .35s ease, background .2s linear;
}

.create-book-v2-page .create-guide-v2::after {
    width: 230px;
    height: 230px;
    right: -108px;
    top: -102px;
    border-radius: 50%;
    background: rgba(139, 120, 255, .07);
    box-shadow:
        0 0 0 34px rgba(130, 110, 255, .035),
        0 0 72px rgba(115, 96, 245, .10);
    pointer-events: none;
}

.create-book-v2-page .create-guide-v2:hover {
    border-color: rgba(174, 164, 255, .18);
    box-shadow:
        0 28px 68px rgba(20, 25, 61, .26),
        0 10px 30px rgba(65, 52, 153, .15),
        inset 0 1px 0 rgba(255, 255, 255, .07);
}

.create-book-v2-page .create-guide-v2 > * {
    position: relative;
    z-index: 2;
}

.create-book-v2-page .guide-badge {
    border-color: rgba(185, 175, 255, .20);
    background: linear-gradient(135deg, rgba(126, 106, 255, .14), rgba(255, 255, 255, .035));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 6px 18px rgba(53, 44, 126, .10);
    backdrop-filter: blur(8px);
}

.create-book-v2-page .wizard-step-list .step {
    overflow: hidden;
    border: 1px solid transparent;
    transform: translateZ(0);
    transition:
        transform .24s ease,
        background .24s ease,
        border-color .24s ease,
        box-shadow .24s ease,
        color .24s ease,
        opacity .24s ease;
}

.create-book-v2-page .wizard-step-list .step:not(:disabled):hover {
    transform: translateX(3px);
    border-color: rgba(180, 170, 255, .10);
    background: rgba(255, 255, 255, .055);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.create-book-v2-page .wizard-step-list .step.active {
    border-color: rgba(151, 136, 255, .18);
    background:
        linear-gradient(110deg, rgba(118, 96, 245, .28), rgba(91, 74, 189, .18));
    box-shadow:
        0 10px 28px rgba(69, 54, 172, .15),
        inset 0 1px 0 rgba(255, 255, 255, .06);
}

.create-book-v2-page .wizard-step-list .step.active > span {
    box-shadow:
        0 7px 18px rgba(98, 76, 228, .32),
        inset 0 1px 0 rgba(255, 255, 255, .16);
}

.create-book-v2-page .wizard-step-list .step.complete {
    color: #eefaf4;
}

.create-book-v2-page .wizard-step-list .step.complete > span {
    background: linear-gradient(145deg, #19bd76, #0ca862);
    box-shadow: 0 7px 18px rgba(13, 168, 98, .20);
}

.create-book-v2-page .guide-progress-card {
    border-color: rgba(190, 183, 255, .13);
    background: linear-gradient(135deg, rgba(255,255,255,.065), rgba(255,255,255,.028));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 10px 24px rgba(8, 12, 38, .07);
    backdrop-filter: blur(9px);
}

.create-book-v2-page .guide-progress-track {
    position: relative;
    height: 6px;
    background: rgba(255,255,255,.105);
    box-shadow: inset 0 1px 2px rgba(4, 6, 24, .18);
}

.create-book-v2-page .guide-progress-track > span {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #7668f5 0%, #9d8cff 55%, #c1b6ff 100%);
    box-shadow: 0 0 16px rgba(143, 124, 255, .30);
}

.create-book-v2-page .guide-progress-track > span::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 -38%;
    width: 34%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
    transform: skewX(-18deg);
    animation: guideSoftShine 3.2s ease-in-out infinite;
}

@keyframes guideSoftShine {
    0%, 22% { left: -38%; opacity: 0; }
    34% { opacity: .72; }
    66% { left: 112%; opacity: .42; }
    100% { left: 112%; opacity: 0; }
}

.create-book-v2-page .guide-tip {
    border-color: rgba(192, 185, 255, .11);
    background:
        radial-gradient(circle at 12% 15%, rgba(255, 205, 100, .08), transparent 32%),
        linear-gradient(135deg, rgba(255,255,255,.048), rgba(255,255,255,.022));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 12px 26px rgba(9, 13, 39, .08);
    transition: transform .24s ease, border-color .24s ease, background .24s ease;
}

.create-book-v2-page .guide-tip:hover {
    transform: translateY(-2px);
    border-color: rgba(204, 196, 255, .17);
    background:
        radial-gradient(circle at 12% 15%, rgba(255, 205, 100, .11), transparent 34%),
        linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.026));
}

.create-book-v2-page .guide-tip > span {
    filter: drop-shadow(0 0 8px rgba(255, 205, 95, .18));
}

@media (prefers-reduced-motion: reduce) {
    .create-book-v2-page .wizard-step-list .step,
    .create-book-v2-page .guide-tip,
    .create-book-v2-page .create-guide-v2 {
        transition: none !important;
    }
    .create-book-v2-page .guide-progress-track > span::after {
        animation: none !important;
        display: none;
    }
}

/* =========================================================
   Create Wizard — Soft Premium Dark Glass Fix
   Prevent native <button> background from turning completed steps white.
   ========================================================= */
.create-book-v2-page .wizard-step-list .step {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    background: rgba(255, 255, 255, .025);
    box-shadow: none;
}

.create-book-v2-page .wizard-step-list .step.complete {
    color: #f0f4ff;
    border-color: rgba(120, 196, 165, .14);
    background:
        radial-gradient(circle at 12% 50%, rgba(27, 190, 119, .10) 0%, transparent 34%),
        linear-gradient(110deg, rgba(54, 57, 119, .58), rgba(28, 34, 75, .50));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .045),
        0 8px 22px rgba(7, 11, 38, .10);
}

.create-book-v2-page .wizard-step-list .step.complete:not(:disabled):hover {
    border-color: rgba(123, 206, 171, .20);
    background:
        radial-gradient(circle at 12% 50%, rgba(31, 199, 127, .13) 0%, transparent 36%),
        linear-gradient(110deg, rgba(62, 64, 134, .66), rgba(31, 38, 84, .58));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .055),
        0 10px 26px rgba(7, 11, 38, .13);
}

.create-book-v2-page .wizard-step-list .step:disabled {
    background: rgba(255, 255, 255, .035);
}

.create-book-v2-page .wizard-step-list .step.active {
    background:
        radial-gradient(circle at 14% 50%, rgba(143, 121, 255, .17) 0%, transparent 38%),
        linear-gradient(110deg, rgba(118, 96, 245, .30), rgba(75, 64, 166, .23));
}

/* PRELIMS Importer */
.structure-footer-actions.has-prelims-import .import-prelims-action{grid-column:1/-1;background:linear-gradient(135deg,#f6f4ff,#fff);color:#6354df;border-color:#dcd6ff}.structure-footer-actions.has-prelims-import .import-prelims-action:hover{background:#eeeaff;border-color:#bdb3ff}.prelims-import-shell{display:grid;gap:18px}.prelims-import-hero{border:1px solid var(--line);border-radius:22px;padding:24px 26px;background:linear-gradient(125deg,#fff 0%,#fbfaff 70%,#f1efff 100%);box-shadow:var(--shadow-sm);display:flex;align-items:center;justify-content:space-between;gap:24px}.prelims-import-hero h2{font-size:25px;line-height:1.18;margin:5px 0 7px}.prelims-import-hero p{max-width:780px;margin:0;color:var(--muted);font-size:12px;line-height:1.65}.prelims-book-chip{min-width:230px;display:flex;align-items:center;gap:11px;padding:11px 13px;border:1px solid #e4e0ff;border-radius:14px;background:rgba(255,255,255,.78);box-shadow:0 8px 24px rgba(54,44,130,.06)}.prelims-book-chip>span{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;color:#fff;font-weight:900;background:linear-gradient(145deg,#5748cf,#7566f2)}.prelims-book-chip div{min-width:0;display:grid;gap:3px}.prelims-book-chip small{font-size:8px;letter-spacing:.13em;color:#9991ba;font-weight:800}.prelims-book-chip strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:200px}.prelims-import-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(300px,.7fr);gap:16px}.prelims-source-panel,.prelims-map-guide,.prelims-preview-panel{border-radius:20px;padding:22px}.prelims-source-form{display:grid;gap:15px}.prelims-dropzone{min-height:205px;border:1.5px dashed #cfc9f5;border-radius:17px;background:linear-gradient(145deg,#fbfaff,#f7f6ff);display:grid;place-items:center;align-content:center;text-align:center;padding:24px;cursor:pointer;transition:.2s;position:relative;overflow:hidden}.prelims-dropzone:hover,.prelims-dropzone.dragover{border-color:#7767ed;background:#f2efff;box-shadow:0 12px 30px rgba(91,75,211,.09)}.prelims-dropzone input{position:absolute;inset:0;opacity:0;cursor:pointer}.prelims-drop-icon{width:48px;height:48px;border-radius:15px;display:grid;place-items:center;color:#fff;background:linear-gradient(145deg,#7463f1,#5e4be0);box-shadow:0 10px 25px rgba(92,75,218,.23);font-size:20px;margin-bottom:9px}.prelims-dropzone strong{font-size:14px;color:#252b3c}.prelims-dropzone p{font-size:11px;color:#858ca0;margin:5px 0}.prelims-dropzone small{font-size:9px;color:#9da3b1}.prelims-dropzone b{font-size:10px;color:#6558dc;margin-top:11px;max-width:90%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.prelims-or{display:flex;align-items:center;gap:12px;color:#a1a6b2;font-size:8px;font-weight:900;letter-spacing:.16em}.prelims-or:before,.prelims-or:after{content:"";height:1px;flex:1;background:#e9eaf0}.prelims-paste-field{display:grid;gap:7px;font-size:11px;font-weight:800;color:#42495b}.prelims-paste-field span small{font-weight:500;color:#9aa0ad}.prelims-paste-field textarea{width:100%;border:1px solid #dfe2ea;border-radius:13px;padding:13px 14px;background:#fbfcfe;outline:none;font:inherit;font-size:12px;line-height:1.55;resize:vertical}.prelims-paste-field textarea:focus{background:#fff;border-color:#8175f5;box-shadow:0 0 0 3px #f0edff}.prelims-error{padding:10px 12px;border:1px solid #ffd3d3;background:#fff5f5;color:#b83535;border-radius:10px;font-size:10px;font-weight:700}.prelims-safety-note{display:flex;gap:9px;align-items:flex-start;padding:12px;border-radius:12px;background:#f4fbf7;border:1px solid #d9f0e2}.prelims-safety-note>span{width:25px;height:25px;border-radius:8px;display:grid;place-items:center;background:#dff6e8;color:#0b8a4b;font-weight:900;flex:none}.prelims-safety-note p{margin:1px 0 0;color:#5d7065;font-size:10px;line-height:1.55}.prelims-preview-btn{min-height:46px}.prelims-map-guide{align-self:start;background:linear-gradient(145deg,#1c2146,#282c57);border:0;color:#fff}.prelims-map-guide .eyebrow{color:#aaa5ff}.prelims-map-guide h3{font-size:19px;margin:7px 0 8px}.prelims-map-guide>p{color:#b9bfd1;font-size:11px;line-height:1.65;margin:0}.prelims-destination-list{display:grid;gap:8px;margin:18px 0}.prelims-destination-list>div{display:grid;grid-template-columns:31px 1fr auto;align-items:center;gap:9px;padding:10px;border:1px solid rgba(255,255,255,.1);border-radius:11px;background:rgba(255,255,255,.045)}.prelims-destination-list>div>span{width:31px;height:31px;border-radius:9px;background:rgba(126,106,255,.18);color:#c0b8ff;display:grid;place-items:center;font-size:9px;font-weight:900}.prelims-destination-list strong{display:block;font-size:10px}.prelims-destination-list small{display:block;font-size:8px;color:#aeb5c8;margin-top:2px}.prelims-destination-list b{font-size:8px;padding:5px 7px;border-radius:999px;background:rgba(73,205,137,.13);color:#75dca5}.prelims-destination-list b.has-content{background:rgba(250,187,70,.12);color:#f5c66f}.prelims-toc-note{padding:12px;border-radius:11px;background:rgba(255,255,255,.055)}.prelims-toc-note strong{font-size:10px}.prelims-toc-note p{font-size:9px;line-height:1.55;color:#afb6c9;margin:5px 0 0}.prelims-preview-panel{scroll-margin-top:20px}.prelims-preview-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;padding-bottom:17px;border-bottom:1px solid var(--line)}.prelims-preview-head h3{font-size:20px;margin:4px 0}.prelims-preview-head p{font-size:10px;color:#7d8494;margin:0}.prelims-confirm-form{display:grid;gap:15px}.prelims-segment-list{display:grid;gap:10px;margin-top:16px}.prelims-segment-card{display:grid;grid-template-columns:42px 1fr;gap:12px;padding:14px;border:1px solid #e3e5ec;border-radius:15px;background:#fff;transition:.18s}.prelims-segment-card:hover{border-color:#d3cefa;box-shadow:0 9px 25px rgba(49,44,100,.055)}.prelims-segment-number{width:42px;height:42px;border-radius:12px;background:#f0edff;color:#6454df;display:grid;place-items:center;font-size:10px;font-weight:900}.prelims-segment-main{min-width:0}.prelims-segment-title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.prelims-segment-title small{font-size:7.5px;letter-spacing:.13em;color:#a099bd;font-weight:900}.prelims-segment-title h4{font-size:13px;margin:3px 0 0}.prelims-segment-title>span{font-size:9px;padding:5px 7px;border-radius:999px;background:#f4f5f8;color:#788092;white-space:nowrap}.prelims-mapping-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}.prelims-mapping-row label{display:grid;gap:5px}.prelims-mapping-row label>span{font-size:9px;color:#6f7687;font-weight:800}.prelims-mapping-row select{width:100%;height:39px;border:1px solid #dfe2ea;border-radius:10px;background:#fbfcfe;padding:0 10px;font:inherit;font-size:10px;color:#303748;outline:none}.prelims-mapping-row select:focus{border-color:#8175f5;box-shadow:0 0 0 3px #f0edff}.prelims-detect-warning,.prelims-existing-warning{margin-top:9px;padding:8px 10px;border-radius:9px;font-size:9px;line-height:1.5}.prelims-detect-warning{background:#fff8e9;color:#8b671b}.prelims-existing-warning{background:#f7f6ff;color:#685bc9}.prelims-text-preview{margin-top:9px;border:1px solid #ececf2;border-radius:10px;overflow:hidden}.prelims-text-preview summary{padding:9px 11px;background:#fafbfc;color:#646b7c;font-size:9px;font-weight:800;cursor:pointer}.prelims-text-preview>div{padding:12px;white-space:pre-wrap;color:#3e4555;font-size:10.5px;line-height:1.65;max-height:260px;overflow:auto}.prelims-confirm-bar{position:sticky;bottom:10px;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 14px;border:1px solid #dfdcf6;border-radius:14px;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);box-shadow:0 14px 35px rgba(40,34,96,.12)}.prelims-confirm-bar div{display:grid;gap:2px}.prelims-confirm-bar strong{font-size:11px}.prelims-confirm-bar small{font-size:9px;color:#858c9b}@media(max-width:980px){.prelims-import-grid{grid-template-columns:1fr}.prelims-map-guide{order:-1}.prelims-import-hero{align-items:flex-start}.prelims-book-chip{min-width:210px}}@media(max-width:680px){.prelims-import-hero{padding:18px;display:grid}.prelims-import-hero h2{font-size:21px}.prelims-book-chip{width:100%}.prelims-source-panel,.prelims-map-guide,.prelims-preview-panel{padding:16px}.prelims-mapping-row{grid-template-columns:1fr}.prelims-segment-card{grid-template-columns:1fr}.prelims-segment-number{width:34px;height:34px}.prelims-preview-head,.prelims-confirm-bar{align-items:stretch;display:grid}.prelims-confirm-bar .btn{width:100%}}

/* Outline Importer + sequential OpenAI content generation */
.structure-footer-actions.has-prelims-import .import-outline-action{grid-column:1/-1;background:linear-gradient(135deg,#f7f9ff,#f3f0ff);color:#4f55c7;border-color:#d8d9f6}.structure-footer-actions.has-prelims-import .import-outline-action:hover{background:#ececff;border-color:#bbbaf1}.empty-small-action{display:inline-flex;align-items:center;justify-content:center;margin-top:8px;padding:7px 10px;border-radius:9px;border:1px solid #ddd9ff;background:#f5f3ff;color:#6255d7;font-size:9px;font-weight:850;text-decoration:none}.editor-more-dropdown>button[data-outline-content-open]{width:100%;border:0;background:transparent;text-align:left;font:inherit;cursor:pointer}
.outline-import-shell{display:grid;gap:18px}.outline-import-hero{border:1px solid var(--line);border-radius:24px;padding:24px 26px;background:linear-gradient(125deg,#fff 0%,#fbfaff 66%,#f0efff 100%);box-shadow:var(--shadow-sm);display:flex;align-items:center;justify-content:space-between;gap:24px}.outline-import-hero h2{font-size:25px;line-height:1.18;margin:5px 0 7px}.outline-import-hero p{max-width:820px;margin:0;color:var(--muted);font-size:12px;line-height:1.65}.outline-book-chip{min-width:255px;display:flex;align-items:center;gap:11px;padding:12px 14px;border:1px solid #e4e0ff;border-radius:15px;background:rgba(255,255,255,.82);box-shadow:0 8px 24px rgba(54,44,130,.06)}.outline-book-chip>span{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;color:#fff;font-weight:900;background:linear-gradient(145deg,#5748cf,#7566f2)}.outline-book-chip div{min-width:0;display:grid;gap:2px}.outline-book-chip small{font-size:8px;letter-spacing:.13em;color:#9991ba;font-weight:800}.outline-book-chip strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:205px}.outline-book-chip em{font-size:8.5px;color:#8b91a2;font-style:normal}.outline-import-grid{display:grid;grid-template-columns:minmax(0,1.28fr) minmax(310px,.72fr);gap:16px}.outline-source-panel,.outline-format-guide,.outline-preview-panel{border-radius:20px;padding:22px}.outline-source-form{display:grid;gap:15px}.outline-dropzone{min-height:210px;border:1.5px dashed #cfc9f5;border-radius:18px;background:linear-gradient(145deg,#fbfaff,#f7f6ff);display:grid;place-items:center;align-content:center;text-align:center;padding:24px;cursor:pointer;transition:.2s;position:relative;overflow:hidden}.outline-dropzone:hover,.outline-dropzone.dragover{border-color:#7767ed;background:#f2efff;box-shadow:0 12px 30px rgba(91,75,211,.09)}.outline-dropzone input{position:absolute;inset:0;opacity:0;cursor:pointer}.outline-drop-icon{width:50px;height:50px;border-radius:16px;display:grid;place-items:center;color:#fff;background:linear-gradient(145deg,#7463f1,#5e4be0);box-shadow:0 10px 25px rgba(92,75,218,.23);font-size:20px;margin-bottom:9px}.outline-dropzone strong{font-size:14px;color:#252b3c}.outline-dropzone p{font-size:11px;color:#858ca0;margin:5px 0}.outline-dropzone small{font-size:9px;color:#9da3b1}.outline-dropzone b{font-size:10px;color:#6558dc;margin-top:11px;max-width:90%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.outline-or{display:flex;align-items:center;gap:12px;color:#a1a6b2;font-size:8px;font-weight:900;letter-spacing:.16em}.outline-or:before,.outline-or:after{content:"";height:1px;flex:1;background:#e9eaf0}.outline-paste-field{display:grid;gap:7px;font-size:11px;font-weight:800;color:#42495b}.outline-paste-field span small{font-weight:500;color:#9aa0ad}.outline-paste-field textarea{width:100%;border:1px solid #dfe2ea;border-radius:13px;padding:13px 14px;background:#fbfcfe;outline:none;font:inherit;font-size:12px;line-height:1.55;resize:vertical}.outline-paste-field textarea:focus{background:#fff;border-color:#8175f5;box-shadow:0 0 0 3px #f0edff}.outline-error{padding:10px 12px;border:1px solid #ffd3d3;background:#fff5f5;color:#b83535;border-radius:10px;font-size:10px;font-weight:700}.outline-safety-note{display:flex;gap:9px;align-items:flex-start;padding:12px;border-radius:12px;background:#f4fbf7;border:1px solid #d9f0e2}.outline-safety-note>span{width:25px;height:25px;border-radius:8px;display:grid;place-items:center;background:#dff6e8;color:#0b8a4b;font-weight:900;flex:none}.outline-safety-note p{margin:1px 0 0;color:#5d7065;font-size:10px;line-height:1.55}.outline-preview-btn{min-height:46px}.outline-format-guide{align-self:start;background:linear-gradient(145deg,#1c2146,#282c57);border:0;color:#fff}.outline-format-guide .eyebrow{color:#aaa5ff}.outline-format-guide h3{font-size:19px;margin:7px 0 8px}.outline-format-guide>p{color:#b9bfd1;font-size:11px;line-height:1.65;margin:0}.outline-format-list{display:grid;gap:8px;margin:18px 0}.outline-format-list>div{display:grid;grid-template-columns:31px 1fr auto;align-items:center;gap:9px;padding:10px;border:1px solid rgba(255,255,255,.1);border-radius:11px;background:rgba(255,255,255,.045)}.outline-format-list>div>span{width:31px;height:31px;border-radius:9px;background:rgba(126,106,255,.18);color:#c0b8ff;display:grid;place-items:center;font-size:9px;font-weight:900}.outline-format-list strong{display:block;font-size:10px}.outline-format-list small{display:block;font-size:8px;color:#aeb5c8;margin-top:2px}.outline-format-list b{font-size:8px;padding:5px 7px;border-radius:999px;background:rgba(111,96,245,.16);color:#bcb4ff}.outline-ai-note{padding:12px;border-radius:11px;background:rgba(255,255,255,.055)}.outline-ai-note strong{font-size:10px}.outline-ai-note p{font-size:9px;line-height:1.55;color:#afb6c9;margin:5px 0 0}.outline-preview-panel{scroll-margin-top:20px}.outline-preview-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;padding-bottom:17px;border-bottom:1px solid var(--line)}.outline-preview-head h3{font-size:20px;margin:4px 0}.outline-preview-head p{font-size:10px;color:#7d8494;margin:0}.outline-confirm-form{display:grid;gap:15px}.outline-import-mode{display:grid;grid-template-columns:minmax(210px,1fr) repeat(2,minmax(190px,.8fr));gap:10px;align-items:stretch;margin-top:16px}.outline-import-mode>div{display:grid;align-content:center;gap:3px;padding:10px 4px}.outline-import-mode>div strong{font-size:12px}.outline-mode-option{border:1px solid #e1e2eb;border-radius:13px;padding:11px 12px;background:#fbfcfe;display:flex;align-items:center;gap:9px;cursor:pointer;transition:.18s}.outline-mode-option input{accent-color:#6b59e7}.outline-mode-option span{display:grid;gap:2px}.outline-mode-option b{font-size:10px}.outline-mode-option small{font-size:8.5px;color:#8e94a3}.outline-mode-option.selected{border-color:#bdb6ff;background:#f4f2ff;box-shadow:0 0 0 3px rgba(114,96,239,.06)}.outline-mode-option.danger.selected{border-color:#ffc5c5;background:#fff5f5}.outline-existing-warning{padding:10px 12px;border-radius:11px;background:#fff8e9;border:1px solid #f7dfaa;color:#80601e;font-size:10px;line-height:1.55}.outline-node-list{display:grid;gap:10px}.outline-node-card{display:grid;grid-template-columns:42px 1fr;gap:12px;padding:14px;border:1px solid #e3e5ec;border-radius:15px;background:#fff;transition:.18s}.outline-node-card:hover{border-color:#d3cefa;box-shadow:0 9px 25px rgba(49,44,100,.055)}.outline-node-card.level-2{margin-left:24px}.outline-node-card.level-3{margin-left:48px}.outline-node-card.is-skipped{opacity:.48;background:#f7f7f9}.outline-node-number{width:42px;height:42px;border-radius:12px;background:#f0edff;color:#6454df;display:grid;place-items:center;font-size:10px;font-weight:900}.outline-node-main{min-width:0;display:grid;gap:10px}.outline-node-top{display:flex;align-items:end;justify-content:space-between;gap:12px}.outline-node-top label,.outline-title-field,.outline-content-field{display:grid;gap:5px}.outline-node-top label>span,.outline-title-field>span,.outline-content-field>span{font-size:9px;color:#6f7687;font-weight:800}.outline-content-field>span small{font-weight:500;color:#9aa0ad}.outline-node-top select,.outline-title-field input,.outline-content-field textarea{width:100%;border:1px solid #dfe2ea;border-radius:10px;background:#fbfcfe;padding:0 10px;font:inherit;font-size:11px;color:#303748;outline:none}.outline-node-top select{height:38px;min-width:160px}.outline-title-field input{height:41px}.outline-content-field textarea{padding:10px 11px;line-height:1.55;resize:vertical}.outline-node-top select:focus,.outline-title-field input:focus,.outline-content-field textarea:focus{background:#fff;border-color:#8175f5;box-shadow:0 0 0 3px #f0edff}.outline-word-badge{font-size:8.5px;padding:6px 8px;border-radius:999px;background:#f4f5f8;color:#788092;white-space:nowrap}.outline-ai-ready,.outline-content-ready{padding:8px 10px;border-radius:9px;font-size:9px;line-height:1.5}.outline-ai-ready{background:#f4f2ff;color:#6557cf}.outline-content-ready{background:#eef9f3;color:#28744b}.outline-confirm-bar{position:sticky;bottom:10px;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 14px;border:1px solid #dfdcf6;border-radius:14px;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);box-shadow:0 14px 35px rgba(40,34,96,.12)}.outline-confirm-bar div{display:grid;gap:2px}.outline-confirm-bar strong{font-size:11px}.outline-confirm-bar small{font-size:9px;color:#858c9b}.outline-regenerate-option{display:flex;gap:10px;align-items:flex-start;padding:11px 12px;margin-top:12px;border:1px solid #e4e2f5;border-radius:12px;background:#faf9ff;cursor:pointer}.outline-regenerate-option input{margin-top:2px;accent-color:#6556df}.outline-regenerate-option span{display:grid;gap:2px}.outline-regenerate-option b{font-size:10px}.outline-regenerate-option small{font-size:8.5px;color:#8a90a0}
@media(max-width:980px){.outline-import-grid{grid-template-columns:1fr}.outline-format-guide{order:-1}.outline-import-hero{align-items:flex-start}.outline-book-chip{min-width:220px}.outline-import-mode{grid-template-columns:1fr 1fr}.outline-import-mode>div{grid-column:1/-1}.outline-node-card.level-2{margin-left:14px}.outline-node-card.level-3{margin-left:28px}}
@media(max-width:680px){.outline-import-hero{padding:18px;display:grid}.outline-import-hero h2{font-size:21px}.outline-book-chip{width:100%}.outline-source-panel,.outline-format-guide,.outline-preview-panel{padding:16px}.outline-import-mode{grid-template-columns:1fr}.outline-import-mode>div{grid-column:auto}.outline-node-card,.outline-node-card.level-2,.outline-node-card.level-3{grid-template-columns:1fr;margin-left:0}.outline-node-number{width:34px;height:34px}.outline-node-top,.outline-preview-head,.outline-confirm-bar{align-items:stretch;display:grid}.outline-confirm-bar .btn{width:100%}}

/* =========================================================
   MANUSCRIPT EDITOR — TRUE MOBILE RESPONSIVE
   Keeps desktop layout intact; converts editor into a touch-first
   document workspace on tablets/phones.
   ========================================================= */
.editor-panel-backdrop {
    display: none;
}

@media (max-width: 760px) {
    body.book-editor-v2-page {
        overflow-x: hidden;
    }

    body.book-editor-v2-page .main {
        width: 100%;
        min-width: 0;
        padding: 12px 10px 34px;
    }

    body.book-editor-v2-page .page-content,
    body.book-editor-v2-page .topbar {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    body.book-editor-v2-page .topbar {
        margin-bottom: 10px;
    }

    body.book-editor-v2-page .topbar h1 {
        font-size: 19px;
        line-height: 1.15;
    }

    .book-editor-v2 {
        width: 100%;
        min-width: 0;
        gap: 10px;
    }

    /* Compact project identity instead of a desktop card squeezed into mobile. */
    .book-editor-v2 .editor-project-header {
        width: 100%;
        min-width: 0;
        gap: 12px;
        padding: 12px;
        border-radius: 16px;
    }

    .book-editor-v2 .editor-project-identity {
        width: 100%;
        max-width: none;
        min-width: 0;
        flex: 0 1 auto;
        align-items: flex-start;
        gap: 10px;
    }

    .book-editor-v2 .editor-project-identity .project-avatar {
        width: 42px;
        height: 50px;
        flex: 0 0 42px;
        border-radius: 10px;
        font-size: 17px;
    }

    .book-editor-v2 .editor-project-identity > div:last-child {
        width: calc(100% - 52px);
        min-width: 0;
    }

    .book-editor-v2 .editor-project-identity .tags {
        max-width: 100%;
        display: flex;
        flex-wrap: nowrap;
        gap: 5px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .book-editor-v2 .editor-project-identity .tags::-webkit-scrollbar {
        display: none;
    }

    .book-editor-v2 .editor-project-identity .pill {
        flex: 0 0 auto;
        font-size: 8px;
    }

    .book-editor-v2 .editor-project-identity h2 {
        display: -webkit-box;
        margin: 5px 0 3px;
        overflow: hidden;
        font-size: 16px;
        line-height: 1.25;
        white-space: normal;
        text-overflow: clip;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .book-editor-v2 .editor-project-identity p {
        display: -webkit-box;
        overflow: hidden;
        font-size: 10px;
        line-height: 1.4;
        white-space: normal;
        text-overflow: clip;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    /* Two compact action rows: Target + More, then Fit + Generate. */
    .book-editor-v2 .editor-project-actions {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
        gap: 7px;
    }

    .book-editor-v2 .editor-project-actions > .editor-target-chip {
        display: grid;
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        min-height: 38px;
        margin: 0;
        padding: 5px 9px;
        border-radius: 10px;
    }

    .book-editor-v2 .editor-project-actions > .editor-more-menu {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        order: initial;
    }

    .book-editor-v2 .editor-project-actions > .editor-fit-action {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        min-width: 0;
        order: initial;
    }

    .book-editor-v2 .editor-project-actions > .editor-primary-action {
        grid-column: 2;
        grid-row: 2;
        width: 100%;
        min-width: 0;
        order: initial;
    }

    .book-editor-v2 .editor-project-actions .btn,
    .book-editor-v2 .editor-project-actions form .btn,
    .book-editor-v2 .editor-more-trigger {
        width: 100%;
        min-width: 0;
        min-height: 38px;
        padding: 8px 8px;
        border-radius: 10px;
        font-size: 9.5px;
        line-height: 1.15;
        white-space: normal;
    }

    .book-editor-v2 .editor-target-chip span,
    .book-editor-v2 .editor-target-chip small {
        font-size: 7.5px;
    }

    .book-editor-v2 .editor-target-chip strong {
        font-size: 14px;
    }

    /* Metrics become a horizontal swipe strip, not six tall cards. */
    .book-editor-v2 .page-budget-overview,
    .book-editor-v2 .editor-overview-cards {
        width: calc(100vw - 20px);
        display: flex;
        gap: 7px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: x proximity;
        padding: 1px 1px 5px;
        scrollbar-width: none;
    }

    .book-editor-v2 .page-budget-overview::-webkit-scrollbar,
    .book-editor-v2 .editor-overview-cards::-webkit-scrollbar {
        display: none;
    }

    .book-editor-v2 .editor-overview-cards > div {
        min-width: 132px;
        flex: 0 0 132px;
        scroll-snap-align: start;
        padding: 9px 10px;
        border-radius: 11px;
    }

    .book-editor-v2 .editor-overview-cards span {
        font-size: 8.5px;
    }

    .book-editor-v2 .editor-overview-cards strong {
        margin-top: 2px;
        font-size: 14px;
    }

    .book-editor-v2 .editor-overview-cards small {
        font-size: 8px;
    }

    /* Keep Page Budget useful, but compact enough that editor remains above the fold. */
    .book-editor-v2 .page-budget-panel {
        gap: 9px;
        margin-bottom: 0;
        padding: 11px 12px;
        border-radius: 13px;
    }

    .book-editor-v2 .page-budget-panel-copy .eyebrow {
        display: none;
    }

    .book-editor-v2 .page-budget-panel-copy h3 {
        margin: 0 0 3px;
        font-size: 12.5px;
        line-height: 1.35;
    }

    .book-editor-v2 .page-budget-panel-copy p {
        display: -webkit-box;
        margin: 0;
        overflow: hidden;
        font-size: 9.5px;
        line-height: 1.45;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .book-editor-v2 .page-budget-meter > div {
        height: 7px;
    }

    .book-editor-v2 .page-budget-meter small {
        margin-top: 5px;
        font-size: 8px;
        text-align: left;
    }

    /* Sticky mobile navigator: Structure / Manuscript / AI. */
    .book-editor-v2 .editor-mobile-switcher {
        position: sticky;
        z-index: 80;
        top: 7px;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        padding: 5px;
        border-radius: 12px;
        background: rgba(255,255,255,.94);
        box-shadow: 0 8px 24px rgba(16,24,40,.09);
        backdrop-filter: blur(12px);
    }

    .book-editor-v2 .editor-mobile-switcher button {
        min-width: 0;
        min-height: 38px;
        padding: 7px 4px;
        border-radius: 8px;
        font-size: 9.5px;
        white-space: nowrap;
    }

    /* The document becomes the primary mobile workspace. */
    .book-editor-v2 .editor-studio {
        width: 100%;
        min-width: 0;
        min-height: 0;
        border-radius: 15px;
        overflow: hidden;
    }

    .book-editor-v2 .editor-document-panel {
        width: 100%;
        min-width: 0;
        min-height: calc(100dvh - 96px);
        border-radius: 14px;
        overflow: hidden;
    }

    .book-editor-v2 .document-topbar {
        min-height: 49px;
        gap: 8px;
        padding: 7px 9px;
    }

    .book-editor-v2 .document-tabs {
        min-width: 0;
        padding: 3px;
    }

    .book-editor-v2 .document-tabs button {
        min-width: 62px;
        padding: 7px 9px;
        font-size: 9.5px;
    }

    .book-editor-v2 .document-save-state {
        min-width: 0;
        margin-left: auto;
    }

    .book-editor-v2 .document-save-state strong {
        font-size: 9px;
    }

    .book-editor-v2 .document-save-state small {
        display: none;
    }

    .book-editor-v2 .editor-document-panel > .document-topbar .mobile-panel-close {
        display: none;
    }

    .book-editor-v2 .document-toolbar {
        width: 100%;
        min-height: 47px;
        gap: 5px;
        padding: 6px 8px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .book-editor-v2 .document-toolbar::-webkit-scrollbar {
        display: none;
    }

    .book-editor-v2 .document-toolbar-group {
        flex: 0 0 auto;
        gap: 2px;
        padding-right: 5px;
    }

    .book-editor-v2 .document-toolbar button:not(.btn) {
        min-width: 32px;
        height: 32px;
        padding: 0 7px;
        font-size: 9.5px;
    }

    .book-editor-v2 .document-toolbar .zoom-control {
        margin-left: 0;
    }

    .book-editor-v2 .zoom-control span {
        min-width: 34px;
        font-size: 8.5px;
    }

    .book-editor-v2 .document-toolbar .btn-small {
        min-width: 58px;
        min-height: 32px;
        margin-left: auto;
        padding: 7px 9px;
        flex: 0 0 auto;
        font-size: 9.5px;
    }

    .book-editor-v2 .document-meta-bar {
        gap: 7px;
        padding: 8px 10px;
    }

    .book-editor-v2 .document-meta-bar input {
        width: 100%;
        font-size: 12.5px;
        line-height: 1.35;
    }

    .book-editor-v2 .document-meta-bar > div {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .book-editor-v2 .document-meta-bar > div::-webkit-scrollbar {
        display: none;
    }

    .book-editor-v2 .document-meta-bar span {
        flex: 0 0 auto;
        font-size: 8px;
    }

    .book-editor-v2 .document-canvas-wrap {
        width: 100%;
        min-width: 0;
        padding: 8px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .book-editor-v2 .document-page {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 62dvh;
        margin: 0;
        padding: clamp(20px, 6vw, 30px) clamp(17px, 5vw, 26px);
        border-radius: 15px;
        box-shadow: 0 9px 24px rgba(24,32,56,.09);
    }

    .book-editor-v2 .document-page::after {
        left: 10px;
        right: 10px;
        bottom: -7px;
    }

    .book-editor-v2 .document-page textarea {
        min-height: calc(62dvh - 46px);
        font-size: max(14px, calc(var(--book-font-size) * var(--editor-zoom)));
        line-height: max(1.55, var(--book-line-spacing, 1.55));
    }

    .book-editor-v2 .document-preview-page article {
        min-width: 0;
        font-size: max(14px, calc(var(--book-font-size) * var(--editor-zoom)));
        overflow-wrap: anywhere;
    }

    .book-editor-v2 .document-preview-page h1 {
        margin: 12px 0 18px;
        font-size: 1.55em;
    }

    .book-editor-v2 .document-statusbar {
        min-height: 44px;
        gap: 7px;
        padding: 8px 10px;
    }

    .book-editor-v2 .document-statusbar span {
        font-size: 8.5px;
    }

    /* Sidebars are real drawers with a tappable backdrop. */
    .book-editor-v2 .editor-sidebar-panel {
        z-index: 310;
        top: 0;
        bottom: 0;
        width: min(340px, calc(100vw - 34px));
        max-width: calc(100vw - 34px);
        height: 100dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #fbfcfe;
        box-shadow: 0 0 45px rgba(13,20,38,.24);
    }

    .book-editor-v2 .editor-structure-panel {
        left: 0;
        border-radius: 0 18px 18px 0;
    }

    .book-editor-v2 .editor-ai-panel {
        right: 0;
        border-radius: 18px 0 0 18px;
    }

    .book-editor-v2 .editor-panel-head {
        position: sticky;
        z-index: 3;
        top: 0;
        padding: 14px;
        background: rgba(251,252,254,.96);
        backdrop-filter: blur(10px);
    }

    .book-editor-v2 .editor-panel-head h3 {
        font-size: 16px;
    }

    .book-editor-v2 .editor-panel-head .mobile-panel-close {
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        border-radius: 10px;
        background: #f0f1f5;
    }

    .book-editor-v2 .structure-search-v2 {
        height: 43px;
        margin: 11px 12px 8px;
    }

    .book-editor-v2 .structure-search-v2 input,
    .book-editor-v2 .editor-section-copy strong,
    .book-editor-v2 .ai-tool-list strong {
        font-size: 11px;
    }

    .book-editor-v2 .editor-section-copy small,
    .book-editor-v2 .ai-tool-list small {
        font-size: 9px;
    }

    .book-editor-v2 .editor-section-select {
        min-height: 43px;
        padding: 8px 7px;
    }

    .book-editor-v2 .editor-section-generate button {
        width: 34px;
        height: 34px;
    }

    .book-editor-v2 .editor-panel-backdrop {
        position: fixed;
        z-index: 300;
        inset: 0;
        display: block;
        border: 0;
        padding: 0;
        background: rgba(15,20,38,.45);
        backdrop-filter: blur(2px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s ease, visibility .2s ease;
    }

    .book-editor-v2.show-structure .editor-panel-backdrop,
    .book-editor-v2.show-assistant .editor-panel-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Modal dialogs use the whole narrow viewport safely. */
    .book-editor-v2 .fit-book-modal,
    .book-editor-v2 .paraphrase-modal {
        padding: 10px;
    }

    .book-editor-v2 .fit-book-dialog,
    .book-editor-v2 .paraphrase-dialog {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - 20px);
        border-radius: 17px;
        padding: 16px;
    }
}

@media (max-width: 420px) {
    body.book-editor-v2-page .main {
        padding-inline: 8px;
    }

    .book-editor-v2 .editor-project-header {
        padding: 10px;
    }

    .book-editor-v2 .editor-project-identity .project-avatar {
        width: 38px;
        height: 46px;
        flex-basis: 38px;
    }

    .book-editor-v2 .editor-project-identity > div:last-child {
        width: calc(100% - 48px);
    }

    .book-editor-v2 .editor-project-identity h2 {
        font-size: 15px;
    }

    .book-editor-v2 .editor-project-actions .btn,
    .book-editor-v2 .editor-project-actions form .btn,
    .book-editor-v2 .editor-more-trigger {
        font-size: 9px;
    }

    .book-editor-v2 .page-budget-overview,
    .book-editor-v2 .editor-overview-cards {
        width: calc(100vw - 16px);
    }

    .book-editor-v2 .editor-overview-cards > div {
        min-width: 124px;
        flex-basis: 124px;
    }

    .book-editor-v2 .page-budget-panel-copy p {
        -webkit-line-clamp: 1;
    }

    .book-editor-v2 .editor-mobile-switcher button {
        font-size: 9px;
    }

    .book-editor-v2 .document-tabs button {
        min-width: 56px;
        padding-inline: 7px;
    }

    .book-editor-v2 .document-toolbar {
        padding-inline: 6px;
    }

    .book-editor-v2 .document-page {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .book-editor-v2 .document-page textarea,
    .book-editor-v2 .document-preview-page article {
        font-size: max(13.5px, calc(var(--book-font-size) * var(--editor-zoom)));
    }
}

/* =========================================================
   MOBILE LAYERING HOTFIX V2 — GLOBAL SIDEBAR VS EDITOR UI
   The global navigation must fully own the screen while open.
   ========================================================= */
@media (max-width: 1050px) {
    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar {
        z-index: 10020 !important;
    }

    body.sidebar-open .sidebar-overlay {
        z-index: 10010 !important;
    }

    /* Completely remove editor-only floating UI from the stacking tree. */
    body.sidebar-open .editor-mobile-switcher,
    body.sidebar-open .book-editor-v2 .editor-mobile-switcher,
    body.sidebar-open .editor-panel-backdrop,
    body.sidebar-open .book-editor-v2 .editor-panel-backdrop,
    body.sidebar-open .editor-sidebar-panel,
    body.sidebar-open .book-editor-v2 .editor-sidebar-panel,
    body.sidebar-open #assistantLauncher,
    body.sidebar-open #assistantPanel,
    body.sidebar-open .assistant-launcher,
    body.sidebar-open .assistant-panel {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}


/* =========================================================
   ORDER MANAGEMENT + CLIENT PORTAL (2026-08-07)
   ========================================================= */
.auth-switch{margin:14px 0 2px;text-align:center;color:#7a8191;font-size:10px}.auth-switch a{color:#6657e8;font-weight:800}.register-card{max-width:520px}.btn-soft{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px;padding:9px 14px;border:1px solid #e2e4ec;border-radius:11px;background:#fff;color:#4e5565;font-weight:800;font-size:10px;cursor:pointer;transition:.2s}.btn-soft:hover{border-color:#d2cbff;background:#f7f5ff;color:#5b4cda}.btn-sm{min-height:31px;padding:6px 10px;font-size:9px}.btn-block{width:100%;justify-content:center}
.order-page{display:grid;gap:18px}.order-client-hero,.order-detail-hero{padding:28px 30px;display:flex;justify-content:space-between;gap:22px;align-items:center;border:1px solid #e7e6f3;border-radius:20px;background:linear-gradient(135deg,#fff,#f7f5ff);box-shadow:var(--shadow-sm)}.order-client-hero h2,.order-detail-hero h2{margin:6px 0 8px;font-size:27px;letter-spacing:-.04em}.order-client-hero p,.order-detail-hero p{margin:0;max-width:720px;color:var(--muted);font-size:11px;line-height:1.65}.order-client-hero .hero-actions{margin-top:18px}.client-flow{min-width:250px;padding:17px;border:1px solid #e2defb;border-radius:15px;background:rgba(255,255,255,.82);display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;color:#6c638f}.client-flow>span{width:100%;font-size:7px;letter-spacing:.12em;font-weight:900;color:#8e83c8}.client-flow b{font-size:9px;color:#403677}.client-flow i{font-style:normal;color:#a69ed1}
.order-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.order-stat-grid>div{padding:17px 18px;border:1px solid #e7e9f0;border-radius:15px;background:#fff;box-shadow:var(--shadow-sm)}.order-stat-grid span{display:block;color:#7b8290;font-size:9px;font-weight:700}.order-stat-grid strong{display:block;margin-top:4px;font-size:25px}.order-list-panel{min-width:0}.client-order-list{display:grid}.client-order-row{display:grid;grid-template-columns:125px minmax(0,1fr) 170px 45px 18px;gap:14px;align-items:center;padding:15px 4px;border-bottom:1px solid #eceef3}.client-order-row:last-child{border-bottom:0}.client-order-row:hover{background:#fbfaff}.client-order-row .order-number{font-size:8px;font-weight:900;color:#6b5ce6}.client-order-row strong{display:block;font-size:11px}.client-order-row small{display:block;margin-top:3px;color:#89909e;font-size:8px}.mini-progress,.tiny-progress{height:5px;border-radius:999px;background:#edf0f5;overflow:hidden}.mini-progress span,.tiny-progress span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#6658ea,#9a75ff)}.client-order-row>b{font-size:9px;color:#6658e7}.client-order-row>i{font-style:normal;color:#8f96a4}
.order-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.order-card{padding:18px;border:1px solid #e6e8ef;border-radius:16px;background:#fff;box-shadow:0 5px 18px rgba(27,32,54,.035);transition:.2s}.order-card:hover{transform:translateY(-2px);border-color:#d6d0ff;box-shadow:0 15px 34px rgba(38,35,82,.09)}.order-card-top{display:flex;justify-content:space-between;align-items:center;gap:8px}.order-card-top>span{font-size:8px;font-weight:900;color:#7569df}.order-card h3{margin:13px 0 5px;font-size:15px}.order-card p{margin:0;min-height:34px;color:#7f8694;font-size:9px;line-height:1.55}.order-specs{display:flex;gap:5px;flex-wrap:wrap;margin:12px 0}.order-specs span,.order-hero-tags span{padding:5px 8px;border-radius:999px;background:#f3f1ff;color:#5d51d8;font-size:7px;font-weight:800}.order-progress{height:6px;border-radius:999px;background:#edf0f5;overflow:hidden}.order-progress span{display:block;height:100%;background:linear-gradient(90deg,#6355ea,#a376ff)}.order-card footer{display:flex;justify-content:space-between;gap:8px;margin-top:9px;color:#858c99;font-size:8px}.order-card footer strong{color:#5f53d6}
.order-status{display:inline-flex;align-items:center;padding:5px 7px;border-radius:999px;background:#f1efff;color:#5d51d4;font-size:7px;font-weight:900;white-space:nowrap}.status-completed{background:#e9f8f1;color:#16805d}.status-cancelled{background:#fff0f0;color:#c55050}.status-client_review,.status-revision{background:#fff5de;color:#9a6c10}.status-writing,.status-editing,.status-layout{background:#edf3ff;color:#3b6bbb}
.order-create-layout{display:grid;grid-template-columns:270px minmax(0,1fr);gap:18px;align-items:start}.order-create-guide{position:sticky;top:18px;padding:25px;border-radius:19px;background:linear-gradient(160deg,#202548,#13172d 75%);color:#fff;overflow:hidden}.order-create-guide:after{content:"";position:absolute;width:190px;height:190px;border-radius:50%;right:-95px;top:-80px;background:rgba(113,93,242,.17);box-shadow:0 0 0 34px rgba(113,93,242,.045)}.order-create-guide>*{position:relative;z-index:1}.order-create-guide h2{margin:17px 0 9px;font-size:23px;line-height:1.2}.order-create-guide p{color:#a9b0c7;font-size:10px;line-height:1.65}.order-flow-list{display:grid;gap:8px;margin-top:23px}.order-flow-list>div{display:flex;gap:10px;align-items:center;padding:10px;border:1px solid rgba(255,255,255,.06);border-radius:12px;background:rgba(255,255,255,.035)}.order-flow-list b{width:29px;height:29px;display:grid;place-items:center;border-radius:9px;background:#6556e8}.order-flow-list strong{display:block;font-size:9px}.order-flow-list small{display:block;margin-top:2px;color:#929bb7;font-size:7px}.order-form-panel{padding:25px}.order-form{display:grid;gap:18px}.order-form-section{padding-bottom:18px;border-bottom:1px solid #eceef3}.order-form-section:last-of-type{border-bottom:0}.order-form-section h3{margin:0 0 13px;font-size:13px}.order-form label,.production-control label{display:grid;gap:6px;color:#4f5666;font-size:9px;font-weight:800}.order-form input,.order-form select,.order-form textarea,.production-control input,.production-control select,.production-control textarea,.revision-form input,.revision-form select,.revision-form textarea,.message-panel textarea,.inline-upload input,.inline-upload select,.production-filter input,.production-filter select,.production-revisions input,.production-revisions select{width:100%;min-height:42px;padding:9px 11px;border:1px solid #dde1e9;border-radius:10px;background:#fbfcfe;color:#202536;font:inherit;font-size:10px;outline:none}.order-form textarea,.production-control textarea,.revision-form textarea,.message-panel textarea{resize:vertical}.order-form input:focus,.order-form select:focus,.order-form textarea:focus,.production-control input:focus,.production-control select:focus,.production-control textarea:focus,.message-panel textarea:focus{border-color:#8070ef;box-shadow:0 0 0 4px rgba(106,89,230,.07);background:#fff}.order-form-grid{display:grid;gap:11px}.order-form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.order-form-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.package-choice{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.package-choice label{position:relative;display:block}.package-choice input{position:absolute;opacity:0;pointer-events:none}.package-choice span{min-height:76px;padding:13px;display:flex;flex-direction:column;justify-content:center;border:1px solid #e1e3eb;border-radius:12px;background:#fff;cursor:pointer}.package-choice input:checked+span{border-color:#8373ef;background:#f5f3ff;box-shadow:0 0 0 3px rgba(112,93,235,.07)}.package-choice strong{font-size:11px}.package-choice small{margin-top:4px;color:#858c9a;font-size:8px;line-height:1.45}.upload-zone{padding:18px!important;border:1px dashed #cfc9f6!important;border-radius:13px;background:#faf9ff;text-align:center}.upload-zone input{min-height:auto;border:0;padding:0;background:transparent}.upload-zone span{color:#5e52d3;font-size:10px}.upload-zone small{color:#8a91a0;font-size:8px}.order-submit-row{display:flex;align-items:center;justify-content:space-between;gap:16px}.order-submit-row>span{max-width:560px;color:#838a98;font-size:8px;line-height:1.55}
.order-detail-hero{background:linear-gradient(135deg,#25294f,#5547ab);color:#fff;border:0}.order-detail-hero .eyebrow,.order-detail-hero p{color:#c9c9df}.order-detail-hero .order-hero-tags span{background:rgba(255,255,255,.1);color:#fff}.order-progress-ring{width:96px;height:96px;border:9px solid rgba(255,255,255,.13);border-top-color:#a992ff;border-radius:50%;display:grid;place-items:center;align-content:center;flex:0 0 auto}.order-progress-ring strong{font-size:24px}.order-progress-ring span{font-size:7px;color:#d5d3e8}.order-detail-grid,.production-detail-grid{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:16px;align-items:start}.order-detail-grid>main,.production-detail-grid>main,.order-detail-grid>aside,.production-detail-grid>aside{display:grid;gap:16px}.production-progress .bar{height:8px;border-radius:999px;background:#eceef3;overflow:hidden}.production-progress .bar span{display:block;height:100%;background:linear-gradient(90deg,#5c51e4,#a47aff)}.production-milestones{display:flex;justify-content:space-between;margin-top:8px}.production-milestones span{color:#a0a6b2;font-size:7px}.production-milestones span.done{color:#5b4fd4;font-weight:900}.history-list{display:grid;margin-top:17px}.history-list>div{display:grid;grid-template-columns:12px minmax(0,1fr) auto;gap:10px;padding:10px 0;border-bottom:1px solid #eef0f4}.history-list i{width:8px;height:8px;margin-top:3px;border-radius:50%;background:#6b5de7;box-shadow:0 0 0 4px #f0edff}.history-list strong{display:block;font-size:9px}.history-list small{display:block;margin-top:2px;color:#8a919f;font-size:8px}.history-list time{font-size:7px;color:#a1a7b2}.order-files{display:grid;gap:7px}.order-files>a{padding:10px;display:grid;grid-template-columns:28px minmax(0,1fr) 20px;gap:9px;align-items:center;border:1px solid #e7e9ef;border-radius:10px;background:#fcfcfe}.order-files>a:hover{border-color:#d8d2ff;background:#faf9ff}.order-files strong{display:block;font-size:9px}.order-files small{display:block;margin-top:2px;color:#8b919e;font-size:7px}.inline-upload{display:grid;grid-template-columns:minmax(0,1fr) 115px auto;gap:7px;margin-top:12px}.draft-downloads{display:flex;gap:8px;margin-top:12px}.revision-form{display:grid;gap:9px}.revision-list{display:grid;gap:8px;margin-top:15px}.revision-list>div{display:grid;grid-template-columns:85px minmax(0,1fr);gap:10px;padding:11px;border:1px solid #e8eaf0;border-radius:11px}.revision-list strong{font-size:10px}.revision-list p{margin:4px 0;color:#666e7d;font-size:9px;line-height:1.55}.revision-list small{color:#959ca9;font-size:7px}.revision-status{align-self:start;padding:5px 7px;border-radius:999px;background:#fff3d8;color:#9b6a07;font-size:7px;font-weight:900;text-align:center}.revision-status.done{background:#e9f8f1;color:#16805d}.revision-status.in_progress{background:#edf2ff;color:#4566af}.order-summary-card dl{margin:12px 0 0}.order-summary-card dl>div{display:flex;justify-content:space-between;gap:10px;padding:9px 0;border-bottom:1px solid #edf0f4;font-size:8px}.order-summary-card dt{color:#8b929f}.order-summary-card dd{margin:0;text-align:right;font-weight:800;color:#303648}.message-panel{max-height:620px}.message-list{display:grid;gap:8px;max-height:330px;overflow:auto;margin:12px 0}.message-list>div{max-width:88%;padding:9px 10px;border-radius:11px 11px 11px 3px;background:#f2f3f7}.message-list>div.mine{justify-self:end;border-radius:11px 11px 3px 11px;background:#efecff}.message-list>div.internal{background:#fff8e7;border:1px solid #f1dfae}.message-list strong{font-size:8px}.message-list p{margin:3px 0;font-size:9px;line-height:1.5}.message-list small{font-size:6.5px;color:#9299a7}.message-panel form{display:grid;gap:7px}.muted-copy{color:#8a919e;font-size:9px;line-height:1.6}
.production-filter{display:flex;gap:8px;margin-bottom:16px}.production-filter input{flex:1}.production-filter select{width:190px}.production-table-wrap{overflow:auto}.production-table{width:100%;border-collapse:collapse;min-width:850px}.production-table th{padding:9px;text-align:left;color:#9299a7;font-size:7px;text-transform:uppercase;letter-spacing:.08em;border-bottom:1px solid #e8eaf0}.production-table td{padding:12px 9px;border-bottom:1px solid #eceef3;vertical-align:middle;font-size:9px}.production-table td>span,.production-table td>small{display:block;color:#8b929f;font-size:7px}.production-table td>strong{display:block;margin:3px 0;font-size:10px}.production-table .tiny-progress{width:110px;margin-bottom:4px}.order-detail-hero.production{background:linear-gradient(135deg,#20264a,#45378e)}.production-hero-actions{display:flex;align-items:center}.brief-spec-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.brief-spec-grid>div{padding:10px;border-radius:10px;background:#f7f8fb}.brief-spec-grid span{display:block;color:#9097a4;font-size:7px}.brief-spec-grid strong{display:block;margin-top:3px;font-size:9px}.brief-text{margin-top:13px;padding:13px;border:1px solid #eceef3;border-radius:11px;color:#5d6574;font-size:10px;line-height:1.7}.production-upload{grid-template-columns:minmax(0,1fr) 90px 80px auto}.check-line{display:flex!important;align-items:center!important;gap:6px!important;font-size:8px!important}.check-line input{width:auto!important;min-height:auto!important}.production-control form{display:grid;gap:9px;margin-top:13px}.production-revisions>div{grid-template-columns:80px minmax(0,1fr)}.production-revisions form{display:grid;grid-template-columns:105px minmax(0,1fr) auto;gap:6px;margin-top:8px}.production-revisions form select,.production-revisions form input{min-height:34px}.admin-user-grid{display:grid;grid-template-columns:310px minmax(0,1fr);gap:16px;align-items:start}.user-list{display:grid}.user-list>div{display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid #eceef3}.user-list strong{display:block;font-size:10px}.user-list small{display:block;color:#9097a4;font-size:7px}.user-list form{display:flex;gap:6px}.user-list select{min-height:33px;border:1px solid #dde1e9;border-radius:9px;padding:6px;font-size:8px}

@media(max-width:1100px){.order-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.order-detail-grid,.production-detail-grid{grid-template-columns:minmax(0,1fr) 280px}.order-create-layout{grid-template-columns:235px minmax(0,1fr)}.admin-user-grid{grid-template-columns:270px minmax(0,1fr)}}
@media(max-width:820px){.order-client-hero,.order-detail-hero{padding:20px;align-items:flex-start}.client-flow{display:none}.order-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.order-create-layout{display:block}.order-create-guide{position:relative;top:auto;margin-bottom:14px}.order-flow-list{grid-template-columns:repeat(4,minmax(0,1fr))}.order-flow-list>div{display:block;text-align:center}.order-flow-list span{display:none}.order-detail-grid,.production-detail-grid,.admin-user-grid{grid-template-columns:1fr}.order-detail-grid>aside,.production-detail-grid>aside{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.client-order-row{grid-template-columns:100px minmax(0,1fr) 80px 35px 12px}.brief-spec-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.production-control{order:-1}}
@media(max-width:620px){.order-client-hero h2,.order-detail-hero h2{font-size:21px}.order-client-hero,.order-detail-hero{display:block}.order-progress-ring{margin-top:16px;width:76px;height:76px}.order-card-grid{grid-template-columns:1fr}.client-order-row{grid-template-columns:1fr auto;gap:5px 10px}.client-order-row .order-number{grid-column:1}.client-order-row>div:first-of-type{grid-column:1}.client-order-row .mini-progress{grid-column:1}.client-order-row>b{grid-column:2;grid-row:3}.client-order-row>i{grid-column:2;grid-row:1/3}.order-form-grid.two,.order-form-grid.three,.package-choice{grid-template-columns:1fr}.order-form-panel{padding:16px}.order-flow-list{grid-template-columns:repeat(2,minmax(0,1fr))}.order-detail-grid>aside,.production-detail-grid>aside{grid-template-columns:1fr}.inline-upload,.production-upload{grid-template-columns:1fr}.draft-downloads{flex-direction:column}.revision-list>div,.production-revisions>div{grid-template-columns:1fr}.production-revisions form{grid-template-columns:1fr}.production-filter{display:grid;grid-template-columns:1fr auto}.production-filter select{width:100%}.brief-spec-grid{grid-template-columns:1fr 1fr}.user-list>div{grid-template-columns:34px minmax(0,1fr)}.user-list form{grid-column:1/-1;justify-content:flex-end}.order-stat-grid>div{padding:14px}.order-stat-grid strong{font-size:20px}}

/* =============================================================
   Dynamic Manuscript Order Form V3
   Scoped to .order-create-v3 to avoid affecting production pages.
   ============================================================= */
.order-create-v3{--oc-primary:#6557ea;--oc-primary-dark:#4f43ca;--oc-soft:#f3f1ff;--oc-line:#e6e8f0;--oc-text:#202536;--oc-muted:#737b8c;--oc-success:#20b980;max-width:1540px;margin:0 auto}.order-ordering-hero-v3{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:28px;padding:26px 30px;border:1px solid #e7e7f2;border-radius:22px;background:linear-gradient(130deg,#fff 0%,#faf9ff 55%,#f1efff 100%);box-shadow:0 14px 40px rgba(31,36,67,.055)}.order-ordering-hero-v3:after{content:"";position:absolute;right:-80px;top:-110px;width:270px;height:270px;border-radius:50%;background:radial-gradient(circle,rgba(109,91,237,.16),rgba(109,91,237,0) 70%);pointer-events:none}.order-ordering-hero-v3>div{position:relative;z-index:1}.order-ordering-hero-v3 h2{margin:6px 0 7px;max-width:780px;color:var(--oc-text);font-family:Manrope,sans-serif;font-size:25px;line-height:1.2;letter-spacing:-.035em}.order-ordering-hero-v3 p{max-width:850px;margin:0;color:var(--oc-muted);font-size:13px;line-height:1.7}.order-hero-status-v3{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;max-width:360px}.order-hero-status-v3 span{display:inline-flex;align-items:center;gap:7px;padding:8px 10px;border:1px solid #e4e1fa;border-radius:999px;color:#61587d;background:rgba(255,255,255,.78);font-size:10px;font-weight:800;white-space:nowrap}.order-hero-status-v3 i{width:7px;height:7px;border-radius:50%;background:#2bc48b;box-shadow:0 0 0 4px rgba(43,196,139,.09)}
.order-create-shell-v3{display:grid;grid-template-columns:260px minmax(0,1fr) 260px;gap:18px;align-items:start}.order-create-guide-v3,.order-live-summary-v3{position:sticky;top:18px}.order-create-guide-v3{overflow:hidden;padding:22px;border-radius:21px;color:#fff;background:linear-gradient(160deg,#24294f 0%,#151932 68%,#11152b 100%);box-shadow:0 20px 50px rgba(23,26,57,.13)}.order-create-guide-v3:before{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(circle at 82% 8%,rgba(124,103,255,.24),transparent 34%),radial-gradient(circle at 12% 86%,rgba(82,130,255,.08),transparent 30%)}.order-create-guide-v3>*{position:relative;z-index:1}.order-guide-head-v3 h3{margin:14px 0 7px;font-size:20px;line-height:1.22;letter-spacing:-.02em}.order-guide-head-v3 p{margin:0;color:#aab1c7;font-size:11px;line-height:1.65}.order-step-list-v3{display:grid;gap:8px;margin-top:19px}.order-step-list-v3 button{appearance:none;width:100%;display:grid;grid-template-columns:34px minmax(0,1fr) 18px;gap:10px;align-items:center;padding:10px;border:1px solid rgba(255,255,255,.07);border-radius:13px;color:#a8aec2;background:rgba(255,255,255,.035);font:inherit;text-align:left;cursor:pointer;transition:.2s ease}.order-step-list-v3 button:hover{border-color:rgba(154,141,255,.26);background:rgba(255,255,255,.06);transform:translateX(2px)}.order-step-list-v3 b{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;color:#cbc7e1;background:rgba(255,255,255,.075);font-size:11px}.order-step-list-v3 strong{display:block;color:#d5d7e3;font-size:11px}.order-step-list-v3 small{display:block;margin-top:2px;color:#858da8;font-size:9px}.order-step-list-v3 i{opacity:0;color:#73e0b6;font-size:12px;font-style:normal}.order-step-list-v3 button.is-active{border-color:rgba(137,120,255,.45);background:linear-gradient(135deg,rgba(103,86,235,.29),rgba(80,73,159,.24));box-shadow:0 9px 24px rgba(64,51,165,.13)}.order-step-list-v3 button.is-active b{color:#fff;background:linear-gradient(135deg,#7666ff,#5f51e5);box-shadow:0 5px 15px rgba(90,75,222,.35)}.order-step-list-v3 button.is-active strong{color:#fff}.order-step-list-v3 button.is-complete i{opacity:1}.order-step-list-v3 button.is-complete b{color:#fff;background:#1cb67d}.order-guide-progress-v3{margin-top:18px;padding:13px;border:1px solid rgba(255,255,255,.1);border-radius:13px;background:rgba(255,255,255,.045)}.order-guide-progress-v3>div:first-child{display:flex;justify-content:space-between;gap:8px;color:#aeb4c8;font-size:9px}.order-guide-progress-v3 strong{color:#fff}.order-guide-track-v3{height:5px;margin-top:9px;overflow:hidden;border-radius:999px;background:rgba(255,255,255,.09)}.order-guide-track-v3 span{display:block;width:25%;height:100%;border-radius:inherit;background:linear-gradient(90deg,#7a69ff,#b2a7ff);transition:width .3s ease}.order-guide-tip-v3{display:flex;gap:9px;margin-top:16px;padding:12px;border:1px solid rgba(255,255,255,.08);border-radius:13px;background:rgba(255,255,255,.035)}.order-guide-tip-v3>span{font-size:14px}.order-guide-tip-v3 strong{display:block;color:#f2f3f8;font-size:10px}.order-guide-tip-v3 small{display:block;margin-top:4px;color:#8f97b0;font-size:8.5px;line-height:1.55}
.order-form-panel-v3{min-width:0;padding:0;overflow:hidden;border-radius:21px}.order-form-head-v3{position:relative;display:flex;justify-content:space-between;gap:18px;padding:24px 26px 20px;border-bottom:1px solid #eceef3;background:linear-gradient(180deg,#fff,#fdfdff)}.order-form-head-v3 h2{margin:5px 0 5px;color:var(--oc-text);font-size:21px;letter-spacing:-.025em}.order-form-head-v3 p{margin:0;max-width:650px;color:var(--oc-muted);font-size:11.5px;line-height:1.6}.order-form-step-badge-v3{width:54px;height:54px;display:flex;align-items:baseline;justify-content:center;gap:2px;flex:0 0 auto;border:1px solid #e3e0fb;border-radius:15px;color:#5b4ed6;background:#f6f4ff;box-shadow:inset 0 0 0 4px #fff}.order-form-step-badge-v3 strong{font-size:20px}.order-form-step-badge-v3 span{font-size:10px;color:#948daa}.order-form-error-v3{margin:16px 24px 0}.order-form-v3{display:grid}.order-wizard-section-v3{padding:24px 26px 10px;animation:orderStepIn .24s ease}.order-wizard-section-v3[hidden]{display:none!important}@keyframes orderStepIn{from{opacity:.25;transform:translateY(7px)}to{opacity:1;transform:none}}.order-section-title-v3{display:flex;align-items:flex-start;gap:12px;margin-bottom:19px}.order-section-title-v3>span{width:38px;height:38px;display:grid;place-items:center;flex:0 0 auto;border:1px solid #dedaff;border-radius:11px;color:#6557df;background:#f4f2ff;font-size:10px;font-weight:900}.order-section-title-v3 h3{margin:0;color:#272c3a;font-size:16px}.order-section-title-v3 p{margin:4px 0 0;color:#858c9a;font-size:10.5px;line-height:1.55}.order-field-v3{display:grid;gap:7px;margin-bottom:15px;color:#4d5565;font-size:12px;font-weight:750}.order-field-v3>span{display:flex;align-items:center;gap:7px}.order-field-v3 em{padding:2px 6px;border-radius:999px;color:#7668df;background:#f0eeff;font-size:8px;font-style:normal}.order-field-v3 input,.order-field-v3 select,.order-field-v3 textarea{width:100%;min-height:48px;padding:11px 13px;border:1px solid #dfe3eb;border-radius:12px;background:#fbfcfe;color:#1f2533;font-family:DM Sans,sans-serif;font-size:13px;font-weight:500;outline:none;transition:.18s ease}.order-field-v3 textarea{min-height:170px;resize:vertical;line-height:1.6}.order-field-v3 input::placeholder,.order-field-v3 textarea::placeholder{color:#abb1bc}.order-field-v3 input:hover,.order-field-v3 select:hover,.order-field-v3 textarea:hover{border-color:#d0d4df;background:#fff}.order-field-v3 input:focus,.order-field-v3 select:focus,.order-field-v3 textarea:focus{border-color:#8174ef;background:#fff;box-shadow:0 0 0 4px rgba(105,89,231,.08)}.order-field-v3>small{margin-top:-1px;color:#9299a6;font-size:9px;font-weight:500}.order-field-featured-v3 input{font-size:14px;font-weight:650}.order-form-grid-v3{display:grid;gap:12px}.order-form-grid-v3.two{grid-template-columns:repeat(2,minmax(0,1fr))}.order-form-grid-v3.three{grid-template-columns:repeat(3,minmax(0,1fr))}.order-input-suffix-v3{position:relative}.order-input-suffix-v3 input{padding-right:55px}.order-input-suffix-v3 i{position:absolute;right:12px;top:50%;transform:translateY(-50%);color:#959baa;font-size:9px;font-style:normal;font-weight:800;pointer-events:none}.order-suggestion-chips-v3{display:flex;flex-wrap:wrap;gap:6px}.order-suggestion-chips-v3 button{padding:6px 9px;border:1px solid #e2e4eb;border-radius:999px;color:#6d7483;background:#fff;font:inherit;font-size:9px;font-weight:700;cursor:pointer;transition:.15s}.order-suggestion-chips-v3 button:hover,.order-suggestion-chips-v3 button.is-selected{border-color:#cec7ff;color:#5f52d8;background:#f6f4ff}.order-layout-preview-v3{display:grid;grid-template-columns:82px minmax(0,1fr);gap:15px;align-items:center;margin:2px 0 17px;padding:15px;border:1px solid #e6e4f7;border-radius:15px;background:linear-gradient(135deg,#faf9ff,#fff)}.order-layout-paper-v3{width:64px;height:82px;display:grid;place-items:center;justify-self:center;border:1px solid #d9d7e7;border-radius:5px 9px 9px 5px;color:#6659dd;background:#fff;box-shadow:0 8px 18px rgba(37,39,66,.1);font-size:10px;font-weight:900;transition:.2s}.order-layout-paper-v3[data-size="A4"]{height:86px;width:61px}.order-layout-paper-v3[data-size="A5"]{height:75px;width:53px}.order-layout-preview-v3 strong{display:block;margin:4px 0;color:#2b3040;font-size:13px}.order-layout-preview-v3 strong b{color:#5d50d7;font-size:18px}.order-layout-preview-v3 p{margin:0;color:#848b99;font-size:9.5px;line-height:1.55}.order-smart-note-v3,.order-package-help-v3{display:flex;gap:10px;align-items:flex-start;padding:12px 13px;border:1px solid #e7e4fb;border-radius:12px;background:#faf9ff;color:#656c7b}.order-smart-note-v3>span,.order-package-help-v3>span{color:#6759de}.order-smart-note-v3 p,.order-package-help-v3 p{margin:0;font-size:10px;line-height:1.55}
.package-choice-v3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.package-card-v3{position:relative;display:block;cursor:pointer}.package-card-v3>input{position:absolute;opacity:0;pointer-events:none}.package-card-v3>span{position:relative;min-height:225px;display:flex;flex-direction:column;padding:17px;border:1px solid #e2e4eb;border-radius:16px;background:#fff;box-shadow:0 7px 18px rgba(25,30,52,.035);transition:.2s ease}.package-card-v3:hover>span{transform:translateY(-2px);border-color:#cfc9ff;box-shadow:0 13px 28px rgba(68,55,155,.09)}.package-card-v3>input:checked+span{border-color:#7667ee;background:linear-gradient(180deg,#f9f8ff,#fff);box-shadow:0 0 0 3px rgba(106,89,232,.08),0 14px 30px rgba(74,61,162,.08)}.package-card-v3 span>i{width:37px;height:37px;display:grid;place-items:center;margin-bottom:12px;border-radius:11px;color:#6254db;background:#f0eeff;font-size:15px;font-style:normal}.package-card-v3 b{font-size:14px;color:#252a38}.package-card-v3 small{min-height:48px;margin-top:5px;color:#7b8290;font-size:9.5px;line-height:1.55}.package-card-v3 ul{display:grid;gap:6px;margin:13px 0 0;padding:11px 0 0;border-top:1px solid #edf0f4;list-style:none}.package-card-v3 li{color:#626978;font-size:9px}.package-card-v3 em{position:absolute;right:10px;top:10px;padding:5px 7px;border-radius:999px;color:#fff;background:#6657e9;font-size:7px;font-style:normal;font-weight:850}.order-package-help-v3{margin-top:13px}.order-field-meta-v3{display:flex;justify-content:space-between;gap:10px;color:#9299a6;font-size:9px;font-weight:500}.order-field-meta-v3 b{white-space:nowrap}.order-upload-zone-v3{display:grid;place-items:center;min-height:190px;padding:25px;border:1.5px dashed #c9c4f0;border-radius:16px;color:#656c7b;background:linear-gradient(180deg,#fbfaff,#f8f7ff);text-align:center;cursor:pointer;transition:.2s ease}.order-upload-zone-v3:hover,.order-upload-zone-v3.is-dragging{border-color:#7767ec;background:#f3f0ff;box-shadow:inset 0 0 0 3px rgba(106,89,232,.05)}.order-upload-zone-v3 input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.order-upload-icon-v3{width:44px;height:44px;display:grid;place-items:center;margin-bottom:10px;border-radius:13px;color:#fff;background:linear-gradient(135deg,#7667f2,#5b4fd8);box-shadow:0 9px 20px rgba(89,73,214,.2);font-size:21px}.order-upload-zone-v3 strong{color:#303647;font-size:12px}.order-upload-zone-v3 p{margin:5px 0 2px;font-size:10px}.order-upload-zone-v3 small{color:#9299a6;font-size:8.5px}.order-file-preview-v3{display:grid;gap:7px;margin-top:9px}.order-file-preview-v3>div{display:grid;grid-template-columns:28px minmax(0,1fr);gap:9px;align-items:center;padding:9px 10px;border:1px solid #e8eaf0;border-radius:10px;background:#fff}.order-file-preview-v3>div>span{width:28px;height:28px;display:grid;place-items:center;border-radius:8px;color:#16805d;background:#e8f8f1;font-size:10px;font-weight:900}.order-file-preview-v3>div.is-invalid{border-color:#f0caca;background:#fff8f8}.order-file-preview-v3>div.is-invalid>span{color:#bd4650;background:#ffeaea}.order-file-preview-v3 strong{display:block;overflow:hidden;color:#3b4250;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.order-file-preview-v3 small{display:block;margin-top:2px;color:#9097a4;font-size:8px}.order-final-check-v3{margin-top:14px;padding:13px;border:1px solid #dfeee8;border-radius:13px;background:#f6fcf9}.order-final-check-v3>div{display:flex;gap:10px;align-items:flex-start}.order-final-check-v3 span{width:28px;height:28px;display:grid;place-items:center;flex:0 0 auto;border-radius:9px;color:#16805d;background:#e3f7ef;font-size:11px;font-weight:900}.order-final-check-v3 p{margin:0;color:#5d6675;font-size:9.5px;line-height:1.6}.order-wizard-actions-v3{position:sticky;bottom:0;z-index:5;display:flex;align-items:center;gap:9px;padding:15px 26px;border-top:1px solid #e9ebf1;background:rgba(255,255,255,.94);backdrop-filter:blur(12px)}.order-action-spacer-v3{flex:1}.order-prev-v3,.order-next-v3,.order-submit-v3{min-height:46px;padding:11px 17px;font-size:11px}.order-next-v3 span,.order-submit-v3>span:first-of-type{font-size:15px}
.order-live-summary-v3{padding:19px;border:1px solid #e5e7ef;border-radius:18px;background:#fff;box-shadow:0 12px 30px rgba(24,29,50,.055)}.order-summary-head-v3 h3{margin:5px 0 3px;color:#2d3241;font-size:16px}.order-summary-head-v3 p{margin:0;color:#8a919f;font-size:9.5px;line-height:1.5}.order-summary-title-v3{display:grid;grid-template-columns:42px minmax(0,1fr);gap:10px;align-items:center;margin:16px 0;padding:12px;border:1px solid #e9e7fb;border-radius:13px;background:#faf9ff}.order-summary-title-v3>span{width:42px;height:42px;display:grid;place-items:center;border-radius:11px;color:#fff;background:linear-gradient(135deg,#6557e8,#8774fa);font-size:16px;font-weight:900}.order-summary-title-v3 strong{display:block;overflow:hidden;color:#2d3240;font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.order-summary-title-v3 small{display:block;overflow:hidden;margin-top:3px;color:#8b92a0;font-size:8px;text-overflow:ellipsis;white-space:nowrap}.order-summary-list-v3{margin:0}.order-summary-list-v3>div{display:flex;justify-content:space-between;gap:10px;padding:9px 0;border-bottom:1px solid #edf0f4;font-size:9px}.order-summary-list-v3 dt{color:#89909d}.order-summary-list-v3 dd{margin:0;color:#3a4050;text-align:right;font-weight:750}.order-summary-progress-v3{margin-top:15px;padding:12px;border-radius:12px;background:#f7f8fb}.order-summary-progress-v3>div:first-child{display:flex;justify-content:space-between;gap:10px;color:#7f8796;font-size:8.5px}.order-summary-progress-v3>div:last-child{height:6px;margin-top:8px;overflow:hidden;border-radius:999px;background:#e9ecf2}.order-summary-progress-v3>div:last-child span{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#6557e8,#9a75ff);transition:width .25s ease}.order-summary-safe-v3{display:flex;gap:8px;align-items:flex-start;margin-top:13px;color:#8a919e}.order-summary-safe-v3 p{margin:0;font-size:8px;line-height:1.5}
@media(max-width:1250px){.order-create-shell-v3{grid-template-columns:240px minmax(0,1fr)}.order-live-summary-v3{position:relative;top:auto;grid-column:1/-1;display:grid;grid-template-columns:220px minmax(0,1fr) 220px;gap:15px;align-items:center}.order-summary-title-v3{margin:0}.order-summary-list-v3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px 14px}.order-summary-list-v3>div{padding:5px 0}.order-summary-progress-v3{margin:0}.order-summary-safe-v3{display:none}}
@media(max-width:900px){.order-ordering-hero-v3{padding:21px 22px}.order-ordering-hero-v3 h2{font-size:22px}.order-hero-status-v3{display:none}.order-create-shell-v3{display:block}.order-create-guide-v3{position:relative;top:auto;margin-bottom:14px;padding:16px}.order-guide-head-v3{display:none}.order-step-list-v3{grid-template-columns:repeat(4,minmax(135px,1fr));margin:0;overflow-x:auto;scrollbar-width:none}.order-step-list-v3::-webkit-scrollbar{display:none}.order-step-list-v3 button{min-width:135px;grid-template-columns:30px minmax(0,1fr);padding:9px}.order-step-list-v3 b{width:30px;height:30px}.order-step-list-v3 i,.order-step-list-v3 small{display:none}.order-guide-progress-v3{margin-top:10px}.order-guide-tip-v3{display:none}.order-create-guide-v3:before{opacity:.7}.order-live-summary-v3{display:grid;grid-template-columns:1fr 1fr;margin-top:14px}.order-summary-head-v3,.order-summary-title-v3{grid-column:1/-1}.order-summary-list-v3{grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr))}.order-summary-progress-v3{grid-column:1/-1}}
@media(max-width:620px){.order-create-v3{gap:12px}.order-ordering-hero-v3{padding:18px;border-radius:17px}.order-ordering-hero-v3 h2{font-size:20px}.order-ordering-hero-v3 p{font-size:11px;line-height:1.6}.order-create-guide-v3{margin-left:-2px;margin-right:-2px;border-radius:16px}.order-step-list-v3{grid-template-columns:repeat(4,minmax(120px,1fr))}.order-form-panel-v3{border-radius:16px}.order-form-head-v3{padding:18px 17px 15px}.order-form-head-v3 h2{font-size:18px}.order-form-head-v3 p{font-size:10px}.order-form-step-badge-v3{width:46px;height:46px;border-radius:13px}.order-form-step-badge-v3 strong{font-size:17px}.order-form-error-v3{margin:12px 14px 0}.order-wizard-section-v3{padding:18px 16px 8px}.order-section-title-v3{margin-bottom:15px}.order-section-title-v3 h3{font-size:15px}.order-section-title-v3 p{font-size:9.5px}.order-field-v3{font-size:11.5px}.order-field-v3 input,.order-field-v3 select,.order-field-v3 textarea{min-height:48px;font-size:13px}.order-form-grid-v3.two,.order-form-grid-v3.three{grid-template-columns:1fr}.package-choice-v3{grid-template-columns:1fr}.package-card-v3>span{min-height:0}.package-card-v3 small{min-height:0}.order-layout-preview-v3{grid-template-columns:66px minmax(0,1fr);padding:12px}.order-upload-zone-v3{min-height:165px;padding:20px 14px}.order-field-meta-v3{align-items:flex-start;flex-direction:column}.order-wizard-actions-v3{padding:12px 15px;bottom:-1px}.order-wizard-actions-v3 .btn{flex:1;min-width:0}.order-action-spacer-v3{display:none}.order-live-summary-v3{grid-template-columns:1fr;padding:16px;border-radius:16px}.order-summary-head-v3,.order-summary-title-v3,.order-summary-list-v3,.order-summary-progress-v3{grid-column:auto}.order-summary-list-v3{grid-template-columns:1fr 1fr}.order-summary-list-v3>div{display:block}.order-summary-list-v3 dd{margin-top:3px;text-align:left}.order-summary-safe-v3{display:flex}.order-summary-title-v3 strong{font-size:11px}}
@media(prefers-reduced-motion:reduce){.order-create-v3 *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}


/* =========================================================
   PESAN NASKAH — TRUE MOBILE RESPONSIVE V2
   Prevents desktop-width clipping and turns the order wizard
   into a native mobile layout instead of a scaled desktop view.
   ========================================================= */
@media (max-width: 900px) {
    body.order-create-page {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    body.order-create-page .app-shell,
    body.order-create-page .main,
    body.order-create-page .page-content,
    body.order-create-page .topbar,
    body.order-create-page .order-page,
    body.order-create-page .order-create-v3,
    body.order-create-page .order-ordering-hero-v3,
    body.order-create-page .order-create-shell-v3,
    body.order-create-page .order-create-guide-v3,
    body.order-create-page .order-form-panel-v3,
    body.order-create-page .order-form-v3,
    body.order-create-page .order-live-summary-v3 {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    body.order-create-page .main,
    body.order-create-page .page-content,
    body.order-create-page .order-create-v3 {
        overflow-x: clip;
    }
    body.order-create-page .topbar-title,
    body.order-create-page .topbar-title > div,
    body.order-create-page .top-actions,
    body.order-create-page .order-ordering-hero-v3 > div,
    body.order-create-page .order-form-head-v3 > div,
    body.order-create-page .order-section-title-v3 > div,
    body.order-create-page .order-summary-title-v3 > div,
    body.order-create-page .order-layout-preview-v3 > div {
        min-width: 0;
    }
    body.order-create-page .topbar h1,
    body.order-create-page .order-ordering-hero-v3 h2,
    body.order-create-page .order-form-head-v3 h2,
    body.order-create-page .order-section-title-v3 h3,
    body.order-create-page .order-field-v3 span,
    body.order-create-page .order-summary-title-v3 strong {
        overflow-wrap: anywhere;
    }
    body.order-create-page .order-create-shell-v3 {
        display: block;
    }
    body.order-create-page .order-create-guide-v3 {
        overflow: hidden;
    }
    body.order-create-page .order-step-list-v3 {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: visible;
    }
    body.order-create-page .order-step-list-v3 button {
        min-width: 0;
        max-width: 100%;
    }
    body.order-create-page .order-form-grid-v3,
    body.order-create-page .package-choice-v3,
    body.order-create-page .order-layout-preview-v3,
    body.order-create-page .order-file-preview-v3,
    body.order-create-page .order-final-check-v3,
    body.order-create-page .order-summary-list-v3 {
        min-width: 0;
        max-width: 100%;
    }
    body.order-create-page .order-field-v3,
    body.order-create-page .order-field-v3 input,
    body.order-create-page .order-field-v3 select,
    body.order-create-page .order-field-v3 textarea,
    body.order-create-page .order-input-suffix-v3,
    body.order-create-page .order-input-suffix-v3 input {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 620px) {
    body.order-create-page .main {
        padding: 14px 12px 42px;
    }
    body.order-create-page .topbar {
        margin-bottom: 14px;
        align-items: center;
    }
    body.order-create-page .topbar-title {
        flex: 1 1 auto;
        overflow: hidden;
    }
    body.order-create-page .topbar h1 {
        max-width: 100%;
        font-size: 18px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    body.order-create-page .top-actions {
        flex: 0 0 auto;
    }
    body.order-create-page .top-create {
        display: none;
    }
    body.order-create-page .profile-trigger > span:last-child:not(.user-avatar) {
        display: none;
    }
    body.order-create-page .profile-trigger {
        width: 40px;
        min-width: 40px;
        padding: 4px;
    }
    body.order-create-page .profile-trigger .user-avatar {
        width: 30px;
        height: 30px;
    }

    body.order-create-page .order-create-v3 {
        gap: 12px;
    }
    body.order-create-page .order-ordering-hero-v3 {
        display: block;
        padding: 18px 16px;
        border-radius: 17px;
    }
    body.order-create-page .order-ordering-hero-v3 h2 {
        font-size: 19px;
        line-height: 1.28;
    }
    body.order-create-page .order-ordering-hero-v3 p {
        font-size: 11.5px;
        line-height: 1.65;
    }

    body.order-create-page .order-create-guide-v3 {
        margin: 0 0 12px;
        padding: 13px;
        border-radius: 16px;
    }
    body.order-create-page .order-step-list-v3 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin: 0;
        overflow: visible;
    }
    body.order-create-page .order-step-list-v3 button {
        width: 100%;
        min-width: 0;
        min-height: 58px;
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 8px;
        padding: 8px;
        border-radius: 11px;
        transform: none;
    }
    body.order-create-page .order-step-list-v3 button:hover {
        transform: none;
    }
    body.order-create-page .order-step-list-v3 b {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }
    body.order-create-page .order-step-list-v3 strong {
        font-size: 10px;
        line-height: 1.25;
        white-space: normal;
    }
    body.order-create-page .order-step-list-v3 small,
    body.order-create-page .order-step-list-v3 i {
        display: none;
    }
    body.order-create-page .order-guide-progress-v3 {
        margin-top: 10px;
    }
    body.order-create-page .order-guide-progress-v3 > div:first-child {
        gap: 8px;
        font-size: 8.5px;
    }

    body.order-create-page .order-form-panel-v3 {
        border-radius: 16px;
    }
    body.order-create-page .order-form-head-v3 {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 10px;
        padding: 17px 15px 14px;
    }
    body.order-create-page .order-form-head-v3 h2 {
        font-size: 18px;
        line-height: 1.3;
    }
    body.order-create-page .order-form-head-v3 p {
        font-size: 11px;
        line-height: 1.55;
    }
    body.order-create-page .order-form-step-badge-v3 {
        width: 43px;
        height: 43px;
        flex: 0 0 auto;
    }
    body.order-create-page .order-wizard-section-v3 {
        padding: 17px 14px 8px;
    }
    body.order-create-page .order-section-title-v3 {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 9px;
    }
    body.order-create-page .order-section-title-v3 h3 {
        font-size: 14.5px;
        line-height: 1.3;
    }
    body.order-create-page .order-section-title-v3 p {
        font-size: 10.5px;
        line-height: 1.5;
    }
    body.order-create-page .order-field-v3 {
        font-size: 12px;
    }
    body.order-create-page .order-field-v3 input,
    body.order-create-page .order-field-v3 select,
    body.order-create-page .order-field-v3 textarea {
        min-height: 48px;
        padding: 11px 12px;
        font-size: 13px;
        border-radius: 11px;
    }
    body.order-create-page .order-form-grid-v3.two,
    body.order-create-page .order-form-grid-v3.three,
    body.order-create-page .package-choice-v3 {
        grid-template-columns: minmax(0, 1fr);
    }
    body.order-create-page .order-suggestion-chips-v3 {
        display: flex;
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 3px;
        scrollbar-width: none;
    }
    body.order-create-page .order-suggestion-chips-v3::-webkit-scrollbar {
        display: none;
    }
    body.order-create-page .order-suggestion-chips-v3 button {
        flex: 0 0 auto;
    }
    body.order-create-page .order-layout-preview-v3 {
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
    }
    body.order-create-page .order-layout-preview-v3 strong,
    body.order-create-page .order-layout-preview-v3 p {
        overflow-wrap: anywhere;
    }
    body.order-create-page .package-card-v3 > span {
        min-height: 0;
        padding: 15px;
    }
    body.order-create-page .package-card-v3 small {
        min-height: 0;
    }
    body.order-create-page .order-upload-zone-v3 {
        min-height: 155px;
        padding: 18px 12px;
    }
    body.order-create-page .order-field-meta-v3 {
        flex-direction: column;
        align-items: flex-start;
    }
    body.order-create-page .order-file-preview-v3 > div {
        min-width: 0;
    }
    body.order-create-page .order-file-preview-v3 strong {
        max-width: 100%;
    }

    body.order-create-page .order-wizard-actions-v3 {
        width: 100%;
        max-width: 100%;
        padding: 11px 13px calc(11px + env(safe-area-inset-bottom));
        gap: 7px;
    }
    body.order-create-page .order-wizard-actions-v3 .btn {
        min-width: 0;
        flex: 1 1 0;
        padding-inline: 9px;
        font-size: 10.5px;
        white-space: nowrap;
    }
    body.order-create-page .order-action-spacer-v3 {
        display: none;
    }

    body.order-create-page .order-live-summary-v3 {
        width: 100%;
        display: block;
        margin-top: 12px;
        padding: 15px;
        border-radius: 16px;
    }
    body.order-create-page .order-summary-head-v3,
    body.order-create-page .order-summary-title-v3,
    body.order-create-page .order-summary-list-v3,
    body.order-create-page .order-summary-progress-v3 {
        grid-column: auto;
        width: 100%;
        min-width: 0;
    }
    body.order-create-page .order-summary-list-v3 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 12px;
    }
    body.order-create-page .order-summary-list-v3 > div {
        min-width: 0;
        display: block;
    }
    body.order-create-page .order-summary-list-v3 dd {
        margin-top: 3px;
        text-align: left;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 390px) {
    body.order-create-page .main {
        padding-inline: 9px;
    }
    body.order-create-page .mobile-menu-button,
    body.order-create-page .profile-trigger {
        width: 38px;
        height: 38px;
        min-height: 38px;
    }
    body.order-create-page .topbar h1 {
        font-size: 17px;
    }
    body.order-create-page .order-ordering-hero-v3 {
        padding: 16px 14px;
    }
    body.order-create-page .order-ordering-hero-v3 h2 {
        font-size: 18px;
    }
    body.order-create-page .order-step-list-v3 {
        gap: 6px;
    }
    body.order-create-page .order-step-list-v3 button {
        min-height: 54px;
        padding: 7px;
    }
    body.order-create-page .order-step-list-v3 strong {
        font-size: 9.5px;
    }
    body.order-create-page .order-form-head-v3,
    body.order-create-page .order-wizard-section-v3 {
        padding-left: 12px;
        padding-right: 12px;
    }
    body.order-create-page .order-summary-list-v3 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* =========================================================
   TIM & USER — MEDIUM, DYNAMIC, RESPONSIVE
   ========================================================= */
.team-users-page .page-content{overflow-x:hidden}.team-users-shell{display:grid;gap:16px;max-width:1500px;margin:0 auto}.team-users-hero{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:26px 28px;border:1px solid #e6e5f4;border-radius:22px;background:linear-gradient(135deg,#fff 0%,#fbfaff 62%,#f1eeff 100%);box-shadow:0 14px 36px rgba(24,29,64,.055)}.team-users-hero:after{content:"";position:absolute;width:230px;height:230px;right:-100px;top:-125px;border-radius:50%;background:radial-gradient(circle,rgba(104,85,232,.17),rgba(104,85,232,0) 68%);pointer-events:none}.team-users-hero-copy{position:relative;z-index:1;min-width:0}.team-users-hero h2{margin:6px 0 7px;color:#161b2d;font-size:27px;line-height:1.2;letter-spacing:-.035em}.team-users-hero p{max-width:760px;margin:0;color:#747c8d;font-size:13px;line-height:1.65}.team-add-button{position:relative;z-index:1;min-height:46px;padding-inline:18px;flex:0 0 auto;font-size:12px}.team-add-icon{font-size:17px;line-height:1}.team-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.team-stat-card{min-width:0;display:grid;grid-template-columns:44px minmax(0,1fr);gap:12px;align-items:center;padding:17px 18px;border:1px solid #e6e8ef;border-radius:16px;background:#fff;box-shadow:0 8px 22px rgba(24,29,64,.04);transition:.18s ease}.team-stat-card:hover{transform:translateY(-2px);border-color:#d9d5fa;box-shadow:0 13px 30px rgba(48,41,107,.075)}.team-stat-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:13px;background:#f0edff;color:#6254dc;font-size:14px;font-weight:900}.team-stat-card.admin .team-stat-icon{background:#eeeaff;color:#5c4bd6}.team-stat-card.editor .team-stat-icon{background:#edf7ff;color:#287db7}.team-stat-card.client .team-stat-icon{background:#ecfaf4;color:#16845c}.team-stat-card small{display:block;color:#9298a6;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.07em}.team-stat-card strong{display:block;margin:2px 0;color:#202536;font-size:23px;line-height:1.15}.team-stat-card p{margin:0;color:#9298a6;font-size:9.5px}.team-users-panel{padding:22px;border:1px solid #e6e8ef;border-radius:20px;background:#fff;box-shadow:0 12px 32px rgba(24,29,64,.045)}.team-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding-bottom:17px;border-bottom:1px solid #eceef3}.team-panel-head h3{margin:4px 0 5px;color:#222839;font-size:20px}.team-panel-head p{margin:0;color:#858c9b;font-size:11.5px}.team-result-count{padding:7px 10px;border:1px solid #e4e1fa;border-radius:999px;color:#6257c9;background:#f8f7ff;font-size:10px;font-weight:800;white-space:nowrap}.team-filter-form{display:grid;grid-template-columns:minmax(230px,1fr) 190px auto;gap:9px;margin:17px 0 11px}.team-search-wrap{position:relative;min-width:0}.team-search-wrap input,.team-role-select{width:100%;height:44px;border:1px solid #dde1e9;border-radius:11px;background:#fbfcfe;color:#232a39;font:inherit;font-size:12px;outline:none;transition:.18s}.team-search-wrap input{padding:0 38px 0 38px}.team-role-select{padding:0 11px}.team-search-wrap input:focus,.team-role-select:focus{border-color:#8072ee;background:#fff;box-shadow:0 0 0 4px rgba(104,88,230,.07)}.team-search-icon{position:absolute;left:13px;top:50%;transform:translateY(-50%);color:#9299a8;font-size:16px;pointer-events:none}.team-search-clear{position:absolute;right:10px;top:50%;width:24px;height:24px;display:grid;place-items:center;transform:translateY(-50%);border-radius:7px;color:#8b92a0;background:#f0f1f5;font-size:15px}.team-filter-button{height:44px;min-height:44px;padding-inline:16px;font-size:11px}.team-role-chips{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:14px}.team-role-chips button{display:inline-flex;align-items:center;gap:7px;min-height:32px;padding:6px 10px;border:1px solid #e1e4eb;border-radius:999px;color:#697181;background:#fff;font:inherit;font-size:10px;font-weight:750;cursor:pointer;transition:.16s}.team-role-chips button:hover,.team-role-chips button.active{border-color:#d1cbfb;color:#5d50d4;background:#f6f4ff}.team-role-chips b{min-width:20px;padding:2px 5px;border-radius:999px;background:#f2f3f6;color:#727a89;font-size:8px;text-align:center}.team-role-chips button.active b{background:#e9e5ff;color:#5d50d4}.team-user-list{display:grid;gap:9px}.team-user-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:center;padding:14px 15px;border:1px solid #e8eaf0;border-radius:14px;background:#fff;transition:.17s ease}.team-user-card:hover{border-color:#dad6fa;background:#fefeff;box-shadow:0 8px 22px rgba(37,32,88,.05)}.team-user-main{min-width:0;display:grid;grid-template-columns:44px minmax(0,1fr);gap:12px;align-items:center}.team-user-avatar{width:44px;height:44px;display:grid;place-items:center;border-radius:13px;background:#eeeaff;color:#5e50d7;font-size:14px;font-weight:900}.team-user-avatar.role-editor{background:#eaf5ff;color:#287db7}.team-user-avatar.role-client{background:#e9f9f1;color:#16845c}.team-user-identity{min-width:0}.team-user-name-row{display:flex;align-items:center;gap:7px;min-width:0;flex-wrap:wrap}.team-user-name-row>strong{max-width:100%;color:#232939;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.team-user-identity>a{display:inline-block;max-width:100%;margin-top:3px;color:#6d7586;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.team-user-meta{display:flex;flex-wrap:wrap;gap:8px 14px;margin-top:5px;color:#989eaa;font-size:9.5px}.team-role-badge,.team-me-badge{display:inline-flex;align-items:center;padding:4px 7px;border-radius:999px;font-size:8px;font-weight:850;white-space:nowrap}.team-role-badge.role-admin{color:#5e4fd4;background:#eeeaff}.team-role-badge.role-editor{color:#2477aa;background:#eaf5ff}.team-role-badge.role-client{color:#177a57;background:#e8f8f0}.team-role-badge.is-pending{outline:1px dashed currentColor}.team-me-badge{color:#8a6c1d;background:#fff7db}.team-role-form{display:grid;grid-template-columns:155px auto;gap:8px;align-items:end}.team-role-form label{display:grid;gap:5px;color:#747c8c;font-size:9px;font-weight:800}.team-role-form select{width:155px;height:38px;border:1px solid #dde1e9;border-radius:10px;background:#fbfcfe;padding:0 9px;color:#2d3444;font:inherit;font-size:11px;outline:none}.team-role-form select:focus{border-color:#8174ef;box-shadow:0 0 0 3px rgba(105,89,231,.07)}.team-save-role{height:38px;min-height:38px;padding:0 11px;font-size:9.5px}.team-role-form.is-dirty .team-save-role{color:#fff;background:#6656e8;border-color:#6656e8}.team-empty-state{padding:46px 20px;text-align:center;border:1px dashed #dfe2e9;border-radius:14px;background:#fafbfc}.team-empty-state>span{width:45px;height:45px;margin:0 auto 10px;display:grid;place-items:center;border-radius:13px;color:#6256d8;background:#efedff;font-size:18px}.team-empty-state h3{margin:0 0 5px;font-size:16px}.team-empty-state p{margin:0 0 13px;color:#8b92a0;font-size:11px}.team-pagination{margin-top:16px;padding-top:14px;border-top:1px solid #eceef3}.team-user-modal{position:fixed;inset:0;z-index:2500;display:grid;place-items:center;padding:22px;visibility:hidden;opacity:0;pointer-events:none;transition:opacity .18s ease,visibility .18s ease}.team-user-modal.is-open{visibility:visible;opacity:1;pointer-events:auto}.team-modal-backdrop{position:absolute;inset:0;border:0;background:rgba(18,22,43,.52);backdrop-filter:blur(5px);cursor:default}.team-modal-card{position:relative;z-index:1;width:min(680px,100%);max-height:min(780px,calc(100vh - 44px));overflow:auto;padding:0;border:1px solid rgba(229,231,241,.95);border-radius:22px;background:#fff;box-shadow:0 28px 80px rgba(15,19,43,.24);transform:translateY(10px) scale(.985);transition:transform .2s ease}.team-user-modal.is-open .team-modal-card{transform:none}.team-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:22px 24px 18px;border-bottom:1px solid #eceef3;background:linear-gradient(180deg,#fff,#fbfaff)}.team-modal-head h2{margin:4px 0 4px;font-size:22px}.team-modal-head p{margin:0;color:#848b99;font-size:11.5px}.team-modal-close{width:36px;height:36px;display:grid;place-items:center;flex:0 0 auto;border:1px solid #e1e4eb;border-radius:11px;color:#747b89;background:#fff;font-size:18px;cursor:pointer}.team-create-form{display:grid;gap:14px;padding:20px 24px 24px}.team-form-grid{display:grid;gap:12px}.team-form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.team-field{display:grid;gap:7px;color:#4f5767;font-size:11.5px;font-weight:800}.team-field>span{display:flex;align-items:center;gap:6px}.team-field em{padding:2px 6px;border-radius:999px;color:#7768dc;background:#f1efff;font-size:8px;font-style:normal}.team-field input,.team-field select{width:100%;height:46px;border:1px solid #dde1e9;border-radius:11px;background:#fbfcfe;padding:0 12px;color:#242b3b;font:inherit;font-size:12.5px;outline:none}.team-field input:focus,.team-field select:focus{border-color:#8174ef;background:#fff;box-shadow:0 0 0 4px rgba(105,89,231,.07)}.team-password-wrap{position:relative}.team-password-wrap input{padding-right:92px}.team-password-wrap button{position:absolute;right:7px;top:50%;transform:translateY(-50%);min-height:32px;padding:0 10px;border:0;border-radius:8px;color:#6256d5;background:#f0edff;font:inherit;font-size:9px;font-weight:800;cursor:pointer}.team-role-preview{display:grid;grid-template-columns:40px 1fr;gap:11px;align-items:center;padding:12px 13px;border:1px solid #e4e1fb;border-radius:13px;background:#faf9ff}.team-role-preview-icon{width:40px;height:40px;display:grid;place-items:center;border-radius:11px;color:#fff;background:#6454df;font-size:12px;font-weight:900}.team-role-preview strong{display:block;color:#2b3141;font-size:12px}.team-role-preview p{margin:3px 0 0;color:#7e8595;font-size:9.5px;line-height:1.55}.team-role-preview[data-role="editor"]{border-color:#dbeefa;background:#f7fcff}.team-role-preview[data-role="editor"] .team-role-preview-icon{background:#398bc1}.team-role-preview[data-role="client"]{border-color:#d9eee4;background:#f7fcf9}.team-role-preview[data-role="client"] .team-role-preview-icon{background:#249269}.team-form-errors{margin:16px 24px 0;padding:12px 14px;border:1px solid #ffd1d1;border-radius:11px;color:#a73535;background:#fff6f6;font-size:10px}.team-form-errors strong{font-size:11px}.team-form-errors ul{margin:6px 0 0;padding-left:18px}.team-modal-actions{display:flex;justify-content:flex-end;gap:8px;padding-top:5px}.team-modal-actions .btn{min-width:115px}.team-modal-open{overflow:hidden}
@media(max-width:1050px){.team-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.team-user-card{grid-template-columns:1fr}.team-role-form{justify-self:stretch;grid-template-columns:minmax(150px,1fr) auto}.team-role-form select{width:100%}}
@media(max-width:700px){.team-users-shell{gap:12px}.team-users-hero{display:grid;padding:19px;border-radius:18px}.team-users-hero h2{font-size:22px}.team-users-hero p{font-size:11.5px}.team-add-button{width:100%;min-height:44px}.team-stat-grid{grid-template-columns:1fr 1fr;gap:8px}.team-stat-card{grid-template-columns:38px minmax(0,1fr);padding:13px;border-radius:13px}.team-stat-icon{width:38px;height:38px;border-radius:11px}.team-stat-card strong{font-size:19px}.team-stat-card p{display:none}.team-users-panel{padding:14px;border-radius:16px}.team-panel-head{display:grid;gap:8px}.team-panel-head h3{font-size:18px}.team-panel-head p{font-size:10.5px}.team-result-count{justify-self:start}.team-filter-form{grid-template-columns:1fr auto;gap:7px}.team-search-wrap{grid-column:1/-1}.team-role-select{min-width:0}.team-filter-button{padding-inline:12px}.team-role-chips{overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px;scrollbar-width:none}.team-role-chips::-webkit-scrollbar{display:none}.team-role-chips button{flex:0 0 auto}.team-user-card{padding:13px;gap:12px}.team-user-main{grid-template-columns:40px minmax(0,1fr);align-items:start}.team-user-avatar{width:40px;height:40px;border-radius:11px}.team-user-name-row>strong{font-size:12.5px}.team-user-identity>a{font-size:10.5px}.team-user-meta{display:grid;gap:3px;font-size:9px}.team-role-form{grid-template-columns:1fr auto;padding-top:11px;border-top:1px solid #edf0f4}.team-role-form label{font-size:8.5px}.team-role-form select{height:40px;font-size:11px}.team-save-role{height:40px;min-height:40px}.team-user-modal{align-items:end;padding:0}.team-modal-card{width:100%;max-height:92dvh;border-radius:22px 22px 0 0;transform:translateY(30px)}.team-modal-head{padding:18px 17px 15px}.team-modal-head h2{font-size:20px}.team-modal-head p{font-size:10.5px}.team-create-form{padding:17px}.team-form-grid.two{grid-template-columns:1fr}.team-field{font-size:11.5px}.team-field input,.team-field select{height:48px;font-size:13px}.team-modal-actions{position:sticky;bottom:-17px;margin:4px -17px -17px;padding:12px 17px calc(12px + env(safe-area-inset-bottom));background:rgba(255,255,255,.95);backdrop-filter:blur(10px);border-top:1px solid #eceef3}.team-modal-actions .btn{flex:1;min-width:0}.team-form-errors{margin:12px 17px 0}}
@media(max-width:390px){.team-stat-grid{grid-template-columns:1fr}.team-filter-form{grid-template-columns:1fr}.team-search-wrap{grid-column:auto}.team-filter-button{width:100%}.team-role-form{grid-template-columns:1fr}.team-save-role{width:100%}}
@media(prefers-reduced-motion:reduce){.team-stat-card,.team-user-card,.team-user-modal,.team-modal-card{transition:none!important}}

/* =========================================================
   PESANAN NASKAH · MEDIUM / DYNAMIC / RESPONSIVE UI
   ========================================================= */
.orders-workspace{display:grid;gap:16px;min-width:0;max-width:100%;overflow:clip}.orders-hero{position:relative;min-width:0;padding:24px 26px;border:1px solid #e7e6f3;border-radius:20px;background:linear-gradient(135deg,#fff 0%,#faf9ff 64%,#f0edff 100%);box-shadow:0 10px 34px rgba(37,32,88,.055);display:flex;align-items:center;justify-content:space-between;gap:22px;overflow:hidden}.orders-hero:before{content:"";position:absolute;right:-70px;top:-90px;width:240px;height:240px;border-radius:50%;background:radial-gradient(circle,rgba(105,85,232,.14),rgba(105,85,232,0) 68%);pointer-events:none}.orders-hero-production{background:linear-gradient(135deg,#fff 0%,#f8f7ff 58%,#efecff 100%)}.orders-hero-copy{position:relative;z-index:1;min-width:0}.orders-eyebrow{display:inline-flex;align-items:center;gap:6px;color:#7367dd;font-size:9px;font-weight:850;letter-spacing:.13em;text-transform:uppercase}.orders-hero h2{max-width:780px;margin:6px 0 7px;color:#171d2d;font-size:25px;line-height:1.18;letter-spacing:-.035em}.orders-hero p{max-width:760px;margin:0;color:#727b8c;font-size:12px;line-height:1.65}.orders-hero-orb{position:relative;z-index:1;flex:0 0 auto;width:66px;height:66px;display:grid;place-items:center;border:1px solid rgba(108,90,231,.15);border-radius:20px;background:linear-gradient(145deg,#6f5dea,#5848d0);box-shadow:0 14px 32px rgba(89,69,210,.22);color:#fff;font-size:22px}.orders-new-button{position:relative;z-index:1;min-height:44px;padding-inline:17px;white-space:nowrap}
.orders-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.orders-stat-card{min-width:0;display:grid;grid-template-columns:44px minmax(0,1fr);gap:11px;align-items:center;padding:14px 15px;border:1px solid #e7e9ef;border-radius:15px;background:#fff;box-shadow:0 5px 18px rgba(27,32,54,.035);transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}.orders-stat-card:hover{transform:translateY(-2px);border-color:#dcd7fa;box-shadow:0 11px 26px rgba(37,32,88,.075)}.orders-stat-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:13px;background:#efedff;color:#6254d8;font-size:15px;font-weight:900}.orders-stat-card.is-new .orders-stat-icon{background:#fff4df;color:#b47a16}.orders-stat-card.is-active .orders-stat-icon{background:#eaf4ff;color:#2c78af}.orders-stat-card.is-review .orders-stat-icon{background:#fff3df;color:#a76d16}.orders-stat-card.is-done .orders-stat-icon{background:#e9f8f0;color:#18805c}.orders-stat-card small{display:block;color:#8c94a3;font-size:9.5px;font-weight:750}.orders-stat-card strong{display:block;margin-top:1px;color:#202637;font-size:22px;line-height:1.05}.orders-stat-card p{margin:3px 0 0;color:#9aa1ad;font-size:9px;line-height:1.4}
.orders-panel{min-width:0;padding:18px;border:1px solid #e7e9ef;border-radius:18px;background:#fff;box-shadow:0 7px 24px rgba(27,32,54,.035)}.orders-panel-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:13px}.orders-panel-head h3{margin:4px 0 3px;color:#202637;font-size:19px;letter-spacing:-.02em}.orders-panel-head p{margin:0;color:#8a92a0;font-size:11px}.orders-clear-filter{flex:0 0 auto;color:#6455d9;font-size:10px;font-weight:800}.orders-filter{display:grid;grid-template-columns:minmax(260px,1fr) 210px auto;gap:8px;align-items:center}.orders-search-field,.orders-select-field{position:relative;min-width:0}.orders-search-field>span{position:absolute;left:12px;top:50%;transform:translateY(-50%);z-index:1;color:#949baa;font-size:16px;pointer-events:none}.orders-filter input,.orders-filter select{width:100%;height:44px;border:1px solid #dde1e9;border-radius:11px;background:#fbfcfe;color:#273041;font:inherit;font-size:12px;outline:none;transition:border-color .15s ease,box-shadow .15s ease,background .15s ease}.orders-filter input{padding:0 12px 0 37px}.orders-filter select{padding:0 34px 0 11px}.orders-filter input:focus,.orders-filter select:focus{border-color:#8376ed;background:#fff;box-shadow:0 0 0 4px rgba(105,89,231,.075)}.orders-filter-button{height:44px;min-height:44px;padding-inline:16px;font-size:10.5px}.orders-status-chips{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:11px 0 15px}.orders-status-chips a{display:inline-flex;align-items:center;min-height:30px;padding:5px 10px;border:1px solid #e3e5eb;border-radius:999px;background:#fff;color:#727a89;font-size:9.5px;font-weight:750;transition:.15s}.orders-status-chips a:hover,.orders-status-chips a.active{border-color:#d1cbfb;background:#f3f0ff;color:#5d50d4}
.production-order-list{display:grid;gap:9px}.production-order-card{min-width:0;display:grid;grid-template-columns:minmax(260px,1.55fr) minmax(230px,1fr) minmax(150px,.65fr) auto;gap:18px;align-items:center;padding:15px;border:1px solid #e8eaf0;border-radius:14px;background:#fff;transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease}.production-order-card:hover{transform:translateY(-1px);border-color:#d9d4f8;box-shadow:0 10px 24px rgba(37,32,88,.055)}.production-order-topline{display:flex;align-items:center;justify-content:flex-start;gap:8px;flex-wrap:wrap}.production-order-number{color:#7164dc;font-size:9.5px;font-weight:850;letter-spacing:.04em}.production-order-main h4{margin:7px 0 4px;color:#242a3a;font-size:14px;line-height:1.35}.production-order-main p{margin:0;max-width:620px;color:#7e8796;font-size:10.5px;line-height:1.55;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.production-order-tags{display:flex;gap:5px;flex-wrap:wrap;margin-top:9px}.production-order-tags span{padding:4px 7px;border-radius:999px;background:#f5f4fa;color:#6e7584;font-size:8.5px;font-weight:700}.production-order-people{display:grid;grid-template-columns:1fr 1fr;gap:12px;min-width:0}.production-order-people>div{min-width:0;padding-left:10px;border-left:2px solid #eeeef5}.production-order-people small,.production-order-progress small{display:block;color:#999fac;font-size:8.5px}.production-order-people strong{display:block;margin:3px 0 2px;color:#303747;font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.production-order-people span{display:block;color:#9ba2ae;font-size:8.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.production-order-progress{min-width:0}.production-order-progress-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}.production-order-progress-head strong{color:#5e51d6;font-size:11px}.orders-progress{height:7px;border-radius:999px;background:#edf0f5;overflow:hidden}.orders-progress>span{display:block;width:var(--order-progress,0%);height:100%;border-radius:inherit;background:linear-gradient(90deg,#6355ea,#9572ff);transform-origin:left;transition:width .45s ease}.production-order-progress>.orders-progress+small{margin-top:5px}.production-order-action{display:flex;justify-content:flex-end}.production-order-action .btn{min-height:39px;padding-inline:13px;white-space:nowrap;font-size:9.5px}.production-order-action .btn span{margin-left:4px}.orders-empty{padding:48px 18px;text-align:center;border:1px dashed #dfe2e9;border-radius:14px;background:#fafbfc}.orders-empty>span{width:48px;height:48px;margin:0 auto 10px;display:grid;place-items:center;border-radius:14px;background:#efedff;color:#6255d7;font-size:18px}.orders-empty h3{margin:0 0 5px;color:#2a3040;font-size:17px}.orders-empty p{max-width:470px;margin:0 auto 14px;color:#8c94a2;font-size:11px;line-height:1.55}.orders-pagination{margin-top:14px;padding-top:13px;border-top:1px solid #eceef3}
.client-order-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.client-order-card{min-width:0;padding:15px;border:1px solid #e7e9ef;border-radius:15px;background:#fff;color:inherit;box-shadow:0 5px 18px rgba(27,32,54,.03);transition:transform .17s ease,border-color .17s ease,box-shadow .17s ease}.client-order-card:hover{transform:translateY(-2px);border-color:#d7d2f8;box-shadow:0 12px 28px rgba(37,32,88,.07)}.client-order-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.client-order-card-head>span{color:#7063d9;font-size:9px;font-weight:850}.client-order-card h3{margin:11px 0 5px;color:#252b3b;font-size:14px;line-height:1.35}.client-order-card>p{min-height:33px;margin:0;color:#818997;font-size:10px;line-height:1.55;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.client-order-meta{display:flex;gap:5px;flex-wrap:wrap;margin:10px 0 13px}.client-order-meta span{padding:4px 7px;border-radius:999px;background:#f4f2ff;color:#6356d6;font-size:8px;font-weight:750}.client-order-progress-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}.client-order-progress-head small{color:#8c94a2;font-size:8.5px}.client-order-progress-head strong{color:#5e51d6;font-size:10px}.client-order-card footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:8px;align-items:end;margin-top:12px;padding-top:11px;border-top:1px solid #eceef3}.client-order-card footer small{display:block;color:#9aa1ad;font-size:7.5px}.client-order-card footer strong{display:block;margin-top:2px;color:#4e5666;font-size:8.8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.client-order-card footer i{width:28px;height:28px;display:grid;place-items:center;border-radius:9px;background:#f0edff;color:#6255d7;font-style:normal;font-weight:900}
.orders-workspace .order-status{padding:5px 8px;font-size:8.5px}.orders-workspace [data-order-card].is-local-hidden{display:none!important}.orders-workspace.is-filtering .production-order-card,.orders-workspace.is-filtering .client-order-card{transition:none}
@media(max-width:1180px){.orders-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.production-order-card{grid-template-columns:minmax(240px,1.3fr) minmax(210px,1fr) 150px}.production-order-action{grid-column:1/-1;justify-content:flex-end;padding-top:10px;border-top:1px solid #eef0f4}.client-order-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:820px){.orders-workspace{gap:12px}.orders-hero{padding:20px}.orders-hero h2{font-size:22px}.orders-hero p{font-size:11.5px}.orders-hero-orb{width:54px;height:54px;border-radius:16px}.orders-panel{padding:14px}.orders-filter{grid-template-columns:1fr 180px auto}.production-order-card{grid-template-columns:1fr 1fr;gap:12px}.production-order-main{grid-column:1/-1}.production-order-people{grid-column:1}.production-order-progress{grid-column:2}.production-order-action{grid-column:1/-1}.production-order-action .btn{width:100%;justify-content:center}.client-order-grid{grid-template-columns:1fr 1fr}}
@media(max-width:620px){.orders-workspace{width:100%;max-width:100%;overflow:hidden}.orders-hero{display:grid;padding:18px 16px;border-radius:17px}.orders-hero h2{font-size:20px;line-height:1.25}.orders-hero p{font-size:11px}.orders-hero-orb{display:none}.orders-new-button{width:100%;justify-content:center}.orders-stats{grid-template-columns:1fr 1fr;gap:7px}.orders-stat-card{grid-template-columns:38px minmax(0,1fr);gap:9px;padding:12px;border-radius:13px}.orders-stat-icon{width:38px;height:38px;border-radius:11px}.orders-stat-card small{font-size:8.5px}.orders-stat-card strong{font-size:19px}.orders-stat-card p{display:none}.orders-panel{padding:12px;border-radius:16px}.orders-panel-head{align-items:flex-start}.orders-panel-head h3{font-size:17px}.orders-panel-head p{font-size:10px}.orders-clear-filter{font-size:9px}.orders-filter{grid-template-columns:1fr;gap:7px}.orders-filter input,.orders-filter select,.orders-filter-button{height:46px;min-height:46px;font-size:12px}.orders-filter-button{width:100%}.orders-status-chips{margin-top:9px;overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px;scrollbar-width:none}.orders-status-chips::-webkit-scrollbar{display:none}.orders-status-chips a{flex:0 0 auto;min-height:31px}.production-order-card{grid-template-columns:1fr;padding:13px;gap:11px;border-radius:13px}.production-order-main,.production-order-people,.production-order-progress,.production-order-action{grid-column:auto}.production-order-main h4{font-size:13.5px}.production-order-main p{font-size:10px}.production-order-people{grid-template-columns:1fr 1fr;gap:8px}.production-order-people>div{padding-left:8px}.production-order-progress{padding:10px;border-radius:11px;background:#fafaff}.production-order-action{padding-top:10px}.client-order-grid{grid-template-columns:1fr}.client-order-card{padding:14px}.client-order-card h3{font-size:13.5px}.client-order-card footer{grid-template-columns:1fr 1fr auto}.orders-empty{padding:38px 14px}.orders-pagination{overflow:auto}}
@media(max-width:390px){.orders-stats{grid-template-columns:1fr}.orders-stat-card p{display:block}.production-order-people{grid-template-columns:1fr}.client-order-card footer{grid-template-columns:1fr auto}.client-order-card footer>div:nth-child(2){grid-column:1}.client-order-card footer i{grid-column:2;grid-row:1/3;align-self:center}}
@media(prefers-reduced-motion:reduce){.orders-stat-card,.production-order-card,.client-order-card,.orders-progress>span{transition:none!important}}

/* === AI Quality Pipeline: Queue + Versioning + RAG + QC === */
.quality-workspace{display:grid;gap:18px;max-width:1500px;margin:0 auto}.quality-hero{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:24px 26px;border:1px solid var(--line);border-radius:24px;background:linear-gradient(135deg,#fff,#f7f6ff);box-shadow:0 14px 38px rgba(44,39,105,.07)}.quality-hero h1{margin:5px 0 3px;font-size:25px}.quality-hero p{margin:0;color:var(--muted)}.quality-hero-actions{display:flex;flex-wrap:wrap;gap:9px}.quality-hero-actions form{margin:0}.quality-stat-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.quality-stat-grid article{padding:17px 18px;border:1px solid var(--line);border-radius:18px;background:#fff}.quality-stat-grid span,.quality-stat-grid small{display:block;color:var(--muted);font-size:12px}.quality-stat-grid strong{display:block;margin:5px 0 2px;font-size:22px}.quality-grid{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px;align-items:start}.quality-panel{border:1px solid var(--line);border-radius:22px;background:#fff;padding:20px}.quality-panel header{display:flex;justify-content:space-between;gap:14px;margin-bottom:16px}.quality-panel h2{margin:4px 0;font-size:19px}.quality-panel p{color:var(--muted)}.quality-panel.compact{padding:18px}.quality-side{display:grid;gap:14px}.quality-section-list{display:grid;gap:10px}.quality-section-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:14px 15px;border:1px solid var(--line);border-radius:17px;background:#fbfcff}.quality-section-main{display:flex;gap:10px;align-items:center;min-width:0}.quality-section-main>div{min-width:0}.quality-section-main strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}.quality-section-main small{color:var(--muted);font-size:11px}.quality-status-dot{width:10px;height:10px;border-radius:50%;background:#f6b73c;box-shadow:0 0 0 5px rgba(246,183,60,.12)}.status-passed .quality-status-dot{background:#20b978;box-shadow:0 0 0 5px rgba(32,185,120,.12)}.status-failed .quality-status-dot{background:#ed5c6b;box-shadow:0 0 0 5px rgba(237,92,107,.12)}.quality-score{display:flex;align-items:baseline;gap:2px}.quality-score strong{font-size:21px}.quality-score span{font-size:10px;color:var(--muted)}.quality-metrics{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.quality-metrics span{padding:8px 9px;background:#fff;border:1px solid #edf0f6;border-radius:11px;font-size:10px;color:var(--muted)}.quality-metrics b{display:block;color:var(--text);font-size:12px;margin-top:2px}.quality-section-card details{grid-column:1/-1}.quality-section-card summary{cursor:pointer;font-size:11px;color:#6255dd;font-weight:700}.quality-issues{display:grid;gap:5px;margin-top:8px}.quality-issues p{margin:0;padding:8px 10px;border-radius:9px;background:#fff8e8;color:#805f17;font-size:11px}.quality-issues p.severity-failed{background:#fff0f2;color:#a93745}.quality-kv{display:flex;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--line);font-size:12px}.quality-note{font-size:11px;line-height:1.6;margin:12px 0 0}.quality-task-list{display:grid;gap:8px;margin-top:12px}.quality-task{display:flex;justify-content:space-between;gap:10px;padding:10px 11px;border:1px solid var(--line);border-radius:12px;background:#fafbff}.quality-task strong{display:block;font-size:11px;text-transform:capitalize}.quality-task small{font-size:10px;color:var(--muted)}.quality-task>span{font-size:11px;font-weight:800;color:#6657ee}.quality-empty{text-align:center;padding:42px 20px;background:#fafbff;border-radius:16px}.quality-empty p{font-size:12px}.version-history-modal .fit-book-dialog{max-width:720px}.version-list{display:grid;gap:9px;max-height:55vh;overflow:auto;padding-right:3px}.version-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:11px;align-items:start;padding:12px;border:1px solid var(--line);border-radius:14px;background:#fbfcff}.version-badge{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:#efedff;color:#6657ee;font-weight:800;font-size:11px}.version-copy strong{display:block;font-size:12px}.version-copy small{display:block;color:var(--muted);font-size:10px;margin:2px 0 5px}.version-copy p{margin:0;color:#4f5668;font-size:10px;line-height:1.5}.version-restore{border:1px solid #d9d5ff;background:#fff;color:#5d50da;border-radius:9px;padding:7px 9px;font-size:10px;font-weight:800;cursor:pointer}.qc-mini-badge{display:inline-flex;align-items:center;gap:5px;padding:4px 7px;border-radius:999px;font-size:9px;font-weight:800;background:#fff4d8;color:#8b691c}.qc-mini-badge.passed{background:#e9fbf3;color:#16845b}.qc-mini-badge.failed{background:#fff0f2;color:#b53b4b}
@media(max-width:1050px){.quality-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.quality-grid{grid-template-columns:1fr}.quality-side{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.quality-workspace{gap:12px}.quality-hero{align-items:flex-start;flex-direction:column;padding:18px;border-radius:18px}.quality-hero h1{font-size:21px}.quality-hero-actions{width:100%}.quality-hero-actions .btn,.quality-hero-actions form{flex:1 1 100%;width:100%}.quality-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.quality-stat-grid article{padding:13px;border-radius:14px}.quality-stat-grid strong{font-size:19px}.quality-side{grid-template-columns:1fr}.quality-panel{padding:14px;border-radius:16px}.quality-section-card{grid-template-columns:minmax(0,1fr) auto;padding:11px}.quality-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.version-row{grid-template-columns:auto minmax(0,1fr)}.version-restore{grid-column:1/-1;width:100%}}
.ai-tool-list .ai-tool-link{display:flex;align-items:center;gap:11px;width:100%;padding:12px;border:1px solid var(--line);border-radius:13px;background:#fff;color:inherit;text-decoration:none}.ai-tool-list .ai-tool-link>span{display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:#f0eeff;color:#6757ee;font-weight:800}.ai-tool-list .ai-tool-link strong,.ai-tool-list .ai-tool-link small{display:block}.ai-tool-list .ai-tool-link strong{font-size:11px}.ai-tool-list .ai-tool-link small{font-size:9px;color:var(--muted);margin-top:2px}

/* === Production Control + Editorial Approval + Provenance + Advanced Queue === */
.editorial-gate-bar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px 14px;border-top:1px solid #e7e9f2;border-bottom:1px solid #eceef5;background:linear-gradient(90deg,#fbfbff,#f6f7ff)}
.editorial-gate-state{display:flex;align-items:center;gap:10px;min-width:0}.editorial-gate-state small{color:#777b90;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.editorial-gate-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.editorial-status{display:inline-flex;align-items:center;border-radius:999px;padding:6px 10px;font-size:11px;font-weight:800;letter-spacing:.02em;white-space:nowrap}.editorial-status.status-draft{background:#eef0f6;color:#596071}.editorial-status.status-need_review{background:#fff1c7;color:#926300}.editorial-status.status-approved{background:#dcfce7;color:#14703d}.editorial-status.status-changes_requested{background:#fee2e2;color:#b42318}
.citation-dialog{max-width:840px}.citation-list{display:grid;gap:12px;max-height:min(62vh,620px);overflow:auto;padding:4px}.citation-card{border:1px solid #e5e8f1;border-radius:16px;padding:14px;background:#fff;box-shadow:0 8px 26px rgba(35,39,74,.05)}.citation-card.is-verified{border-color:#a8e0bf;background:#fbfffc}.citation-card-head{display:flex;gap:10px;align-items:flex-start}.citation-label{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:30px;border-radius:9px;background:#ede9fe;color:#6d4aff;font-size:11px;font-weight:800}.citation-card-head strong{display:block;font-size:13px;color:#25283b}.citation-card-head small{display:block;margin-top:3px;color:#85899c}.citation-locator{display:block;margin:9px 0 0;color:#6c55e8;font-size:11px;word-break:break-all}.citation-card p{margin:10px 0;color:#555b70;font-size:12px;line-height:1.65}.citation-card-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #edf0f5;padding-top:10px}.citation-card-foot span{font-size:11px;color:#6e7388}.citation-card-foot button{border:0;background:#f1efff;color:#6048d9;border-radius:10px;padding:8px 10px;font-weight:700;cursor:pointer}.quality-editorial-badge{font-size:10px;font-weight:800;border-radius:999px;padding:5px 8px;white-space:nowrap}.quality-editorial-badge.editorial-approved{background:#dcfce7;color:#14703d}.quality-editorial-badge.editorial-need_review{background:#fff1c7;color:#926300}.quality-editorial-badge.editorial-changes_requested{background:#fee2e2;color:#b42318}.quality-editorial-badge.editorial-draft{background:#eef0f6;color:#596071}
.production-control,.queue-monitor{display:grid;gap:18px}.production-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding:24px 26px;border-radius:24px;background:linear-gradient(135deg,#171a3b 0%,#25255b 58%,#333270 100%);color:#fff;box-shadow:0 20px 52px rgba(27,29,75,.18)}.production-hero h1{margin:5px 0 7px;font-size:28px;line-height:1.08}.production-hero p{margin:0;color:#c9cce3;max-width:760px;font-size:13px;line-height:1.6}.production-hero .eyebrow{color:#b9b1ff}.production-hero-actions{display:flex;gap:8px;flex-wrap:wrap}.production-hero .btn-secondary{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.15);color:#fff}
.production-stat-grid,.queue-stat-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}.production-stat-grid article,.queue-stat-grid article{padding:16px;border:1px solid #e7e9f1;border-radius:18px;background:#fff;box-shadow:0 8px 28px rgba(35,39,74,.045)}.production-stat-grid span,.queue-stat-grid span{display:block;color:#777d91;font-size:11px;font-weight:700}.production-stat-grid strong,.queue-stat-grid strong{display:block;margin:6px 0 2px;color:#282c44;font:800 25px/1 Manrope,sans-serif}.production-stat-grid small{color:#9498a8;font-size:10px}.production-stat-grid article.is-danger,.queue-stat-grid article.is-danger{border-color:#fecaca;background:#fffafa}.production-stat-grid article.is-warning{border-color:#fde68a;background:#fffdf6}
.production-dashboard-grid{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(320px,.75fr);gap:16px}.production-side-stack{display:grid;gap:16px;align-content:start}.production-panel{border:1px solid #e6e8f0;border-radius:20px;background:#fff;box-shadow:0 9px 32px rgba(35,39,74,.05);overflow:hidden}.production-panel>header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:18px;border-bottom:1px solid #eef0f5}.production-panel>header h2{margin:3px 0 2px;font-size:17px}.production-panel>header p{margin:0;color:#858a9c;font-size:11px}.production-panel>header>a{font-size:11px;color:#6653db;font-weight:800}.production-list,.deadline-list,.queue-health-list{display:grid}.production-list-row,.deadline-row,.queue-health-row{display:grid;align-items:center;gap:11px;padding:13px 16px;border-bottom:1px solid #f0f1f5;color:inherit;text-decoration:none}.production-list-row:last-child,.deadline-row:last-child,.queue-health-row:last-child{border-bottom:0}.production-list-row{grid-template-columns:auto minmax(0,1fr) auto auto}.production-status-dot{width:10px;height:10px;border-radius:50%;background:#f5b942;box-shadow:0 0 0 5px rgba(245,185,66,.12)}.production-status-dot.status-failed{background:#e55353;box-shadow:0 0 0 5px rgba(229,83,83,.11)}.production-status-dot.status-changes{background:#f08c46}.production-list-row strong,.deadline-row strong,.queue-health-row strong{display:block;font-size:12px}.production-list-row small,.deadline-row small,.queue-health-row small{display:block;color:#888d9e;font-size:10px;margin-top:2px}.production-row-tags{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.production-row-tags span{font-size:9px;font-weight:800;padding:5px 7px;background:#f4f3fb;border-radius:999px;color:#696d82}.deadline-row{grid-template-columns:minmax(0,1fr) auto}.deadline-row time{font-weight:800;font-size:11px;color:#52586f}.deadline-row.is-late time{color:#b42318}.queue-health-row{grid-template-columns:minmax(0,1fr) auto}.queue-health-row>span{font-size:9px;font-weight:800;padding:5px 7px;border-radius:999px;background:#eef0f7}.queue-health-row.status-failed>span{background:#fee2e2;color:#b42318}.queue-health-row.status-running>span{background:#e0e7ff;color:#4f46b6}.quality-note{padding:12px 16px;color:#858a9c;font-size:11px;line-height:1.55}
.queue-stat-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.queue-filter-bar{display:grid;grid-template-columns:minmax(220px,1.4fr) minmax(150px,.6fr) minmax(190px,.8fr) auto auto;gap:10px;align-items:end;padding:14px;border:1px solid #e6e8f0;border-radius:18px;background:#fff}.queue-filter-bar label{display:grid;gap:5px}.queue-filter-bar label>span{font-size:10px;font-weight:800;color:#71768a}.queue-filter-bar input,.queue-filter-bar select{height:44px;border:1px solid #dfe2eb;border-radius:12px;padding:0 12px;font-size:12px;background:#fff;color:#292d43}.queue-task-list{display:grid;gap:10px}.queue-task-card{display:grid;grid-template-columns:minmax(300px,1.4fr) minmax(180px,.7fr) minmax(360px,1fr) auto;align-items:center;gap:14px;padding:15px;border:1px solid #e6e8f0;border-radius:18px;background:#fff;box-shadow:0 7px 24px rgba(35,39,74,.04)}.queue-task-card.status-failed{border-color:#fecaca}.queue-task-card.status-running{border-color:#c7d2fe}.queue-task-main{display:flex;align-items:center;gap:11px;min-width:0}.queue-task-icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:13px;background:#f0edff;color:#6652df;font-weight:800}.queue-task-title{display:flex;align-items:center;gap:8px}.queue-task-title strong{font-size:12px}.queue-task-title span{font-size:9px;font-weight:800;border-radius:999px;padding:4px 7px;background:#eef0f7}.queue-task-main p{margin:3px 0;color:#555b70;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.queue-task-main small{color:#9a9eae;font-size:9px}.queue-task-progress{display:flex;align-items:center;gap:8px}.queue-task-progress>div{height:7px;flex:1;background:#eeeef5;border-radius:99px;overflow:hidden}.queue-task-progress>div span{display:block;height:100%;background:linear-gradient(90deg,#735cf0,#5878ef);border-radius:99px}.queue-task-progress>b{font-size:10px;color:#555b70}.queue-task-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.queue-task-metrics span{padding:7px;background:#f7f8fb;border-radius:10px}.queue-task-metrics small{display:block;color:#9296a7;font-size:8px}.queue-task-metrics b{display:block;margin-top:2px;font-size:10px;color:#383d54;overflow:hidden;text-overflow:ellipsis}.queue-task-actions{display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap}.queue-error{grid-column:1/-1;border-radius:12px;background:#fff5f5;padding:9px 11px}.queue-error summary{cursor:pointer;font-size:10px;font-weight:800;color:#a72d2d}.queue-error pre{white-space:pre-wrap;word-break:break-word;font-size:10px;color:#753a3a;max-height:180px;overflow:auto}.queue-cancel-note{grid-column:1/-1;padding:8px 10px;border-radius:10px;background:#fff7d6;color:#805f00;font-size:10px}.pagination-wrap{display:flex;justify-content:center}

@media (max-width:1180px){.production-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.production-dashboard-grid{grid-template-columns:1fr}.queue-task-card{grid-template-columns:minmax(260px,1fr) minmax(170px,.7fr);}.queue-task-metrics,.queue-task-actions{grid-column:auto}.queue-task-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:760px){.editorial-gate-bar{align-items:flex-start;flex-direction:column}.editorial-gate-state{width:100%;align-items:flex-start;flex-direction:column;gap:5px}.editorial-gate-state small{white-space:normal}.editorial-gate-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}.editorial-gate-actions [data-section-citations]{grid-column:1/-1}.production-hero{align-items:flex-start;flex-direction:column;padding:18px;border-radius:18px}.production-hero h1{font-size:22px}.production-hero-actions{width:100%}.production-hero-actions .btn{flex:1}.production-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.production-stat-grid article{padding:13px}.production-stat-grid strong{font-size:21px}.production-list-row{grid-template-columns:auto minmax(0,1fr) auto}.production-row-tags{grid-column:2/-1;justify-content:flex-start}.production-dashboard-grid{gap:12px}.queue-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.queue-filter-bar{grid-template-columns:1fr 1fr}.queue-filter-bar label:first-child,.queue-filter-bar label:nth-child(3){grid-column:1/-1}.queue-filter-bar .btn{width:100%}.queue-task-card{grid-template-columns:1fr;padding:13px}.queue-task-progress,.queue-task-metrics,.queue-task-actions{grid-column:1}.queue-task-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.queue-task-actions{justify-content:stretch}.queue-task-actions form,.queue-task-actions a{flex:1}.queue-task-actions .btn{width:100%}.citation-card-foot{align-items:flex-start;flex-direction:column}.citation-card-foot button{width:100%}}

/* ==========================================================================\n   SIDEBAR V5 — professional, compact, responsive navigation\n   ========================================================================== */
.sidebar-v5{
    --sidebar-w:270px;
    --sidebar-icon:34px;
    width:var(--sidebar-w);
    padding:18px 14px 12px;
    overflow:hidden;
    background:
        radial-gradient(circle at 22% -5%,rgba(125,105,255,.20),transparent 25%),
        radial-gradient(circle at 100% 35%,rgba(86,69,200,.08),transparent 30%),
        linear-gradient(180deg,#171b32 0%,#111426 54%,#0e1120 100%);
    box-shadow:12px 0 42px rgba(12,15,29,.08);
}
.sidebar-v5-head{flex:0 0 auto;margin:0 2px 15px;padding:1px 3px 14px;border-bottom:1px solid rgba(255,255,255,.065)}
.sidebar-v5-brand{gap:10px;overflow:hidden}
.sidebar-v5-brand .brand-mark{width:42px;height:42px;border-radius:13px;font-size:18px;box-shadow:0 10px 25px rgba(99,81,236,.25)}
.sidebar-v5-brand .brand-copy strong{font-size:14px;line-height:1.2}
.sidebar-v5-brand .brand-copy small{margin-top:3px;font-size:9px;color:#858da9}
.sidebar-head-actions{display:flex;align-items:center;gap:5px}
.sidebar-collapse{width:30px;height:30px;display:grid;place-items:center;flex:0 0 auto;border:1px solid rgba(255,255,255,.075);border-radius:9px;background:rgba(255,255,255,.035);color:#8f97b2;cursor:pointer;transition:.18s ease}
.sidebar-collapse:hover{color:#fff;border-color:rgba(155,142,255,.3);background:rgba(114,96,234,.13)}
.sidebar-collapse svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .22s ease}
.sidebar-v5-scroll{min-height:0;flex:1;overflow-y:auto;overflow-x:hidden;padding:1px 2px 12px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.11) transparent}
.sidebar-v5-scroll::-webkit-scrollbar{width:4px}.sidebar-v5-scroll::-webkit-scrollbar-thumb{background:rgba(255,255,255,.11);border-radius:8px}
.sidebar-section+.sidebar-section{margin-top:14px}
.sidebar-v5 .sidebar-label{height:22px;padding:0 10px 7px;color:#6e7695;font-size:8px;line-height:15px;letter-spacing:.17em;white-space:nowrap;overflow:hidden;transition:.18s ease}
.sidebar-v5-nav{gap:3px}
.sidebar-v5-nav a{min-height:42px;padding:5px 9px;gap:10px;border:1px solid transparent;border-radius:11px;color:#aeb6cf;font-size:11.5px;font-weight:700;letter-spacing:-.01em;overflow:hidden}
.sidebar-v5-nav a::before{display:none}
.sidebar-v5-nav a:hover{transform:none;color:#fff;background:rgba(255,255,255,.045);border-color:rgba(255,255,255,.035)}
.sidebar-v5-nav a.active{color:#fff;border-color:rgba(134,119,255,.14);background:linear-gradient(90deg,rgba(107,88,232,.25),rgba(74,64,146,.10));box-shadow:inset 3px 0 0 #806eff,0 8px 22px rgba(7,8,20,.08)}
.sidebar-v5-nav .nav-icon{width:var(--sidebar-icon);height:var(--sidebar-icon);border-radius:10px;color:#a8a2ff;background:rgba(255,255,255,.045);transition:.18s ease}
.sidebar-v5-nav .nav-icon svg{width:16px;height:16px}
.sidebar-v5-nav a:hover .nav-icon{background:rgba(121,104,246,.12);color:#c6c1ff}
.sidebar-v5-nav a.active .nav-icon{color:#fff;background:linear-gradient(145deg,#7463f3,#5e4dde);box-shadow:0 7px 17px rgba(91,72,220,.25)}
.nav-copy{display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:opacity .15s ease,width .18s ease}
.sidebar-system-section{padding-top:13px;border-top:1px solid rgba(255,255,255,.052)}
.sidebar-ai-section{padding-top:4px}
.sidebar-ai-card{margin:0 3px;border:1px solid rgba(255,255,255,.075);border-radius:14px;background:linear-gradient(145deg,rgba(255,255,255,.045),rgba(255,255,255,.018));overflow:hidden;transition:.2s ease}
.sidebar-ai-card:hover{border-color:rgba(142,128,255,.16);background:rgba(255,255,255,.045)}
.sidebar-ai-head{width:100%;min-height:58px;padding:10px 11px;display:grid;grid-template-columns:34px minmax(0,1fr) 18px;align-items:center;gap:9px;border:0;background:transparent;color:#fff;text-align:left;cursor:pointer}
.sidebar-ai-head .engine-orb{width:34px;height:34px;border-radius:10px;color:#c9c4ff;background:rgba(116,98,239,.16)}
.sidebar-ai-head .engine-orb svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round}
.sidebar-ai-copy{min-width:0;display:grid;gap:2px}.sidebar-ai-copy strong{font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-ai-copy .engine-status{font-size:8.5px;color:#8f98b3;white-space:nowrap}
.sidebar-ai-chevron{width:15px;height:15px;fill:none;stroke:#737d9a;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s ease}
.sidebar-ai-card.open .sidebar-ai-chevron{transform:rotate(180deg)}
.sidebar-ai-detail{display:grid;grid-template-rows:0fr;opacity:.2;transition:grid-template-rows .22s ease,opacity .18s ease}.sidebar-ai-detail>*{overflow:hidden}.sidebar-ai-card.open .sidebar-ai-detail{grid-template-rows:1fr;opacity:1}
.sidebar-ai-detail p{margin:0;padding:0 12px;color:#818aa6;font-size:8.5px;line-height:1.55}.sidebar-ai-card.open .sidebar-ai-detail p{padding-bottom:9px}
.sidebar-ai-flow{margin:0 10px 10px;padding:8px;display:flex;align-items:center;gap:4px;border-radius:9px;background:rgba(0,0,0,.11);color:#8e97b1;font-size:7.5px;white-space:nowrap}.sidebar-ai-flow span{min-width:0}.sidebar-ai-flow b{color:#6258a9;font-weight:700}
.sidebar-v5-footer{flex:0 0 auto;padding:10px 2px 0;border-top:1px solid rgba(255,255,255,.06)}
.sidebar-v5-user{margin:0;padding:8px;min-height:50px;border:0;border-radius:12px;background:rgba(255,255,255,.025);transition:.18s ease;overflow:hidden}.sidebar-v5-user:hover{background:rgba(255,255,255,.045)}
.sidebar-v5-user .user-avatar{width:34px;height:34px;border-radius:10px;background:linear-gradient(145deg,rgba(116,98,242,.36),rgba(81,65,198,.28));font-size:11px}
.sidebar-user-copy{min-width:0;line-height:1.2}.sidebar-v5-user .sidebar-user-copy strong{font-size:10px;color:#eef0fa}.sidebar-v5-user .sidebar-user-copy small{margin-top:2px;font-size:8px;color:#9aa2bc}.sidebar-v5-user .sidebar-user-copy span{display:block;margin-top:2px;color:#646d89;font-size:7.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Desktop icon-only mode */
@media (min-width:1051px){
    body.sidebar-collapsed .app-shell{grid-template-columns:82px minmax(0,1fr)}
    body.sidebar-collapsed .sidebar-v5{--sidebar-w:82px;padding-inline:12px}
    body.sidebar-collapsed .sidebar-v5-head{justify-content:center;padding-inline:0}
    body.sidebar-collapsed .sidebar-v5-brand .brand-copy,
    body.sidebar-collapsed .sidebar-v5 .sidebar-label,
    body.sidebar-collapsed .sidebar-v5 .nav-copy,
    body.sidebar-collapsed .sidebar-ai-copy,
    body.sidebar-collapsed .sidebar-ai-chevron,
    body.sidebar-collapsed .sidebar-ai-detail,
    body.sidebar-collapsed .sidebar-v5-user .sidebar-user-copy{display:none!important}
    body.sidebar-collapsed .sidebar-head-actions{position:absolute;left:64px;top:27px}
    body.sidebar-collapsed .sidebar-collapse{width:25px;height:25px;border-radius:8px;background:#1a1f38;box-shadow:0 6px 16px rgba(0,0,0,.18)}
    body.sidebar-collapsed .sidebar-collapse svg{transform:rotate(180deg)}
    body.sidebar-collapsed .sidebar-v5-nav a{justify-content:center;padding-inline:0;overflow:visible}
    body.sidebar-collapsed .sidebar-v5-nav a.active{box-shadow:none}
    body.sidebar-collapsed .sidebar-v5-nav a[data-nav-label]::after{content:attr(data-nav-label);position:absolute;left:calc(100% + 12px);top:50%;z-index:120;transform:translate(4px,-50%);padding:7px 9px;border:1px solid #e4e5ef;border-radius:8px;background:#fff;color:#262c3b;box-shadow:0 10px 28px rgba(17,21,38,.14);font-size:10px;font-weight:750;white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transition:.14s ease}
    body.sidebar-collapsed .sidebar-v5-nav a[data-nav-label]:hover::after{opacity:1;visibility:visible;transform:translate(0,-50%)}
    body.sidebar-collapsed .sidebar-section+.sidebar-section{margin-top:9px}
    body.sidebar-collapsed .sidebar-system-section{padding-top:9px}
    body.sidebar-collapsed .sidebar-ai-card{margin:0;border:0;background:transparent;overflow:visible}
    body.sidebar-collapsed .sidebar-ai-head{display:flex;justify-content:center;padding:4px;min-height:42px}
    body.sidebar-collapsed .sidebar-ai-head .engine-orb{width:34px;height:34px}
    body.sidebar-collapsed .sidebar-v5-user{justify-content:center;padding:7px;background:transparent}
    body.sidebar-collapsed .sidebar-v5-user .user-avatar{width:36px;height:36px}
}

@media(max-width:1050px){
    .sidebar-v5{width:min(292px,88vw);padding:17px 14px 12px}
    .sidebar-collapse{display:none}
    .sidebar-v5-scroll{padding-bottom:16px}
    .sidebar-v5-nav a{min-height:44px;font-size:12px}
    .sidebar-ai-card{margin-bottom:2px}
}
@media(max-width:480px){
    .sidebar-v5{width:min(286px,90vw);padding:15px 12px 10px}
    .sidebar-v5-head{margin-bottom:11px;padding-bottom:12px}
    .sidebar-v5-brand .brand-mark{width:39px;height:39px;border-radius:12px;font-size:17px}
    .sidebar-v5-nav a{min-height:42px;padding:4px 8px}
    .sidebar-v5-nav .nav-icon{width:33px;height:33px}
    .sidebar-section+.sidebar-section{margin-top:11px}
    .sidebar-v5 .sidebar-label{height:20px;padding-bottom:5px}
}

/* === Workflow V7: plagiarism, client approval, notification center === */
.notification-menu{position:relative}.notification-trigger{width:43px;height:43px;border:1px solid #e5e7eb;border-radius:13px;background:#fff;display:grid;place-items:center;position:relative;cursor:pointer}.notification-trigger svg{width:19px;height:19px;fill:none;stroke:#374151;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.notification-count{position:absolute;right:-4px;top:-5px;min-width:19px;height:19px;padding:0 5px;border-radius:99px;background:#6d5dfc;color:#fff;display:grid;place-items:center;font-size:8px;font-weight:900;border:2px solid #fff}.notification-count.is-empty{display:none}.notification-dropdown{position:absolute;right:0;top:51px;width:min(380px,calc(100vw - 28px));background:#fff;border:1px solid #e5e7eb;border-radius:18px;box-shadow:0 24px 60px rgba(15,23,42,.16);padding:12px;z-index:120;display:none}.notification-menu.open .notification-dropdown{display:block}.notification-dropdown-head{display:flex;justify-content:space-between;align-items:center;padding:4px 5px 10px}.notification-dropdown-head strong{font-size:13px}.notification-dropdown-head a,.notification-read-all button{border:0;background:none;color:#5b50cf;font-size:10px;font-weight:800;text-decoration:none;cursor:pointer}.notification-dropdown-list{display:grid;gap:5px;max-height:390px;overflow:auto}.notification-mini{width:100%;border:0;text-align:left;font:inherit;cursor:pointer;display:grid;grid-template-columns:9px 1fr;gap:9px;padding:10px;border-radius:12px;text-decoration:none;color:inherit;background:#fafbfc}.notification-mini:disabled{cursor:wait;opacity:.65}.notification-mini.is-unread{background:#f5f3ff}.notification-mini i{width:7px;height:7px;border-radius:99px;background:#a3a3a3;margin-top:5px}.notification-mini.is-unread i{background:#6d5dfc}.notification-mini strong,.notification-mini small{display:block}.notification-mini strong{font-size:10px}.notification-mini p{font-size:9px;color:#64748b;line-height:1.45;margin:3px 0}.notification-mini small{font-size:8px;color:#94a3b8}.notification-read-all{padding:8px 4px 0;border-top:1px solid #edf1f5;margin-top:8px}.notification-loading{font-size:10px;color:#94a3b8;padding:14px;text-align:center}
.notification-page{max-width:1120px;margin:0 auto;display:grid;gap:14px}.notification-hero{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:22px}.notification-hero h2{margin:5px 0;font-size:24px}.notification-hero p{margin:0;color:#64748b;font-size:12px}.notification-list-panel{padding:14px}.notification-list{display:grid;gap:7px}.notification-row{width:100%;font:inherit;text-align:left;cursor:pointer;background:#fff;display:grid;grid-template-columns:30px minmax(0,1fr) auto;gap:10px;align-items:start;padding:13px;border:1px solid #edf1f5;border-radius:14px;text-decoration:none;color:inherit}.notification-row.is-unread{background:#faf9ff;border-color:#ddd8ff}.notification-row-icon{width:28px;height:28px;border-radius:9px;background:#eef2ff;color:#5b50cf;display:grid;place-items:center;font-size:10px;font-weight:900}.notification-row strong{font-size:12px}.notification-row p{font-size:10px;color:#64748b;margin:3px 0;line-height:1.5}.notification-row small{font-size:9px;color:#94a3b8}.notification-row>b{color:#6d5dfc}
.plagiarism-gate,.gate-passed,.gate-warning,.gate-failed,.gate-pending{font-weight:900}.gate-passed{color:#15803d}.gate-warning{color:#b45309}.gate-failed{color:#b91c1c}.gate-pending{color:#64748b}.plagiarism-match-list{display:grid;gap:7px;margin-top:8px}.plagiarism-match-list>div{padding:9px;border:1px solid #edf1f5;border-radius:10px}.plagiarism-match-list strong,.plagiarism-match-list small,.plagiarism-match-list a{display:block}.plagiarism-match-list strong{font-size:10px}.plagiarism-match-list small{font-size:9px;color:#64748b;margin:2px 0}.plagiarism-match-list a{font-size:9px;color:#5b50cf;text-decoration:none}.btn.is-disabled{opacity:.55;pointer-events:none}
.client-approval-control h2,.client-review-gate h2,.client-review-summary h2{margin:5px 0 12px;font-size:17px}.approval-kv{display:flex;justify-content:space-between;gap:10px;padding:9px 0;border-bottom:1px solid #edf1f5;font-size:10px}.approval-kv span{color:#64748b}.client-approval-control form{display:grid;gap:8px;margin-top:12px}.client-approval-control textarea,.client-approval-actions textarea,.client-approval-actions input{width:100%;border:1px solid #dfe4ea;border-radius:11px;padding:10px;font:inherit}.client-approval-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.client-approval-actions form{display:grid;gap:8px;padding:12px;border:1px solid #edf1f5;border-radius:14px}.approval-note{padding:10px 12px;border-radius:12px;background:#f8fafc;margin:8px 0 12px}.approval-note strong{font-size:10px}.approval-note p{font-size:10px;color:#64748b;margin:3px 0;line-height:1.5}
@media(max-width:760px){.date-chip{display:none}.notification-trigger{width:40px;height:40px}.notification-dropdown{position:fixed;right:12px;left:12px;top:72px;width:auto}.notification-hero{display:grid}.client-approval-actions{grid-template-columns:1fr}}

/* V8.2 — Dynamic & Responsive Queue Monitor */
.queue-monitor{min-width:0}.queue-live-actions{align-items:center}.queue-live-indicator{min-height:38px;display:inline-flex;align-items:center;gap:7px;padding:0 11px;border:1px solid rgba(255,255,255,.16);border-radius:12px;background:rgba(255,255,255,.08);font-size:10px;font-weight:800;white-space:nowrap}.queue-live-indicator i{width:8px;height:8px;border-radius:50%;background:#94a3b8;box-shadow:0 0 0 4px rgba(148,163,184,.14)}.queue-live-indicator.is-live i{background:#4ade80;box-shadow:0 0 0 4px rgba(74,222,128,.14);animation:queue-live-pulse 1.8s infinite}.queue-live-indicator small{font-size:9px;font-weight:600;color:#cbd5e1}.queue-live-indicator.is-paused{opacity:.72}.queue-feedback{padding:11px 14px;border-radius:13px;border:1px solid #dbeafe;background:#eff6ff;color:#1e40af;font-size:11px;font-weight:750}.queue-feedback.is-success{border-color:#bbf7d0;background:#f0fdf4;color:#166534}.queue-feedback.is-error{border-color:#fecaca;background:#fff1f2;color:#b91c1c}.queue-stat-grid-v82{grid-template-columns:repeat(6,minmax(0,1fr))}.queue-stat-grid-v82 article{position:relative;overflow:hidden}.queue-stat-grid-v82 article::after{content:"";position:absolute;inset:auto 0 0;height:2px;background:transparent}.queue-stat-grid-v82 article.is-active::after{background:#6366f1}.queue-stat-grid-v82 article.is-warning{border-color:#fde68a;background:#fffdf6}.queue-stat-grid-v82 article.is-warning::after{background:#f59e0b}.queue-stat-grid-v82 article.is-danger::after{background:#ef4444}.queue-stat-grid-v82 small{display:block;margin-top:5px;color:#a0a5b5;font-size:9px}.queue-filter-bar-v82{grid-template-columns:minmax(250px,1.5fr) minmax(145px,.65fr) minmax(175px,.8fr) minmax(105px,.4fr) auto auto}.queue-list-toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;padding:2px 2px 0}.queue-list-toolbar>div{display:grid;gap:3px}.queue-list-toolbar strong{font-size:13px;color:#282c44}.queue-list-toolbar span{font-size:10px;color:#8a90a2}.queue-auto-note{white-space:nowrap}.queue-auto-note b{color:#5b55d8}.queue-task-card{transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease,opacity .18s ease}.queue-task-card:hover{border-color:#d8d9ef;box-shadow:0 12px 32px rgba(35,39,74,.07);transform:translateY(-1px)}.queue-task-card.is-stalled{border-color:#fcd34d;background:linear-gradient(90deg,#fffdf6 0,#fff 34%)}.queue-task-copy{min-width:0}.queue-task-title{flex-wrap:wrap}.queue-status-badge{letter-spacing:.02em}.queue-status-badge.status-running{background:#eef2ff;color:#4f46e5}.queue-status-badge.status-queued{background:#f1f5f9;color:#475569}.queue-status-badge.status-completed{background:#ecfdf5;color:#047857}.queue-status-badge.status-failed{background:#fff1f2;color:#be123c}.queue-status-badge.status-cancelled{background:#f8fafc;color:#64748b}.queue-status-badge.is-stalled{background:#fff7ed;color:#b45309}.queue-task-submeta{display:flex;align-items:center;gap:6px;min-width:0;margin-top:4px;color:#9a9eae;font-size:9px}.queue-task-submeta code{display:block;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#8a8fa3;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.queue-task-submeta span{display:inline-flex;align-items:center;gap:4px}.queue-task-submeta span::before{content:"•";color:#cbd5e1}.queue-progress-track{height:8px!important}.queue-task-metrics span.is-warning{background:#fff7ed}.queue-task-metrics span.is-warning b{color:#b45309}.queue-empty-state{min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.queue-empty-icon{width:48px;height:48px;display:grid;place-items:center;margin-bottom:10px;border-radius:16px;background:#f1f0ff;color:#6759df;font-size:20px}.queue-monitor.is-refreshing .queue-task-list{opacity:.64}.queue-monitor.queue-live-paused .queue-auto-note b{color:#94a3b8}
@keyframes queue-live-pulse{0%,100%{box-shadow:0 0 0 4px rgba(74,222,128,.12)}50%{box-shadow:0 0 0 7px rgba(74,222,128,.03)}}
@media(max-width:1280px){.queue-stat-grid-v82{grid-template-columns:repeat(3,minmax(0,1fr))}.queue-filter-bar-v82{grid-template-columns:minmax(220px,1.3fr) repeat(3,minmax(130px,.7fr)) auto auto}.queue-search-field{grid-column:span 2}.queue-task-card{grid-template-columns:minmax(250px,1fr) minmax(150px,.55fr)}.queue-task-metrics,.queue-task-actions{grid-column:auto}}
@media(max-width:900px){.queue-live-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}.queue-live-indicator{grid-column:1/-1;justify-content:center}.queue-live-actions .btn{width:100%}.queue-live-actions a:last-child{grid-column:1/-1}.queue-filter-bar-v82{grid-template-columns:1fr 1fr}.queue-filter-bar-v82 .queue-search-field{grid-column:1/-1}.queue-filter-bar-v82 .btn{width:100%}.queue-list-toolbar{align-items:flex-start;flex-direction:column;gap:5px}.queue-auto-note{white-space:normal}.queue-task-card{grid-template-columns:1fr}.queue-task-progress,.queue-task-metrics,.queue-task-actions{grid-column:1}.queue-task-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}.queue-task-actions{justify-content:flex-start}}
@media(max-width:640px){.queue-stat-grid-v82{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.queue-stat-grid-v82 article{padding:13px}.queue-stat-grid-v82 strong{font-size:21px}.queue-filter-bar-v82{grid-template-columns:1fr 1fr;padding:11px}.queue-filter-bar-v82 label{grid-column:auto}.queue-filter-bar-v82 .queue-search-field{grid-column:1/-1}.queue-filter-bar-v82 label:nth-child(3){grid-column:1/-1}.queue-task-card{padding:12px;gap:11px}.queue-task-main{align-items:flex-start}.queue-task-icon{width:38px;height:38px;flex:0 0 38px}.queue-task-title{gap:5px}.queue-task-main p{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.queue-task-submeta{flex-wrap:wrap}.queue-task-submeta code{width:100%;max-width:100%}.queue-task-submeta span:first-of-type::before{display:none}.queue-task-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.queue-task-actions{display:grid;grid-template-columns:1fr 1fr}.queue-task-actions form,.queue-task-actions a{min-width:0}.queue-task-actions>a:last-child:nth-child(odd){grid-column:1/-1}.queue-live-actions{grid-template-columns:1fr}.queue-live-indicator,.queue-live-actions a:last-child{grid-column:1}.queue-live-actions .btn{min-height:42px}}
@media(max-width:390px){.queue-stat-grid-v82{grid-template-columns:1fr 1fr}.queue-filter-bar-v82{grid-template-columns:1fr}.queue-filter-bar-v82 label,.queue-filter-bar-v82 .queue-search-field,.queue-filter-bar-v82 label:nth-child(3){grid-column:1}.queue-task-actions{grid-template-columns:1fr}.queue-task-actions>a:last-child:nth-child(odd){grid-column:1}.queue-task-metrics{gap:5px}}
@media(prefers-reduced-motion:reduce){.queue-live-indicator.is-live i{animation:none}.queue-task-card{transition:none}}

/* Workflow V9 auth recovery */
.auth-forgot-link{font-size:12px;font-weight:800;color:#5b4ce6;text-decoration:none}.auth-forgot-link:hover{text-decoration:underline}
/* V9.7.0-R1: explicit project mode keeps the existing book workflow isolated. */
.project-mode-selector{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:22px}.project-mode-option{display:flex;align-items:flex-start;gap:12px;min-width:0;padding:16px;border:1px solid #dfe4ee;border-radius:16px;background:#fff;cursor:pointer;transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}.project-mode-option:hover,.project-mode-option.is-selected{border-color:#7357f2;background:#f7f5ff;box-shadow:0 8px 24px rgba(91,69,211,.09)}.project-mode-option input{flex:0 0 auto;width:18px;height:18px;margin-top:2px;accent-color:#654cf4}.project-mode-option span{min-width:0}.project-mode-option b{display:block;color:#141a2a;font-size:15px;line-height:1.35}.project-mode-option small{display:block;margin-top:5px;color:#738097;font-size:12px;line-height:1.5}
.form-field select.is-textbook-locked{pointer-events:none;border-color:#cdc5ff;color:#4f3bd4;background:#f6f3ff;font-weight:750}.textbook-lock-hint{color:#5d4bd2!important}.textbook-context-field{padding:14px;border:1px solid #e1dcff;border-radius:14px;background:#faf9ff}.textbook-context-field input{background:#fff}
@media(max-width:680px){.project-mode-selector{grid-template-columns:1fr}.project-mode-option{padding:14px}}

/* V9.7.0-R4.3: make append versus replace impossible to misread. */
.outline-mode-status{display:flex;align-items:center;gap:11px;padding:12px 14px;border:1px solid #dfe4ed;border-radius:13px;background:#f8fafc;color:#334155}.outline-mode-status>span{display:grid;place-items:center;width:34px;height:34px;flex:0 0 auto;border-radius:10px;background:#ede9fe;color:#5b4ed8;font-size:17px;font-weight:900}.outline-mode-status div{display:grid;gap:3px}.outline-mode-status strong{font-size:11px}.outline-mode-status small{color:#64748b;font-size:9px;line-height:1.5}.outline-mode-status.is-replace{border-color:#fecaca;background:#fff5f5;color:#991b1b}.outline-mode-status.is-replace>span{background:#fee2e2;color:#b91c1c}.outline-mode-status.is-replace small{color:#a33b3b}.outline-mode-option.danger.selected input{accent-color:#dc2626}.outline-confirm-form:has(input[value="replace"]:checked) .outline-confirm-bar{border-color:#fecaca;background:rgba(255,247,247,.97)}.outline-confirm-form:has(input[value="replace"]:checked) [data-outline-submit-button]{border-color:#b91c1c;background:#b91c1c}

/* R4.4 mobile E2E hardening: this selector intentionally lives outside all
   media queries. The class only exists while JavaScript portals the bar. */
body > .wizard-actions.is-mobile-portal {
    position: fixed !important;
    inset: auto 0 0 !important;
    z-index: 2147483647 !important;
    display: flex !important;
    width: auto !important;
    margin: 0 !important;
    pointer-events: auto !important;
    transform: none !important;
}
