/* /add-border-to-image/ page styles. Built from /assets/polyatic.css tokens only (no new colours);
 * the three quick-colour swatches show the literal colour they set, which is content, not chrome. */
.nojs{margin:1.25rem 0 0;padding:0.875rem 1rem;border:1px solid var(--line);border-left:0.25rem solid var(--accent);border-radius:0.625rem;background:var(--surface);color:var(--ink);font-size:0.9375rem;line-height:1.6}

/* the preview gets the width on desktop; the settings panels sit beside it */
@media(min-width:920px){.bd-duo{grid-template-columns:minmax(0,1.6fr) minmax(19rem,.85fr)}}
.bd-side{display:grid;gap:1rem;align-content:start}
@media(min-width:920px){.bd-duo>.pane-result.bd-side{position:static}}
.bd-panel[hidden]{display:none}

/* drop zone (same component as the other polyatic file tools) */
.drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;text-align:center;min-height:11rem;padding:1.5rem 1.25rem;border:2px dashed var(--line-2);border-radius:0.875rem;background:var(--surface-2);cursor:pointer;transition:border-color .15s,background .15s}
.drop:hover,.drop:focus-visible,.drop.drag{border-color:var(--accent);background:var(--accent-soft)}
.drop b{font-size:1.0625rem}
.drop small{color:var(--muted);max-width:36ch}
/* icon: a photo inside a thick frame with a deeper bottom */
.bd-drop-icon{width:2.75rem;height:3.125rem;position:relative;border:2px solid var(--ink);border-radius:0.25rem;background:var(--surface)}
.bd-drop-icon::after{content:"";position:absolute;left:0.3125rem;right:0.3125rem;top:0.3125rem;height:1.75rem;border-radius:0.125rem;background:var(--accent);box-shadow:inset 0 -0.5rem 0 var(--signal)}
.has-photos .drop{display:none}

.hint{font-size:0.8125rem;color:var(--muted);margin:0.75rem 0.125rem 0;min-height:1.125rem}
.hint.bad{color:var(--bad);font-weight:600}
.has-photos #hint{margin-top:0}

