/* Docnest shelf, drawn from the app's SwiftUI views (Shelf/ShelfEdgeHandle, ShelfTimelineList, ShelfTimelineRow,
   CompactCaptureView, ShelfDocumentPage, ShelfRevisionScrubber) in the dark appearance. Sizes are macOS points.
   The film and the shelf to try share these rules; only placement differs. */
.dn{--bg:#141b28;--surface:#1c2535;--raised:#263246;--accent:#9dbfff;--brand:#3670e7;--text:#f2f5fa;--sec:#b6c5dc;
  --border:#3a4b65;--sel:#243d63;--primary:#a2c1ff;--ptext:#14213b;--orange:#ff9f0a;--glass:rgba(24,31,46,.95);--edge:rgba(255,255,255,.13);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue","Segoe UI",Roboto,Arial,sans-serif;color:var(--text);
  -webkit-font-smoothing:antialiased;line-height:1.3;text-align:left}
.dn *{box-sizing:border-box}
:where(.dn) button{all:unset;box-sizing:border-box;cursor:pointer}
.dn button:focus-visible{outline:2px solid var(--accent);outline-offset:1px;border-radius:8px}
.ic{display:block;flex:none}

/* collapsed: a 4×40 line at the screen edge (window 12×56), dim until something waits */
.dn-line{position:absolute;width:4px;height:40px;border-radius:2px;background:rgba(182,197,220,.4)}
.dn-line>i{position:absolute;inset:0;border-radius:2px;background:var(--brand);box-shadow:0 0 4px rgba(54,112,231,.7);opacity:0}
.dn-line.on>i{opacity:1}
.dn-glow{position:absolute;width:80px;height:120px;border-radius:50%;background:radial-gradient(closest-side,rgba(76,130,255,.55),rgba(76,130,255,0));opacity:0;pointer-events:none}

/* pointer on the line: a 34×54 glass capsule with one count (window 46×66) */
.dn-capsule{position:absolute;width:34px;height:54px;border-radius:17px;background:var(--glass);box-shadow:inset 0 0 0 .5px var(--edge),0 6px 18px rgba(0,0,0,.35);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;transform-origin:100% 50%}
.dn-capsule>b{font:700 15px/1 ui-rounded,"SF Pro Rounded",-apple-system,BlinkMacSystemFont,sans-serif;font-variant-numeric:tabular-nums}
.dn-capsule>i{width:5px;height:5px;border-radius:50%;background:var(--brand)}
.dn-capsule.zero>b{color:var(--sec)}
.dn-capsule.zero>i{background:var(--border)}

/* agent icon with a file-type badge at the bottom right (badge 55% of the icon, at least 11) */
.dn-agent{position:relative;display:block;flex:none;width:var(--s);height:var(--s)}
.dn-agent>svg{display:block}
.dn-badge{position:absolute;right:-2.4px;bottom:-2.4px;width:11px;height:11px;border-radius:50%;background:var(--surface);box-shadow:0 0 0 .75px rgba(182,197,220,.45);color:var(--accent);display:grid;place-items:center}
.dn-badge>svg{width:9px;height:9px}

