/* The uploader page, on top of ../assets/site.css. Class names are the ones app.js renders.
 * The flasher's look (../flasher/style.css, graded on 2026-11-15): ink on a cool grey; a line's weight says what it is
 * (2 px a frame, 1.5 px a control, 1 px a divider or a list's rule), a softer text tone (--soft) for what explains,
 * controls with 3 px corners and normal writing, headings in capitals. States are borders, dashes and inversion,
 * never colour. One typeface (IBM Plex Mono).
 * The tokens, the header, the buttons, the status line and the footer are the flasher's: keep them alike. The manager
 * (../manager/style.css), which this page's styles came from, has the same look since 16/11/2026.
 * site.css also styles .wrap, .top, .brand, .btn and .foot: the rules here override all it sets on them.
 * Plain CSS (no nesting, color-mix or :has). */

:root{
  color-scheme:light;
  --ink:#17222e;           /* a dark blue-grey, not black */
  --ink-up:#2a3848;        /* the ink a step lighter: the filled button under the pointer */
  --soft:#4a5562;          /* the second text tone: what explains */
  --soft-inv:#b4bcc6;      /* the same on an inverted row */
  --rule:#98a1ab;          /* the lines between the rows of a list */
  --tint:rgba(23,34,46,.09);   /* an outlined control under the pointer */
  --paper:#d7dbe0;
  --card:#e6ebf1;          /* the two panes, a shade lighter than the page; the dark theme keeps them on the page's tone */
  --field:#f1f4f7;         /* where you type or choose: lighter than the pane */
  --sh-win:var(--ink);     /* the warning window's shadow: the flasher's checkerboard, in the ink (a light one is lost on the dithered backdrop) */
  --chk:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1H0zM1 1h1v1H1z'/%3E%3C/svg%3E");   /* the mask that cuts it to a checkerboard */
  --casing:var(--paper);
  --well:var(--paper);
  --line:var(--ink);
  --line-2:var(--ink);
  --ink-2:var(--ink);
  --muted:var(--soft);
  --ctl:var(--ink);
  --ctl-ink:var(--paper);
  --ctl-edge:var(--ink);
  --red:var(--ink);
  --red-ink:var(--ink);
  --accent-ink:var(--paper);
  --accent-glow:transparent;
  --accent-2:var(--ink);
  --accent-2-bg:var(--paper);
  --ok:var(--ink);
  --warn:var(--ink);
  --bad:var(--ink);
  --f:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --f-code:var(--f);
  --r:3px;
  --wrap:1120px;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){color-scheme:dark;--ink:#d7dbe0;--ink-up:#f1f4f7;--soft:#a9b1bb;--soft-inv:#4a5562;--rule:#4a5562;--tint:rgba(215,219,224,.14);--paper:#0b0c0e;--card:var(--paper);--field:#161a20}
}
:root[data-theme="dark"]{color-scheme:dark;--ink:#d7dbe0;--ink-up:#f1f4f7;--soft:#a9b1bb;--soft-inv:#4a5562;--rule:#4a5562;--tint:rgba(215,219,224,.14);--paper:#0b0c0e;--card:var(--paper);--field:#161a20}

body{font:400 15px/1.5 var(--f);-webkit-font-smoothing:antialiased}
/* while the warning window is open (app.js sets the class), the page behind it does not scroll; the gutter stays,
   so nothing shifts where scrollbars take room */
html{scrollbar-gutter:stable}
html.modal{overflow:hidden}
::selection{background:var(--ink);color:var(--paper)}
:focus-visible{outline:3px solid currentColor;outline-offset:3px}
a{text-decoration-thickness:1.5px;text-decoration-color:currentColor;text-underline-offset:.22em}
a:hover{text-decoration-thickness:2.5px;text-decoration-color:currentColor}
h1,h2,h3{font-family:var(--f);font-weight:700;letter-spacing:0;text-transform:uppercase;line-height:1}
button,input,select{font:inherit;color:inherit}
[hidden]{display:none !important}

/* header */
.top{align-items:center;gap:10px 20px;padding-top:24px}
.brand{font:700 20px/1 var(--f);text-transform:uppercase;letter-spacing:0}
.top nav{gap:6px 16px;align-items:center;font:600 14px/1 var(--f);text-transform:uppercase}
.top nav a{text-decoration:none}
.top nav a:hover,.top nav a[aria-current="page"]{text-decoration:underline;text-decoration-color:currentColor;text-decoration-thickness:2px;text-underline-offset:.3em}
.theme-btn{width:36px;height:36px;margin:0;border:1.5px solid var(--ink);border-radius:var(--r);color:var(--ink)}
.theme-btn:hover{background:var(--tint);color:var(--ink)}

/* the one filled button (Upload): a block of ink, a step lighter under the pointer (nothing moves); disabled, an
   empty dashed frame */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:44px;padding:0 20px;border:1.5px solid var(--ink);border-radius:var(--r);
  background:var(--ink);color:var(--paper);box-shadow:none;font:600 15px/1 var(--f);text-transform:none;text-decoration:none;cursor:pointer;
  transform:none;transition:none}
