/* Payout certificate tool (/certificate). Builds on style.css and guide.css: same type, colours and pills. */
.cert-hero{padding-bottom:0}
.cert-hero h1{font-size:clamp(36px,5.6vw,72px)}

/* The tool: preview on the left, controls on the right. overflow:clip (not hidden) keeps the rounded corners without
   making a scroll container, so the preview can stay in view on phones (position:sticky below). */
.cert-tool{display:grid;grid-template-columns:minmax(0,1fr) 360px;margin-top:40px;border:1px solid #ffffff2e;border-radius:20px;overflow:clip;background:#121214}
/* The preview sits on a neutral mid-grey, so the new background's colours aren't judged against black. */
.cert-stage{position:relative;display:grid;place-items:center;align-content:center;gap:12px;min-height:620px;padding:32px;background:#2a2a2d}
.cert-stage.drop::after{content:'';position:absolute;inset:12px;border:2px dashed #fff;border-radius:14px;pointer-events:none}
#view{display:block;max-width:100%;max-height:min(76vh,720px);width:auto;height:auto;filter:drop-shadow(0 12px 32px #00000066);touch-action:none}
/* Computers: the preview starts at the top of the tool and stays in view while the controls beside it scroll. */
@media(min-width:901px){.cert-stage{align-content:start}#view,.cert-empty{position:sticky;top:24px}}
#view.pannable{cursor:grab}
#view.pannable.grabbing{cursor:grabbing}
.cert-empty{display:grid;justify-items:center;align-content:center;gap:8px;width:min(440px,100%);aspect-ratio:1;padding:24px;border:1.5px dashed #ffffff59;border-radius:16px;text-align:center}
.cert-empty p{margin:0}
.cert-empty-big{color:#fff;font-size:20px;font-weight:600}
.cert-empty-small{color:#bdbdbd;font-size:14px}
.cert-empty .guide-button{margin-top:16px}
.cert-note{margin:0;color:#d6d6d6;font-size:14px;text-align:center}

/* Controls */
.cert-panel{display:flex;flex-direction:column;gap:22px;min-width:0;padding:24px;border-left:1px solid #ffffff1f}
.cert-slots{display:grid;gap:8px;margin:0;padding:0;list-style:none}
.cert-slot{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;column-gap:12px;padding:12px 12px 12px 14px;border:1px solid #ffffff24;border-radius:14px;background:#0b0b0c;cursor:pointer}
.cert-slot.active{border-color:#ffffffa6}
.cert-slot.drop{border-style:dashed;border-color:#fff}
.cert-slot-number{display:grid;place-items:center;width:28px;height:28px;border:1px solid #ffffff4d;border-radius:50%;color:#fff;font-family:var(--font-display);font-size:13px;font-weight:800}
.cert-slot-text{min-width:0}
.cert-slot h2{margin:0;color:#fff;font-size:15px;font-weight:600}
.cert-file{margin:2px 0 0;color:#cfcfcf;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cert-dims{margin:2px 0 0;color:#8f8f8f;font-size:12px}
.cert-slot .secondary-button{min-height:38px;padding:0 14px;font-size:13px}
.cert-err{margin:0;color:#ff9a8a;font-size:14px;line-height:1.6}
.cert-warn{margin:0;padding:10px 14px;border:1px solid #6b4a30;border-radius:10px;background:#1d140d;color:#f0cfae;font-size:13px;line-height:1.7}
.cert-controls{display:grid;gap:14px;min-width:0;margin:0;padding:0;border:0}
.cert-controls:disabled{opacity:.4}
.cert-controls legend{margin-bottom:6px;padding:0;color:#fff;font-size:15px;font-weight:600}
.cert-range{display:grid;gap:6px}
.cert-range>span{display:flex;justify-content:space-between;gap:12px;color:#c8c8c8;font-size:14px}
.cert-range output{color:#fff;font-variant-numeric:tabular-nums}
.cert-range input{width:100%;margin:0;accent-color:#fff}
.cert-hint{margin:0;color:#9a9a9a;font-size:13px;line-height:1.7}
.cert-buttons{display:flex;flex-wrap:wrap;gap:8px}
.cert-buttons .secondary-button{min-height:38px;font-size:13px}

/* Contrast meter and saving, at the bottom of the controls */
.cert-foot{display:grid;gap:12px;margin-top:auto;padding-top:18px;border-top:1px solid #ffffff1f}
.cert-meter{display:grid;grid-template-columns:auto 1fr;align-items:baseline;column-gap:12px;row-gap:2px}
.cert-meter-label{color:#c8c8c8;font-size:14px}
.cert-meter-ref{color:#8f8f8f;font-size:12px;text-align:right}
.cert-meter-value{color:#fff;font-size:26px;font-weight:600;line-height:1.2;font-variant-numeric:tabular-nums}
.cert-say{font-size:13px}
.cert-say.good{color:#8fe0b0}
.cert-say.low{color:#f0c27a}
.cert-say.bad{color:#ff9a8a}
.cert-meter-where{grid-column:1/-1;color:#8f8f8f;font-size:12px}
.cert-actions{display:flex;gap:8px}
.cert-actions>*{flex:1;justify-content:center;min-height:46px}
.cert-peek{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.cert-tool .guide-button{border:0;cursor:pointer}
.cert-tool button:disabled{opacity:.4;cursor:not-allowed}
.cert-saved{margin:0;color:#bdbdbd;font-size:13px}
.cert-saved:empty{display:none}
/* Touch screens have no Ctrl+V. */
@media(pointer:coarse){.cert-paste-hint{display:none!important}}

/* Phones and tablets: preview above the controls, kept in view while the sliders scroll under it. */
@media(max-width:900px){
  .cert-tool{grid-template-columns:1fr;margin-top:28px}
  .cert-stage{position:sticky;top:0;z-index:2;min-height:0;padding:16px}
  #view{max-height:52vh}
  .cert-stage:has(#empty:not([hidden])){position:relative}
  .cert-empty{width:100%;aspect-ratio:auto;min-height:220px}
  .cert-panel{padding:20px 16px;border-left:0;border-top:1px solid #ffffff1f}
}
