/* S6 site tool pages: directory, templates, cover letter, signature, business card, share PDF, bulk QR.
   Reuses tools.css (tl-*) and v4 tokens. Prefix: st-. No gradients. [hidden] never blocks clicks. */
.st-work { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; padding-bottom: 8px; }
.st-work__form { display: grid; gap: 12px; min-width: 0; }
.st-work .tl-out { position: sticky; top: 96px; }
.st-work__form > .tl-lock, .st-work > .tl-out { grid-area: auto; }
[hidden] { display: none !important; }

/* ---------- shared bits ---------- */
.st-suggest { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 10px; border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--surface); font: 700 .78rem var(--font); color: var(--text); cursor: pointer; }
.st-suggest:hover { border-color: var(--accent); color: var(--accent); }
.st-suggest .qq-ic { width: 13px; height: 13px; }
.st-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; cursor: pointer; }
.st-switch > span { position: relative; width: 40px; height: 24px; border-radius: 12px; background: var(--surface-3); flex: none; transition: background .2s; }
.st-switch > span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: left .2s; }
.st-switch.is-on > span { background: var(--accent); }
.st-switch.is-on > span::after { left: 19px; }
.st-switch em { font-style: normal; font-weight: 600; font-size: .88rem; }
.st-eye { border: 0; background: none; color: var(--text-2); cursor: pointer; padding: 6px; }
.st-eye .qq-ic { width: 18px; height: 18px; }
.st-layouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.st-layout { display: grid; gap: 2px; justify-items: start; text-align: left; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font: inherit; color: inherit; cursor: pointer; }
.st-layout .qq-ic { width: 20px; height: 20px; color: var(--text-2); }
.st-layout b { font-size: .88rem; } .st-layout small { color: var(--text-2); font-size: .76rem; line-height: 1.35; }
.st-layout:hover { border-color: var(--line-2); }
.st-layout.is-on { border-color: var(--ink); box-shadow: var(--sh-1); }
.st-layout.is-on .qq-ic { color: var(--accent); }
.st-empty { display: grid; justify-items: center; gap: 6px; padding: 48px 20px; border-radius: var(--r-xl); border: 1.5px dashed var(--line-2); text-align: center; color: var(--text-2); }
.st-empty > span .qq-ic { width: 40px; height: 40px; color: var(--accent); }
.st-empty b { color: var(--text); font-size: 1.05rem; }
.st-empty p { margin: 0 0 8px; }
.st-file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.st-file > span .qq-ic { width: 30px; height: 30px; color: var(--accent); }
.st-file b { display: block; font-size: .92rem; overflow-wrap: anywhere; } .st-file small { color: var(--text-2); }
.st-file .qq-iconbtn { margin-left: auto; flex: none; }
.st-progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.st-progress i { display: block; flex: 1; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; position: relative; }
.st-progress i::after { content: ""; position: absolute; inset: 0; width: var(--p, 0%); background: var(--accent); border-radius: 4px; transition: width .15s; }
.st-progress em { font-style: normal; font-weight: 700; font-size: .82rem; min-width: 40px; text-align: right; }