.btn:hover{background:var(--ink-up);border-color:var(--ink-up);color:var(--paper)}
.btn:active{transform:none;box-shadow:none}
.btn:disabled,.btn:disabled:hover{background:transparent;border-color:var(--ink);color:var(--ink);border-style:dashed;cursor:not-allowed;transform:none;box-shadow:none}

/* the page */
.up{display:flex;flex-direction:column;gap:28px;padding-top:32px;padding-bottom:16px}
.up-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px 24px}
.up-head h1{font-size:28px;line-height:1.15;letter-spacing:-.02em}
.chip{display:inline-flex;align-items:center;gap:10px;min-height:38px;padding:0 12px;border:1.5px solid var(--ink);border-radius:var(--r);
  background:transparent;font:600 14px/1 var(--f);cursor:pointer}
.chip:hover{background:var(--tint)}
.chip:disabled{cursor:not-allowed}
.chip:disabled:hover{background:transparent}
.dot{display:inline-block;width:10px;height:10px;background:currentColor}
.chip.off .dot{background:transparent;border:2px dashed currentColor}
.ports{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px 14px;border:1.5px dashed var(--ink);font-size:13px;color:var(--soft)}
.ports select{min-height:34px;padding:0 8px;background:var(--field);color:var(--ink);border:1.5px solid var(--ink);border-radius:var(--r)}

/* the one status line: news plain, a warning dashed, a problem inverted */
.status{margin:0;padding:10px 14px;border:2px solid var(--ink);font-weight:600}
.status.bad{background:var(--ink);color:var(--paper)}
.status.warn{border-style:dashed}

/* a warning or a problem: a window over the page until OK, as the flasher's How to use, its backdrop the same 1-bit
   dither; a warning's title over a dashed line, a problem's inverted */
/* as the flasher's window: the <dialog> only places it, .alert-in is the box (frame, ground, scrolling), and the
   shadow is a block behind the box, 8 px down and right, cut to a 1 px checkerboard */
.alert{width:min(560px,calc(100vw - 32px));max-width:none;margin:auto;padding:0;border:0;background:none;color:var(--ink);overflow:visible;isolation:isolate}
.alert::after{content:"";position:absolute;z-index:-1;top:8px;left:8px;right:-8px;bottom:-8px;background:var(--sh-win);pointer-events:none;
  -webkit-mask:var(--chk) 0 0 / 2px 2px;mask:var(--chk) 0 0 / 2px 2px}