/* arrival pill 270×44; under the pointer it grows to 88 with Read later and Open */
.dn-pill{position:absolute;width:270px;height:88px;border-radius:22px;overflow:hidden}
.dn-pill-bg{position:absolute;left:0;top:0;width:270px;height:88px;border-radius:22px;background:var(--bg);box-shadow:inset 0 0 0 .5px var(--edge);transform:translateY(-44px)}
.dn-count{position:absolute;left:22px;right:22px;bottom:3px;height:3px;border-radius:2px;background:rgba(157,191,255,.75);transform-origin:0 50%}
.dn-pill-rows{position:absolute;left:0;top:0;width:270px;height:44px}
.dn-pill-row{position:absolute;inset:0;display:flex;align-items:center;gap:8px;padding:0 14px;opacity:0}
.dn-pill-row b{font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dn-pill-row em{font-style:normal;font-size:12px;font-weight:600;color:var(--accent);white-space:nowrap}
.dn-pill-row small{margin-left:auto;font-size:11px;color:var(--sec);font-variant-numeric:tabular-nums;white-space:nowrap}
.dn-pill-row .dn-agent{transform-origin:50% 50%}
.dn-pill-acts{position:absolute;left:14px;right:14px;top:46px;height:30px;display:flex;justify-content:flex-end;gap:6px;opacity:0}

/* small buttons (DocnestButtonStyle .small): secondary and primary */
.dn-btn{display:inline-flex;align-items:center;gap:5px;height:26px;padding:0 11px;border-radius:9px;background:var(--raised);color:var(--text);font-size:12px;font-weight:600;white-space:nowrap}
.dn-btn svg{display:block}
.dn-btn.primary{background:var(--primary);color:var(--ptext)}
.dn-btn.on{background:var(--primary);color:var(--ptext)}

/* expanded: a 400×640 glass panel */
.dn-panel{position:absolute;width:400px;height:640px}
.dn-shell{position:absolute;inset:0;border-radius:22px;background:var(--glass);box-shadow:inset 0 0 0 .5px var(--edge),0 30px 80px rgba(0,0,0,.5),0 8px 24px rgba(0,0,0,.3)}
.dn-content{position:absolute;inset:0;display:flex;flex-direction:column;border-radius:22px;overflow:hidden}
.dn-head{flex:none;display:flex;align-items:center;gap:10px;padding:18px 18px 10px}
.dn-title{margin:0;font:600 20px/1.2 "Avenir Next",Avenir,-apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:-.01em;white-space:nowrap}
.dn-chip{display:inline-flex;align-items:center;gap:3px;padding:4px 9px;border-radius:999px;background:rgba(157,191,255,.12);color:var(--accent);font-size:11px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.dn-chip svg{width:8px;height:8px}
.dn-tools{margin-left:auto;display:flex;gap:2px;padding:3px;border-radius:999px;background:rgba(255,255,255,.045);box-shadow:inset 0 0 0 .5px rgba(255,255,255,.1)}
.dn-tool{width:30px;height:28px;display:grid;place-items:center;border-radius:999px;color:var(--text)}
.dn .dn-tool:hover{background:rgba(255,255,255,.08)}
.dn-list{position:relative;flex:1;overflow:hidden auto;padding:0 8px 52px;scrollbar-width:none}
.dn-list::-webkit-scrollbar{display:none}
.dn-sec{position:relative;display:flex;align-items:center;justify-content:space-between;height:26px;padding:10px 10px 2px;font-size:10px;font-weight:700;color:var(--sec);letter-spacing:.01em}
.dn-sec:first-child{height:18px;padding-top:2px}
.dn-sec .dn-all{font-size:10px;font-weight:600;color:var(--accent);opacity:0;padding:0 2px}
.dn-sec:hover .dn-all,.dn-sec:focus-within .dn-all{opacity:1}
.dn-row{position:relative;height:34px;margin-bottom:2px;border-radius:10px;overflow:hidden}
.dn-reveal{position:absolute;inset:0;border-radius:10px;opacity:0}
.dn-reveal.star{background:var(--primary)}
.dn-reveal.ignore{background:var(--sec)}
.dn-reveal-label{position:absolute;top:0;bottom:0;display:flex;align-items:center;gap:5px;font-size:11px;font-weight:600;color:var(--ptext);opacity:0}
.dn-reveal-label.star{left:14px}
.dn-reveal-label.ignore{right:14px}
.dn-row-in{position:relative;height:34px;display:flex;align-items:center;border-radius:10px}
.dn-row-fill{position:absolute;inset:0;border-radius:10px;background:rgba(28,37,53,.85);opacity:0}
.dn-row.hover .dn-row-fill{opacity:1}
.dn-row.dragging .dn-row-fill{opacity:1;background:#1c2434}
.dn-row.dragging .dn-acts{opacity:0!important}
.dn-row.dragging .dn-time,.dn-row.dragging .dn-slot>*{opacity:1!important}
.dn-row.hl .dn-row-fill{opacity:1;background:var(--sel)}
.dn-open{position:relative;flex:1;min-width:0;height:34px;display:flex;align-items:center;gap:10px;padding:0 0 0 10px}
.dn .dn-open:focus-visible{outline-offset:-2px;border-radius:10px}
.dn-row-t{flex:1;min-width:0;font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dn-row.unread .dn-row-t{font-weight:600}
.dn-time{flex:none;min-width:14px;font-size:11px;color:var(--sec);font-variant-numeric:tabular-nums;white-space:nowrap;text-align:right}
.dn-slot{position:relative;flex:none;width:18px;height:18px;margin:0 10px 0 8px;display:grid;place-items:center}
.dn-dot{width:7px;height:7px;border-radius:50%;background:var(--brand)}
.dn-dot.mod{background:var(--orange)}
.dn-star-on{color:var(--accent)}
.dn-acts{position:absolute;right:10px;top:8px;display:flex;gap:4px;opacity:0}
.dn-act{width:18px;height:18px;display:grid;place-items:center;color:var(--sec);border-radius:5px}
.dn-act.starred{color:var(--accent)}
.dn .dn-act:hover{color:var(--text)}
.dn-row.hover .dn-acts,.dn-row.hl .dn-acts{opacity:1}
.dn-row.hover .dn-time,.dn-row.hl .dn-time,.dn-row.hover .dn-slot>*,.dn-row.hl .dn-slot>*{opacity:0}

/* undo pill under the list (4 s in the app) */
.dn-undo{position:absolute;left:50%;bottom:12px;display:inline-flex;align-items:center;gap:6px;padding:6px 14px;border-radius:999px;background:var(--glass);
  box-shadow:inset 0 0 0 .5px var(--edge),0 8px 22px rgba(0,0,0,.4);color:var(--accent);font-size:12px;font-weight:600;white-space:nowrap;opacity:0;transform:translateX(-50%)}

/* the document page grows out of its row: 680 wide, same 640 height */
.dn-page{position:absolute;width:680px;height:640px}
.dn-page-shell{position:absolute;inset:0;border-radius:22px;background:var(--bg);box-shadow:inset 0 0 0 .5px var(--edge),0 30px 80px rgba(0,0,0,.5),0 8px 24px rgba(0,0,0,.3);transform-origin:0 0}
.dn-page-in{position:absolute;inset:0;display:flex;flex-direction:column;border-radius:22px;overflow:hidden}
.dn-page-head{flex:none;display:flex;align-items:center;gap:10px;padding:12px 14px 12px 10px}
.dn-back{flex:none;width:30px;height:30px;display:grid;place-items:center;border-radius:8px;color:var(--text)}
.dn-page-tt{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.dn-page-tt b{font-size:17px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dn-meta{font-size:11px;color:var(--sec);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
.dn-rule{flex:none;height:1px;background:rgba(58,75,101,.55)}
.dn-body{position:relative;flex:1;min-height:0;overflow:hidden auto;padding:26px 30px 30px 34px;scrollbar-width:thin}
.dn-doc{position:relative}
.dn-ln{position:absolute;left:0;right:0;top:0}
.dn-ln>.hlb{position:absolute;inset:0 -14px 0 -22px;border-radius:6px;opacity:0}
.dn-ln.add>.hlb{background:rgba(46,160,67,.2)}
.dn-ln.del>.hlb{background:rgba(248,81,73,.18)}
.dn-ln>.mk{position:absolute;left:-18px;top:0;width:12px;font:600 14px/26px var(--ui);opacity:0;text-align:center}
.dn-ln.add>.mk{color:#4fc26b}
.dn-ln.del>.mk{color:#ff7b72}
.dn-ln.del .b-li span,.dn-ln.del .b-p{text-decoration:line-through;text-decoration-color:rgba(255,123,114,.7)}
.dn-ln>:not(.hlb):not(.mk){position:relative}
.b-h1{margin:0;padding:0 0 14px;font-size:26px;line-height:1.25;font-weight:700;letter-spacing:-.015em}
.b-h2{margin:0;padding:10px 0 8px;font-size:18px;line-height:1.3;font-weight:700}
.b-p{margin:0;padding:0 0 6px;font-size:15px;line-height:1.6;color:#dfe6f1}
.b-gap{height:12px}
.b-li{display:flex;align-items:center;gap:11px;min-height:30px;font-size:15px;line-height:1.5;color:#dfe6f1}
.b-li>i{flex:none;font-style:normal}
.b-task>i{width:15px;height:15px;border-radius:4px;border:1.5px solid #5f7393}
.b-task.done>i{background:var(--accent);border-color:var(--accent);box-shadow:inset 0 0 0 2.5px var(--bg)}
.b-bullet>i{width:5px;height:5px;margin:0 5px;border-radius:50%;background:#8fa2bd}
.b-num>i{width:16px;color:#8fa2bd;text-align:right}
.b-quote{margin:4px 0;padding:10px 14px;border-left:3px solid var(--accent);border-radius:3px 8px 8px 3px;background:rgba(157,191,255,.08);font-size:14.5px;line-height:1.5;color:#dfe6f1}

/* revision scrubber: a glass capsule floating under the body */
.dn-scrub{flex:none;margin:10px 14px;display:flex;align-items:center;gap:12px;padding:7px 16px 7px 8px;border-radius:999px;background:rgba(38,50,70,.82);box-shadow:inset 0 0 0 .5px var(--edge)}
.dn-play{flex:none;width:34px;height:26px;display:grid;place-items:center;border-radius:9px;background:var(--raised);color:var(--text)}
.dn-play>span{grid-area:1/1}
.dn-play .pa{opacity:0}
.dn-track{position:relative;flex:1;height:24px;touch-action:none}
.dn-track-base,.dn-track-fill{position:absolute;left:8px;right:8px;top:10.5px;height:3px;border-radius:2px;background:var(--border)}
.dn-track-fill{background:var(--accent);transform-origin:0 50%}
.dn-tick{position:absolute;top:8px;width:8px;height:8px;margin-left:-4px;border-radius:50%;background:var(--bg);box-shadow:inset 0 0 0 1.5px var(--border)}
.dn-tick.on{background:var(--accent);box-shadow:none}
.dn-knob{position:absolute;left:0;top:4px;width:16px;height:16px;margin-left:-8px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 2px rgba(255,255,255,.9),0 1px 3px rgba(0,0,0,.35)}
.dn-pos{flex:none;font-size:11px;font-weight:500;color:var(--sec);font-variant-numeric:tabular-nums;white-space:nowrap}