.bd-work[hidden]{display:none}
.bd-bar{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem;margin:0.25rem 0 0.625rem}
.bd-arrow{min-width:2.75rem;font-size:1.25rem;line-height:1;padding:0.375rem 0.625rem}
.bd-count{font-size:0.875rem;font-weight:600;white-space:nowrap}
.bd-bar-acts{display:flex;gap:0.375rem;margin-left:auto}
.chip:disabled,.modes button:disabled{opacity:.45;cursor:default}
.chip:focus-visible,.modes button:focus-visible,.drop:focus-visible,.bd-sw:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* the preview: a checkerboard behind see-through corners */
.bd-stage{display:flex;justify-content:center;align-items:center;border:1px solid var(--line);border-radius:0.5rem;background:var(--surface-2);background-image:linear-gradient(45deg,var(--line) 25%,transparent 25%,transparent 75%,var(--line) 75%),linear-gradient(45deg,var(--line) 25%,transparent 25%,transparent 75%,var(--line) 75%);background-size:1rem 1rem;background-position:0 0,0.5rem 0.5rem;padding:0.75rem}
#view{display:block;max-width:100%;max-height:min(68vh,44rem);width:auto;height:auto;box-shadow:var(--shadow)}
#view.picking{cursor:crosshair;outline:2px dashed var(--accent);outline-offset:3px}
@media(max-width:600px){#view{max-height:56vh}}

.bd-legend{display:flex;flex-wrap:wrap;gap:0.375rem 0.875rem;align-items:baseline;margin:0.5rem 0.125rem 0;font-size:0.8125rem;color:var(--muted)}
.bd-pick-hint{color:var(--ink);font-weight:600}
.bd-pick-hint[hidden]{display:none}
.bd-dims{font-family:var(--mono);font-size:0.75rem;color:var(--muted)}

.bd-thumbs{display:flex;gap:0.375rem;overflow-x:auto;padding:0.5rem 0.125rem 0.25rem;margin-top:0.5rem;overscroll-behavior-x:contain}
.bd-thumbs button{flex:0 0 auto;padding:0;border:2px solid var(--line);border-radius:0.375rem;background:var(--surface-2);cursor:pointer;line-height:0}
.bd-thumbs button[aria-selected=true]{border-color:var(--accent)}
.bd-thumbs canvas{display:block;height:3.5rem;width:auto;border-radius:0.25rem}

/* side panels */
.bd-panel .sec{font-size:0.8125rem;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);margin:0 0 0.625rem}
.bd-lab{display:block;font-size:0.8125rem;font-weight:600;color:var(--ink-2);margin:0 0 0.3125rem}
.bd-modes{margin:0.75rem 0 0}
.bd-modes.bd-first{margin-top:0}
.bd-wrap{flex-wrap:wrap}
.bd-gap{margin-top:0.875rem}
.bd-panel .field{margin-top:0.875rem}
.bd-panel .field[hidden],.bd-panel [hidden]{display:none}
.bd-range-num{display:grid;grid-template-columns:minmax(0,1fr) 5rem;gap:0.625rem;align-items:center}
.bd-panel input[type=number]{width:100%;min-width:0}
.bd-sides{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0.5rem;margin-top:0.875rem}
.bd-sides label{display:grid;gap:0.25rem;font-size:0.75rem;font-weight:600;color:var(--ink-2)}
.bd-color-row{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem;margin-top:0.875rem}
.bd-color-row .bd-lab{margin:0;flex:0 0 100%}
.bd-panel input[type=color]{width:3.25rem;height:2.5rem;padding:0.125rem;border:1px solid var(--line-2);border-radius:0.5rem;background:var(--surface);cursor:pointer}
.bd-pick.on{border-color:var(--accent);background:var(--accent-soft)}
.bd-swatches{display:flex;gap:0.375rem;margin-left:auto}
.bd-sw{width:1.75rem;height:1.75rem;border-radius:50%;border:1px solid var(--line-2);cursor:pointer;padding:0}
.bd-sw[data-val="#ffffff"]{background:#ffffff}
.bd-sw[data-val="#f4efe4"]{background:#f4efe4}
.bd-sw[data-val="#000000"]{background:#000000}
.bd-switch{display:inline-flex;align-items:center;gap:0.5rem;cursor:pointer;color:var(--ink);font-size:0.9375rem;margin-top:0.875rem}
.bd-switch input{width:1.125rem;height:1.125rem;accent-color:var(--accent);margin:0}
.bd-mat{display:flex;gap:0.75rem;align-items:flex-end}
.bd-mat .field{margin-top:0.5rem}
.bd-grow{flex:1 1 auto;min-width:0}
.bd-custom{display:flex;align-items:center;gap:0.5rem;margin-top:0.75rem}
.bd-custom input{max-width:6rem}
#gradRow select{flex:1 1 9rem;min-width:0}
.bd-two{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0.625rem}
.bd-two select{width:100%}
.note{font-size:0.8125rem;color:var(--muted);margin:0.875rem 0.125rem 0;line-height:1.5}
.note b{color:var(--ink)}
.bd-dl{width:100%;margin-top:0.875rem}
.bd-dl+.bd-dl{margin-top:0.5rem}
.bd-dl:disabled{opacity:.5;cursor:default;filter:none}

.explainer .bd-steps,.explainer .bd-cannot{color:var(--muted);font-size:0.9375rem;margin:0 0 0.75rem;padding-left:1.25rem}
.explainer .bd-steps li,.explainer .bd-cannot li{margin:0 0 0.5rem}
.explainer .bd-steps b,.explainer .bd-cannot b{color:var(--ink)}
.explainer table{max-width:none}

@media (prefers-reduced-motion:reduce){.drop{transition:none}}

@media(max-width:480px){
  .bd-bar{gap:0.375rem}
  .bd-bar-acts .chip{padding:0.375rem 0.5rem}
  .bd-arrow{min-width:2.5rem}
  .bd-stage{padding:0.5rem}
}
.bd-wrap button{flex:1 1 auto;white-space:nowrap}
