/* The Job Application Sankey Diagram Maker (job-application-sankey.html): sits on top of styles.css.
   Hero: the heading, then the maker: the list of stages on the left and the live diagram on the right (stacked on
   smaller screens). Then a short how-to and a sign-up card. The diagram itself is drawn by js/sankey.js. */

.skt { --paper-2: #FFFBF3; --rule: #EADCC4; --rose-ink: #A8384A; }
.skt main { background: var(--bg); }
.sec { position: relative; padding-block: clamp(64px, 8vw, 104px); }

/* ===================== hero ===================== */
/* the home page's sunset (its .dusk-run colours), ending in the colour the meadow divider below starts from */
.sh { position: relative; isolation: isolate; padding: calc(var(--head) + clamp(28px, 4vw, 56px)) 0 clamp(40px, 5vw, 64px);
  background: linear-gradient(180deg, #FFF3E6 0%, #FCEBDC 22%, #F6E0E4 52%, #F4D9D8 78%, #F4CFC5 100%); }

/* the meadow strip between the tool and the how-to (drawn by js/main.js, like the home page's dividers) */
.skt .divider { margin-top: -1px; }
.sh-copy { display: grid; gap: 16px; margin-bottom: clamp(24px, 3.5vw, 40px); }
.sh h1 { max-width: 760px; font-family: var(--serif); font-weight: 700; font-size: clamp(2.3rem, 1.4rem + 2.6vw, 3.5rem); line-height: 1.02; letter-spacing: -.025em; color: var(--logo-green); text-wrap: balance; }

/* ===================== the maker ===================== */
/* the tool runs a little wider than the rest of the site (up to 1280px against the usual 1160px): the 400px editor
   on the left, the diagram board taking the rest (about 845px wide on a large screen) */
.sh > .wrap { width: min(100% - 2 * var(--gutter), 1280px); }
.mk { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: clamp(20px, 2.5vw, 32px); align-items: start; }

/* the stages */
.ed { display: grid; gap: 14px; background: var(--paper); border: 2px solid var(--line); border-radius: 24px; padding: clamp(18px, 2.4vw, 26px);
  box-shadow: 0 4px 0 var(--line-strong), 0 30px 60px -30px rgba(91, 70, 54, .35); }
.ed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ed-h { font-family: var(--font); font-weight: 800; font-size: clamp(1.3rem, 1.15rem + .5vw, 1.55rem); line-height: 1.1; letter-spacing: -.01em; color: var(--logo-green); }
.preset select { height: 40px; font: inherit; font-size: .92rem; font-weight: 700; border: 2px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--ink); padding: 0 10px; cursor: pointer; max-width: 100%; }

/* one card per stage: its name and total, then its outcomes (moved on, rejected, anything else) */
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: st; }
.card { position: relative; background: var(--paper-2); border: 2px solid var(--line); border-left: 6px solid var(--c); border-radius: 16px; padding: 10px 10px 8px; transition: background .2s; }
.card.flash, .out.flash { background: #F4FAF5; }
/* a stage's row and its outcome rows share one set of columns, so everything lines up down the card and the card's
   padding is the same on both sides:
   drag handle 18px (empty on the stage row) | swatch 26px | name | number 72px (the stage's up/down arrows, centred
   over the number boxes) | bin 26px. The stage's total sits on a small line under its name. */
.c-head { display: grid; grid-template-columns: 18px 26px minmax(0, 1fr) 72px 26px; gap: 0 4px; align-items: center; }
.c-name { min-width: 0; height: 38px; font: inherit; font-weight: 800; font-size: 1.02rem; border: 2px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); padding: 0 8px; }
.c-name:hover, .o-name:hover { border-color: var(--line); background: #fff; }
.c-name:focus, .o-name:focus { border-color: var(--line-strong); background: #fff; }
/* the editor's boxes show where you're typing with a green border, not the site's blue focus ring */
.ed input:focus, .ed input:focus-visible, .ed select:focus, .ed select:focus-visible { outline: none; box-shadow: none; border-radius: 10px; border-color: var(--leaf-dark); }
.ed .title-row input:focus, .ed .preset select:focus { border-radius: 12px; }
.c-tot { grid-column: 3 / -1; grid-row: 2; justify-self: start; padding-left: 10px; margin-top: -4px; font-size: .8rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.c-tot.bad { color: #8A5B00; }
.c-tools, .o-tools, .c-move { display: flex; justify-content: flex-end; gap: 0; }
.c-move { justify-content: center; }
.c-tools button, .o-tools button, .c-move button { width: 26px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; padding: 0; }
.c-tools button:hover:not(:disabled), .o-tools button:hover:not(:disabled), .c-move button:hover:not(:disabled) { background: #F1E8D8; color: var(--ink); }
.c-tools button:disabled, .o-tools button:disabled, .c-move button:disabled { opacity: .25; cursor: default; }
.c-tools svg, .o-tools svg, .c-move svg { width: 14px; height: 14px; }
.o-tools .del svg, .c-tools .del svg { width: 17px; height: 17px; }
.c-tools .del:hover:not(:disabled), .o-tools .del:hover:not(:disabled) { background: #FDECEF; color: var(--rose-ink); }

.outs { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.out { display: grid; grid-template-columns: 18px 26px minmax(0, 1fr) 72px 26px; gap: 4px; align-items: center; padding: 3px 0; border-radius: 10px; transition: background .2s; position: relative; }
/* the 6-dot handle for dragging an outcome up or down within its stage (phones get the arrows instead, below) */
.o-grip { width: 18px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: #B9AE9C; padding: 0; cursor: grab; touch-action: none; }
button.o-grip:hover, button.o-grip:focus-visible { color: var(--ink); background: #F1E8D8; }
.o-grip svg { width: 14px; height: 14px; }
.o-tools .o-arrow { display: none; }
.out.dragging { z-index: 10; background: var(--paper); box-shadow: 0 10px 24px rgba(91, 70, 54, .2), 0 0 0 2px var(--line-strong); transition: none; }
.out.dragging .o-grip, .sorting { cursor: grabbing; }
.sorting { -webkit-user-select: none; user-select: none; }
.o-ic { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: var(--c); color: var(--ink); margin-left: 2px; }
.o-ic svg { width: 14px; height: 14px; }
.o-next { min-width: 0; font-size: .92rem; font-weight: 600; color: var(--ink-soft); padding-left: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-next b { color: var(--ink); font-weight: 800; }
.o-name { min-width: 0; height: 36px; font: inherit; font-weight: 700; font-size: .95rem; border: 2px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); padding: 0 8px; }
.o-num { width: 100%; height: 36px; font: inherit; font-weight: 800; font-size: 1rem; text-align: center; font-variant-numeric: tabular-nums; border: 2px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink); -moz-appearance: textfield; padding: 0 4px; }
.o-num::-webkit-outer-spin-button, .o-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* + Stage on a card with later stages it isn't linked to: a new stage, or a link straight on to one of them */
.c-addm { position: relative; display: inline-flex; }
.c-menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); min-width: 170px; display: grid; gap: 2px; padding: 6px; background: #fff; border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 12px 28px rgba(91, 70, 54, .18); }
.c-menu[hidden] { display: none; }
.c-menu button { display: flex; align-items: center; gap: 7px; border: 0; background: none; text-align: left; padding: 6px 9px; border-radius: 9px; font: inherit; font-size: .86rem; font-weight: 700; color: var(--ink); cursor: pointer; white-space: nowrap; }
.c-menu button:hover, .c-menu button:focus-visible { background: var(--leaf-soft); }
.c-menu button svg { width: 12px; height: 12px; flex: none; color: var(--leaf-text); }
.c-menu-h { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); padding: 6px 9px 2px; border-top: 1.5px solid var(--line); margin-top: 2px; }
.c-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; margin-top: 8px; }
.c-add { display: inline-flex; align-items: center; gap: 5px; border: 2px solid #CDEBD6; background: #fff; padding: 3px 12px 3px 10px; border-radius: 999px; font: inherit; font-size: .84rem; font-weight: 700; color: var(--leaf-text); cursor: pointer; }
.c-add:hover { background: var(--leaf-soft); }
.c-add svg { width: 12px; height: 12px; }

/* colour swatches */
.sw { position: relative; display: grid; place-items: center; }
.sw > button { width: 22px; height: 22px; border-radius: 7px; border: 2px solid rgba(62, 58, 53, .18); background: var(--c); cursor: pointer; padding: 0; }
.c-head .sw > button { width: 26px; height: 26px; border-radius: 8px; }
.sw-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: -6px; display: grid; grid-template-columns: repeat(5, 26px); gap: 6px; padding: 10px; background: var(--paper); border: 2px solid var(--line-strong); border-radius: 14px; box-shadow: 0 14px 30px rgba(91, 70, 54, .18); }
.sw-pop[hidden] { display: none; }
.sw-pop button { width: 26px; height: 26px; border-radius: 8px; border: 2px solid rgba(62, 58, 53, .15); background: var(--c); cursor: pointer; padding: 0; }
.sw-pop button:hover { transform: scale(1.1); }
.sw-pop button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.sw-pop .sw-auto { grid-column: 1 / -1; width: auto; height: 30px; background: #fff; font: inherit; font-size: .82rem; font-weight: 700; color: var(--ink-soft); border-color: var(--line-strong); }
.sw-pop .sw-auto:hover { transform: none; color: var(--ink); }
.card:has(.sw-pop:not([hidden])) { z-index: 5; }

.add { justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 16px 8px 12px; border: 2px dashed var(--line-strong); border-radius: 14px; background: none; font: inherit; font-weight: 800; color: var(--leaf-text); cursor: pointer; }
.add:hover { background: var(--leaf-soft); border-color: var(--leaf); }
.add svg { width: 18px; height: 18px; }
.ed-warn { font-size: .88rem; font-weight: 700; color: #8A5B00; background: #FFF5D6; border: 2px solid #F1DAA6; border-radius: 12px; padding: 8px 12px; line-height: 1.4; }
.ed-warn[hidden] { display: none; }

.opts { display: grid; gap: 8px; border-top: 2px solid var(--line); padding-top: 14px; }
.opt-title { font-weight: 800; }
.title-on { display: grid; gap: 8px; }
.title-on[hidden] { display: none; }
.title-del { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--ink-soft); cursor: pointer; padding: 0; }
.title-del:hover { background: #FDECEF; color: var(--rose-ink); }
.title-del svg { width: 18px; height: 18px; }
.title-add { justify-self: start; }
.title-add[hidden] { display: none; }
.title-row { display: flex; gap: 6px; align-items: center; }
.title-row input { flex: 1 1 auto; min-width: 0; height: 44px; font: inherit; font-weight: 700; border: 2px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--ink); padding: 0 12px; }

/* the picture */
/* one row of board controls, spread evenly: Numbers/Percentages, Text, Zoom, Select all, then Reset, Undo and Redo */
.pv-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 6px; flex-wrap: wrap; }
.pv-bar .seg, .pv-bar .fsz, .pv-bar .sel-btn, .pv-bar .hist-btn { box-sizing: border-box; height: 40px; }
.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--paper); border: 2px solid var(--line-strong); border-radius: 999px; }
.seg button { min-height: 30px; padding: 4px 11px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: .84rem; font-weight: 800; color: var(--ink-soft); cursor: pointer; transition: background .2s, color .2s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--leaf-dark); color: #fff; box-shadow: 0 2px 0 #2E7A4C; }
.seg button[aria-pressed="true"]:hover { color: #fff; }
.sel-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px 4px 10px; border: 2px solid var(--line-strong); border-radius: 999px; background: var(--paper); font: inherit; font-size: .84rem; font-weight: 800; color: var(--ink); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.sel-btn:hover { background: #F5EEE2; }
.sel-btn svg { width: 17px; height: 17px; }
.sel-btn[aria-pressed="true"] { background: var(--leaf-dark); border-color: var(--leaf-dark); color: #fff; box-shadow: 0 2px 0 #2E7A4C; }
/* the whole chart while it's selected: a green dashed box with a light tint, green-edged bars, a move cursor */
.pv-svg.selall svg { cursor: move; }
.pv-svg.selall .node, .pv-svg.selall .lab { cursor: move; }
.pv-svg .sel-h { fill: #fff; stroke: #3F9A63; }
.pv-svg .sel-box { fill: rgba(108, 192, 139, .12); stroke: #3F9A63; stroke-width: 3; stroke-dasharray: 12 8; }
.pv-svg.selall .node rect:not(.hit) { stroke: #3F9A63; stroke-width: 3; }
.pv-svg.selall .chart path { filter: saturate(1.25); }
.zm .fsz-val { min-width: 70px; }
.fsz { display: inline-flex; align-items: center; gap: 1px; padding: 3px; background: var(--paper); border: 2px solid var(--line-strong); border-radius: 999px; }
.fsz button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; padding: 0; }
.fsz button:hover:not(:disabled) { background: #F1E8D8; }
.fsz button:disabled { opacity: .3; cursor: default; }
.fsz svg { width: 13px; height: 13px; }
.fsz-val { min-width: 62px; text-align: center; font-size: .8rem; font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.hist { display: inline-flex; gap: 4px; }
.hist-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 4px 11px 4px 9px; border: 2px solid var(--line-strong); border-radius: 999px; background: var(--paper); font: inherit; font-size: .84rem; font-weight: 800; color: var(--ink); cursor: pointer; }
.hist-btn:hover:not(:disabled) { background: #F5EEE2; }
.hist-btn:disabled { opacity: .4; cursor: default; }
.hist-btn svg { width: 15px; height: 15px; }
.pv { position: sticky; top: calc(var(--head) + 20px); display: grid; gap: 14px; min-width: 0; }
.pv-frame { background: #FFF8EC; border: 2px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 4px 0 var(--line-strong), 0 30px 60px -30px rgba(91, 70, 54, .35); }
.pv-svg svg { display: block; width: 100%; height: var(--board-h, auto); max-height: var(--board-max, none); -webkit-user-select: none; user-select: none; } /* --board-max: js/sankey.js keeps the board's column within the window */
.pv-svg .node, .pv-svg .lab { cursor: grab; touch-action: none; }
.pv-frame.zoomed { overflow: auto; }
.pv-svg .node:hover rect { filter: brightness(.95); }
/* bands bend when dragged (a double-click straightens one) */
.pv-svg .band { cursor: grab; touch-action: none; transition: opacity .15s; }
.pv-svg .band:hover, .pv-svg .band.drag { opacity: .8; }
.pv-svg.selall .band { cursor: move; }
.pv-svg.dragging, .pv-svg.dragging .node { cursor: grabbing; }
.pv-svg .node.drag rect:not(.hit) { stroke: #3E3A35; stroke-width: 2; }
.pv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pv-ok { font-size: .9rem; font-weight: 700; color: var(--leaf-text); }
.pv-ok:empty { display: none; }

/* share links on the same line as the downloads, pushed to the right: the same round buttons as on a Library article
   (library.css); "Link copied" shows under them */
.sk-share { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; }
.sk-share .share-h { font-weight: 800; font-size: .9rem; color: var(--ink-soft); margin: 0; }
.sk-share .share-note { flex-basis: 100%; text-align: right; }
.sk-share .share-btn { width: 36px; height: 36px; }
.sk-share .share-btn svg { width: 16px; height: 16px; }
.pv-ok { flex-basis: 100%; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink-soft); cursor: pointer; text-decoration: none; transition: background .2s, color .2s, border-color .2s, transform .2s var(--back); }
.share-btn svg { width: 18px; height: 18px; fill: currentColor; overflow: visible; }
.share-ico { display: grid; place-items: center; line-height: 0; }
.share-btn svg.line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.share-btn:hover, .share-btn:focus-visible { background: var(--ink); border-color: var(--ink); color: var(--paper); transform: translateY(-2px); }
.share-note { margin: 0; font-size: .85rem; font-weight: 700; color: var(--leaf-text); }
.share-note:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .share-btn { transition: none; } .share-btn:hover { transform: none; } }

/* ===================== how to read it ===================== */
.how-wrap { display: grid; gap: 28px; }
.how-wrap > * { max-width: 920px; }
.how-head { display: grid; gap: 14px; }
.how-head p { color: #4F483F; max-width: 64ch; }
/* the privacy line, moved down from the top of the page: a small badge under the how-to's intro */
.how-head .how-free { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 11px; border-radius: 999px; background: var(--leaf-soft); color: var(--leaf-text); font-size: .92rem; font-weight: 700; }
.how-free svg { width: 17px; height: 17px; flex: none; }
.tips { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--line); }
.tips li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px 24px; padding: 20px 0; border-bottom: 2px solid var(--line); }
.tips li > b { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--c); font-family: var(--serif); font-size: 1.5rem; color: var(--logo-green); }
.tips h3 { font-size: 1.08rem; margin-bottom: 4px; }
.tips p { color: var(--ink-soft); font-size: .98rem; }
.how-fine { font-size: .95rem; color: var(--ink-soft); border-left: 4px solid var(--line-strong); padding: 2px 0 2px 14px; }

/* ===================== call to action ===================== */
.ucta { padding-top: 0; }
.ucta-card { display: flex; align-items: center; justify-content: space-between; gap: 20px 40px; flex-wrap: wrap; background: var(--paper); border: 2px solid #CDEBD6; border-radius: 24px; box-shadow: 0 4px 0 #CDEBD6; padding: clamp(24px, 4vw, 40px); }
.ucta-card > div { display: grid; gap: 10px; max-width: 58ch; flex: 1 1 320px; }
.ucta-card .h2 { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem); }
.ucta-card p { color: var(--ink-soft); }

/* ===================== responsive ===================== */
/* on a desktop the stage editor is drawn at 90% size (text, boxes, buttons, spacing) so more stages fit on one
   screen; it still fills its column, so it keeps its full width and its rows simply get more room across */
@media (min-width: 1024px) {
  .ed { zoom: .9; }
}
@media (max-width: 1023px) {
  .mk { grid-template-columns: minmax(0, 1fr); }
  .pv { position: static; order: -1; }
  .ed { max-width: 640px; }
}
@media (max-width: 640px) {
  .o-grip, .c-gap { display: none; }
  .o-tools .o-arrow { display: grid; }
  .out { grid-template-columns: 26px minmax(0, 1fr) 72px 78px; }
  .c-head { grid-template-columns: 26px minmax(0, 1fr) auto 26px; }
  .c-move { justify-content: flex-end; margin-right: -4px; } /* so its arrows sit right above the outcomes' arrows */
  .c-tot { grid-column: 2 / -1; }
  .sh { padding-top: calc(var(--head) + 22px); }
  .pv-frame { border-radius: 16px; }
  .pv-actions .btn { flex: 1 1 auto; }
  .pv-actions .btn-primary { flex-basis: 100%; }
  .sk-share { margin-left: 0; flex-basis: 100%; justify-content: flex-start; }
  .sk-share .share-note { text-align: left; }
  .sk-share .share-h { flex-basis: 100%; }
  .sk-share .share-row { gap: 4px; flex-wrap: nowrap; }
  .sk-share .share-btn { width: 33px; height: 33px; }
  .sk-share .share-btn svg { width: 15px; height: 15px; }
  .tips li { grid-template-columns: 1fr; gap: 8px; }
  .ucta-card .btn { width: 100%; }
}
@media (max-width: 420px) {
  .out { grid-template-columns: 26px minmax(0, 1fr) 60px 66px; gap: 4px; }
  .c-head { grid-template-columns: 26px minmax(0, 1fr) auto 22px; gap: 4px; }
  .c-move { margin-right: -4px; }
  .o-tools button, .c-tools button, .c-move button { width: 22px; }
}
