/* CV Builder v2 - self-contained styles (prefix b2-) */
.b2-page { background: var(--background, #f6f5f2); }
.b2-toolbar { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: #1d1d20; color: #fff; position: sticky; top: 0; z-index: 30; }
.b2-back { color: #fff; width: 36px; height: 36px; border: 1px solid #55555c; border-radius: 50%; display: grid; place-items: center; text-decoration: none; flex: 0 0 auto; }
.b2-title { flex: 1; font-weight: 700; text-align: center; font-family: var(--font-heading, inherit); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b2-cloud { opacity: .7; margin-left: .25rem; }
.b2-actions { display: flex; gap: .4rem; flex: 0 0 auto; }
.b2-status { margin: .5rem 1rem 0; padding: .6rem .9rem; border-radius: 10px; font-size: .9rem; }
.b2-status.ok { background: #e7f6ec; color: #17603a; } .b2-status.err { background: #fde8e8; color: #9b1c1c; } .b2-status.info { background: #e8f0fe; color: #1a4fa0; }

.b2-shell { display: grid; grid-template-columns: minmax(380px, 460px) 1fr; gap: 1.25rem; padding: 1rem; max-width: 1500px; margin: 0 auto; align-items: start; }
.b2-left { background: var(--surface, #fff); border: 1px solid var(--border, #e9e6f2); border-radius: 16px; padding: 1rem; max-height: calc(100vh - 110px); overflow-y: auto; }
.b2-right { position: sticky; top: 70px; }
.b2-preview { background: #e7e5f0; border-radius: 16px; padding: 1.25rem; max-height: calc(100vh - 110px); overflow: auto; }
.b2-preview .cv-page { box-shadow: 0 10px 30px rgba(0,0,0,.18); margin: 0 auto; }

.b2-tabs { display: flex; gap: .4rem; margin: 0 0 1rem; padding: 0; list-style: none; border-bottom: 1px solid var(--border, #e9e6f2); }
.b2-tabs .nav-link { border: 0; background: none; font-weight: 700; color: var(--muted, #837e93); padding: .55rem .9rem; border-bottom: 3px solid transparent; }
.b2-tabs .nav-link.active { color: var(--primary, #5b4fe0); border-bottom-color: var(--primary, #5b4fe0); }

.b2-card { border: 1px solid var(--border, #e9e6f2); border-radius: 14px; padding: 1rem; margin-bottom: 1rem; background: #fff; }
.b2-card h3 { font-size: 1.1rem; font-weight: 800; margin: 0 0 .8rem; }
.b2-field { margin-bottom: .7rem; }
.b2-field label { display: block; font-size: .8rem; font-weight: 600; color: #4b4860; margin-bottom: .25rem; }
.b2-field label .req { color: #d63a3a; }
.b2-input, .b2-field input[type=text], .b2-field input[type=email], .b2-field input[type=tel], .b2-field input[type=date], .b2-field input[type=month], .b2-field input[type=number], .b2-field select, .b2-field textarea {
  width: 100%; border: 1px solid transparent; background: #f4f4f6; border-radius: 8px; padding: .6rem .75rem; font-size: .95rem; outline: none; }
.b2-field input:focus, .b2-field select:focus, .b2-field textarea:focus { border-color: #4a7bd8; background: #eaf2ff; }
.b2-field.invalid input { border-color: #d63a3a; background: #fff3f3; }
.b2-field textarea { min-height: 90px; resize: vertical; }
.b2-hint { font-size: .75rem; color: var(--muted, #837e93); margin-top: .2rem; }
.b2-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.b2-photo { width: 84px; height: 84px; border-radius: 12px; background: #f1f1f4; border: 1px dashed #c9c9d3; display: grid; place-items: center; color: #8a8a99; font-size: 1.6rem; cursor: pointer; overflow: hidden; position: relative; }
.b2-photo img { width: 100%; height: 100%; object-fit: cover; }
.b2-photo-row { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.b2-photo-row button { font-size: .8rem; }

.b2-pills { display: flex; flex-wrap: wrap; gap: .45rem; }
.b2-pill { border: 1px solid #b9b9c4; background: #fff; border-radius: 999px; padding: .35rem .85rem; font-size: .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; color: #2b2940; }
.b2-pill:hover { border-color: var(--primary, #5b4fe0); color: var(--primary, #5b4fe0); }
.b2-addbar { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border, #e9e6f2); }
.b2-addlabel { font-size: .8rem; font-weight: 700; color: var(--muted, #837e93); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .5rem; }

.b2-sec { border-bottom: 1px solid var(--border, #e9e6f2); padding: .9rem 0; background: #fff; }
.b2-sec.hidden-sec .b2-sec-title { opacity: .45; }
.b2-sec-head { display: flex; align-items: center; gap: .45rem; }
.b2-handle { cursor: grab; color: #9a9aa8; padding: .35rem .45rem; touch-action: none; user-select: none; font-size: 1.15rem; line-height: 1; }
.b2-handle:active { cursor: grabbing; }
.b2-sec-title { flex: 1; font-size: 1.15rem; font-weight: 800; border: 0; background: transparent; padding: .2rem .3rem; border-radius: 6px; min-width: 0; font-family: var(--font-heading, inherit); }
.b2-sec-title:focus { background: #eaf2ff; outline: none; }
.b2-ibtn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #c9c9d3; background: #fff; display: grid; place-items: center; cursor: pointer; color: #333; flex: 0 0 auto; }
.b2-ibtn:hover { border-color: var(--primary, #5b4fe0); color: var(--primary, #5b4fe0); }
.b2-ibtn.danger:hover { border-color: #d63a3a; color: #d63a3a; }
.b2-sec-body { margin-top: .8rem; }
.b2-sec.collapsed .b2-sec-body { display: none; }

.b2-item { border: 1px solid var(--border, #e3e1ee); border-radius: 12px; margin-bottom: .6rem; background: #fff; }
.b2-item-head { display: flex; align-items: center; gap: .4rem; padding: .45rem .55rem; cursor: pointer; }
.b2-item-sum { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.b2-item-sum small { color: var(--muted, #837e93); font-weight: 400; }
.b2-item-sum.empty { color: #9a9aa8; font-weight: 400; font-style: italic; }
.b2-item-body { padding: .3rem .9rem .9rem; display: none; }
.b2-item.open .b2-item-body { display: block; }
.b2-item-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .4rem; }
.b2-done { border: 0; background: var(--primary, #5b4fe0); color: #fff; border-radius: 999px; padding: .4rem 1.1rem; font-weight: 600; }
.b2-chiprow { display: flex; align-items: center; gap: .4rem; margin-bottom: .45rem; }
.b2-chiprow input[type=text] { flex: 1; min-width: 0; border: 1px solid transparent; background: #f4f4f6; border-radius: 8px; padding: .5rem .65rem; }
.b2-chiprow select { flex: 0 0 120px; border: 1px solid transparent; background: #f4f4f6; border-radius: 8px; padding: .5rem .4rem; }
.b2-chiprow input:focus, .b2-chiprow select:focus { border-color: #4a7bd8; background: #eaf2ff; outline: none; }
.b2-addrow { margin-top: .4rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.b2-extra { display: flex; gap: .4rem; align-items: flex-end; margin-bottom: .6rem; }
.b2-extra .b2-field { flex: 1; margin: 0; }

.b2-tplgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.b2-tpl { border: 2px solid var(--border, #e3e1ee); border-radius: 12px; overflow: hidden; background: #fff; cursor: pointer; text-align: center; padding: 0; }
.b2-tpl.active { border-color: var(--primary, #5b4fe0); box-shadow: 0 0 0 3px var(--primary-light, #efedfc); }
.b2-tpl .th { aspect-ratio: 210 / 297; background: #f1f1f4 center top / cover no-repeat; display: grid; place-items: center; color: #9a9aa8; font-size: 2rem; }
.b2-tpl .nm { font-size: .85rem; font-weight: 700; padding: .4rem; }
.b2-swatches { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.2rem; }
.b2-swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #c9c9d3; cursor: pointer; }
.b2-swatch.active { box-shadow: 0 0 0 3px var(--primary, #5b4fe0); }
.b2-range label { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; }
.b2-range input[type=range] { width: 100%; }
.b2-sub { font-size: .8rem; font-weight: 700; color: var(--muted, #837e93); text-transform: uppercase; letter-spacing: .06em; margin: 1rem 0 .5rem; }

.b2-fab { display: none; position: fixed; right: 16px; bottom: 18px; z-index: 40; border: 0; background: var(--primary, #5b4fe0); color: #fff; border-radius: 999px; padding: .85rem 1.2rem; font-weight: 700; box-shadow: 0 10px 25px rgba(0,0,0,.25); }
.dragging-ghost, .sortable-ghost { opacity: .4; }

/* layout switch (navigation only - not part of the CV, so the CV itself has no media queries) */
@media (max-width: 991px) {
  .b2-shell { display: block; padding: .6rem; }
  .b2-left, .b2-preview { max-height: none; }
  .b2-right { display: none; position: static; }
  .b2-shell.b2-show-preview .b2-left { display: none; }
  .b2-shell.b2-show-preview .b2-right { display: block; }
  .b2-fab { display: inline-flex; gap: .4rem; align-items: center; }
  .b2-preview { padding: .5rem; }
}

/* AI suggestions */
.b2-ai-btn{border:1px dashed #8b5cf6;color:#6d28d9;background:#f5f3ff;border-radius:999px;padding:.25rem .75rem;font-size:.82rem;margin-top:.4rem;cursor:pointer}
.b2-ai-btn:hover{background:#ede9fe}.b2-ai-btn.busy{opacity:.6;pointer-events:none}
.b2-ai-box{margin-top:.5rem}.b2-ai-msg{font-size:.85rem;color:#555}.b2-ai-msg.err{color:#b91c1c}
.b2-ai-opt{border:1px solid #e5e7eb;border-radius:10px;padding:.55rem .7rem;margin-bottom:.45rem;background:#fff;display:flex;gap:.6rem;align-items:flex-start;justify-content:space-between}
.b2-ai-opt .txt{font-size:.88rem;flex:1}
