/* Resume Studio - builds on the JobPilot design system in app.css */

/* ------------------------------------------------------------------ ATS analyzer (step 5) */
.ats-wrap { max-width: 1240px; margin: 0 auto; padding: 32px 24px 64px; }
.ats-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; }
.ats-setup { position: sticky; top: 84px; }
.ats-hero { display: flex; gap: 22px; align-items: center; }
.ats-hero .ring.lg::before { width: 86px; height: 86px; font-size: 28px; content: attr(data-v); }
.ats-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.ats-cat { padding: 14px 16px; text-decoration: none !important; color: inherit; transition: border-color .15s, box-shadow .15s; }
.ats-cat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.recs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: rec; }
.rec-i { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.ats-detail summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; padding: 4px 6px; }
.ats-detail summary::-webkit-details-marker { display: none; }
.checks { list-style: none; margin: 10px 0 4px; padding: 0 6px; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks li svg { margin-top: 2px; flex: none; }
@media (max-width: 1000px) { .ats-grid { grid-template-columns: 1fr; } .ats-setup { position: static; } }
@media (max-width: 640px) { .ats-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ats-hero { flex-direction: column; text-align: center; } .ats-wrap { padding: 20px 12px 64px; } }

.rs-brand small { color: var(--accent); }
.rs-badge-ai { background: linear-gradient(120deg, var(--primary-soft), color-mix(in srgb, var(--accent) 16%, transparent)); color: var(--primary); }

/* hero layout: copy left, product visual right */
.rs-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 72px 20px 56px; text-align: left; position: relative; }
.rs-hero::before { content: ""; position: absolute; inset: -180px -20% auto; height: 700px; z-index: -1; pointer-events: none; background:
  radial-gradient(520px 280px at 20% 30%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 70%),
  radial-gradient(420px 260px at 85% 45%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); }
.rs-hero h1 { font-size: clamp(34px, 4.6vw, 56px); font-weight: 750; letter-spacing: -.04em; line-height: 1.05; margin: 20px 0 16px; }
.rs-hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--brand-700), var(--brand-500) 50%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rs-hero .sub { color: var(--muted); font-size: clamp(16px, 1.5vw, 18.5px); max-width: 540px; margin-bottom: 28px; }
.rs-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.rs-trust { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 26px; color: var(--muted); font-size: var(--fs-sm); }
.rs-trust span { display: inline-flex; align-items: center; gap: 6px; }
.rs-trust svg { color: var(--success); }
@media (max-width: 960px) { .rs-hero { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; text-align: center; } .rs-hero .sub { margin-left: auto; margin-right: auto; } .rs-ctas, .rs-trust { justify-content: center; } }

