*,*::before,*::after{box-sizing:border-box}
html{line-height:1.5;-webkit-text-size-adjust:100%}
body{margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
h1,h2,h3,p{margin:0}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit;margin:0}
button{background:none;border:0;padding:0;cursor:pointer}
img{display:block;max-width:100%;height:auto}
[hidden]{display:none!important}
.hidden{display:none!important}
.block{display:block}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

@keyframes gradientShift{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-10px)}}
@keyframes glow{0%,100%{box-shadow:0 0 5px rgba(102,126,234,.5)}50%{box-shadow:0 0 20px rgba(102,126,234,.8)}}
@keyframes shine{0%{left:-100%}100%{left:100%}}
@keyframes fadeIn{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}
@keyframes slideIn{from{transform:translateX(100%);opacity:0}to{transform:translateX(0);opacity:1}}
@keyframes spin{to{transform:rotate(360deg)}}
.fade-in{animation:fadeIn .5s ease-out}
.float-icon{animation:float 3s ease-in-out infinite}
.loading-spinner{display:inline-block;width:20px;height:20px;border:3px solid rgba(255,255,255,.3);border-radius:50%;border-top-color:#fff;animation:spin 1s linear infinite}

/* ---------- auth ---------- */
.auth-body{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:16px;background:linear-gradient(135deg,#9333ea,#3b82f6)}
.auth-wrap{width:100%;max-width:28rem}
.animated-header{background:linear-gradient(135deg,#667eea 0%,#764ba2 50%,#f093fb 100%);background-size:200% 200%;animation:gradientShift 3s ease infinite,glow 2s ease-in-out infinite;position:relative;overflow:hidden;border-radius:1rem;padding:24px;margin-bottom:24px;text-align:center;color:#fff;box-shadow:0 25px 50px -12px rgba(0,0,0,.25)}
.animated-header::before{content:'';position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.3),transparent);animation:shine 3s infinite}
.auth-icons{display:flex;justify-content:center;gap:12px;font-size:34px;margin-bottom:10px}
.animated-header h1{font-size:28px;font-weight:700;letter-spacing:.05em}
.animated-header p{font-size:14px;margin-top:8px;opacity:.9}
.auth-card{background:rgba(255,255,255,.95);backdrop-filter:blur(10px);border-radius:1rem;padding:32px;box-shadow:0 25px 50px -12px rgba(0,0,0,.25)}
.auth-tabs{display:flex;gap:8px;padding:6px;background:#f3f4f6;border-radius:12px;margin-bottom:24px}
.auth-tabs button{flex:1;padding:10px;font-size:14px;font-weight:600;border-radius:8px;color:#4b5563;transition:all .3s}
.auth-tabs button:hover{background:#fff}
.auth-tabs button.on{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;box-shadow:0 4px 14px rgba(102,126,234,.4)}
.auth-card h2{font-size:24px;font-weight:700;color:#1f2937;text-align:center;margin-bottom:24px}
.auth-card h2+.auth-sub{margin-top:-18px}
.auth-sub{color:#6b7280;font-size:14px;text-align:center;margin-bottom:24px}
.auth-card label{display:block;font-weight:600;color:#374151;margin:16px 0 8px}
.auth-card label i{margin-right:8px}
.auth-card input[type=text],.auth-card input[type=password]{width:100%;padding:12px 16px;border:1px solid #d1d5db;border-radius:8px;outline:0;transition:box-shadow .15s}
.auth-card input:focus{box-shadow:0 0 0 2px #a855f7}
.auth-hint{font-size:12px;color:#9ca3af;margin-top:4px}
.auth-btn{width:100%;margin-top:22px;padding:12px;border-radius:8px;color:#fff;font-weight:700;background:linear-gradient(90deg,#9333ea,#3b82f6);box-shadow:0 10px 15px -3px rgba(0,0,0,.1);transition:transform .3s}
.auth-btn:hover{transform:scale(1.03)}
.auth-btn.green{background:linear-gradient(90deg,#16a34a,#14b8a6)}
.auth-foot{text-align:center;color:#6b7280;font-size:14px;margin-top:20px}
.auth-foot button{color:#9333ea;font-weight:600}
.auth-foot button:hover{text-decoration:underline}
.auth-error{background:#fef2f2;border:1px solid #fecaca;color:#b91c1c;border-radius:8px;padding:10px 12px;font-size:14px;margin-bottom:16px}
.promo-card{display:flex;align-items:center;gap:12px;margin-top:24px;background:#fff;border:1px solid #f3e8ff;border-radius:1rem;padding:16px;box-shadow:0 10px 15px -3px rgba(0,0,0,.1);transition:transform .15s}
.promo-card:hover{transform:scale(1.02)}
.promo-new{background:linear-gradient(90deg,#9333ea,#3b82f6);color:#fff;font-size:12px;font-weight:700;padding:2px 8px;border-radius:999px;flex:0 0 auto}
.promo-copy{flex:1;min-width:0}
.promo-copy b{display:block;font-size:14px;color:#1f2937}
.promo-copy em{font-style:normal;color:#7e22ce}
.promo-copy small{display:block;color:#6b7280;font-size:12px;margin-top:2px}
.promo-card>i{color:#9333ea}

/* ---------- toast ---------- */
.toast{position:fixed;bottom:20px;right:20px;z-index:1000;animation:slideIn .3s ease-out;background:#16a34a;color:#fff;padding:12px 18px;border-radius:10px;font-size:14px;font-weight:600;box-shadow:0 10px 25px rgba(0,0,0,.2);max-width:90vw}
.toast.error{background:#dc2626}

/* ---------- dashboard shell ---------- */
.dashboard-body{background:#f8fafc;color:#111827;min-height:100vh}
.dashboard-shell{width:min(100%,1600px);margin:0 auto;padding:0 20px 28px}
.dashboard-topbar{min-height:64px;display:flex;align-items:center;gap:20px;background:#fff;border-bottom:1px solid #e5e7eb;margin:0 -20px 16px;padding:8px 20px;position:relative;z-index:40}
.dashboard-brand{display:flex;align-items:center;gap:12px;min-width:max-content}
.brand-icons{display:flex;align-items:center;gap:9px;font-size:24px;line-height:1}
.brand-icons .fa-link,.brand-icons .fa-rocket{color:#3730d9}
.brand-icons .fa-bolt{color:#f7c514}
.dashboard-brand-name{font-size:20px;font-weight:700;letter-spacing:-.02em}
.dashboard-metrics{margin-left:auto;display:flex;align-items:center;gap:12px}
.metric{display:flex;align-items:center;gap:9px;padding:3px 12px;border-left:1px solid #e5e7eb;min-height:42px}
.metric:first-child{border-left:0}
.metric-icon{width:32px;height:32px;border-radius:8px;display:grid;place-items:center;color:#342ed7;background:#f5f4ff;flex:0 0 auto}
.metric-label{color:#64748b;font-size:11px;line-height:1.1}
.metric-value{font-size:16px;line-height:1.15;font-weight:700;font-variant-numeric:tabular-nums}
.today-pill{display:inline-flex;align-items:center;gap:4px;margin-left:7px;padding:3px 7px;border-radius:999px;background:#eef2ff;color:#3730d9;font-size:10px;font-weight:700;white-space:nowrap}
.community-metric{gap:10px}
.community-icon{font-size:14px}
.community-trend{margin-left:3px;color:#3730d9;font-size:8px}
.community-copy{display:flex;min-width:0;flex-direction:column;align-items:flex-start}
.community-scope{display:inline-flex;align-items:center;margin-top:2px;padding:2px 6px;border-radius:999px;background:#eef2ff;color:#3730d9;font-size:8px;line-height:1.2;font-weight:700;white-space:nowrap}
.account-wrap{position:relative;margin-left:6px}
.account-button,.shield-button{width:52px;height:42px;border:1px solid #dbe2ea;border-radius:9px;display:flex;align-items:center;justify-content:center;gap:8px;color:#342ed7;background:#fff}
.account-button:hover{background:#f8fafc}
.account-menu{position:absolute;right:0;top:calc(100% + 8px);width:176px;padding:6px;background:#fff;border:1px solid #dbe2ea;border-radius:10px;box-shadow:0 14px 35px rgba(15,23,42,.14)}
.account-menu button{display:flex;align-items:center;gap:9px;width:100%;padding:9px 10px;border-radius:7px;color:#334155;font-size:13px;font-weight:600;text-align:left}
.account-menu button:hover{background:#f1f5f9}
.account-menu .logout-link{color:#dc2626}

@keyframes shieldRing{0%,52%,100%{transform:rotate(0)}60%{transform:rotate(13deg)}68%{transform:rotate(-11deg)}76%{transform:rotate(8deg)}84%{transform:rotate(-5deg)}92%{transform:rotate(2deg)}}
@keyframes shieldDotPulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.28);opacity:.72}}
.shield-wrap{position:relative;flex:0 0 auto}
.shield-button{position:relative;display:grid;place-items:center;transition:background .15s,border-color .15s,box-shadow .15s}
.shield-button:hover,.shield-button[aria-expanded="true"]{background:#f7f7ff;border-color:#c9c7f7;box-shadow:0 4px 12px rgba(52,46,215,.12)}
.shield-icon{font-size:19px;transform-origin:50% 18%;animation:shieldRing 1.8s ease-in-out 2}
.shield-dot{position:absolute;right:7px;top:6px;width:8px;height:8px;border:2px solid #fff;border-radius:999px;background:#ef4444;animation:shieldDotPulse 1.6s ease-in-out infinite}
.shield-button.is-seen .shield-icon{animation:none}
.shield-button.is-seen .shield-dot{display:none}
.shield-panel{position:absolute;right:0;top:calc(100% + 9px);width:320px;max-width:calc(100vw - 24px);overflow:hidden;border:1px solid #dbe2ea;border-radius:12px;background:#fff;box-shadow:0 18px 45px rgba(15,23,42,.18);text-align:left;z-index:70}
.shield-panel-head{padding:15px 16px 13px;border-bottom:1px solid #edf0f4}
.shield-panel-title{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.shield-panel-title-icon{width:30px;height:30px;display:grid;place-items:center;border-radius:8px;color:#342ed7;background:#f3f2ff}
.shield-panel-title strong{display:block;font-size:14px;line-height:1.2}
.shield-panel-title small{display:block;margin-top:2px;color:#64748b;font-size:10px;font-weight:600}
.shield-summary{color:#1f2937;font-size:13px;line-height:1.45}
.shield-summary-note{margin-top:7px;color:#64748b;font-size:11px;line-height:1.45}
.shield-days{max-height:246px;overflow:auto;overscroll-behavior:contain}
.shield-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:34px;padding:8px 16px;border-top:1px solid #f0f2f5;color:#64748b;font-size:11.5px}
.shield-row:first-child{border-top:0}
.shield-row-count{color:#334155;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.shield-row-count.is-zero{color:#94a3b8}
.shield-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-top:1px solid #e5e7eb;background:#f8fafc;color:#64748b;font-size:11px}
.shield-footer strong{color:#342ed7;font-size:12px}
@media (prefers-reduced-motion:reduce){.shield-icon,.shield-dot{animation:none}}

.dashboard-grid{display:grid;grid-template-columns:minmax(0,62fr) minmax(350px,38fr);gap:16px;align-items:start}
.workspace-panel,.links-list-section{background:#fff;border:1px solid #dfe5ec;border-radius:10px;box-shadow:0 1px 2px rgba(15,23,42,.03);min-width:0}
.workspace-panel{padding:14px 16px 16px}
.links-list-section{padding:16px}
.links-panel{min-width:0;display:grid;gap:16px}
.dashboard-tabs{display:grid;grid-template-columns:1fr 1fr;border:1px solid #dfe5ec;border-radius:7px;overflow:hidden;margin-bottom:16px}
.dashboard-tab{min-height:38px;padding:8px 14px;background:#f8fafc;color:#27324a;font-size:14px;font-weight:600;transition:background .15s,color .15s}
.dashboard-tab+.dashboard-tab{border-left:1px solid #dfe5ec}
.dashboard-tab.tab-active{color:#fff;background:#3832db}
.dashboard-tab.tab-inactive:hover{background:#f1f5f9}
.creator-form{display:grid;gap:14px}
.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.field label,.field-label{display:block;margin-bottom:6px;color:#1f2937;font-size:13px;font-weight:700}
.field-label .muted,.field label .muted{color:#64748b;font-weight:500}
.dashboard-input{width:100%;border:1px solid #cfd8e3;border-radius:7px;background:#fff;color:#1e293b;padding:10px 12px;font-size:14px;line-height:1.45;transition:border-color .15s,box-shadow .15s}
.dashboard-input:focus{outline:0;border-color:#5148e5;box-shadow:0 0 0 2px rgba(81,72,229,.12)}
textarea.dashboard-input{resize:vertical}
.bulk-urls{min-height:122px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.bulk-urls.one-url-mode{min-height:64px;resize:none}
.bulk-mode-guide{display:grid;gap:7px}
.bulk-mode-title{font-size:15px;line-height:1.25;font-weight:750}
.bulk-mode-subtitle{color:#64748b;font-size:11px}
.bulk-mode-option{display:flex;align-items:flex-start;gap:8px;color:#475569;font-size:11px;line-height:1.4}
.bulk-mode-option i{width:15px;margin-top:2px;color:#64748b;text-align:center}
.bulk-mode-option strong{color:#334155}
.bulk-per-image-row{display:flex;align-items:center;gap:10px;margin-top:3px;padding:10px 0;border-top:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;cursor:pointer}
.bulk-per-image-toggle{position:relative;width:36px;height:20px;flex:0 0 auto}
.bulk-per-image-toggle input{position:absolute;width:1px;height:1px;opacity:0}
.bulk-per-image-track{position:absolute;inset:0;border-radius:999px;background:#cbd5e1;transition:background .15s}
.bulk-per-image-track::after{content:'';position:absolute;top:3px;left:3px;width:14px;height:14px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(15,23,42,.3);transition:transform .15s}
.bulk-per-image-toggle input:checked+.bulk-per-image-track{background:#3933d8}
.bulk-per-image-toggle input:checked+.bulk-per-image-track::after{transform:translateX(16px)}
.bulk-per-image-toggle input:focus-visible+.bulk-per-image-track{outline:2px solid #5148e5;outline-offset:2px}
.bulk-per-image-copy{min-width:0}
.bulk-per-image-label{display:block;color:#334155;font-size:12px;line-height:1.3;font-weight:700}
.bulk-per-image-help{display:block;margin-top:2px;color:#64748b;font-size:10px;line-height:1.35}
.image-tools{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,.75fr);gap:10px;align-items:end}
.upload-button{min-height:42px;border:1px dashed #8d88ed;border-radius:7px;color:#3730d9;background:#fafaff;display:flex;align-items:center;justify-content:center;gap:8px;padding:9px 12px;font-size:13px;font-weight:700;cursor:pointer}
.upload-button:hover{background:#f4f3ff}
.image-help{color:#64748b;font-size:11px;line-height:1.45;margin-top:5px}
#singleImagePreview{width:min(100%,580px);margin-top:2px}
.single-preview{position:relative;width:100%;aspect-ratio:1200/630;border:1px solid #dfe5ec;border-radius:8px;overflow:hidden;background:#f8fafc}
.single-preview img{width:100%;height:100%;object-fit:contain;background:#eef2f7}
.preview-size{position:absolute;left:10px;top:10px;z-index:2;padding:4px 7px;border-radius:5px;background:rgba(255,255,255,.9);color:#334155;font-size:11px;font-weight:700}
.preview-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px}
.preview-label{color:#64748b;font-size:11px;line-height:1.35}
.image-feedback{margin-top:4px;padding:6px 10px;border-radius:8px;font-size:11px}
.image-feedback.ok{background:#f0fdf4;color:#166534}
.image-feedback.warn{background:#fffbeb;color:#92400e}
.image-feedback.error{background:#fef2f2;color:#b91c1c}
.preview-actions{display:flex;gap:7px;flex:0 0 auto}
.quiet-button{border:1px solid #cfd8e3;border-radius:6px;padding:7px 10px;background:#fff;color:#3730d9;font-size:12px;font-weight:600}
.quiet-button.danger{color:#dc2626;border-color:#fecaca}
.primary-action{width:100%;min-height:43px;border-radius:7px;background:#3933d8;color:#fff;font-size:15px;font-weight:700;box-shadow:0 3px 10px rgba(57,51,216,.18);display:flex;align-items:center;justify-content:center}
.primary-action:hover{background:#302ac7}
.primary-action:disabled{opacity:.65;cursor:wait}
.traffic-trust-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 8px;margin-top:8px;color:#64748b;font-size:12px;text-align:center}
.trust-icon{color:#10b981;font-size:13px}
.trust-separator{color:#94a3b8}
.keep-row{display:flex;align-items:center;gap:9px;padding:10px 12px;margin-top:12px;border:1px solid #e2e8f0;border-radius:7px;color:#334155;font-size:12px;font-weight:500;cursor:pointer}
.keep-row input{width:17px;height:17px;accent-color:#3933d8}
.quick-reuse{margin-top:14px;padding-top:14px;border-top:1px solid #e2e8f0}
.quick-reuse-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:9px}
.quick-reuse-title{font-size:15px;line-height:1.2;font-weight:750}
.quick-reuse-subtitle{margin-top:2px;color:#64748b;font-size:10px}
.quick-reuse-device{display:flex;align-items:center;gap:6px;color:#64748b;font-size:10px;white-space:nowrap}
.quick-reuse-clear{color:#3730d9;font-size:10px;font-weight:650}
.quick-reuse-clear:hover{text-decoration:underline}
.quick-reuse-list{display:grid;gap:7px}
.quick-reuse-item{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:9px;align-items:center;min-width:0;padding:9px;border:1px solid #e2e8f0;border-radius:8px;background:#fff}
.quick-reuse-item.is-top{border-color:#aaa6fa;background:#fafaff}
.quick-reuse-rank{width:34px;height:34px;display:grid;place-items:center;border-radius:8px;background:#eef2f7;color:#475569;font-size:13px;font-weight:750}
.quick-reuse-item.is-top .quick-reuse-rank{background:#3933d8;color:#fff}
.quick-reuse-copy{min-width:0}
.quick-reuse-url{overflow:hidden;color:#3730d9;font-size:12px;font-weight:700;white-space:nowrap;text-overflow:ellipsis}
.quick-reuse-name{overflow:hidden;margin-top:2px;color:#334155;font-size:11px;white-space:nowrap;text-overflow:ellipsis}
.quick-reuse-meta{margin-top:3px;color:#64748b;font-size:10px}
.quick-reuse-use{min-width:86px;border:1px solid #aaa6fa;border-radius:7px;padding:7px 9px;background:#fff;color:#3730d9;font-size:11px;font-weight:700;white-space:nowrap}
.quick-reuse-use:hover{background:#f4f3ff}

#resultTray{margin-top:12px;border:1px solid #dfe5ec;border-radius:8px;background:#fff;padding:12px}
.tray-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;font-weight:700;font-size:14px;color:#166534}
.tray-close{color:#94a3b8;width:26px;height:26px;border-radius:6px}
.tray-close:hover{background:#f1f5f9}
.tray-short{color:#7c3aed;font-weight:600;font-size:14px;word-break:break-all}
.tray-actions{display:flex;gap:8px;margin:8px 0 4px;flex-wrap:wrap}
.tray-dest{margin-top:8px;font-family:ui-monospace,monospace;font-size:11px;color:#6b7280;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tray-more{font-size:11px;color:#6b7280;margin-top:8px}
.result-items-list{display:grid}
.result-item-row{display:grid;grid-template-columns:44px minmax(0,1fr) 30px 30px;gap:9px;align-items:center;min-width:0;padding:7px 0;border-top:1px solid #eef2f6}
.result-item-thumb{width:44px;height:34px;border-radius:6px;overflow:hidden;display:grid;place-items:center;background:#f1f5f9;color:#cbd5e1;font-size:13px}
.result-item-thumb img{width:100%;height:100%;object-fit:cover}
.result-item-main{min-width:0;display:grid;gap:2px}
.result-item-short{color:#7c3aed;font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.result-item-destination{color:#94a3b8;font-family:ui-monospace,monospace;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.result-item-action{width:30px;height:30px;display:grid;place-items:center;border-radius:6px;color:#475569}
.result-item-action:hover{background:#f1f5f9}

.bulk-images{display:flex;flex-wrap:wrap;gap:10px;align-items:stretch}
#bulkImagePool{display:flex;flex-wrap:wrap;gap:10px}
.pool-chip{position:relative;width:132px;height:86px;border-radius:7px;border:1px solid #e5e7eb;overflow:hidden;background:#f9fafb;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;font-size:11px;text-align:center}
.pool-chip img{width:100%;height:100%;object-fit:cover}
.pool-chip.failed{border-color:#fca5a5;background:#fef2f2;color:#dc2626;padding:6px;width:160px;height:auto;min-height:86px}
.pool-chip.warn{box-shadow:0 0 0 2px #fbbf24}
.pool-chip .pool-x{position:absolute;top:0;right:0;width:20px;height:20px;background:#ef4444;color:#fff;border-bottom-left-radius:4px;font-size:10px}
.pool-chip .pool-btn{border:1px solid #fca5a5;background:#fff;border-radius:5px;padding:2px 6px;font-size:11px;color:#b91c1c}
.add-images-tile{width:132px;height:86px;border:1px dashed #8d88ed;border-radius:7px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:#3730d9;background:#fafaff;cursor:pointer;font-size:12px;font-weight:600}
.add-images-tile i{width:28px;height:28px;border-radius:999px;background:#3933d8;color:#fff;display:grid;place-items:center}
#bulkImagePicker:focus-visible+.add-images-tile{outline:2px solid #5148e5;outline-offset:2px}
.bulk-clear-images{align-self:center;min-height:36px;padding:8px 10px;border:1px solid #b91c1c;border-radius:6px;background:#fff;color:#b91c1c;font-size:12px;font-weight:600}
.bulk-clear-images:hover:not(:disabled){background:#fef2f2}
.bulk-clear-images:disabled{color:#64748b;border-color:#d8dce5;background:#f8fafc;cursor:default}

.links-heading-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.links-heading{font-size:17px;line-height:1.2;font-weight:700}
.link-count{color:#64748b;font-size:11px;font-weight:500;margin-left:5px}
.link-search{display:grid;grid-template-columns:minmax(0,1fr) 118px;gap:9px;margin-bottom:12px}
.search-field{position:relative}
.search-field .dashboard-input{padding-right:38px}
.search-submit{position:absolute;right:3px;top:3px;width:34px;height:34px;display:grid;place-items:center;color:#334155;border-radius:6px}
.search-submit:hover{background:#f1f5f9}
.links-list{border:1px solid #e1e7ee;border-radius:8px}
.links-list>.link-row+.link-row{border-top:1px solid #e8edf2}
.empty-state{padding:26px 16px;text-align:center;color:#64748b;font-size:14px}
.link-row{display:grid;grid-template-columns:10px 58px minmax(0,1fr) auto auto;gap:10px;align-items:center;padding:10px;background:#fff}
.link-row:first-child{border-radius:8px 8px 0 0}
.link-row:last-child{border-radius:0 0 8px 8px}
.link-status{width:9px;height:9px;border-radius:999px;background:#079669}
.link-thumb{width:58px;height:44px;border-radius:6px;overflow:hidden;background:#f1f5f9;display:grid;place-items:center;color:#cbd5e1}
.link-thumb img{width:100%;height:100%;object-fit:cover}
.link-main{min-width:0}
.link-title{color:#1f2937;font-size:13px;line-height:1.25;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.link-short-line{display:flex;align-items:center;gap:6px;min-width:0;margin-top:2px}
.link-short{color:#3730d9;font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.link-copy{color:#3730d9;font-size:12px;flex:0 0 auto}
.link-meta,.link-description{color:#64748b;font-size:10px;line-height:1.35;margin-top:2px;overflow-wrap:anywhere}
.link-meta{display:flex;gap:4px;align-items:center;min-width:0}
.link-meta-url{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 105px);display:inline-block}
.link-description{color:#94a3b8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.link-clicks{min-width:72px;display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;color:#475569;font-size:12px;white-space:nowrap}
.link-clicks i{font-size:10px;color:#4f46e5}
.link-clicks-value{color:#334155;font-weight:700}
.link-clicks-unit{color:#64748b;font-size:10px;font-weight:600}
.link-actions{position:relative}
.kebab-toggle{width:28px;height:28px;display:grid;place-items:center;color:#334155;border-radius:6px}
.kebab-toggle:hover{background:#f1f5f9}
.kebab-menu{position:absolute;right:0;top:100%;margin-top:4px;width:160px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 10px 15px -3px rgba(0,0,0,.1);z-index:20;padding:4px 0}
.kebab-menu a,.kebab-menu button{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:7px 12px;font-size:14px;color:#374151}
.kebab-menu a:hover,.kebab-menu button:hover{background:#f9fafb}
.kebab-menu i{width:16px;text-align:center}
.kebab-menu .feedback-link-report{color:#4338ca}
.kebab-menu .danger{color:#dc2626}
.kebab-menu .danger:hover{background:#fef2f2}
.pagination-wrap{margin-top:14px;padding-top:12px;border-top:1px solid #eef2f6;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px}
.pg{color:#3730d9;font-weight:600;padding:6px 10px;border:1px solid #dfe5ec;border-radius:6px}
.pg:hover{background:#f7f7ff}
.pg-info{color:#64748b}
.mobile-stats{display:none}

.shortener-promo{display:grid;gap:12px;padding:14px;background:#fff;border:1px solid #dfe1fb;border-radius:10px}
.shortener-promo-heading h2{font-size:15px;line-height:1.2;font-weight:750}
.shortener-promo-heading p{margin-top:3px;color:#73809b;font-size:10.5px}
.shortener-promo-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.shortener-promo-sites,.shortener-promo-credentials{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid #dfe3ee;border-radius:8px;overflow:hidden;background:#fff}
.shortener-promo-sites a{position:relative;min-height:48px;display:flex;align-items:center;justify-content:center;padding:8px 18px 8px 4px;color:#3730d9;font-size:10px;font-weight:700;text-align:center}
.shortener-promo-sites a i{position:absolute;top:50%;right:5px;font-size:9px;transform:translateY(-50%)}
.shortener-promo-sites a+a,.shortener-promo-copy+.shortener-promo-copy{border-left:1px solid #e5e7eb}
.shortener-promo-sites a:hover{background:#f7f7ff}
.shortener-promo-copy{min-height:48px;display:grid;grid-template-columns:minmax(0,1fr) 34px;align-items:center;gap:5px;padding:6px 6px 6px 10px;text-align:left;background:#fff}
.shortener-promo-copy:hover{background:#fafaff}
.shortener-promo-copy-text{min-width:0;display:grid;gap:2px}
.shortener-promo-copy-text small{color:#73809b;font-size:9px}
.shortener-promo-copy-text strong{overflow:hidden;font-size:10.5px;font-weight:650;white-space:nowrap;text-overflow:ellipsis}
.shortener-promo-copy-icon{width:34px;height:34px;display:grid;place-items:center;border:1px solid #e1e3fb;border-radius:7px;color:#3730d9;background:#fbfbff;font-size:14px}
.shortener-promo-copy.is-copied .shortener-promo-copy-icon{color:#078548;border-color:#bbebd0;background:#f1fcf6}

/* ---------- traffic panel ---------- */
.traffic-panel{background:#fff;border:1px solid #dfe5ec;border-radius:10px;padding:16px;box-shadow:0 1px 2px rgba(15,23,42,.03);min-width:0}
.traffic-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.traffic-head h2{font-size:15px;font-weight:750;display:flex;align-items:center;gap:8px}
.traffic-head h2 i{color:#3730d9}
.traffic-range{font-size:11px;color:#64748b;background:#f1f5f9;border-radius:999px;padding:3px 8px;white-space:nowrap}
.traffic-tabs{display:grid;grid-template-columns:1fr 1fr;border:1px solid #dfe5ec;border-radius:7px;overflow:hidden;margin-bottom:12px}
.traffic-tabs button{min-height:32px;background:#f8fafc;color:#27324a;font-size:13px;font-weight:600}
.traffic-tabs button+button{border-left:1px solid #dfe5ec}
.traffic-tabs button.on{background:#3832db;color:#fff}
.traffic-body{display:grid;gap:9px}
.traffic-row{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr) 62px;gap:10px;align-items:center}
.traffic-label{display:flex;align-items:center;gap:7px;min-width:0;font-size:12.5px;font-weight:600;color:#1f2937}
.traffic-label>span:not(.cc-badge){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.traffic-label i{font-size:10px;color:#94a3b8;width:22px;text-align:center}
.cc-badge{display:inline-grid;place-items:center;min-width:24px;height:18px;padding:0 4px;border-radius:4px;background:#eef2ff;color:#3730d9;font-size:10px;font-weight:800;letter-spacing:.02em}
.traffic-bar{height:8px;border-radius:999px;background:#eef2f7;overflow:hidden}
.traffic-bar i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#6366f1,#3832db)}
.traffic-num{text-align:right;font-variant-numeric:tabular-nums;line-height:1.15}
.traffic-num b{display:block;font-size:12.5px;color:#111827}
.traffic-num small{font-size:10px;color:#64748b}
.traffic-empty{color:#94a3b8;font-size:13px;text-align:center;padding:14px 0}
.traffic-foot{margin-top:12px;color:#94a3b8;font-size:10.5px;text-align:center}
.traffic-foot a{text-decoration:underline}

/* ---------- feedback ---------- */
.feedback-prompt{position:fixed;z-index:80;left:50%;bottom:14px;transform:translateX(-50%);width:min(680px,calc(100% - 24px));border:1px solid #d7dbea;border-radius:14px;padding:18px 20px 14px;background:#fff;box-shadow:0 18px 55px rgba(15,23,42,.2);text-align:center}
.feedback-prompt-close{position:absolute;top:6px;right:6px;width:44px;height:44px;display:grid;place-items:center;border-radius:999px;color:#64748b}
.feedback-prompt-close:hover{background:#f1f5f9}
.feedback-prompt-title{padding:0 30px;font-size:18px;font-weight:750}
.feedback-prompt-subtitle{margin-top:3px;color:#64748b;font-size:12px}
.feedback-prompt-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:16px}
.feedback-tap{min-height:44px;display:flex;align-items:center;justify-content:center;gap:7px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#475569;font-size:14px;font-weight:650}
.feedback-tap.good{border-color:#86c994;color:#16803a;background:#f7fff8}
.feedback-tap.problem{border-color:#f2a1a1;color:#dc2626;background:#fffafa}
.feedback-tap:hover,.feedback-category:hover{background:#f8fafc}
.feedback-more{min-height:44px;display:inline-flex;align-items:center;justify-content:center;margin-top:7px;padding:0 8px;color:#3730d9;font-size:13px;text-decoration:underline}
.feedback-backdrop{position:fixed;z-index:89;inset:0;background:rgba(15,23,42,.4)}
.feedback-sheet{position:fixed;z-index:90;left:50%;bottom:0;transform:translateX(-50%);width:min(680px,100%);max-height:min(90vh,760px);overflow:auto;border-radius:18px 18px 0 0;padding:18px 22px 20px;background:#fff;box-shadow:0 -18px 55px rgba(15,23,42,.25)}
.feedback-sheet-handle{width:42px;height:4px;margin:0 auto 13px;border-radius:999px;background:#cbd5e1}
.feedback-sheet-title{font-size:21px;font-weight:800;text-align:center}
.feedback-sheet-subtitle{margin-top:4px;color:#64748b;font-size:13px;text-align:center}
.feedback-link-context{margin-top:10px;padding:8px 10px;border-radius:7px;background:#f5f4ff;color:#3730d9;font-size:12px;text-align:center}
.feedback-categories{display:grid;gap:9px;margin-top:17px}
.feedback-category{min-height:46px;display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;border:1px solid #dbe1e8;border-radius:9px;padding:10px 14px;background:#fff;color:#3730d9;font-size:14px;font-weight:600;text-align:left}
.feedback-category.is-selected{border-color:#5148e5;background:#f5f4ff;box-shadow:0 0 0 1px #5148e5 inset}
.feedback-category.is-expanded{border-radius:9px 9px 0 0}
.feedback-reach-reasons{margin-top:-9px;padding:12px;border:1px solid #5148e5;border-top:0;border-radius:0 0 9px 9px;background:#fafaff}
.feedback-reach-question{margin-bottom:9px;color:#334155;font-size:13px;font-weight:700}
.feedback-reach-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.feedback-reach-option{min-height:44px;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#334155;font-size:12px;font-weight:650;text-align:center}
.feedback-reach-option:hover{background:#f5f4ff}
.feedback-reach-option.is-selected{border-color:#5148e5;background:#eeecff;color:#3730d9;box-shadow:0 0 0 1px #5148e5 inset}
.feedback-message{width:100%;min-height:90px;margin-top:12px;resize:vertical;border:1px solid #dbe1e8;border-radius:9px;padding:11px 12px;font-size:14px}
.feedback-message:focus{outline:2px solid #aaa6fa;outline-offset:1px}
.feedback-send{width:100%;min-height:46px;margin-top:12px;border-radius:9px;background:#3933d8;color:#fff;font-size:15px;font-weight:750}
.feedback-send:disabled{opacity:.55;cursor:not-allowed}
.feedback-not-now{min-height:44px;display:flex;align-items:center;justify-content:center;margin:6px auto 0;padding:0 12px;color:#3730d9;font-size:14px;font-weight:650}
.feedback-privacy{margin-top:10px;color:#64748b;font-size:11px;text-align:center}

/* ---------- stats page ---------- */
.stats-body{background:linear-gradient(180deg,#f9fafb,#f3f4f6);min-height:100vh;color:#1f2937}
.stats-wrap{max-width:64rem;margin:0 auto;padding:24px 16px;display:grid;gap:16px}
.stats-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.stats-back{color:#9333ea;font-size:14px;font-weight:600}
.stats-head h1{font-size:20px;font-weight:700;color:#7e22ce}
.stats-card{background:#fff;border-radius:14px;padding:18px;box-shadow:0 4px 14px rgba(15,23,42,.06)}
.stats-card h2{font-size:15px;font-weight:700;margin-bottom:12px}
.stats-link{display:flex;align-items:center;gap:12px}
.stats-link-icon{width:40px;height:40px;border-radius:10px;background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;display:grid;place-items:center;flex:0 0 auto}
.stats-link a{color:#7c3aed;font-weight:600;font-size:14px;word-break:break-all;display:block}
.stats-link code{font-size:12px;color:#6b7280;display:block;margin-top:2px;word-break:break-all}
.stats-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.stats-tile{background:#fff;border-radius:12px;padding:14px 16px;box-shadow:0 4px 14px rgba(15,23,42,.06);border-left:4px solid}
.stats-tile.t1{border-color:#a855f7}.stats-tile.t2{border-color:#3b82f6}.stats-tile.t3{border-color:#22c55e}
.stats-tile small{display:block;font-size:10px;letter-spacing:.05em;color:#6b7280;font-weight:600}
.stats-tile b{display:block;font-size:26px;font-weight:800;margin:2px 0}
.stats-tile span{font-size:11px;color:#9ca3af}
.stats-chart{display:flex;align-items:flex-end;gap:6px;height:190px;border-bottom:1px solid #e5e7eb}
.stats-bar{flex:1;min-height:2px;border-radius:6px 6px 0 0;background:linear-gradient(180deg,#8b5cf6,#6366f1)}
.stats-axis{display:flex;justify-content:space-between;font-size:10px;color:#9ca3af;margin-top:6px}
.stats-table{width:100%;border-collapse:collapse;font-size:14px}
.stats-table th{font-size:10px;letter-spacing:.05em;color:#6b7280;font-weight:600;text-align:left;padding:6px 0}
.stats-table td{padding:8px 0;border-top:1px solid #f3f4f6}
.stats-table .r{text-align:right}
.stats-empty{color:#9ca3af;font-size:13px}
.stats-table .cc-badge{margin-right:6px}
@media (max-width:640px){.stats-tiles{grid-template-columns:1fr}}

/* ---------- responsive ---------- */
@media (max-width:1023px){
  .dashboard-shell{padding:0 14px 22px}
  .dashboard-topbar{margin:0 -14px 12px;padding:8px 14px;min-height:58px}
  .dashboard-metrics{display:none}
  .dashboard-brand-name{font-size:18px}
  .brand-icons{font-size:22px}
  .shield-wrap{margin-left:auto}
  .account-wrap{margin-left:0}
  .dashboard-grid{grid-template-columns:1fr;gap:12px}
  .workspace-panel{padding:12px}
  .links-panel{order:2}
  .links-list-section{padding:12px}
  .shortener-promo-actions{grid-template-columns:1fr}
  .field-grid,.image-tools{grid-template-columns:1fr}
  .bulk-urls{min-height:144px}
  .mobile-stats{display:grid;grid-template-columns:23% 44% 33%;margin:0 0 12px;overflow:hidden;border:1px solid #dfe5ec;border-radius:8px;background:#fff}
  .mobile-stat{min-width:0;min-height:56px;display:grid;grid-template-columns:22px minmax(0,1fr);grid-template-rows:auto auto;column-gap:5px;row-gap:2px;align-items:center;padding:7px 8px}
  .mobile-stat+.mobile-stat{border-left:1px solid #e5e7eb}
  .mobile-stat-icon{grid-column:1;grid-row:1;width:22px;height:22px;display:grid;place-items:center;border-radius:6px;background:#f5f4ff;color:#3730d9;font-size:12px}
  .mobile-stat-label{grid-column:2;grid-row:1;min-width:0;overflow:hidden;color:#64748b;font-size:9px;white-space:nowrap;text-overflow:ellipsis}
  .mobile-stat-value-row{grid-column:1/-1;grid-row:2;display:flex;flex-wrap:wrap;align-items:center;gap:3px}
  .mobile-stat-value{font-size:14px;line-height:1.1;font-weight:700;white-space:nowrap}
  .mobile-stat .today-pill{margin:0;padding:2px 4px;font-size:8px}
  .community-mobile-stat .mobile-stat-value-row{flex-direction:column;align-items:flex-start;gap:2px}
  .community-mobile-stat .community-scope{margin-top:0;padding:2px 4px;font-size:7px}
}
@media (max-width:520px){
  .dashboard-shell{padding-left:10px;padding-right:10px}
  .dashboard-topbar{margin-left:-10px;margin-right:-10px;padding-left:10px;padding-right:10px;gap:8px}
  .shield-button{width:42px;height:40px}.account-button{width:46px;height:40px}
  .shield-panel{position:fixed;left:10px;right:10px;top:66px;width:auto;max-width:none}
  .link-search{grid-template-columns:minmax(0,1fr) 100px}
  .link-row{grid-template-columns:8px 48px minmax(0,1fr) auto auto;column-gap:6px;row-gap:3px;padding:9px 8px 9px}
  .link-thumb{width:48px;height:42px}
  .link-description{display:none}
  .feedback-prompt-actions{gap:7px}
  .feedback-tap{font-size:12px;padding:6px}
  .feedback-reach-options{grid-template-columns:1fr}
  .pool-chip,.add-images-tile{width:calc(33% - 8px);min-width:84px}
}
