/* ==========================================================================
   Typed lists — "Prefer to type it out?"

   One stylesheet for both places the box appears: under "Build your line
   items" on the products page, and above the table on the bulk order form,
   where it starts as a one-line opener. Same tokens and fallbacks as the
   finder, so it reads as part of the same form on either page.
   ========================================================================== */

.ecf-tl,
.ecf-tl-opener{
  --ecf-tl-ink:var(--ink,#17201b);
  --ecf-tl-muted:var(--muted,#606a63);
  --ecf-tl-line:var(--line,#dde3de);
  --ecf-tl-accent:var(--green-700,#22503a);
  --ecf-tl-accent-soft:var(--green-100,#e4f0e9);
  --ecf-tl-radius:var(--radius-sm,4px);
  --ecf-tl-head:var(--font-head,system-ui,sans-serif);
}

.ecf-tl{
  margin:24px 0 0;padding:24px;
  background:var(--card,#fff);
  border:1.5px solid var(--ecf-tl-line);border-radius:var(--ecf-tl-radius);
}

.ecf-tl__head{display:flex;align-items:baseline;justify-content:space-between;gap:12px}

.ecf-tl__title{
  margin:0 0 6px;
  font-family:var(--ecf-tl-head);font-size:var(--fs-lg,18px);font-weight:800;
  color:var(--ecf-tl-ink);
}

.ecf-tl__intro{
  margin:0 0 16px;max-width:64ch;
  font-size:var(--fs-sm,15px);line-height:1.5;color:var(--ecf-tl-muted);
}

.ecf-tl__text{
  display:block;width:100%;min-height:9em;padding:12px 14px;resize:vertical;
  font-family:var(--font-mono,ui-monospace,monospace);font-size:var(--fs-sm,15px);line-height:1.5;
  color:var(--ecf-tl-ink);background:#fff;
  border:1.5px solid var(--ecf-tl-line);border-radius:var(--ecf-tl-radius);
}
.ecf-tl__text::placeholder{color:var(--ecf-tl-muted);opacity:.8}
.ecf-tl__text:focus{
  outline:none;border-color:var(--ecf-tl-accent);
  box-shadow:0 0 0 3px var(--ecf-tl-accent-soft);
}

.ecf-tl__actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:14px}

.ecf-tl__add{
  min-height:48px;padding:12px 26px;cursor:pointer;
  font-family:var(--ecf-tl-head);font-weight:700;font-size:var(--fs-sm,15px);
  color:#fff;background:var(--ecf-tl-accent);
  border:1.5px solid var(--ecf-tl-accent);border-radius:var(--ecf-tl-radius);
}
.ecf-tl__add:hover:not(:disabled){filter:brightness(1.08)}
.ecf-tl__add:disabled{opacity:.6;cursor:default}
.ecf-tl__add:focus-visible{outline:2px solid var(--ecf-tl-ink);outline-offset:2px}

/* ---- Attach a file ------------------------------------------------------- */

/* A label around a visually hidden input, so the whole button opens the
   picker — and on a phone, the camera — while the input stays focusable. */
.ecf-tl__attach{
  position:relative;display:inline-flex;align-items:center;gap:8px;
  min-height:48px;padding:12px 20px;cursor:pointer;
  font-family:var(--ecf-tl-head);font-weight:700;font-size:var(--fs-sm,15px);
  color:var(--ecf-tl-accent);background:#fff;
  border:1.5px solid var(--ecf-tl-accent);border-radius:var(--ecf-tl-radius);
}
.ecf-tl__attach:hover{background:var(--ecf-tl-accent-soft)}
.ecf-tl__attach:focus-within{outline:2px solid var(--ecf-tl-ink);outline-offset:2px}
.ecf-tl__attach:has(input:disabled){opacity:.5;cursor:default}
.ecf-tl__file-input{
  position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;
}
.ecf-tl__file-input:disabled{cursor:default}

.ecf-tl__hint{margin:8px 0 0;font-size:var(--fs-xs,13px);color:var(--ecf-tl-muted)}

.ecf-tl__files{display:flex;flex-direction:column;gap:6px;margin:12px 0 0;padding:0;list-style:none}
.ecf-tl__files[hidden]{display:none}
.ecf-tl__file{
  display:flex;align-items:center;gap:10px;min-width:0;
  padding:8px 8px 8px 12px;font-size:var(--fs-sm,15px);color:var(--ecf-tl-ink);
  background:var(--ecf-tl-accent-soft);border-radius:var(--ecf-tl-radius);
}
.ecf-tl__file-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ecf-tl__file-state{flex:0 0 auto;font-size:var(--fs-xs,13px);color:var(--ecf-tl-muted)}
/* A refused file: the name keeps its line, and the reason goes under it. */
.ecf-tl__file.is-error{flex-wrap:wrap;background:#fbeaea}
.ecf-tl__file.is-error .ecf-tl__file-state{order:3;flex:1 1 100%;margin-top:-4px;white-space:normal;color:var(--ecf-danger,#b3261e)}
.ecf-tl__file-remove{
  flex:0 0 auto;width:32px;height:32px;cursor:pointer;
  font-size:20px;line-height:1;color:var(--ecf-tl-muted);background:none;border:0;border-radius:var(--ecf-tl-radius);
}
.ecf-tl__file-remove:hover{color:var(--ecf-tl-ink);background:rgba(0,0,0,.06)}
.ecf-tl__file-remove:focus-visible{outline:2px solid var(--ecf-tl-ink);outline-offset:1px}

.ecf-tl__status{
  margin:12px 0 0;min-height:1.4em;
  font-size:var(--fs-sm,15px);color:var(--green-700,#2c6349);
}
.ecf-tl__status:empty{min-height:0;margin:0}
.ecf-tl__status.is-error{color:var(--ecf-danger,#b3261e)}

/* ---- Bulk order form ------------------------------------------------------
   Above the table, as one line that opens into the box. The table is still
   the main way to order there, so the box takes no room until it is asked for. */

.kohper-bulk-order .ecf-tl{margin:0 0 var(--sp-4,16px)}
/* The confirmation under the closed opener, clear of the toolbar below it. */
.kohper-bulk-order .ecf-tl-opener + .ecf-tl__status{margin:calc(-1 * var(--sp-2,8px)) 0 var(--sp-4,16px)}

.ecf-tl-opener{
  display:flex;align-items:center;gap:10px;width:100%;
  margin:0 0 var(--sp-4,16px);padding:14px 18px;cursor:pointer;text-align:left;
  font-family:var(--ecf-tl-head);font-size:var(--fs-sm,15px);font-weight:600;
  color:var(--ecf-tl-accent);background:var(--card,#fff);
  border:1.5px dashed var(--ecf-tl-line);border-radius:var(--ecf-tl-radius);
}
.ecf-tl-opener::before{content:"+";font-weight:800;font-size:1.15em;line-height:1}
.ecf-tl-opener:hover{border-color:var(--ecf-tl-accent)}
.ecf-tl-opener:focus-visible{outline:2px solid var(--ecf-tl-ink);outline-offset:2px}
/* A list waiting to go with the order: say so on the closed line. */
.ecf-tl-opener.has-list{border-style:solid;border-color:var(--ecf-tl-accent);background:var(--ecf-tl-accent-soft)}
.ecf-tl-opener.has-list::before{content:"✓"}

.ecf-tl__close{
  flex:0 0 auto;padding:4px 8px;cursor:pointer;
  font-size:var(--fs-sm,15px);color:var(--ecf-tl-muted);
  background:none;border:0;text-decoration:underline;
}
.ecf-tl__close:focus-visible{outline:2px solid var(--ecf-tl-ink);outline-offset:2px}

/* On the bulk order form the grid's own Add to Order sends the list, so the
   box carries a note in place of a button. */
.ecf-tl__note{margin:10px 0 0;font-size:var(--fs-sm,15px);color:var(--ecf-tl-muted)}

@media (max-width:600px){
  .ecf-tl{padding:18px}
  .ecf-tl__add,
  .ecf-tl__attach{width:100%;justify-content:center}
}

/* ---- Save to List, beside Add to Order ------------------------------------
   assets/job-lists.css styles this control for the finder's dark bar; in the
   box it sits on white, so it takes the box's height and outline instead. */
.ecf-tl .ecf-jl-bar{flex-wrap:wrap}
.ecf-tl .ecf-jl-bar__select,
.ecf-tl .ecf-jl-bar__name,
.ecf-tl .ecf-jl-bar__go{min-height:48px;border-width:1.5px}
.ecf-tl .ecf-jl-bar__select,
.ecf-tl .ecf-jl-bar__name{max-width:240px}
.ecf-tl .ecf-jl-bar__go{color:var(--ecf-tl-accent);border-color:var(--ecf-tl-accent)}
.ecf-tl .ecf-jl-bar__go:hover:not(:disabled){background:var(--ecf-tl-accent-soft)}

@media (max-width:600px){
  .ecf-tl .ecf-jl-bar{width:100%}
  .ecf-tl .ecf-jl-bar__select,
  .ecf-tl .ecf-jl-bar__name{max-width:none}
}
