:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;--bg:#f5f6f8;--surface:#fff;--surface-2:#eef0f3;--border:#d6dae0;--text:#1b1f24;--muted:#5d6673;--accent:#2f6fde;--accent-text:#fff;--accent-soft:#dbe7fb;--danger:#c2362f;--danger-soft:#fbe3e1;--warning-soft:#fff3cd;--focus:#2f6fde;--overlay:#0a0c108c;--viewer-bg:#0d0f12;--radius:8px;--shadow:0 4px 20px #0000001f;--font:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--mono:ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace}@media (prefers-color-scheme:dark){:root{--lightningcss-light: ;--lightningcss-dark:initial;--bg:#121418;--surface:#1b1e24;--surface-2:#252931;--border:#353a44;--text:#e6e8eb;--muted:#9aa3af;--accent:#5b93f2;--accent-text:#0b0d10;--accent-soft:#233a63;--danger:#ef6b63;--danger-soft:#4a2321;--warning-soft:#4a3f1a;--focus:#7aa8f7;--overlay:#000000a6;--shadow:0 4px 24px #00000080}}*,:before,:after{box-sizing:border-box}html,body{background:var(--bg);min-height:100%;color:var(--text);font-family:var(--font);margin:0;font-size:15px;line-height:1.45}[hidden]{display:none!important}h1{margin:0 0 1rem;font-size:1.4rem}h2{margin:0 0 .75rem;font-size:1.15rem}h3{color:var(--muted);margin:1rem 0 .4rem;font-size:.95rem;font-weight:600}p{margin:0 0 .75rem}.muted{color:var(--muted)}.error{color:var(--danger);margin:.5rem 0}.notice{background:var(--accent-soft);border-radius:var(--radius);padding:.6rem .8rem}.warning{background:var(--warning-soft);border-radius:var(--radius);margin:.75rem 0;padding:.6rem .8rem}.mono{font-family:var(--mono)}.empty{color:var(--muted);text-align:center;padding:3rem 1rem}button,input,textarea,select{font:inherit;color:inherit}button{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);cursor:pointer;white-space:nowrap;padding:.45rem .85rem}button:hover:not(:disabled){border-color:var(--accent)}button:disabled{opacity:.5;cursor:not-allowed}button.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-text);font-weight:600}button.danger{color:var(--danger);border-color:var(--danger);background:0 0}button.active{background:var(--accent-soft);border-color:var(--accent)}.link-btn{color:var(--accent);background:0 0;border:none;padding:.25rem 0;text-decoration:underline}.icon-btn{background:0 0;border:none;padding:.3rem .55rem;font-size:1.05rem;line-height:1}:focus-visible{outline:2px solid var(--focus);outline-offset:2px}input[type=text],input[type=password],input[type=search],input:not([type]),textarea{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);width:100%;padding:.5rem .65rem}textarea{resize:vertical}.form{flex-direction:column;gap:.75rem;display:flex}.field{flex-direction:column;gap:.25rem;display:flex}.field>span{font-size:.9rem;font-weight:600}.counter{align-self:flex-end}.checkbox{cursor:pointer;align-items:center;gap:.4rem;display:inline-flex}.actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:.5rem;margin-top:.75rem;display:flex}.actions>.muted:first-child{margin-right:auto}.actions-start{justify-content:flex-start}.inline-form{align-items:center;gap:.5rem;display:flex}.segmented{display:inline-flex}.segmented button{border-radius:0;margin-left:-1px}.segmented button:first-child{border-radius:var(--radius) 0 0 var(--radius);margin-left:0}.segmented button:last-child{border-radius:0 var(--radius) var(--radius) 0}progress{width:100%;height:6px;accent-color:var(--accent)}.spinner-wrap{color:var(--muted);align-items:center;gap:.5rem;display:inline-flex}.spinner{border:2px solid var(--border);border-top-color:var(--accent);border-radius:50%;width:1.1rem;height:1.1rem;animation:.8s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.toasts{z-index:1000;pointer-events:none;flex-direction:column;gap:.5rem;width:min(92vw,520px);display:flex;position:fixed;bottom:1rem;left:50%;transform:translate(-50%)}.toast{background:var(--text);color:var(--bg);border-radius:var(--radius);box-shadow:var(--shadow);text-align:center;padding:.7rem 1rem}.auth-page{justify-content:center;align-items:center;min-height:100vh;padding:1rem;display:flex}.card{background:var(--surface);border:1px solid var(--border);border-radius:calc(var(--radius) * 1.5);width:100%;max-width:460px;box-shadow:var(--shadow);padding:1.5rem}.auth-links{justify-content:space-between;margin-top:.5rem;display:flex}.recovery-key{font-family:var(--mono);letter-spacing:.04em;background:var(--surface-2);border:1px dashed var(--border);border-radius:var(--radius);text-align:center;word-break:break-all;-webkit-user-select:all;user-select:all;padding:.9rem;font-size:1.15rem;font-weight:600}.recovery .checkbox{margin-top:1rem}.topbar{z-index:20;background:var(--surface);border-bottom:1px solid var(--border);flex-wrap:wrap;align-items:center;gap:1rem;padding:.6rem 1rem;display:flex;position:sticky;top:0}.brand{font-weight:700}.tabs{gap:.25rem;display:flex}.tab{background:0 0;border:none;border-bottom:2px solid #0000;border-radius:0;padding:.45rem .75rem}.tab.active{border-bottom-color:var(--accent);background:0 0;font-weight:600}.topbar-actions{flex-wrap:wrap;gap:.5rem;margin-left:auto;display:flex}.tab-content{padding:1rem}.filter-bar{flex-direction:column;gap:.6rem;margin-bottom:.75rem;display:flex}.filter-row{flex-wrap:wrap;align-items:center;gap:.75rem;display:flex}.filter-row .search{flex:240px;max-width:420px}.count{color:var(--muted);margin-left:auto}.chips{flex-wrap:wrap;gap:.35rem;display:flex}.chips.disabled{opacity:.5}.chip{background:var(--surface);border-radius:999px;padding:.2rem .7rem;font-size:.85rem}.chip.selected{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}.chip.static{border:1px solid var(--border);background:var(--surface-2);display:inline-block}.chip-new{border-style:dashed}.tag-picker{flex-direction:column;gap:.4rem;display:flex}.tag-picker .chips{max-height:9.5rem;overflow-y:auto}.tag-picker.compact .chips{max-height:6rem}.selection-bar{z-index:10;background:var(--accent-soft);border-radius:var(--radius);flex-wrap:wrap;align-items:center;gap:.5rem;margin-bottom:.75rem;padding:.5rem .75rem;display:flex;position:sticky;top:3.3rem}.selection-bar>span:first-child{margin-right:.5rem;font-weight:600}.grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:6px;display:grid}.tile{aspect-ratio:1;background:var(--surface-2);border-radius:6px;position:relative;overflow:hidden}.tile.selected{outline:3px solid var(--accent);outline-offset:-3px}.tile-main{background:0 0;border:none;border-radius:0;width:100%;height:100%;padding:0;display:block}.tile-main img{object-fit:cover;width:100%;height:100%;display:block}.tile-placeholder{width:100%;height:100%;color:var(--muted);justify-content:center;align-items:center;display:flex}.tile-placeholder.error{color:var(--danger);font-weight:700}.tile-check{background:var(--surface);opacity:0;border-radius:4px;padding:2px 4px;line-height:0;transition:opacity .15s;position:absolute;top:6px;left:6px}.tile-check input{cursor:pointer;width:1.1rem;height:1.1rem;margin:0}.tile:hover .tile-check,.tile.selected .tile-check,.tile-check:focus-within,.tile-check.static{opacity:1}@media (hover:none){.tile-check{opacity:1}}.sentinel{justify-content:center;min-height:1px;padding:1.5rem 0;display:flex}.viewer{z-index:100;background:var(--viewer-bg);color:#e6e8eb;flex-direction:column;display:flex;position:fixed;inset:0}.viewer button{color:#e6e8eb;background:#ffffff14;border-color:#ffffff2e}.viewer button.active{background:#5b93f259;border-color:#5b93f2}.viewer button.danger{color:#ef6b63;border-color:#ef6b63}.viewer-toolbar{flex-wrap:wrap;align-items:center;gap:.75rem;padding:.5rem .75rem;display:flex}.viewer-title{text-overflow:ellipsis;white-space:nowrap;opacity:.85;flex:auto;min-width:0;overflow:hidden}.viewer-actions{flex-wrap:wrap;gap:.4rem;display:flex}.viewer-body{flex:auto;min-height:0;display:flex}.panes{flex:auto;gap:4px;min-height:0;padding:0 4px 4px;display:grid}.panes-1{grid-template-columns:1fr}.panes-2{grid-template-columns:repeat(2,minmax(0,1fr))}.panes-3{grid-template-columns:repeat(3,minmax(0,1fr))}.panes-4{grid-template-columns:repeat(4,minmax(0,1fr))}.pane{touch-action:none;-webkit-user-select:none;user-select:none;border:2px solid #0000;border-radius:4px;justify-content:center;align-items:center;min-width:0;min-height:0;display:flex;position:relative;overflow:hidden}.panes:not(.panes-1) .pane.active{border-color:#5b93f2}.pane img{object-fit:contain;transform-origin:0 0;will-change:transform;cursor:zoom-in;width:100%;max-width:100%;height:100%;max-height:100%;transition:transform .22s ease-out}.pane.zoomed img{cursor:grab}.pane.panning img{cursor:grabbing}.pane img.no-anim{transition:none}@media (prefers-reduced-motion:reduce){.pane img{transition:none}}.pane-nav{z-index:1;opacity:.55;padding:.6rem .7rem;font-size:2rem;line-height:1;position:absolute;top:50%;transform:translateY(-50%)}.pane-nav:hover:not(:disabled){opacity:1}.pane-nav:disabled{opacity:.15}.pane-nav.prev{left:6px}.pane-nav.next{right:6px}.pane-pos{background:#00000080;border-radius:999px;padding:.1rem .5rem;font-size:.8rem;position:absolute;bottom:6px;left:50%;transform:translate(-50%)}.viewer-info{border-left:1px solid #ffffff1f;flex:0 0 280px;padding:.75rem 1rem;overflow-y:auto}.viewer-info dl{margin:0}.viewer-info dt{opacity:.65;margin-top:.6rem;font-size:.8rem}.viewer-info dd{word-break:break-word;margin:0}.viewer-info .chip.static{background:#ffffff1a;border-color:#fff3}@media (width<=767px){.wide-only{display:none}.viewer-body{flex-direction:column}.viewer-info{border-top:1px solid #ffffff1f;border-left:none;flex:none;max-height:40vh}}.modal{border:1px solid var(--border);border-radius:calc(var(--radius) * 1.5);background:var(--surface);color:var(--text);width:min(94vw,520px);max-height:90vh;box-shadow:var(--shadow);padding:0}.modal-wide{width:min(96vw,760px)}.modal::backdrop{background:var(--overlay)}.modal-head{border-bottom:1px solid var(--border);background:var(--surface);z-index:1;justify-content:space-between;align-items:center;padding:.8rem 1rem;display:flex;position:sticky;top:0}.modal-head h2{margin:0}.modal-body{padding:1rem}.copy-field{font-family:var(--mono)}.dropzone{border:2px dashed var(--border);border-radius:var(--radius);text-align:center;flex-direction:column;align-items:center;gap:.5rem;padding:1.25rem;display:flex}.dropzone p{margin:0}.upload-list{flex-direction:column;gap:.5rem;margin:1rem 0 0;padding:0;list-style:none;display:flex}.upload-item{border:1px solid var(--border);border-radius:var(--radius);align-items:flex-start;gap:.75rem;padding:.5rem;display:flex}.upload-item.invalid{background:var(--danger-soft)}.upload-item.duplicate{background:var(--surface-2)}.upload-thumb{background:var(--surface-2);height:56px;color:var(--muted);border-radius:4px;flex:0 0 56px;justify-content:center;align-items:center;font-size:.75rem;display:flex;overflow:hidden}.upload-thumb img{object-fit:cover;width:100%;height:100%}.upload-info{flex-direction:column;flex:auto;gap:.25rem;min-width:0;display:flex}.upload-name{text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.upload-actions{align-items:center;gap:.25rem;display:flex}details summary{cursor:pointer;color:var(--accent);font-size:.85rem}.link-grid{grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:.75rem;display:grid}.link-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);flex-direction:column;gap:.4rem;padding-bottom:.5rem;display:flex;position:relative;overflow:hidden}.link-card.selected{outline:3px solid var(--accent);outline-offset:-3px}.link-card>.chips{padding:0 .6rem}.link-main{text-align:left;white-space:normal;background:0 0;border:none;border-radius:0;flex-direction:column;padding:0;display:flex}.link-thumb{aspect-ratio:16/10;background:var(--surface-2);width:100%;overflow:hidden}.link-thumb img{object-fit:cover;width:100%;height:100%;display:block}.link-text{flex-direction:column;gap:.1rem;min-width:0;padding:.5rem .6rem 0;display:flex}.link-title{text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.link-domain{color:var(--muted);font-size:.8rem}.link-note{color:var(--muted);-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;font-size:.85rem;display:-webkit-box;overflow:hidden}.link-tools{pointer-events:none;justify-content:space-between;display:flex;position:absolute;top:6px;left:6px;right:6px}.link-tools>*{pointer-events:auto}.link-tools .tile-check{position:static}.link-tools .icon-btn{background:var(--surface);opacity:.85;border-radius:4px}.link-ph{letter-spacing:.05em;color:#fff;justify-content:center;align-items:center;width:100%;height:100%;font-size:2.2rem;font-weight:700;display:flex}.ph-0{background:#3b6fd4}.ph-1{background:#2e9d6b}.ph-2{background:#c0582f}.ph-3{background:#8a4fc4}.ph-4{background:#c23d6a}.ph-5{background:#1f8ea3}.ph-6{background:#a3821f}.ph-7{background:#5b6476}.thumb-input{border:2px dashed var(--border);border-radius:var(--radius);align-items:flex-start;gap:1rem;padding:.75rem;display:flex}.thumb-preview{aspect-ratio:16/10;background:var(--surface-2);border-radius:4px;flex:0 0 176px;justify-content:center;align-items:center;display:flex;overflow:hidden}.thumb-preview img{object-fit:cover;width:100%;height:100%}.thumb-controls{flex:auto}.settings{flex-direction:column;align-items:center;gap:1rem;padding:1rem;display:flex}.settings .card{max-width:720px}.tag-table{border-collapse:collapse;width:100%;margin-top:.75rem}.tag-table th,.tag-table td{text-align:left;border-bottom:1px solid var(--border);vertical-align:middle;padding:.4rem .3rem}.tag-table th{color:var(--muted);font-size:.85rem}.row-actions{text-align:right;white-space:nowrap}.row-actions button+button{margin-left:.4rem}@media (width<=600px){.topbar{gap:.5rem;padding:.5rem}.topbar-actions{width:100%;margin-left:0}.tab-content,.settings{padding:.6rem}.grid{grid-template-columns:repeat(auto-fill,minmax(105px,1fr));gap:4px}.selection-bar{top:0}.thumb-input{flex-direction:column}.thumb-preview{flex-basis:auto;width:100%}.card{padding:1rem}}