/* product visual: a resume "paper" with floating ATS + AI cards */
.rs-visual { position: relative; min-height: 470px; animation: rise .8s var(--ease) both .1s; }
.paper { position: absolute; inset: 0 60px 0 20px; background: #fff; color: #1f2937; border-radius: 14px; border: 1px solid var(--border); box-shadow: 0 40px 80px -30px rgba(40, 40, 120, .35), var(--shadow-md); padding: 28px 30px; font-size: 10px; line-height: 1.5; overflow: hidden; }
.paper .nm { font-size: 20px; font-weight: 750; letter-spacing: -.02em; color: #111827; }
.paper .tt { color: #4f46e5; font-weight: 600; font-size: 11px; margin-top: 2px; }
.paper .ct { color: #6b7280; margin-top: 6px; }
.paper h5 { margin: 14px 0 6px; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: #4f46e5; border-bottom: 1px solid #e5e7eb; padding-bottom: 3px; }
.paper .ln { height: 6px; border-radius: 3px; background: #e5e7eb; margin: 5px 0; }
.paper .ln.hl { background: color-mix(in srgb, #4f46e5 22%, #e5e7eb); }
.paper .row2 { display: flex; justify-content: space-between; font-weight: 650; color: #111827; font-size: 10.5px; }
.paper .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.paper .chips i { font-style: normal; background: #eef0ff; color: #4338ca; border-radius: 4px; padding: 1px 6px; font-size: 9px; font-weight: 600; }
.float { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 14px 16px; }
.float.ats { right: 0; top: 36px; width: 220px; animation: floaty 6s ease-in-out infinite; }
.float.ai { left: 0; bottom: 34px; width: 280px; animation: floaty 7s ease-in-out infinite reverse; }
@keyframes floaty { 50% { transform: translateY(-8px); } }
.float .k { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.float .chk { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-top: 6px; color: var(--text-2); }
.float .chk svg { color: var(--success); width: 14px; height: 14px; }
.float .chk.warn svg { color: var(--warning); }
.float .sugg { font-size: 12px; color: var(--text-2); margin: 8px 0 10px; line-height: 1.45; }
.float .sugg del { color: var(--faint); }
.float .sugg ins { text-decoration: none; background: var(--success-soft); color: var(--success); border-radius: 4px; padding: 0 3px; }
@media (max-width: 560px) {
  .rs-visual { min-height: 0; display: grid; gap: 12px; }
  .paper { position: relative; inset: auto; height: 380px; }
  .float, .float.ats, .float.ai { position: relative; inset: auto; width: auto; animation: none; text-align: left; }
  .rs-brand small { display: none; }
}
@media (prefers-reduced-motion: reduce) { .float { animation: none; } }

/* ATS explainer */
.ats-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
@media (max-width: 900px) { .ats-split { grid-template-columns: 1fr; } }
.ats-list { display: grid; gap: 14px; }
.ats-item { display: flex; gap: 14px; align-items: flex-start; }
.ats-item p { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.report { padding: 22px; }
.report .bars { margin-top: 16px; }
.rec { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); }
.rec svg { flex: none; margin-top: 2px; }
.rec.hi svg { color: var(--danger); } .rec.md svg { color: var(--warning); } .rec.lo svg { color: var(--info); }

/* template showcase */
.tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 960px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tpl-grid { grid-template-columns: 1fr; } }
.tpl { padding: 14px; display: grid; gap: 12px; }
.tpl-thumb { aspect-ratio: 8.5 / 7.4; background: #fff; border-radius: 10px; border: 1px solid var(--border); padding: 16px 18px; overflow: hidden; color: #1f2937; position: relative; }
.tpl-thumb .n { height: 9px; border-radius: 3px; background: #111827; width: 46%; }
.tpl-thumb .t { height: 5px; border-radius: 3px; background: var(--tacc); width: 30%; margin-top: 5px; opacity: .85; }
.tpl-thumb .c { height: 4px; border-radius: 3px; background: #cbd5e1; width: 62%; margin-top: 6px; }
.tpl-thumb .h { height: 5px; width: 26%; background: var(--tacc); border-radius: 2px; margin: 12px 0 6px; }
.tpl-thumb .r { height: 1px; background: #e5e7eb; margin: 3px 0 7px; }
.tpl-thumb .l { height: 4px; border-radius: 2px; background: #e5e7eb; margin: 4px 0; }
.tpl-thumb .l.s { width: 70%; } .tpl-thumb .l.m { width: 86%; }
.tpl-thumb .chips { display: flex; gap: 4px; flex-wrap: wrap; }
.tpl-thumb .chips i { height: 7px; width: 26px; border-radius: 3px; background: color-mix(in srgb, var(--tacc) 22%, #fff); }
/* variants */
.tpl-thumb.centered .n, .tpl-thumb.centered .t, .tpl-thumb.centered .c { margin-left: auto; margin-right: auto; }
.tpl-thumb.centered .h { width: 100%; height: 1px; background: #111827; }
.tpl-thumb.band .band { margin: -16px -18px 10px; padding: 14px 18px 12px; background: var(--tacc); }
.tpl-thumb.band .band .n { background: #fff; } .tpl-thumb.band .band .t { background: #cbd5e1; } .tpl-thumb.band .band .c { background: rgba(255,255,255,.45); }
.tpl-thumb.rule .n { width: 38%; height: 7px; } .tpl-thumb.rule .h { background: #111827; height: 1px; width: 100%; margin-top: 16px; } .tpl-thumb.rule .l { margin: 7px 0; }
.tpl-thumb.split .hdr { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid var(--tacc); padding-bottom: 8px; margin-bottom: 4px; }
.tpl-thumb.split .hdr .c { width: 90px; }
.tpl-thumb.left .hdr { border-left: 3px solid var(--tacc); padding-left: 8px; }
.tpl-thumb.mono .h { font-family: var(--mono); }
.tpl-thumb.mono .chips i { border: 1px solid var(--tacc); background: transparent; }
.tpl .meta2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tpl p { color: var(--muted); font-size: var(--fs-sm); }

/* "coming next" placeholder */
.rs-soon { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(800px 400px at 50% -100px, color-mix(in srgb, var(--primary) 12%, transparent), transparent), var(--bg); }
.rs-soon .card { max-width: 560px; text-align: center; padding: 40px 32px; display: grid; justify-items: center; gap: 14px; }
.rs-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 4px; }

/* ------------------------------------------------------------------ wizard (step 2) */
.req { color: var(--danger); }
.wz { min-height: 100vh; background: radial-gradient(1000px 420px at 50% -160px, color-mix(in srgb, var(--primary) 10%, transparent), transparent), var(--bg); }
.wz-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.save-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.save-state svg { color: var(--success); }
.wz-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; max-width: 1160px; margin: 0 auto; padding: 28px 24px 64px; align-items: start; }
.wz-rail { position: sticky; top: 84px; display: grid; gap: 2px; }
.rail-i { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 550; font-size: var(--fs-sm); text-decoration: none !important; }
.rail-i:hover { background: var(--bg-soft); }
.rail-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--muted); flex: none; }
.rail-i.cur { background: var(--primary-soft); color: var(--primary); }
.rail-i.cur .rail-ic { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.rail-i.done .rail-ic { background: var(--success-soft); border-color: transparent; color: var(--success); }
.rail-i.bad .rail-ic { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.rail-i.skip { color: var(--faint); }
.wz-main { min-width: 0; }
.wz-progress { height: 4px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.wz-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--brand-400)); transition: width .4s var(--ease); }
.wz-card { padding: 32px; animation: pageIn .3s var(--ease); }
.wz-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.wz-head h1 { margin-top: 6px; font-size: 24px; }
.wz-head p { color: var(--muted); margin-top: 6px; }
.wz-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.tipbox { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--info-soft); color: var(--text-2); font-size: var(--fs-sm); margin-bottom: 18px; }
.tipbox svg { color: var(--info); margin-top: 2px; }
@media (max-width: 900px) {
  .wz-body { grid-template-columns: 1fr; padding: 16px 12px 64px; gap: 12px; }
  .wz-rail { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .rail-i { flex: none; border: 1px solid var(--border); background: var(--surface); padding: 6px 10px; }
  .rail-i .xs { display: none; }
  .wz-card { padding: 20px 16px; }
  .wz-head { flex-direction: column; gap: 10px; }
  .wz-top { padding: 0 12px; }
}

/* repeatable items */
.items { display: grid; gap: 10px; margin-bottom: 12px; }
.item-card { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.item-card.open { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.item-card.has-err { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }
.item-card.dragging, .order-i.dragging { opacity: .45; }
.item-card.drop-over, .order-i.drop-over { box-shadow: 0 -3px 0 var(--primary); }
.item-h { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.item-toggle { display: grid; text-align: left; border: 0; background: none; padding: 4px 6px; cursor: pointer; font: inherit; color: inherit; min-width: 0; border-radius: 6px; }
.item-toggle .it { font-weight: 650; }
.item-toggle .is { font-size: var(--fs-xs); color: var(--muted); }
.item-acts { display: flex; gap: 2px; }
.drag { border: 0; background: none; color: var(--faint); cursor: grab; padding: 6px; border-radius: 6px; display: grid; place-items: center; }
.drag:hover { background: var(--bg-soft); color: var(--text-2); }
.item-b { display: none; padding: 6px 16px 18px; border-top: 1px solid var(--border); }
.item-card.open > .item-b { display: block; padding-top: 16px; }
.add-item { border-style: dashed; width: 100%; height: 44px; }
.empty-mini { display: flex; gap: 12px; align-items: center; padding: 18px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); color: var(--muted); margin-bottom: 4px; }
.empty-mini svg { color: var(--primary); }
@media (max-width: 560px) { .item-acts [data-dup] { display: none; } }

/* bullets */
.bullets { display: grid; gap: 6px; }
.bullet { display: grid; grid-template-columns: 14px 1fr auto; gap: 6px; align-items: start; }
.bullet .dotb { color: var(--faint); padding-top: 9px; text-align: center; }
.bullet textarea { resize: none; overflow: hidden; min-height: 40px; line-height: 1.45; }
.bacts { display: flex; opacity: .55; }
.bullet:hover .bacts, .bullet:focus-within .bacts { opacity: 1; }

/* start screen */
.wz-start { max-width: 1040px; margin: 0 auto; padding: 40px 20px 64px; }
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.start-opt { position: relative; text-align: left; padding: 24px; display: grid; gap: 10px; align-content: start; cursor: pointer; font: inherit; color: inherit; text-decoration: none !important; }
.start-opt p { color: var(--muted); font-size: var(--fs-sm); }
.start-opt:disabled { opacity: .6; cursor: progress; }
.drafts { margin-top: 32px; display: grid; gap: 10px; }

/* review: section order */
.order { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.order-i { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); cursor: grab; }
.order-i.off { opacity: .55; }
.wz .field { align-content: start; }
.bullets > [data-badd] { justify-self: start; }
@media (max-width: 560px) { .wz-foot > .row { flex: 1; justify-content: flex-end; } }

/* ------------------------------------------------------------------ import (step 3) */
.pipe { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pipe li { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--faint); font-weight: 600; }
.pipe-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border-strong); flex: none; background: var(--surface); }
.pipe li.cur { color: var(--primary); } .pipe li.cur .pipe-ic { border-color: var(--primary); color: var(--primary); }
.pipe li.done { color: var(--text-2); } .pipe li.done .pipe-ic { background: var(--success); border-color: var(--success); color: #fff; }
.pipe li.fail { color: var(--danger); } .pipe li.fail .pipe-ic { border-color: var(--danger); color: var(--danger); }
@media (max-width: 640px) { .pipe { grid-template-columns: 1fr 1fr; } }

.imp-body { display: grid; grid-template-columns: 210px minmax(0, 1fr) 360px; gap: 24px; max-width: 1440px; margin: 0 auto; padding: 24px 24px 64px; align-items: start; }
.imp-nav { position: sticky; top: 84px; display: grid; gap: 2px; }
.rail-i.warn .rail-ic { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.imp-main { min-width: 0; }
.imp-sec { scroll-margin-top: 80px; }
.imp-sec-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.imp-sec-h h2 { font-size: 17px; }
.imp-foot { display: flex; justify-content: space-between; margin-top: 20px; gap: 12px; flex-wrap: wrap; }
.imp-orig { position: sticky; top: 84px; }
.orig-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 10px 16px; }
.orig-text { margin: 0; padding: 12px 16px 16px; max-height: calc(100vh - 230px); overflow: auto; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: var(--text-2); border-top: 1px solid var(--border); }
.orig-text mark { background: color-mix(in srgb, var(--warning) 35%, transparent); color: inherit; border-radius: 3px; }
.orig-links { padding: 10px 16px 14px; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.orig-links summary { cursor: pointer; font-weight: 600; margin-bottom: 4px; }
.field.check .input, .bullet.check textarea { border-color: color-mix(in srgb, var(--warning) 70%, var(--border)); background: color-mix(in srgb, var(--warning) 6%, var(--surface)); }
.check-note { font-size: var(--fs-xs); color: var(--warning); display: flex; gap: 6px; align-items: flex-start; grid-column: 1 / -1; }
.bullet.check { row-gap: 4px; }
.bullet .check-note { grid-column: 2 / -1; }
@media (max-width: 1200px) { .imp-body { grid-template-columns: 190px minmax(0, 1fr); } .imp-orig { grid-column: 1 / -1; position: static; order: 3; } .orig-text { max-height: 360px; } }
@media (max-width: 900px) { .imp-body { grid-template-columns: 1fr; padding: 16px 12px 64px; } .imp-nav { position: static; display: flex; overflow-x: auto; gap: 6px; } .imp-nav .rail-i { flex: none; border: 1px solid var(--border); background: var(--surface); } .imp-orig { order: 0; } }
.badge:empty { display: none; }
@media (max-width: 560px) {
  .wz-top { gap: 6px; }
  .wz-top .brand span { display: none; }
  .wz-top .save-state .lbl { display: none; }
}

/* ------------------------------------------------------------------ improve with AI (step 4) */
.ai-btn { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: var(--primary-soft); }
.ai-btn:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.ai-row { padding: 14px 16px; display: grid; gap: 8px; transition: opacity .2s, border-color .2s; }
.ai-row.applied { border-color: color-mix(in srgb, var(--success) 50%, var(--border)); background: color-mix(in srgb, var(--success) 5%, var(--surface)); }
.ai-row.dim { opacity: .5; }
.ai-row.rejected { opacity: 0; transform: translateX(10px); transition: all .18s; }
.ai-text { margin: 0; line-height: 1.6; color: var(--text); }
.ai-diff ins { text-decoration: none; background: var(--success-soft); color: var(--success); border-radius: 3px; padding: 0 2px; }
.ai-diff del { color: var(--danger); opacity: .75; }
.ai-warn { display: grid; gap: 4px; }
.ai-warn div { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-xs); color: var(--warning); }
.ai-warn svg { flex: none; margin-top: 1px; }
.ai-acts { gap: 6px; }

/* ------------------------------------------------------------------ templates (step 6) */
.tg-wrap { max-width: 1320px; margin: 0 auto; padding: 32px 24px 64px; }
.tg-head > * { min-width: 0; }
.tg-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.tg-head select { width: 100%; }
.tg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 24px; align-items: start; }
.tg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.tg-card { text-align: left; background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; padding: 10px; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tg-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md, 0 6px 20px rgba(0,0,0,.08)); }
.tg-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.tg-thumb, .tg-preview { position: relative; overflow: hidden; border-radius: 8px; background: #e5e7eb; }
.tg-thumb iframe, .tg-preview iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #fff; }
.tg-thumb iframe { pointer-events: none; }
.tg-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.tg-card p { margin: 4px 0 0; }
.tg-side { position: sticky; top: 76px; min-width: 0; }
.tg-panel { padding: 18px; }
.tg-ctl { display: flex; gap: 18px; flex-wrap: wrap; margin: 16px 0; align-items: flex-end; }
.tg-ctl > div { display: grid; gap: 6px; }
.tg-sw { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tg-sw .sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.tg-sw .sw.on { box-shadow: 0 0 0 2px var(--primary); }
.tg-sw .custom { display: grid; place-items: center; background: var(--surface-2, #f3f4f6); position: relative; overflow: hidden; }
.tg-sw .custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tg-preview { max-height: 70vh; overflow-y: auto; }
.tg-actions { margin-top: 14px; gap: 8px; }
@media (max-width: 1100px) { .tg-grid { grid-template-columns: minmax(0, 1fr); } .tg-side { position: static; order: -1; } }
@media (max-width: 640px) { .tg-wrap { padding: 20px 12px 64px; } .tg-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* ------------------------------------------------------------------ editor (step 7) */
.ed { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.ed .wz-top { flex: none; }
.ed-title { font: inherit; font-weight: 650; font-size: var(--fs-sm); border: 1px solid transparent; background: transparent; color: var(--text); border-radius: var(--r-sm); padding: 5px 8px; min-width: 0; width: clamp(120px, 22vw, 280px); }
.ed-title:hover { border-color: var(--border); } .ed-title:focus { border-color: var(--primary); outline: none; background: var(--surface); }
.ed-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 232px minmax(360px, 1fr) minmax(380px, 1.05fr); }
.ed-nav { overflow-y: auto; overflow-x: hidden; padding: 16px 10px 32px; border-right: 1px solid var(--border); display: grid; align-content: start; gap: 2px; background: var(--surface); }
.ed-nav-h { padding: 4px 10px 6px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.ed-nav-row { display: flex; align-items: center; gap: 2px; }
.ed-nav-row .rail-i { flex: 1; min-width: 0; }
.ed-nav-row.off .rail-i { color: var(--faint); }
.ed-nav-row.off .rail-i .rail-ic { opacity: .55; }
.ed-eye { opacity: .35; flex: none; } .ed-nav-row:hover .ed-eye, .ed-eye:focus-visible, .ed-nav-row.off .ed-eye { opacity: 1; }
.ed-nav-row.off .ed-eye { color: var(--faint); }
.ed-form { overflow-y: auto; padding: 22px 24px 64px; background: var(--bg); }
.ed-card { padding: 26px; max-width: 760px; margin: 0 auto; }
.ed-card .wz-head h1 { margin-top: 0; font-size: 21px; }
.ed-prev { min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--bg-soft); }
.ed-prev-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.ed-prev-bar .choice button { padding: 3px 10px; font-size: 12px; min-height: 0; }
.ed-paper { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 0 40px; }
.ed-paper.zoomed { overflow-x: auto; }
.ed-scale { transform-origin: 0 0; box-shadow: 0 4px 24px rgba(15,23,42,.14); background: #fff; }
.ed-scale iframe { border: 0; display: block; background: #fff; }
.ed-pv-load { position: absolute; top: 10px; right: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 4px 8px; box-shadow: var(--shadow-sm); }
.ed-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ed-tpl { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.ed-tpl:hover { border-color: var(--primary); }
.ed-tpl.on { border-color: var(--primary); background: var(--primary-soft); }
.ed-tpl-sw { width: 22px; height: 6px; border-radius: 3px; margin-bottom: 4px; }
.ed-tabs { display: none; }
/* tablet: icon-only section rail */
@media (max-width: 1200px) {
  .ed-body { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr); }
  .ed-nav { padding: 12px 6px; }
  .ed-nav .nav-t, .ed-eye { display: none; }
  .ed-nav .rail-i { justify-content: center; padding: 6px; }
  .ed-form { padding: 16px; }
  .ed-card { padding: 20px; }
}
/* phone: Edit / Preview tabs, sections as a scrollable chip row */
@media (max-width: 900px) {
  .ed { height: auto; overflow: visible; }
  .ed-tabs { display: flex; position: sticky; top: 60px; z-index: 15; background: var(--surface); border-bottom: 1px solid var(--border); }
  .ed-tabs button { flex: 1; display: flex; justify-content: center; align-items: center; gap: 6px; padding: 10px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
  .ed-tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
  .ed-body { display: block; }
  .ed-body[data-mode="edit"] .ed-prev, .ed-body[data-mode="preview"] .ed-nav, .ed-body[data-mode="preview"] .ed-form { display: none; }
  .ed-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 8px 12px; gap: 6px; scrollbar-width: none; position: sticky; top: 101px; z-index: 14; }
  .ed-nav .nav-t { display: inline; } .ed-nav .ed-nav-h, .ed-nav .xs.faint { display: none; }
  .ed-nav-row { flex: none; }
  .ed-nav .rail-i { flex: none; border: 1px solid var(--border); padding: 5px 10px; }
  .ed-nav .rail-ic { width: 22px; height: 22px; }
  .ed-form { overflow: visible; padding: 12px 12px 64px; }
  .ed-card { padding: 18px 14px; }
  .ed-prev { border-left: 0; }
  #printPv { display: none; }
  .ed-paper { overflow: visible; }
  .ed-title { width: 34vw; }
}

/* ------------------------------------------------------------------ dashboard (step 8) */
.db-wrap { max-width: 1240px; margin: 0 auto; padding: 32px 24px 64px; }
.db-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.db-head > * { min-width: 0; }
.db-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.db-stat { display: flex; gap: 12px; align-items: center; padding: 14px 16px; }
.db-v { font-size: 22px; font-weight: 700; line-height: 1.1; }
.db-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.db-search { position: relative; flex: 1; min-width: 200px; display: block; }
.db-search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.db-search .input { padding-left: 36px; }
.db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.db-card { padding: 0; overflow: visible; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.db-card:hover { box-shadow: var(--shadow-md); }
.db-card.db-new, .db-ver.db-new { animation: dbNew 1.6s var(--ease); }
@keyframes dbNew { 0%, 40% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 45%, transparent); } }
.db-thumb { display: block; position: relative; aspect-ratio: 210 / 150; overflow: hidden; border-radius: var(--r-lg, 16px) var(--r-lg, 16px) 0 0; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.db-thumb iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.db-thumb::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40px; background: linear-gradient(transparent, rgba(255,255,255,.9)); }
.db-flag { position: absolute; top: 10px; left: 10px; z-index: 1; }
.db-body { padding: 14px 16px 16px; display: grid; gap: 2px; }
.db-body h3 { margin: 0; font-size: 16px; }
.ats-b { text-decoration: none !important; white-space: nowrap; flex: none; }
.db-acts { gap: 6px; margin-top: 12px; }
.db-menu { position: relative; }
.db-menu > summary { list-style: none; cursor: pointer; }
.db-menu > summary::-webkit-details-marker { display: none; }
.db-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; display: grid; }
.db-pop button { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: var(--r-sm); font: inherit; font-size: var(--fs-sm); color: var(--text); cursor: pointer; }
.db-pop button:hover, .db-pop button:focus-visible { background: var(--bg-soft); }
.db-pop button:disabled { opacity: .6; cursor: default; }
.db-pop .danger { color: var(--danger); }
.db-sep { height: 1px; background: var(--border); margin: 4px 0; }
.db-vers { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.db-vers-t { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px; border: 0; background: none; font: inherit; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; border-radius: var(--r-sm); }
.db-vers-t:hover { background: var(--bg-soft); }
.db-vers-t[aria-expanded="true"] .i:last-child { transform: rotate(180deg); }
.db-vers ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.db-ver { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; border: 1px solid var(--border); border-radius: var(--r-md); }
.db-ver-t { display: block; font-weight: 600; font-size: var(--fs-sm); color: var(--text); }
.db-ver .db-pop { min-width: 220px; }
.db-empty { text-align: center; padding: 48px 24px; display: grid; justify-items: center; gap: 10px; }
.db-pv { max-height: 72vh; overflow-y: auto; overflow-x: hidden; background: var(--bg-soft); border-radius: var(--r-md); }
@media (max-width: 900px) { .db-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .db-wrap { padding: 20px 12px 64px; } .db-grid { grid-template-columns: minmax(0, 1fr); } .db-stat { padding: 12px; } .db-v { font-size: 18px; } }
.db-card, .db-body, .db-grid > * { min-width: 0; }
.db-acts { display: flex; flex-wrap: wrap; }
.db-acts .btn { flex: 1 1 auto; justify-content: center; }
.db-acts .db-menu { flex: 1 1 auto; } .db-acts .db-menu > summary { width: 100%; justify-content: center; }
.db-ver { flex-wrap: wrap; }
.db-ver > .grow { flex: 1 1 140px; }
@media (max-width: 640px) { .db-bar > select { flex: 1; } .db-head .row { width: 100%; } .db-head .row .btn { flex: 1; justify-content: center; } }
.db-body { grid-template-columns: minmax(0, 1fr); }

/* ================================================================ Resume Studio: responsive scale (15" laptops to 24" monitors)
   Design only. The page containers grow with the viewport instead of stopping at ~1200px, so a 24" screen isn't a
   narrow column in the middle; 15" laptops keep their current widths. */
.rs-hero { max-width: clamp(1180px, 74vw, 1440px); gap: clamp(40px, 3.6vw, 80px); }
.rs-hero h1 { font-size: clamp(40px, 2.4vw + 6px, 60px); line-height: 1.05; }
.ats-wrap, .db-wrap { max-width: clamp(1240px, 78vw, 1520px); }
.tg-wrap { max-width: clamp(1320px, 82vw, 1600px); }
.wz-body { max-width: clamp(1160px, 72vw, 1400px); }
@media (min-width: 901px) { .wz-body { grid-template-columns: clamp(240px, 14vw, 280px) minmax(0, 1fr); gap: clamp(24px, 1.8vw, 36px); } } /* phones keep their rules above */
.wz-start { max-width: clamp(1040px, 66vw, 1280px); }
.imp-body { max-width: clamp(1440px, 90vw, 1760px); }
