/* ===== News Show 24 — Admin Panel ===== */
:root {
    --red: #FF008C;
    --neon: #FF1493;
    --panel: #080609;
    --silver: #F5F5F7;
    --red-dark: #C0005A;
    --red-deep: #80003D;
    --ink: #080609;
    --ink-2: #23262d;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f3f4f6;
    --card: #ffffff;
    --green: #16a34a;
    --amber: #d97706;
    --blue: #2563eb;
    --purple: #7c3aed;
    --teal: #0d9488;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
    --font: 'Inter', 'Noto Sans Devanagari', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid transparent; border-radius: 8px;
    padding: 10px 16px; font-size: 14px; font-weight: 600;
    transition: .15s; white-space: nowrap;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #f9fafb; border-color: #d1d5db; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.icon-btn {
    width: 34px; height: 34px; border: none; border-radius: 8px;
    background: #f3f4f6; color: var(--muted); font-size: 16px;
    display: grid; place-items: center; transition: .15s;
}
.icon-btn:hover { background: #e5e7eb; color: var(--ink); }
.icon-btn.danger:hover { background: #fee2e2; color: #dc2626; }

/* ---------- login ---------- */
.login-wrap {
    min-height: 100vh;
    display: grid; place-items: center; padding: 24px;
    background:
        radial-gradient(1000px 500px at 80% -10%, rgba(255, 0, 140, .38), transparent 60%),
        radial-gradient(800px 400px at 10% 110%, rgba(255, 20, 147, .28), transparent 60%),
        linear-gradient(160deg, #0a090c 0%, #121016 60%, #0a090c 100%);
}
.login-card {
    width: 100%; max-width: 400px;
    background: linear-gradient(180deg, #0d0b11 0%, #080609 100%);
    border: 1px solid rgba(255, 20, 147, .28);
    border-radius: 16px; padding: 34px 30px; color: var(--silver);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .60), 0 0 46px rgba(255, 0, 140, .16), inset 0 -2px 24px rgba(128, 0, 61, .35);
}
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo-img {
    width: 232px; height: auto; max-width: 100%;
    border-radius: 10px; margin: 0 auto 10px; display: block;
    filter: drop-shadow(0 0 20px rgba(255, 20, 147, .38));
}
.login-logo p { color: #9ca3af; font-size: 13px; margin-top: 4px; letter-spacing: 3px; text-transform: uppercase; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--silver); }
.input-icon { position: relative; }
.input-icon i {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: #9ca3af; font-size: 14px;
}
.input-icon input {
    width: 100%; padding: 11px 12px 11px 38px;
    border: 1px solid rgba(255, 255, 255, .13); border-radius: 9px; outline: none;
    transition: .15s; background: rgba(255, 255, 255, .05); color: var(--silver);
}
.input-icon input::placeholder { color: #7c8290; }
.input-icon input:focus { border-color: var(--red); background: rgba(255, 255, 255, .09); box-shadow: 0 0 0 3px rgba(255, 0, 140, .22); }
.login-err { color: #ff6b8f; font-size: 13px; min-height: 18px; margin-top: 12px; }
.login-card .btn-block { margin-top: 4px; }
.login-back {
    display: block; text-align: center; margin-top: 18px;
    color: #9ca3af; font-size: 13px; text-decoration: none;
}
.login-back:hover { color: var(--red); }

/* ---------- app layout ---------- */
.app { display: flex; min-height: 100vh; }

.side {
    width: 240px; flex-shrink: 0;
    background: linear-gradient(180deg, #0c0a0f 0%, #080609 55%, #100a12 100%);
    color: #d1d5db; display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.side-logo { padding: 16px 20px 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.side-logo-img {
    width: 100%; height: auto; display: block;
    border-radius: 8px;
    filter: drop-shadow(0 0 14px rgba(255, 20, 147, .35));
}
.side-logo p { font-size: 11px; color: #6b7280; margin-top: 8px; letter-spacing: 2.5px; text-transform: uppercase; }

.side-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side-link {
    display: flex; align-items: center; gap: 11px;
    width: 100%; padding: 11px 13px; border: none; border-radius: 9px;
    background: transparent; color: #9ca3af; font-size: 14px; font-weight: 500;
    text-align: left; transition: .15s;
}
.side-link i { width: 17px; text-align: center; font-size: 14px; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #e5e7eb; }
.side-link.active { background: var(--red); color: #fff; font-weight: 600; }

.side-foot { padding: 14px 10px 18px; border-top: 1px solid rgba(255, 255, 255, .07); display: flex; flex-direction: column; gap: 3px; }
.side-foot a, .side-foot button {
    display: flex; align-items: center; gap: 11px; padding: 10px 13px;
    border: none; border-radius: 9px; background: transparent;
    color: #9ca3af; font-size: 13px; text-decoration: none; transition: .15s;
}
.side-foot a:hover { background: rgba(255, 255, 255, .06); color: #e5e7eb; }
.side-foot button:hover { background: rgba(220, 38, 38, .18); color: #fca5a5; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 62px; background: #fff; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 16px; padding: 0 24px;
    position: sticky; top: 0; z-index: 40;
}
.topbar h3 { font-size: 17px; font-weight: 700; }
.side-toggle { display: none; border: none; background: #f3f4f6; width: 36px; height: 36px; border-radius: 8px; color: var(--ink); }
.top-user { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.top-user i { font-size: 22px; color: var(--red); }

.view { padding: 24px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat-card {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px; display: flex; align-items: center; gap: 14px;
}
.stat-ico {
    width: 46px; height: 46px; border-radius: 11px;
    display: grid; place-items: center; font-size: 18px; color: #fff; flex-shrink: 0;
}
.stat-ico.red { background: var(--red); }
.stat-ico.green { background: var(--green); }
.stat-ico.amber { background: var(--amber); }
.stat-ico.blue { background: var(--blue); }
.stat-ico.purple { background: var(--purple); }
.stat-ico.teal { background: var(--teal); }
.stat-card b { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-card span { font-size: 12.5px; color: var(--muted); }

/* ---------- panels ---------- */
.panel {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.panel.narrow { max-width: 520px; }
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.panel-head h4 { font-size: 15.5px; font-weight: 700; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.toolbar .search { position: relative; }
.toolbar .search.grow { flex: 1; min-width: 220px; }
.toolbar .search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: 13px; }
.toolbar .search input {
    width: 260px; padding: 10px 12px 10px 36px;
    border: 1px solid var(--line); border-radius: 9px; outline: none; background: #fff;
}
.toolbar .search.grow input { width: 100%; }
.toolbar .search input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 0, 140, .18); }
.toolbar select {
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
    background: #fff; outline: none;
}
.hint { color: var(--muted); font-size: 13px; }

/* ---------- table ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
    text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; color: var(--muted); background: #f9fafb;
    padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 12px 16px; border-bottom: 1px solid #f1f2f4; font-size: 14px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #fafbfc; }
.tbl .t-thumb { width: 62px; }
.tbl .t-thumb img { width: 62px; height: 44px; object-fit: cover; border-radius: 6px; background: #eee; display: block; }
.tbl .t-title { font-weight: 600; max-width: 420px; }
.tbl .t-title a { color: var(--ink); text-decoration: none; }
.tbl .t-title a:hover { color: var(--red); }
.tbl .t-title small { display: block; color: var(--muted); font-weight: 400; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 400px; }
.tbl .t-actions { display: flex; gap: 6px; justify-content: flex-end; }

.chip {
    display: inline-block; padding: 4px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip.cat { background: #FFF0F7; color: var(--red); }
.chip.pub { background: #ecfdf5; color: var(--green); }
.chip.draft { background: #fffbeb; color: var(--amber); }
.chip.sched { background: #eef2ff; color: #4f46e5; }
.t-title .t-tags { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.t-title .t-tags i { font-size: 10px; margin-right: 3px; }

.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* recent list (dashboard) */
.recent-list { display: flex; flex-direction: column; }
.recent-item {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 20px; border-bottom: 1px solid #f1f2f4; text-decoration: none;
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: #fafbfc; }
.recent-item img { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; background: #eee; }
.recent-item b { font-size: 14px; color: var(--ink); font-weight: 600; display: block; }
.recent-item span { font-size: 12.5px; color: var(--muted); }
.recent-item .chip { margin-left: auto; }

/* ---------- categories ---------- */
.cat-list { display: flex; flex-direction: column; }
.cat-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 20px; border-bottom: 1px solid #f1f2f4;
}
.cat-row:last-child { border-bottom: none; }
.cat-row .cat-ico {
    width: 36px; height: 36px; border-radius: 9px; background: #FFF0F7;
    color: var(--red); display: grid; place-items: center; font-size: 14px; flex-shrink: 0;
}
.cat-row input.cat-in {
    flex: 1; padding: 8px 11px; border: 1px solid transparent; border-radius: 8px;
    font-size: 14.5px; font-weight: 600; background: transparent; outline: none;
}
.cat-row input.cat-in:hover { border-color: var(--line); background: #fff; }
.cat-row input.cat-in:focus { border-color: var(--red); background: #fff; box-shadow: 0 0 0 3px rgba(255, 0, 140, .18); }
.cat-row .cat-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.cat-row .cat-btns { display: flex; gap: 6px; }

/* ---------- media ---------- */
.media-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px;
}
.media-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    overflow: hidden; display: flex; flex-direction: column;
}
.media-card .m-img { position: relative; aspect-ratio: 4/3; background: #f1f2f4; }
.media-card .m-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-card .m-body { padding: 11px 13px; display: flex; flex-direction: column; gap: 9px; }
.media-card .m-name {
    font-size: 12.5px; font-weight: 600; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; color: var(--ink);
}
.media-card .m-meta { font-size: 11.5px; color: var(--muted); }
.media-card .m-btns { display: flex; gap: 6px; }
.media-card .m-btns .btn { flex: 1; justify-content: center; padding: 7px 8px; font-size: 12.5px; }

/* ---------- forms ---------- */
.form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.form input, .form select, .form textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line);
    border-radius: 9px; outline: none; background: #fff; transition: .15s; resize: vertical;
}
.form input:focus, .form select:focus, .form textarea:focus {
    border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 0, 140, .18);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.f { min-width: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.form-err { color: #dc2626; font-size: 13px; min-height: 16px; }

.img-pick { display: flex; align-items: center; gap: 10px; }
.img-pick span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }

/* ---------- modal ---------- */
.modal {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(17, 20, 26, .62); backdrop-filter: blur(3px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 40px 16px; overflow-y: auto;
}
.modal-card {
    width: 100%; max-width: 720px; background: #fff;
    border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
    animation: pop .18s ease;
}
.modal-sm { max-width: 420px; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 17px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16.5px; font-weight: 700; }
.cf-msg { padding: 20px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.modal-sm .form-actions { padding: 0 20px 20px; }

/* ---------- toast ---------- */
.toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 200;
    background: var(--ink); color: #fff; padding: 13px 18px;
    border-radius: 10px; font-size: 14px; font-weight: 500;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .3);
    transform: translateY(80px); opacity: 0; transition: .25s;
    max-width: 340px; display: flex; align-items: center; gap: 9px;
}
.toast.show { transform: none; opacity: 1; }
.toast.ok i { color: #4ade80; }
.toast.err i { color: #f87171; }

/* ---------- news editor (WordPress style) ---------- */
.ed {
    position: fixed; inset: 0; z-index: 85; background: #f3f4f6;
    display: flex; flex-direction: column;
}
.ed-top {
    display: flex; align-items: center; gap: 14px;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 11px 18px; flex-shrink: 0;
}
.ed-top-mid { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.ed-mode { font-weight: 700; font-size: 15.5px; color: var(--ink); white-space: nowrap; }
.ed-saved { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ed-top-right { margin-left: auto; display: flex; gap: 9px; }

.ed-body {
    flex: 1; overflow-y: auto; display: grid;
    grid-template-columns: minmax(0, 1fr) 330px; gap: 20px;
    padding: 20px; align-items: start;
}
.ed-main { display: flex; flex-direction: column; gap: 0; min-width: 0; }

.ed-title {
    width: 100%; border: 1px solid var(--line); background: #fff;
    border-radius: 12px; padding: 15px 17px;
    font-size: 23px; font-weight: 700; color: var(--ink);
    font-family: inherit; outline: none; transition: border-color .15s;
}
.ed-title:focus { border-color: var(--red); }

.ed-perma {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--line); border-top: none;
    border-radius: 0 0 12px 12px; padding: 9px 17px; font-size: 13.5px;
}
.ed-perma b { color: var(--muted); font-weight: 600; }
.ed-perma input {
    border: none; outline: none; font-size: 13.5px; color: var(--red);
    font-family: inherit; background: transparent; flex: 1; min-width: 140px;
    font-weight: 600;
}
.ed-hint { color: var(--muted); font-size: 12.5px; }

.ed-toolbar {
    display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--line); border-bottom: none;
    border-radius: 12px 12px 0 0; padding: 7px 9px; margin-top: 16px;
    position: sticky; top: -20px; z-index: 2;
}
.ed-toolbar button {
    border: none; background: transparent; cursor: pointer;
    width: 32px; height: 30px; border-radius: 7px;
    font-size: 14px; color: #374151; display: grid; place-items: center;
}
.ed-toolbar button:hover { background: #eef0f3; }
.ed-toolbar button.on { background: var(--red); color: #fff; }
.ed-toolbar .ed-b { font-weight: 800; }
.ed-toolbar .ed-i i { font-style: italic; }
.ed-toolbar .ed-s s { text-decoration: line-through; }
.ed-sep { width: 1px; height: 19px; background: var(--line); margin: 0 5px; }
.ed-toolbar select {
    height: 28px; border: 1px solid var(--line); border-radius: 7px;
    font-size: 12.5px; font-family: inherit; background: #fff; color: #374151;
    padding: 0 5px; cursor: pointer;
}

.ed-content {
    min-height: 420px; background: #fff; border: 1px solid var(--line);
    border-radius: 0 0 12px 12px; padding: 20px 22px;
    font-size: 16px; line-height: 1.85; color: #1f2937; outline: none;
}
.ed-content:empty::before {
    content: attr(data-placeholder); color: #9ca3af;
}
.ed-content h2 { font-size: 21px; margin: 20px 0 8px; }
.ed-content h3 { font-size: 18px; margin: 18px 0 7px; }
.ed-content h4 { font-size: 16.5px; margin: 16px 0 6px; }
.ed-content p { margin: 0 0 13px; }
.ed-content a { color: var(--red); text-decoration: underline; }
.ed-content blockquote {
    margin: 16px 0; padding: 10px 18px; border-left: 4px solid var(--red);
    background: #fef6f6; color: #444; font-style: italic; border-radius: 0 8px 8px 0;
}
.ed-content ul, .ed-content ol { margin: 0 0 13px; padding-left: 26px; }
.ed-content li { margin-bottom: 5px; }
.ed-content img { max-width: 100%; border-radius: 8px; margin: 8px 0; cursor: pointer; }
.ed-content img.ed-img-sel {
    outline: 3px solid var(--primary); outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(255, 0, 140, .20);
}
.ed-html {
    width: 100%; min-height: 420px; background: #080609; color: #FFC9E4;
    border: 1px solid var(--line); border-radius: 0 0 12px 12px;
    padding: 18px 20px; font-size: 14px; line-height: 1.7;
    font-family: Consolas, 'Courier New', monospace; outline: none; resize: vertical;
}
.ed-statusbar {
    display: flex; gap: 18px; font-size: 12.5px; color: var(--muted);
    padding: 8px 4px;
}

/* image resize bar (body images) */
.ed-imgbar {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
    z-index: 70; display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
    background: #080609; color: #fff; padding: 9px 13px; border-radius: 13px;
    border: 1px solid rgba(255, 20, 147, .35);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .55), 0 0 22px rgba(255, 0, 140, .20);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .38); max-width: 94vw;
}
.ed-imgbar-lab { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; letter-spacing: .2px; }
.ed-imgbar-val { font-size: 12px; min-width: 40px; text-align: right; color: #cbd5e1; }
.ed-imgbar input[type=range] { width: 128px; accent-color: var(--primary); cursor: pointer; }
.ed-imgbar button {
    background: rgba(255, 255, 255, .09); color: #fff; border: 0; cursor: pointer;
    border-radius: 8px; padding: 6px 9px; font-size: 12px; font-weight: 600;
    font-family: inherit; line-height: 1; transition: background .15s;
}
.ed-imgbar button:hover { background: rgba(255, 255, 255, .2); }
.ed-imgbar button.danger:hover { background: #dc2626; }
.ed-imgbar .ed-sep { background: rgba(255, 255, 255, .22); }

/* publish time: live clock + now button */
.ed-clock {
    display: flex; align-items: center; gap: 7px; margin: -3px 0 0;
    font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.ed-clock i { color: var(--primary); }
.ed-now-btn { align-self: flex-start; }

/* image bar: caption input */
.ed-imgcap {
    width: 210px; border: 0; border-radius: 8px; padding: 6px 10px;
    background: rgba(255, 255, 255, .1); color: #fff;
    font-family: inherit; font-size: 12.5px;
}
.ed-imgcap::placeholder { color: #98a2b3; }
.ed-imgcap:focus { outline: 2px solid var(--primary); background: rgba(255, 255, 255, .18); }

/* editor: figure + caption + gallery */
.ed-content figure { margin: 12px 0; }
.ed-content figcaption {
    font-size: 13px; color: #6b7280; font-style: italic;
    text-align: center; margin-top: 6px;
}
.ed-content figcaption:empty::before { content: 'कैप्शन...'; color: #c7ccd4; }
.ed-content .art-gallery { display: grid; gap: 8px; margin: 12px 0; }
.ed-content .art-gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
.ed-content .art-gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
.ed-content .art-gallery.cols-4 { grid-template-columns: repeat(4, 1fr); }
.ed-content .art-gallery figure { margin: 0; }

/* media library: gallery mode */
.lib-mode { display: inline-flex; background: #f1f5f9; border-radius: 9px; padding: 2px; }
.lib-mode button {
    border: 0; background: transparent; cursor: pointer; font-family: inherit;
    font-size: 12.5px; font-weight: 600; color: #475569;
    padding: 6px 11px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px;
}
.lib-mode button.on { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }
.lib-count { font-size: 12.5px; font-weight: 700; color: var(--primary); }
.lib-url { display: flex; gap: 8px; padding: 0 16px 10px; }
.lib-url input {
    flex: 1; border: 1px solid var(--line); border-radius: 9px;
    padding: 8px 11px; font-family: inherit; font-size: 13px;
}
.lib-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 16px 14px; border-top: 1px solid var(--line);
}
.lib-foot .ed-hint { margin: 0; }
.media-card { position: relative; }
.media-card .m-check {
    position: absolute; top: 6px; right: 6px; z-index: 2;
    width: 22px; height: 22px; border-radius: 50%;
    background: #fff; border: 2px solid #cbd5e1; color: transparent;
    display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.media-card.sel { outline: 3px solid var(--primary); outline-offset: -2px; }
.media-card.sel .m-check { background: var(--primary); border-color: var(--primary); color: #fff; }

.ed-side { display: flex; flex-direction: column; gap: 15px; }
.ed-box {
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 15px 16px; display: flex; flex-direction: column; gap: 9px;
}
.ed-box-h {
    font-size: 13.5px; font-weight: 700; color: var(--ink);
    display: flex; align-items: center; gap: 8px;
}
.ed-box-h i { color: var(--red); width: 15px; text-align: center; }
.ed-box-h a { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--red); text-decoration: none; }
.ed-box-h a:hover { text-decoration: underline; }
.ed-box label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ed-opt { font-weight: 400; color: #9ca3af; }
.ed-box input[type="text"], .ed-box input[type="url"], .ed-box input[type="datetime-local"],
.ed-box select, .ed-box textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 8px;
    padding: 9px 11px; font-size: 13.5px; font-family: inherit;
    color: var(--ink); background: #fff; outline: none; transition: border-color .15s;
}
.ed-box input:focus, .ed-box select:focus, .ed-box textarea:focus { border-color: var(--red); }
.ed-box textarea { resize: vertical; line-height: 1.55; }
.ed-note { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 0; }

.ed-cats { display: flex; flex-direction: column; gap: 2px; max-height: 190px; overflow-y: auto; }
.ed-cats label {
    display: flex; align-items: center; gap: 8px; font-size: 13.5px;
    color: var(--ink); font-weight: 500; padding: 5px 7px;
    border-radius: 7px; cursor: pointer;
}
.ed-cats label:hover { background: #f6f7f9; }
.ed-cats input { accent-color: var(--red); width: 15px; height: 15px; }

.ed-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: #f3f4f6; border: 1px solid var(--line); color: #374151;
    font-size: 12.5px; font-weight: 600; padding: 4px 9px; border-radius: 20px;
}
.ed-tag button {
    border: none; background: none; cursor: pointer; color: #9ca3af;
    font-size: 13px; line-height: 1; padding: 0;
}
.ed-tag button:hover { color: #dc2626; }
.ed-tags .empty { font-size: 12.5px; color: #9ca3af; padding: 0; }

.ed-feat {
    width: 100%; max-height: 150px; object-fit: cover;
    border-radius: 8px; border: 1px solid var(--line);
}
.ed-btnrow { display: flex; gap: 7px; align-items: center; }
.ed-btnrow .btn { flex: 1; justify-content: center; }
.ed-btnrow label.btn { cursor: pointer; }

.ed-snippet {
    background: #f8f9fa; border: 1px solid var(--line); border-radius: 9px;
    padding: 11px 13px; font-size: 13px; line-height: 1.45;
}
.ed-snippet .s-title { color: #1a0dab; font-size: 15.5px; font-weight: 500; margin-bottom: 3px; }
.ed-snippet .s-url { color: #006621; font-size: 12.5px; margin-bottom: 4px; word-break: break-all; }
.ed-snippet .s-desc { color: #4d5156; font-size: 13px; }

/* media picker modal */
.lib-bar { display: flex; align-items: center; gap: 13px; padding: 14px 20px; }
.lib-grid { padding: 0 20px 20px; max-height: 55vh; overflow-y: auto; }
#libModal .modal-card { max-width: 860px; }
#libModal .media-card { cursor: pointer; transition: transform .13s, box-shadow .13s; }
#libModal .media-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0, 0, 0, .16); }
#libModal .media-card:hover .m-name { color: var(--red); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .ed-body { grid-template-columns: 1fr; }
    .ed-side { order: 2; }
}
@media (max-width: 960px) {
    .side {
        position: fixed; left: 0; top: 0; z-index: 80;
        transform: translateX(-100%); transition: .22s;
    }
    .side.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .5); }
    .side-toggle { display: grid; place-items: center; }
    .row2 { grid-template-columns: 1fr; }
    .toolbar .search input { width: 100%; }
    .toolbar .search { flex: 1; min-width: 180px; }
    .view { padding: 16px; }
    .tbl .t-title small { display: none; }
}