.alert::backdrop{background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1H0zM2 0h1v1H2zM1 2h1v1H1zM3 2h1v1H3z' fill='%2317222e'/%3E%3C/svg%3E")}
.alert-in{display:flex;flex-direction:column;gap:14px;max-height:calc(100vh - 48px);padding:14px 20px 20px;border:2px solid var(--ink);background:var(--card);
  overflow:auto;overscroll-behavior:contain}
.alert h2{margin:0;padding-bottom:8px;border-bottom:1px dashed currentColor;font-size:20px}
.alert.bad h2{margin:-14px -20px 0;padding:14px 20px 12px;border-bottom:0;background:var(--ink);color:var(--paper)}
.alert-body{display:flex;flex-direction:column;gap:12px}
.alert-body>p{margin:0;font-weight:600;line-height:1.5;overflow-wrap:anywhere}
/* the files it names: up to three as they are, more folded (details, as the flasher's "Something went wrong?") into a
   list that scrolls */
.alert-body .named{margin:0;padding:0;list-style:none;border-top:1px solid var(--rule)}
.alert-body .named li{display:flex;flex-direction:column;gap:2px;padding:6px 0;border-bottom:1px solid var(--rule);font-size:13px;line-height:1.45}
.alert-body .named b{overflow-wrap:anywhere}
.alert-body .fold>summary{cursor:pointer;font-weight:700;font-size:14px}
.alert-body .fold .named{max-height:min(240px,40vh);overflow:auto;margin-top:8px}
/* what to do: blocks of a heading and a sentence or two, or steps, as the flasher's How to use (.info-body h3, ol.howto) */
.alert-body .blk h3{margin:0 0 2px;font-size:13px;line-height:1.4}
.alert-body .blk p{margin:0;font-size:14.5px;line-height:1.6;max-width:72ch}
.alert-body .blk ol{margin:0;padding-left:1.8em;font-size:14.5px;line-height:1.6}   /* the numbers inside the box */
.alert .btn{align-self:flex-end;min-width:120px;min-height:40px}

/* the two panes: the files to upload on the left, the Cycles on the right. The pane has the 2 px frame, everything
   inside it 1 px rules in grey and small tools; one filled button, Upload. */
.panes{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:20px;align-items:start}
.pane{display:flex;flex-direction:column;gap:12px;min-width:0;padding:18px 20px 20px;background:var(--card);border:2px solid var(--ink)}
.pane.drag{outline:2px dashed var(--ink);outline-offset:5px}
.phead{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 16px}
.phead h2{font-size:18px;line-height:1}
.tools{display:flex;flex-wrap:wrap;gap:6px}
.tool{min-height:28px;padding:0 10px;background:transparent;border:1.5px solid var(--ink);border-radius:var(--r);
  font:600 13px/1 var(--f);cursor:pointer}
.tool:hover:enabled{background:var(--tint)}
.tool:disabled{border-style:dashed;cursor:not-allowed}
.hint{margin:0;font-size:12px;font-weight:500;line-height:1.5;color:var(--soft)}
.pane > .btn{width:100%;min-height:44px}
.ports .tool{min-height:34px}

/* the path on the Cycles: +Drive › My Samples › Drums, every part but the last one a button */
.crumbs{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;min-height:28px;font-size:14px}
.crumb{padding:2px 0;background:none;border:0;font:inherit;cursor:pointer;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.25em}
.crumb:hover:enabled{text-decoration-thickness:2px}
.crumb:disabled{cursor:default;text-decoration:none}
.crumb.here{font-weight:600;text-decoration:none}
.crumbs .sep{user-select:none;color:var(--soft)}
.newdir{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.newdir input{flex:1 1 200px;min-width:0;height:32px;padding:0 8px;background:var(--field);border:1.5px solid var(--ink);border-radius:var(--r);font:14px var(--f)}

/* over each list, its columns in small print (hidden by app.js while the list has no rows) */
.cols{display:flex;justify-content:space-between;margin:0 0 -8px;padding:0 6px;font-size:12px;font-weight:600;line-height:1.4;color:var(--soft)}
/* the rows of both lists: a small pixel icon, the name, the size or how far it got, grey rules between them; a
   selected row is inverted. Own class names (nm, pix): site.css styles .name and .ico for the drawn Model:Cycles. */
.rows{margin:0;padding:0;list-style:none;border-top:1px solid var(--rule);outline:none;user-select:none}
.rows:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
.rows li{display:flex;align-items:center;gap:10px;min-height:34px;padding:3px 6px;border-bottom:1px solid var(--rule);cursor:default}
.rows li.sel{background:var(--ink);border-bottom-color:var(--ink);color:var(--paper)}
.rows li.kept{cursor:default}
.rows li.empty{min-height:34px;font-size:13px;color:var(--soft)}
.rows li.drop-here{justify-content:center;min-height:120px;margin:10px 0;border:1.5px dashed var(--ink);text-align:center}
.nm{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.nm > b{font-weight:400;overflow-wrap:anywhere}
.rows li.folder .nm > b{font-weight:600}
.why{font-size:12px;line-height:1.4;color:var(--soft)}
.pix{flex:none;width:16px;height:14px;background:currentColor;
  -webkit-mask:var(--pix) center / var(--pix-size) no-repeat;mask:var(--pix) center / var(--pix-size) no-repeat}
.pix.dir{--pix-size:16px 14px;--pix:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 7' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h3v1h-3zM0 1h8v1h-8zM0 2h1v4h-1zM7 2h1v4h-1zM0 6h8v1h-8z'/%3E%3C/svg%3E")}
.pix.smp{--pix-size:14px 14px;--pix:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath d='M0 2h1v3h-1zM2 0h1v7h-1zM4 1h1v5h-1zM6 2h1v3h-1z'/%3E%3C/svg%3E")}
.size{flex:none;font-size:12px;font-weight:500;text-align:right;white-space:nowrap;color:var(--soft)}
.state{flex:0 1 auto;min-width:0;font-size:12px;font-weight:500;text-align:right;color:var(--soft)}
.state.bad{color:var(--ink)}
/* on the inverted row, the small print in the light soft tone */
.rows li.sel .size,.rows li.sel .state,.rows li.sel .why{color:var(--soft-inv)}
.state.ok::before{content:"✓ "}
.state.warn::before,.state.skip::before{content:"! "}
.state.bad{font-weight:700}
.rows li.sel .state.bad{color:var(--paper)}
.state.bad::before{content:"× "}
.open{flex:none;width:26px;text-align:center;font:700 18px/1 var(--f)}
.dst .rows li.folder{cursor:pointer}
.dst .rows li.folder:hover .nm > b{text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:.25em}
.tool[aria-pressed="true"],.tool[aria-pressed="true"]:hover:enabled{background:var(--ink);color:var(--paper)}
/* Select: a box in front of each row, ticked with the flasher's pixel check while the row is picked */
.box{display:none;flex:none;position:relative;width:14px;height:14px;border:1.5px solid currentColor;border-radius:2px}
.rows.selecting .box{display:block}
.rows.selecting .box.off{visibility:hidden}
.rows.selecting li{cursor:pointer}
.dst .rows.selecting li.folder:hover .nm > b{text-decoration:none}
.rows li.sel .box::after{content:"";position:absolute;inset:0;background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath d='M7 1h1v1h-1zM6 2h2v1h-2zM0 3h1v1h-1zM5 3h2v1h-2zM0 4h2v1h-2zM4 4h2v1h-2zM1 5h4v1h-4zM2 6h2v1h-2z'/%3E%3C/svg%3E") center / 8px 8px no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath d='M7 1h1v1h-1zM6 2h2v1h-2zM0 3h1v1h-1zM5 3h2v1h-2zM0 4h2v1h-2zM4 4h2v1h-2zM1 5h4v1h-4zM2 6h2v1h-2z'/%3E%3C/svg%3E") center / 8px 8px no-repeat}
.rename{flex:1;min-width:0;height:26px;padding:0 6px;background:var(--field);color:var(--ink);border:1.5px solid var(--ink);border-radius:var(--r);font:14px var(--f)}
/* the list's folders open and close by their triangle; a file keeps the place empty, so the icons stay in line */
.twisty{flex:none;width:16px;height:22px;margin-right:-6px;padding:0;background:none;border:0;font:700 13px/1 var(--f);color:inherit;cursor:pointer}
span.twisty{cursor:default}
.rows li[draggable="true"]{cursor:grab}
/* where a drag would land: a folder row, or the Cycles' list for the folder shown */
.rows li.into{outline:2px solid var(--ink);outline-offset:-2px}
.rows li.sel.into{outline-color:var(--paper)}
.rows.into{outline:2px dashed var(--ink);outline-offset:3px}

/* all files of an upload: a bar under the status line */
.overall{height:8px;margin-top:-28px;border:1.5px solid var(--ink);border-top:0}
.overall .fill{height:100%;width:0;background:var(--ink)}

/* footer: as the flasher's */
.foot{margin-top:56px;padding:24px 0 40px;border-top:2px solid var(--ink);font-size:13px;color:var(--soft)}
.foot .wrap{flex-direction:column;gap:10px}
.foot p{max-width:none}

@media (prefers-reduced-motion:reduce){
  .btn{transition:none}
  .btn:hover{transform:none}
}