/* ---------- 1. tools directory ---------- */
.st-dir { padding-bottom: 8px; }
.st-dir__bar { display: grid; gap: 12px; margin-bottom: 14px; }
.st-dir__search { max-width: 560px; }
.st-dir__search input { width: 100%; }
.st-dir__clear { border: 0; background: none; color: var(--text-2); cursor: pointer; padding: 6px; }
.st-dir__clear .qq-ic { width: 15px; height: 15px; }
.st-dir__cats { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.st-dir__cats::-webkit-scrollbar { display: none; }
.st-dir__count { margin: 0 0 12px; font-size: .88rem; font-weight: 600; color: var(--text-2); }
.st-dir__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.st-card { display: grid; gap: 4px; align-content: start; min-height: 190px; padding: 18px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; box-shadow: var(--sh-1); transition: border-color .2s, box-shadow .2s, transform .2s; }
.st-card:hover { border-color: var(--line-2); box-shadow: var(--sh-2); transform: translateY(-2px); }
.st-card[hidden] { display: none; }
.st-card__ic { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 8px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.st-card__ic .qq-ic { width: 25px; height: 25px; }
.st-card b { font-size: 1.02rem; } .st-card small { color: var(--text-2); font-size: .86rem; line-height: 1.45; }
.st-card .tl-chip { justify-self: start; margin-top: 8px; }
.st-dir__lock, .st-tpl__lock { width: 100%; margin-top: 14px; }

/* ---------- 2. CV templates ---------- */
.st-tpl__filters { overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; max-width: 100%; }
.st-tpl__filters::-webkit-scrollbar { display: none; }
.st-tpl__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.st-tpl__card { display: grid; gap: 0; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; box-shadow: var(--sh-1); }
.st-tpl__card[hidden] { display: none; }
.st-tpl__thumb { position: relative; display: block; width: 100%; padding: 18px 18px 0; border: 0; background: var(--bg-2); cursor: pointer; }
.st-tpl__hover { position: absolute; left: 0; right: 0; bottom: 14px; display: grid; justify-items: center; gap: 8px; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; pointer-events: none; }
.st-tpl__hover a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: var(--pill); background: var(--ink); color: var(--on-ink); font-weight: 700; font-size: .86rem; text-decoration: none; }
.st-tpl__hover em { font-style: normal; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: .78rem; font-weight: 600; }
.st-tpl__hover .qq-ic { width: 15px; height: 15px; }
.st-tpl__thumb:hover .st-tpl__hover a, .st-tpl__thumb:focus-visible .st-tpl__hover a { pointer-events: auto; }
.st-tpl__thumb:hover .st-tpl__hover, .st-tpl__thumb:focus-visible .st-tpl__hover { opacity: 1; transform: translateY(0); }
.st-tpl__meta { display: grid; gap: 8px; padding: 14px 16px 16px; }
.st-tpl__meta b { font-size: 1.02rem; } .st-tpl__meta small { display: block; margin-top: 2px; color: var(--text-2); font-size: .85rem; line-height: 1.45; }
.st-tpl__cats { display: flex; flex-wrap: wrap; gap: 6px; }
.st-tpl__cats em { font-style: normal; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-2); }
.st-tpl__cta .qq-btn { width: 100%; }
/* mini CV thumbnails (pure HTML/CSS, --tc = template colour) */
.st-mini { aspect-ratio: 1 / 1.3; border-radius: 10px 10px 0 0; background: #fff; border: 1px solid var(--line); border-bottom: 0; overflow: hidden; color: #0a0a0a; }
.st-mini--big { aspect-ratio: 1 / 1.414; border-radius: 14px; border-bottom: 1px solid var(--line); box-shadow: var(--sh-2); }
.st-mini i { display: block; border-radius: 3px; background: #d6d3d1; margin-top: 5px; }
.st-mini em { display: block; height: 8px; }
.st-mini b { display: block; height: 12px; border-radius: 4px; background: var(--tc); }
.st-mini__pad { padding: 12px; }
.st-mini__name { width: 52%; }
.st-mini__row { display: grid; grid-template-columns: 34% 1fr; height: 100%; }
.st-mini__side { background: var(--tc); padding: 12px 10px; }
.st-mini__side s { display: block; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.85); margin-bottom: 8px; }
.st-mini__side i { background: rgba(255,255,255,.55); }
.st-mini__main { padding: 12px 10px; }
.st-mini__main b { width: 70%; }
.st-mini__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.st-mini__top { padding: 12px 12px 8px; border-bottom: 3px solid var(--tc); }
.st-mini__top b { width: 44%; }
.st-mini__band { background: var(--tc); padding: 12px; }
.st-mini__band b { background: #fff; width: 48%; }
.st-mini__band i { background: rgba(255,255,255,.6); }
.st-mini__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.st-mini__cards u { display: block; height: 34px; border-radius: 6px; background: color-mix(in srgb, var(--tc) 14%, #fff); border: 1px solid color-mix(in srgb, var(--tc) 30%, #fff); text-decoration: none; }
.st-tpl__modal { width: min(880px, 100%); grid-template-columns: 1fr 1fr; gap: 24px; text-align: left; align-items: start; }
.st-tpl__mmeta { display: grid; gap: 12px; align-content: start; }
.st-tpl__mmeta h2 { font-size: 1.8rem; }
.st-tpl__mmeta p { margin: 0; }
.st-tpl__dots { display: flex; gap: 10px; }
.st-tpl__dots button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line-2); }
.st-tpl__dots button.is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }

/* ---------- 3. cover letter A4 preview ---------- */
.st-qrwait { display: grid; place-items: center; min-height: 64px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-weight: 700; }
.st-a4 { background: #fff; color: #1c1917; border-radius: 8px; border: 1px solid var(--line); box-shadow: var(--sh-2); padding: 26px 24px; font-size: .86rem; line-height: 1.65; aspect-ratio: 1 / 1.25; overflow: auto; }
.st-a4 > b { display: block; font-size: 1.15rem; letter-spacing: -.01em; color: #0a0a0a; }
.st-a4 p { margin: 10px 0 0; overflow-wrap: break-word; }
.st-a4__date { color: #78716c; }
.st-a4__empty { color: #a8a29e; }
.st-a4__role { margin-top: 14px; padding-top: 10px; border-top: 1px solid #e7e5e4; color: #57534e; font-weight: 600; }

/* ---------- 4. email signature ---------- */
.st-espaper { background: #fff; border-radius: var(--r-lg); border: 1px solid var(--line); padding: 20px 16px; color: #1c1917; overflow-x: auto; }
.st-es { font: 400 13px/1.55 Inter, Arial, sans-serif; }
.st-es b { color: #0a0a0a; font-size: 15px; }
.st-es a { color: var(--esc, #166534); text-decoration: none; }
.st-es__side { display: flex; gap: 12px; align-items: center; }
.st-es__photo { display: inline-block; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; background: #e7e5e4; vertical-align: middle; }
.st-es__stack .st-es__photo { width: 56px; height: 56px; margin-bottom: 8px; }
.st-es__banner { border-left: 4px solid var(--esc, #166534); padding-left: 12px; }
.st-es__centred { text-align: center; }
.st-es__centred .st-es__photo { margin: 0 auto 8px; }
.st-es__card { border: 1px solid #e7e5e4; border-radius: 12px; padding: 12px; display: flex; gap: 12px; align-items: center; }
.st-es__qr { display: inline-block; width: 64px; height: 64px; flex: none; vertical-align: middle; }
.st-es__qr svg { display: block; width: 100%; height: auto; }
.st-mailtabs { display: flex; gap: 4px; padding: 4px; margin: 16px 20px 0; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line); }
.st-mailtabs button { flex: 1; min-height: 36px; border: 0; border-radius: var(--pill); background: none; font: 600 .86rem var(--font); color: var(--text-2); cursor: pointer; }
.st-mailtabs button[aria-selected="true"] { background: var(--ink); color: var(--on-ink); }
.st-mailpan { padding: 14px 22px 20px; color: var(--text-2); font-size: .94rem; line-height: 1.6; }
.st-mailpan ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.st-mailpan strong { color: var(--text); }

/* ---------- 5. business card flip preview ---------- */
.st-bcstage { perspective: 1200px; }
.st-bc { position: relative; aspect-ratio: 85 / 55; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.st-bcstage.is-back .st-bc { transform: rotateY(180deg); }
.st-bc__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--sh-2); overflow: hidden; background: #fff; color: #1c1917; padding: 14px 16px; font-size: 11px; line-height: 1.5; }
.st-bc__back { transform: rotateY(180deg); }
.st-bc__front b { display: block; font-size: 15px; color: #0a0a0a; letter-spacing: -.01em; }
.st-bc__front small, .st-bc__back small { color: #57534e; }
.st-bc__qr { display: inline-block; width: 72px; height: 72px; vertical-align: middle; }
.st-bc__qr svg { display: block; width: 100%; height: auto; }
.st-bc__split { display: flex; gap: 10px; align-items: center; height: 100%; }
.st-bc__split > div:first-child { flex: 1; min-width: 0; }
.st-bc__centred { text-align: center; display: grid; gap: 2px; align-content: center; height: 100%; }
.st-bc__band { border-top: 10px solid var(--bcc, #166534); }
.st-bc__dark { background: #1c1917; color: #e7e5e4; border-color: #1c1917; }
.st-bc__dark b { color: #fff; } .st-bc__dark small { color: #a8a29e; }
.st-bc__photo { display: flex; gap: 12px; align-items: center; height: 100%; }
.st-bc__init { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--bcc, #166534); color: #fff; font-weight: 800; font-size: 22px; flex: none; }
.st-bc__backc { display: flex; gap: 12px; align-items: center; justify-content: center; height: 100%; text-align: left; }
.st-bc__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.st-bc__row em { font-style: normal; font-size: .82rem; font-weight: 600; color: var(--text-2); }

/* ---------- 6. share PDF result ---------- */
.st-result { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 22px 18px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); color: #0a0a0a; }
.st-result__qr { width: 150px; }
.st-result__qr svg { display: block; width: 100%; height: auto; }
.st-result__link { width: 100%; }
.st-result__link input { width: 100%; font-size: .82rem; }
.st-result__row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.st-result__meta { margin: 0; font-size: .8rem; color: #57534e; }
.st-result--idle { background: var(--bg-2); color: var(--text); }
.st-result--idle > span .qq-ic { width: 40px; height: 40px; color: var(--accent); }
.st-result--idle p { margin: 0; font-size: .86rem; color: var(--text-2); }

/* ---------- 7. bulk QR ---------- */
.st-steps { list-style: none; margin: 0 0 4px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.st-steps li { display: grid; gap: 2px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: .8rem; color: var(--text-2); }
.st-steps li > span .qq-ic { width: 20px; height: 20px; }
.st-steps li b { color: var(--text); font-size: .86rem; }
.st-steps li.is-on { border-color: var(--ink); box-shadow: var(--sh-1); }
.st-steps li.is-on > span .qq-ic { color: var(--accent); }
.st-steps li.is-done { border-color: var(--accent-line); }
.st-bk__helpers { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.st-bk__helpers .st-switch { min-height: 38px; }
.st-dd { position: relative; }
.st-dd__btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; color: var(--text); cursor: pointer; }
.st-dd__btn .qq-ic { width: 15px; height: 15px; transition: transform .2s; }
.st-dd__btn[aria-expanded="true"] .qq-ic { transform: rotate(180deg); }
.st-dd__list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: 220px; overflow: auto; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--sh-3); }
.st-dd__list button { display: block; width: 100%; text-align: left; min-height: 40px; padding: 0 10px; border: 0; border-radius: 9px; background: none; font: inherit; color: var(--text); cursor: pointer; }
.st-dd__list button:hover { background: var(--surface-2); }
.st-dd__list button.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.st-bkgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-height: 420px; overflow: auto; padding: 4px; }
.st-bkgrid__idle { grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; padding: 30px 12px; text-align: center; color: var(--text-2); font-size: .86rem; }
.st-bkgrid__idle .qq-ic { width: 36px; height: 36px; color: var(--accent); }
.st-bkcell { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; color: #0a0a0a; }
.st-bkcell svg { display: block; width: 100%; height: auto; }
.st-bkcell small { display: block; margin-top: 4px; font-size: .7rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .st-work { grid-template-columns: 1fr; } .st-work .tl-out { position: static; } }
@media (max-width: 900px) { .st-dir__grid, .st-tpl__grid { grid-template-columns: repeat(2, 1fr); } .st-tpl__modal { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .st-dir__grid, .st-tpl__grid, .st-layouts { grid-template-columns: 1fr; }
  .st-steps { grid-template-columns: repeat(2, 1fr); }
  .st-tpl__filters { display: flex; }
  .st-bkgrid { grid-template-columns: repeat(2, 1fr); }
  .st-a4 { aspect-ratio: auto; min-height: 420px; }
}
@media (max-width: 420px) { .st-dir__grid, .st-tpl__grid { grid-template-columns: 1fr; } .st-bkgrid { grid-template-columns: 1fr 1fr; } }
.st-dir__grid > *, .st-tpl__grid > *, .st-work__form > *, .tl-out > * { min-width: 0; }
@media (prefers-reduced-motion: reduce) { .st-bc { transition: none; } }
