/* Shivshahi Master Link Library V1.9
   Visual language intentionally matches Reels/Photo Master Library, while keeping
   its existing API and event contracts. This stylesheet affects this page only. */
:root{--bg:#f6f7fb;--panel:#fff;--ink:#151927;--muted:#6f7688;--purple:#6f2bd5;--purple2:#8b4ee8;--line:#e5e7ef;--ok:#16713b;--okbg:#effaf3;--bad:#b53549;--badbg:#fff1f3;--shadow:0 8px 24px rgba(26,31,50,.06);font-family:Inter,"Nirmala UI",system-ui,-apple-system,"Segoe UI",Arial,sans-serif}
*{box-sizing:border-box}html,body{min-width:0;margin:0;background:var(--bg);color:var(--ink)}body{padding:12px}button,input,select,textarea{font:inherit}button{cursor:pointer}button:focus-visible,summary:focus-visible{outline:3px solid #aa86ed;outline-offset:2px}[hidden]{display:none!important}
.wrap{width:100%;max-width:1100px;margin:0 auto;min-width:0}
/* Header matches the light Reels/Photo master header, no dark banner. */
.hero{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:14px 16px;border:1px solid var(--line);border-radius:15px;background:linear-gradient(135deg,#fff,#faf7ff);box-shadow:var(--shadow)}
.eyebrow{display:block;font-size:9px;font-weight:900;letter-spacing:.12em;color:var(--purple)}.hero h1{font-size:21px;line-height:1.2;margin:4px 0}.hero p{font-size:11px;line-height:1.5;color:var(--muted);margin:0;max-width:550px}.hero-actions{display:flex;flex-shrink:0;align-items:center;gap:7px}
.btn{min-height:37px;border:1px solid var(--line);background:#fff;color:#343a49;border-radius:10px;padding:8px 13px;font-size:11px;font-weight:800;line-height:1.3}.btn:hover{background:#f9f6ff}.btn.primary{color:#fff;border-color:var(--purple);background:var(--purple)}.btn.primary:hover{background:#5f21bc}.btn.danger{color:var(--bad);border-color:#f1c0c8;background:#fff8fa}.btn:disabled{opacity:.56;cursor:not-allowed}
/* Same visual hierarchy as Reel Library and Photo Library's Library / Report tabs. */
.library-tabs,.entry-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;background:#edeef4;border-radius:12px;padding:5px;margin:8px 0}
.library-tab,.entry-tab{min-height:35px;padding:7px 9px;border:0;border-radius:9px;background:transparent;color:#5d6070;font-size:11px;font-weight:800}
.library-tab.active,.entry-tab.active{background:#fff;color:var(--purple);box-shadow:0 3px 10px rgba(26,31,50,.06)}
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:9px 0}.kpis article,.report-kpis article{min-width:0;background:#fff;border:1px solid var(--line);border-radius:12px;padding:11px 12px;box-shadow:var(--shadow)}.kpis small,.report-kpis small{display:block;color:var(--muted);font-size:10px;font-weight:700}.kpis strong,.report-kpis strong{display:block;font-size:21px;margin-top:3px;line-height:1.15}
.card{background:#fff;border:1px solid var(--line);border-radius:13px;margin:9px 0;box-shadow:var(--shadow);min-width:0;overflow:visible}.card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.card-head h2{font-size:17px;margin:0 0 4px}.card-head p{font-size:11px;color:var(--muted);margin:0;line-height:1.45}
.icon-btn{border:0;width:35px;height:35px;border-radius:10px;background:#f2f3f7;color:#3c4250;font-size:21px;line-height:1}
/* Add panel stays optional, preserving existing Single/Bulk/CSV logic. */
.add-panel{padding:14px;scroll-margin-top:155px}.add-panel .card-head{margin-bottom:12px}.entry-tabs{grid-template-columns:repeat(3,minmax(0,1fr));background:#f2f1f6;margin:9px 0 13px}.entry-tab{font-size:10px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.field{min-width:0;display:flex;flex-direction:column;gap:5px}.field.full,.check.full,.form-actions.full,.advanced-options.full{grid-column:1/-1}.field span{font-size:11px;color:#4f5668;font-weight:800}.field small{font-size:10px;color:var(--muted);line-height:1.35}.field input,.field textarea,.field select,.toolbar input,.toolbar select{width:100%;min-width:0;min-height:40px;border:1px solid var(--line);border-radius:10px;padding:9px 11px;color:var(--ink);background:#fff;outline:none;font-size:12px}.field textarea{min-height:70px;resize:vertical}.field input:focus,.field textarea:focus,.toolbar input:focus,.toolbar select:focus{border-color:#b995ef;box-shadow:0 0 0 3px #f1e9ff}
.check{display:flex;align-items:center;gap:9px;font-size:11px;color:#4f5668;font-weight:650}.check input{width:18px;height:18px;flex:0 0 auto;accent-color:var(--purple)}.check-emphasis{border:1px solid #e6d6f3;border-radius:11px;background:#faf7ff;padding:10px}.check-emphasis span{display:flex;flex-direction:column;gap:3px}.check-emphasis span b{font-size:11px;color:#54258a}.check-emphasis span small{font-size:9px;line-height:1.4;color:#82718c;font-weight:400}
.form-actions,.dialog-actions{display:flex;gap:7px;justify-content:flex-end;flex-wrap:wrap}.form-actions{border-top:1px solid var(--line);padding-top:11px}.link-hint{font-size:10px;font-weight:700;color:#6e37b6}.link-hint.warn{color:var(--bad)}.advanced-options{border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fafbfe}.advanced-options summary{display:flex;gap:9px;align-items:center;cursor:pointer;list-style:none;padding:11px;font-size:11px;font-weight:800;color:#57358b}.advanced-options summary::-webkit-details-marker{display:none}.advanced-options summary small{font-size:9px;color:var(--muted);font-weight:500;margin-left:auto}.advanced-options summary:after{content:'▾'}.advanced-options[open] summary:after{content:'▴'}.advanced-grid{padding:2px 11px 11px}.bulk-panel{padding:4px 0 9px}.bulk-panel textarea{width:100%;min-height:115px;padding:10px;border:1px solid var(--line);border-radius:10px}.bulk-panel input[type=file]{width:100%;padding:13px;background:#fafbfe;border:1px dashed #c7c9d7;border-radius:10px}.bulk-panel p{font-size:10px;color:var(--muted);line-height:1.5}.bulk-controls{border-top:1px solid var(--line);padding-top:10px}.bulk-preview{background:#fafbfe;border:1px solid var(--line);border-radius:10px;padding:10px;font-size:11px;overflow-wrap:anywhere}.bulk-preview .preview-row{padding:3px 0;color:#5c6070}.bulk-preview .preview-row.bad{color:var(--bad)}.bulk-actions{display:flex;gap:7px;justify-content:flex-end;margin-top:8px}.bulk-controls progress{width:100%;margin-top:8px;accent-color:var(--purple)}#bulkResult{font-size:10px;line-height:1.5;margin-top:7px}
/* Search/filter region exactly above the library card grid. */
.toolbar{display:grid;grid-template-columns:minmax(170px,1fr) minmax(130px,170px) minmax(125px,150px) minmax(120px,150px) auto;gap:8px;align-items:center;padding:12px;border-bottom:1px solid var(--line)}.toolbar .muted{font-size:10px;color:var(--muted)}.status-box{margin:10px 12px;padding:9px 11px;border:1px solid var(--line);border-radius:9px;background:#fafbfe;font-size:11px;color:var(--muted)}.status-box.ok{background:var(--okbg);border-color:#c8ebd3;color:var(--ok)}.status-box.bad{background:var(--badbg);border-color:#f1c0c8;color:var(--bad)}.empty-grid{grid-column:1/-1;width:100%;text-align:center;padding:22px}
/* Thumbnail tiles follow the image-card model, with safe, honest platform covers
   because this link-only library does not store actual media thumbnails. */
.links-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:0 12px 13px;align-items:start}
.link-card{position:relative;min-width:0;background:#fff;border:1px solid var(--line);border-radius:12px;overflow:visible;box-shadow:0 4px 12px rgba(26,31,50,.05);transition:box-shadow .15s ease,border-color .15s ease}
.link-card:hover{border-color:#d1b8f2;box-shadow:0 8px 22px rgba(26,31,50,.10)}.tile-cover{aspect-ratio:9/11;position:relative;display:grid;place-items:center;border-radius:12px 12px 0 0;background:linear-gradient(145deg,#5e2a98,#bd90ee);overflow:hidden}
.tile-cover:before{content:'';position:absolute;width:125%;height:120%;border-radius:48%;border:1px solid rgba(255,255,255,.27);transform:rotate(-27deg) translate(24%,18%);pointer-events:none}.tile-cover:after{content:'';position:absolute;inset:0;background:radial-gradient(ellipse at 10% 10%,rgba(255,255,255,.16),transparent 58%);pointer-events:none}
.platform-instagram{background:linear-gradient(145deg,#6133b3,#bd4fa0 64%,#e8975e)}.platform-facebook{background:linear-gradient(145deg,#1667c8,#6ca5ed)}.platform-youtube{background:linear-gradient(145deg,#a3203a,#f65b5b)}.platform-tiktok{background:linear-gradient(145deg,#15242b,#2c6272)}.platform-pinterest{background:linear-gradient(145deg,#7d1643,#d94f60)}.platform-twitter{background:linear-gradient(145deg,#1c2634,#657185)}.platform-direct{background:linear-gradient(145deg,#6044bd,#68a3c8)}
.tile-status{position:absolute;top:8px;left:8px;z-index:2;background:#158045;color:#fff;border-radius:8px;padding:4px 6px;font-size:8px;font-weight:900;line-height:1}.tile-status.inactive{background:#7a7583}.tile-status.expired{background:#ba344b}.tile-menu-button{position:absolute;z-index:3;top:7px;right:7px;border:0;width:28px;height:28px;border-radius:10px;color:#fff;background:rgba(24,26,42,.70);font-size:21px;line-height:21px;padding:0}
.tile-preview-button{width:100%;height:100%;border:0;background:transparent;display:grid;place-items:center;color:#fff;padding:0}.tile-symbol{font-size:47px;font-weight:800;color:rgba(255,255,255,.40);transform:translateY(-12px)}.tile-play{position:absolute;display:grid;place-items:center;width:36px;height:36px;border-radius:999px;color:#fff;background:rgba(25,16,46,.61);font-size:14px;box-shadow:0 4px 15px rgba(0,0,0,.18)}.tile-cover-label{position:absolute;bottom:8px;left:8px;right:8px;color:#fff;font-weight:900;font-size:12px;text-align:center;text-shadow:0 2px 5px rgba(0,0,0,.28);pointer-events:none}
.tile-body{padding:10px 9px}.tile-body h3{font-size:12px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tile-tags{display:flex;flex-wrap:wrap;gap:4px;align-items:center;margin-top:5px}.platform,.auto-tag{display:inline-flex;min-height:20px;align-items:center;padding:2px 6px;border-radius:6px;font-size:9px;font-weight:750;background:#f3ecff;color:#67329e}.auto-tag{background:#eaf9f1;color:#177448}.auto-tag.off{background:#f2f1f4;color:#777183}.tile-description{margin:6px 0;color:var(--muted);font-size:10px;line-height:1.35;min-height:26px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.tile-mini-stats{display:flex;justify-content:space-between;gap:4px;font-size:9px;color:#6d7283;border-top:1px solid #f0edf7;padding-top:6px}.tile-mini-stats b{color:#34394a}.tile-actions{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:8px}.tile-actions .btn{min-height:31px;padding:5px;font-size:9.5px}
.tile-menu{position:absolute;right:5px;top:38px;z-index:30;background:#fff;border:1px solid #ddd6ec;border-radius:10px;padding:4px;box-shadow:0 9px 24px rgba(27,21,43,.20);min-width:130px}.tile-menu button{width:100%;display:block;padding:9px 10px;text-align:left;border:0;border-radius:7px;background:transparent;color:var(--ink);font-size:11px;font-weight:700}.tile-menu button:hover{background:#f5f0fd}.tile-menu button.danger{color:var(--bad)}
/* Report is a separate tab instead of 6 wide cards on the library page. */
.report-panel{padding:15px}.report-panel .card-head{margin-bottom:13px}.report-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-bottom:11px}.report-note{background:#f9f7fe;color:#705c81;border:1px solid #e9e2f2;border-radius:9px;padding:9px 11px;font-size:10px;margin-bottom:10px}.report-scroll{overflow-x:auto}.report-table{border-collapse:collapse;width:100%;font-size:11px;text-align:left;min-width:440px}.report-table th{background:#f5f6fa;font-size:10px;color:#5c6071;text-transform:none;padding:9px 10px}.report-table td{border-top:1px solid var(--line);padding:10px}.report-table small{display:block;color:var(--muted);margin-top:4px}
/* Detail and Edit dialogs use matching library modal semantics. */
.dialog{width:min(710px,calc(100% - 20px));max-height:93dvh;overflow:auto;padding:0;border:0;border-radius:15px;box-shadow:0 24px 75px rgba(15,17,30,.30);background:#fff;color:var(--ink)}.dialog::backdrop{background:rgba(18,20,28,.50)}.dialog-head{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:13px 15px;border-bottom:1px solid var(--line)}.dialog-head strong{display:block;font-size:15px}.dialog-head small{display:block;font-size:10px;color:var(--muted);margin-top:3px}.dialog-body,.detail-dialog-body{padding:15px}.dialog-actions{padding-top:12px;border-top:1px solid var(--line);margin-top:12px}.detail-dialog-cover{height:98px;display:grid;place-items:center;border-radius:12px;background:linear-gradient(145deg,#6133b3,#bd4fa0);color:#fff;margin-bottom:12px}.detail-dialog-cover span{font-size:34px}.detail-dialog-info>p{font-size:12px;font-weight:800}.detail-dialog-info>div{display:flex;justify-content:space-between;gap:10px;border-bottom:1px solid var(--line);padding:7px 0;font-size:11px}.detail-dialog-info b{color:#5e6273}.detail-dialog-info span{color:#343a49}.source-details{border:1px solid var(--line);border-radius:10px;margin-top:12px}.source-details summary{cursor:pointer;list-style:none;display:flex;justify-content:space-between;font-size:11px;padding:9px 10px;color:#5c6071;font-weight:700}.source-details summary::-webkit-details-marker{display:none}.source-details .raw-url{overflow-wrap:anywhere;padding:10px;background:#fafbfe;font-size:10px;color:#544b65}.dialog .muted{font-size:10px;color:var(--muted);line-height:1.4}.toast{position:fixed;z-index:100;right:13px;bottom:13px;background:#242535;color:#fff;font-size:11px;padding:10px 13px;border-radius:10px;max-width:350px;box-shadow:0 10px 25px rgba(0,0,0,.18)}.toast.bad{background:#9b1c38}
/* Responsive: works within the existing narrow Admin shell and on desktop. */
@media(max-width:980px){.links-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.toolbar{grid-template-columns:1fr 1fr}.toolbar .search{grid-column:1/-1}.toolbar #resultCount{grid-column:1/-1}}
@media(max-width:640px){body{padding:8px}.wrap{width:100%}.hero{padding:11px;border-radius:13px;display:grid;gap:8px}.hero h1{font-size:18px}.hero p{font-size:10px}.hero-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}.hero-actions .btn{width:100%}.kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.kpis article{padding:10px}.kpis strong{font-size:19px}.links-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 9px 10px}.toolbar{padding:9px;gap:7px}.toolbar .search{grid-column:1/-1}.toolbar input,.toolbar select,.field input,.field textarea{font-size:16px}.toolbar #resultCount{grid-column:1/-1}.card{border-radius:12px}.status-box{margin:9px}.add-panel{padding:10px}.card-head h2{font-size:14px}.form-grid{grid-template-columns:1fr;gap:9px}.field.full,.check.full,.form-actions.full,.advanced-options.full{grid-column:1}.advanced-grid{padding:0 9px 9px}.advanced-options summary small{display:none}.form-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}.form-actions #addCancelBtn{grid-column:1/-1}.report-panel{padding:10px}.report-kpis{gap:6px}.report-kpis article{padding:9px}.report-kpis strong{font-size:17px}.dialog{max-height:90dvh}.tile-cover-label{font-size:10px}}
@media(max-width:350px){.links-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.tile-body{padding:7px}.tile-actions{grid-template-columns:1fr}.tile-mini-stats{display:block}.tile-mini-stats span{display:block}.hero-actions .btn{font-size:10px}}
/* Embed mode resizes via existing same-origin postMessage; no nested scrollbar. */
body.embed-mode{padding:5px!important;background:transparent;overflow:visible!important}body.embed-mode .wrap{max-width:100%;height:auto!important;min-height:0!important}body.embed-mode .card{box-shadow:0 4px 14px rgba(26,31,50,.04)}

/* Reel-library density: four cards at narrow Admin-desktop width, two on phones. */
.tile-actions{grid-template-columns:1fr}
@media(min-width:480px) and (max-width:640px){
  .links-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
  .tile-body{padding:6px}
  .tile-body h3{font-size:10.5px}
  .tile-tags{gap:2px}
  .platform,.auto-tag{font-size:7.5px;padding:2px 4px;min-height:17px}
  .tile-cover-label{font-size:9px}
  .tile-description{font-size:9px;min-height:25px}
  .tile-mini-stats{display:grid;gap:3px;font-size:8px}
  .tile-actions .btn{font-size:9px}
}
@media(min-width:420px) and (max-width:479px){.links-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* V1.9: optional real images, exactly as the Master Reels/Photo tile model. */
.tile-cover.has-cover:before,.tile-cover.has-cover:after{display:none}
.tile-cover-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;z-index:0}
.tile-cover.has-cover .tile-symbol{opacity:0}
.tile-cover.has-cover .tile-cover-label{z-index:2;background:linear-gradient(transparent,rgba(0,0,0,.65));bottom:0;left:0;right:0;padding:24px 5px 8px}
.tile-preview-button{position:relative;isolation:isolate}
.tile-cover-photo{pointer-events:none}
.tile-play{z-index:2}
.detail-dialog-cover.has-cover{height:220px;overflow:hidden}
.detail-cover-photo{width:100%;height:100%;object-fit:contain;background:#161420}
.cover-upload{background:#faf9fe;padding:10px;border:1px dashed #ccc1df;border-radius:10px}
.cover-upload input[type=file]{background:#fff;min-height:42px}
#removeCoverBtn{align-self:flex-start;color:#a83045}

/* Companion add tile keeps sparse libraries usable without fake Reel images. */
.link-add-tile{min-height:168px;aspect-ratio:9/14;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;border:1px dashed #c0ace6;border-radius:12px;background:#faf8ff;color:#6831b9;text-align:center;padding:10px;font-size:11px}
.link-add-tile:hover{background:#f0e9ff;border-color:#854ed8}.link-add-tile .add-icon{font-size:27px;display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#eee3ff}.link-add-tile small{color:#807390;font-size:9px}

/* V2.0 Category controls match Reels Master Library. */
.category-toolbar{display:flex;align-items:center;gap:8px;grid-column:1/-1;min-width:0}.category-toolbar select{flex:1;max-width:290px}.category-manager-btn{min-height:36px;padding:7px 12px;border-radius:10px;border:1px solid #d9c7f5;background:#f4ecff;color:#6b31aa;font-size:11px;font-weight:850}.category-manager-btn:hover{background:#eaddfa}.category-tag{display:inline-flex;align-items:center;max-width:100%;padding:2px 6px;border-radius:6px;background:#fff5dc;color:#795022;font-size:9px;font-weight:750;overflow:hidden;text-overflow:ellipsis}.category-dialog-body{padding:14px}.category-create{display:flex;gap:8px;flex-wrap:wrap}.category-create input{flex:1;min-width:120px;padding:10px 11px;border:1px solid var(--line);border-radius:10px;font-size:13px}.category-manage-list{margin-top:14px;display:grid;gap:7px;max-height:45dvh;overflow-y:auto}.category-row{display:flex;align-items:center;gap:8px;border:1px solid var(--line);padding:9px;border-radius:10px}.category-row .category-name{flex:1;min-width:0;font-size:12px;font-weight:800;overflow-wrap:anywhere}.category-row small{font-size:10px;color:var(--muted)}.category-row button{min-height:32px}.bulk-category-row{margin:8px 0}.bulk-category-row>span{display:block;font-size:11px;font-weight:800;margin-bottom:6px}.bulk-category-row select{width:100%;max-width:270px;min-height:37px;border:1px solid var(--line);border-radius:10px;padding:8px;background:#fff}.category-dialog-body .muted{margin-top:14px}.category-toolbar select{font-size:12px}
@media(max-width:640px){.category-toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(110px,auto);gap:7px}.category-toolbar select{max-width:none}.category-manager-btn{min-height:40px}.category-create{display:grid;grid-template-columns:1fr}.category-create .btn{min-height:40px}.category-row{flex-wrap:wrap}.category-row .category-name{flex-basis:100%}}


/* V2.1: same Categories rhythm as Reels Master Library, with persistent error/status feedback. */
.toolbar #manageCategoriesBtn{grid-column:1/-1;justify-self:start;min-width:180px;min-height:39px;background:#f2eaff;border:1px solid #e1cff5;color:#652ca5;box-shadow:none}
.toolbar .category-toolbar{grid-column:1/-1;display:flex}.category-toolbar select{width:min(100%,310px);max-width:310px}
.categories-dialog{width:min(545px,calc(100% - 24px));max-height:min(88dvh,780px);overflow:hidden;display:flex;flex-direction:column}
.categories-dialog:not([open]){display:none!important}
.categories-dialog .dialog-head{flex-shrink:0}
.categories-dialog .category-dialog-body{padding:12px;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.category-create-panel{padding:11px 12px 12px;border:1px solid #e4d5f4;background:linear-gradient(125deg,#fbf7ff,#f9f4ff);border-radius:13px}
.category-create-panel>label{display:block;font-size:11px;font-weight:850;color:#4c2870;margin-bottom:7px}
.category-create{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
.category-create input{width:100%;min-width:0;min-height:42px;border-radius:10px;background:#fff;padding:10px;font-size:13px}
.category-create button{min-width:81px;min-height:42px;border-radius:10px;background:linear-gradient(120deg,#8650d0,#6b2fb6);color:#fff}
.category-feedback{font-size:11px;line-height:1.55;border-radius:9px;color:#5a5071;padding:8px 10px;margin-top:9px;background:#faf8fd;border:1px solid #ebe4f3;overflow-wrap:anywhere}
.category-feedback[data-kind="ok"]{background:#ecfaf3;border-color:#bee3cb;color:#13653b}.category-feedback[data-kind="bad"]{background:#fff1f3;border-color:#f1c9d0;color:#9d2344}
.category-list-summary{font-size:11px;color:#645277;font-weight:800;margin:12px 2px 8px}
.category-manage-list{margin-top:0;display:flex;flex-direction:column;gap:7px;max-height:none;overflow:visible}
.category-row{display:flex;min-height:56px;align-items:center;gap:9px;border:1px solid #e9e1f1;background:#fff;border-radius:12px;padding:8px 9px}
.category-row .category-glyph{width:31px;height:31px;flex:0 0 31px;display:grid;place-items:center;background:#f1e8fd;border-radius:9px;color:#753cb5;font-weight:900;font-size:13px}
.category-row .category-copy{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}
.category-row .category-name{font-size:12px;line-height:1.15;font-weight:900;color:#34244b}
.category-row .category-count{font-size:10px;color:#84748f}
.category-row .category-actions{display:flex;align-items:center;gap:5px;margin-left:auto}
.category-row .category-actions .btn{min-height:30px;padding:5px 8px;font-size:10px;border-radius:9px}
.category-row .category-default{font-size:9px;color:#72647e;background:#f7f4fa;padding:5px 8px;border-radius:20px}
.category-row .category-actions button:disabled{opacity:.45}
@media(max-width:640px){.toolbar #manageCategoriesBtn{grid-column:1/-1;width:min(100%,230px);justify-self:start}.category-toolbar select{max-width:100%}.category-create{grid-template-columns:minmax(0,1fr) auto}.category-row{flex-wrap:nowrap}.category-row .category-copy{flex-basis:auto}.category-create-panel>label{font-size:12px}}
@media(max-width:390px){.category-row .category-actions .btn{padding:5px 6px;font-size:9px}.category-row{gap:5px;padding:7px}.category-row .category-glyph{width:27px;flex-basis:27px;height:27px}}

/* V2.2: Reels Library-style bulk Category selection for Master Links. */
.link-bulk-toolbar{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;background:#fbf8ff;border:1px solid #e6d9f3;border-radius:12px;margin:8px 10px 0;padding:8px}
.link-bulk-toolbar .btn{min-height:34px;padding:7px 9px;font-size:10px}.bulk-select-controls,.bulk-select-summary{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.bulk-select-summary{margin-left:auto}.bulk-select-summary strong{font-size:11px;color:#6b359e;white-space:nowrap}
.tile-select-label{position:absolute;right:7px;top:7px;z-index:5;display:flex;align-items:center;gap:4px;padding:5px 6px;border-radius:9px;border:1px solid rgba(255,255,255,.65);background:rgba(32,15,48,.82);color:white;font-size:9px;font-weight:800;cursor:pointer;user-select:none}
.tile-select-label input{width:15px;height:15px;margin:0;accent-color:#9d66e1;cursor:pointer}
.tile-menu-button{top:38px}
.move-category-dialog{width:min(440px,calc(100% - 22px))}.move-category-dialog .dialog-body{padding:13px}.move-category-dialog select{min-height:44px;padding:9px;border-radius:10px;border:1px solid #e1d5ec;background:#fff;width:100%;font-size:14px}
@media(max-width:540px){.link-bulk-toolbar{align-items:stretch;gap:8px}.bulk-select-controls{flex:1}.bulk-select-summary{width:100%;justify-content:space-between;margin-left:0}.link-bulk-toolbar .btn{font-size:10px;padding:7px}.tile-select-label{padding:4px 5px;right:5px;top:5px}.tile-menu-button{top:34px}}


/* SHIVSHAHI LINK LIBRARY PREMIUM UI V2.3 - presentation only, no API or JS changes */
:root{--bg:#f8f6fc;--panel:#fff;--ink:#28213c;--muted:#716982;--purple:#7133b7;--purple2:#995ae0;--line:#e9e1f4;--shadow:0 8px 24px rgba(64,35,103,.065)}
html,body{background:#f8f6fc;color:var(--ink)}
body{padding:12px}
.wrap{max-width:1180px}
.hero{align-items:center;gap:14px;padding:18px 20px;border-radius:20px;border:1px solid #e7d9f5;background:linear-gradient(115deg,#fff 0%,#fcf9ff 60%,#f4eafd 100%);box-shadow:0 8px 25px rgba(82,39,128,.08)}
.eyebrow{font-size:10px;letter-spacing:.16em;color:#9560be}
.hero h1{font-size:clamp(20px,2.4vw,28px);font-weight:850;letter-spacing:-.04em;color:#47246e;margin:5px 0 7px}
.hero p{font-size:12px;line-height:1.55;color:#766686}
.hero-actions{gap:9px;flex-wrap:wrap}
.btn{min-height:41px;border-radius:12px;padding:9px 14px;font-size:12px;box-shadow:0 1px 1px rgba(0,0,0,.02);transition:background-color .14s ease,box-shadow .14s ease,transform .14s ease}
.btn:hover{box-shadow:0 5px 12px rgba(83,39,131,.1)}
.btn.primary{background:linear-gradient(125deg,#8450cd,#6830ac);border-color:#7e43c3;color:#fff;box-shadow:0 5px 13px rgba(109,49,175,.16)}
.btn.primary:hover{background:linear-gradient(125deg,#7940c7,#592596)}
.btn.danger{color:#ae3452;border-color:#efcad7;background:#fff8fb}
.btn:focus-visible,.library-tab:focus-visible,.entry-tab:focus-visible{outline:3px solid #aa86ed;outline-offset:2px}
.library-tabs{margin:13px 0 10px;border:1px solid #ebe1f5;background:#f2eafb;padding:5px;border-radius:14px}
.library-tab{min-height:43px;font-size:12px;border-radius:10px;color:#715987}
.library-tab.active{color:#622ba5;background:#fff;box-shadow:0 3px 9px rgba(90,40,133,.12)}
.kpis{gap:10px;margin:10px 0 13px}
.kpis article,.report-kpis article{padding:14px;min-height:83px;border-color:#e8dff2;border-radius:16px;background:linear-gradient(145deg,#fff,#fcfaff);box-shadow:0 4px 14px rgba(84,42,127,.045)}
.kpis small,.report-kpis small{font-size:11px;line-height:1.35;color:#81728f}
.kpis strong,.report-kpis strong{font-size:25px;color:#562887;font-weight:850;letter-spacing:-.045em;margin-top:8px}
.card{border-radius:17px;border-color:#e7dcf0;box-shadow:0 5px 16px rgba(75,35,105,.045)}
.card-head h2{font-size:19px;color:#42245f;letter-spacing:-.025em}
.card-head p{font-size:12px;line-height:1.55}
.icon-btn{width:39px;height:39px;color:#642f9c;background:#f2e9fc;border:1px solid #e3d5f2;border-radius:12px}
.add-panel{padding:16px;scroll-margin-top:90px}
.entry-tabs{gap:5px;background:#f4edfb;border-radius:13px;padding:5px;margin:10px 0 16px}
.entry-tab{font-size:12px;min-height:41px;border-radius:10px;color:#77678a}
.entry-tab.active{color:#622b9f}
.form-grid{gap:13px}
.field{gap:7px}.field span{font-size:12px;color:#4c3866}
.field small{font-size:11px;line-height:1.5}
.field input,.field select,.field textarea,.toolbar input,.toolbar select{min-height:44px;font-size:13px;background:#fff;border:1px solid #ded1ec;border-radius:12px;padding:10px 12px}
.field input:focus,.field textarea:focus,.toolbar input:focus,.toolbar select:focus{border-color:#aa78da;box-shadow:0 0 0 3px #f0e3fb}
.check{font-size:12px}.check-emphasis{background:#faf5ff;border-color:#eadbf8;padding:12px;border-radius:13px}.check-emphasis span b{font-size:12px}.check-emphasis span small{font-size:11px}
.cover-upload{background:#fbf8ff;border:1px dashed #c9afe3;border-radius:13px;padding:13px}
.advanced-options{background:#fbf8ff;border:1px solid #e7dcef;border-radius:13px}.advanced-options summary{font-size:12px;min-height:44px;padding:13px}
.form-actions{gap:9px;padding-top:14px}.form-actions .btn{min-width:96px}
.bulk-panel{padding:7px 0 11px}.bulk-panel textarea{min-height:146px;font-size:13px;border-color:#ded1ec;border-radius:12px}
.bulk-panel p,.bulk-preview,#bulkResult{font-size:11px;line-height:1.5}
.toolbar{gap:10px;padding:14px;border-bottom-color:#efe5f6}
.toolbar .muted{font-size:11px}
.status-box{border-radius:11px;background:#fbf9fe;border-color:#e9e1f3;color:#736980;padding:11px 13px;font-size:12px}
.links-grid{gap:11px;padding:3px 13px 16px}
.link-card{border:1px solid #e5daf1;border-radius:14px;box-shadow:0 5px 14px rgba(61,29,91,.055);overflow:visible}
.link-card:hover{border-color:#c6a7e4;box-shadow:0 9px 21px rgba(74,32,120,.12)}
.tile-cover{border-radius:13px 13px 0 0}
.tile-status{font-size:9px;border-radius:8px;padding:5px 7px}
.tile-menu-button{width:30px;height:30px;border-radius:9px}
.tile-body{padding:11px 10px}.tile-body h3{font-size:12px;color:#3a2651;font-weight:850}
.tile-tags{gap:5px;margin-top:7px}.platform,.auto-tag,.category-tag{font-size:10px;line-height:1.2;min-height:21px;border-radius:7px}
.tile-description{font-size:11px;line-height:1.45;min-height:31px}
.tile-mini-stats{font-size:10px;padding-top:8px}
.tile-actions{gap:6px;margin-top:10px}.tile-actions .btn{font-size:10.5px;min-height:35px;border-radius:9px;padding:7px 5px}
.tile-menu{min-width:150px;border-radius:12px;border-color:#ded0eb;box-shadow:0 12px 30px rgba(48,25,73,.18)}.tile-menu button{font-size:12px}
.link-add-tile{border-radius:14px;background:linear-gradient(140deg,#fff,#f5edff);border-color:#c6a4e9;min-height:172px;color:#6930ae}
.link-add-tile small{font-size:10px}.link-add-tile .add-icon{background:#eedeff}
.link-bulk-toolbar{border-radius:12px;background:#faf6ff;border-color:#e5d6f4;margin:10px 13px 1px;padding:10px}
.link-bulk-toolbar .btn{min-height:36px;font-size:11px}.bulk-select-summary strong{font-size:12px}
.category-manager-btn{min-height:41px;border-radius:11px;font-size:12px}
.toolbar #manageCategoriesBtn{background:#f3eaff;border-color:#dcc7f1}
.report-panel{padding:17px}.report-note{font-size:11px;line-height:1.55;border-radius:11px}
.dialog{border-radius:18px}.dialog-head{background:linear-gradient(105deg,#fff,#f7efff)}
.dialog-head strong{color:#51257b}
.categories-dialog,.move-category-dialog{border-color:#e4d6f1}
.category-row{border-radius:12px}
.toast{font-size:12px}
@media(max-width:760px){.hero{padding:14px 15px}.hero h1{font-size:22px}.hero p{font-size:11.5px}.toolbar{gap:8px}.kpis article{padding:11px}}
@media(max-width:640px){body{padding:8px}.hero{gap:10px}.hero-actions .btn{min-height:39px;font-size:11px}.links-grid{gap:8px;padding:4px 9px 12px}.tile-body{padding:8px}.tile-body h3{font-size:11px}.tile-description{font-size:10px}.tile-tags .platform,.tile-tags .auto-tag{font-size:9px}.tile-mini-stats{font-size:9px}.tile-actions .btn{min-height:33px;font-size:10px}.link-bulk-toolbar{margin:8px 9px 1px}.add-panel{padding:12px}.kpis{gap:6px}.kpis strong{font-size:21px}.report-panel{padding:12px}}
@media(min-width:480px) and (max-width:640px){.links-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.tile-tags{gap:3px}.tile-tags .platform,.tile-tags .auto-tag{font-size:8px;min-height:17px;padding:2px 4px}.tile-body{padding:6px}.tile-body h3{font-size:10.5px}.tile-description{font-size:9px;min-height:25px}.tile-mini-stats{font-size:8px}.tile-actions .btn{font-size:9px;padding:5px 3px;min-height:31px}}
@media(max-width:479px){.hero{align-items:stretch}.hero-actions{width:100%}.hero-actions .btn{flex:1 1 0}.kpis article{min-width:0;padding:10px 8px}.kpis small{font-size:10px}.kpis strong{font-size:19px}.entry-tab{font-size:11px}.library-tab{font-size:11px}.tile-status{font-size:8px}.tile-actions .btn{font-size:10px}.toolbar{padding:10px}.card-head h2{font-size:17px}}
@media(max-width:350px){.tile-actions .btn{font-size:10px}.links-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.btn,.link-card{transition:none}}
