/* app.css: the CV builder. Editor on the left on white; the page on a grey desk on the right. */
.app-body { background: var(--desk); }
.bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 20px; height: 60px; padding: 0 20px; background: var(--paper); border-bottom: 1px solid var(--line); }
.mark { position: relative; display: inline-flex; align-items: center; text-decoration: none; font: 700 21px/1 var(--display); letter-spacing: -0.03em; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 15px; color: var(--ink-2); }
.tabs a:hover { background: var(--desk); }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--desk); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.saved { font-size: 13px; color: var(--muted); }
.saved::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--go); margin-right: 7px; vertical-align: 1px; }

.example-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 20px; background: var(--hi-soft); border-bottom: 1px solid #F1E2A0; font-size: 15px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.work { display: grid; grid-template-columns: minmax(380px, 520px) minmax(0, 1fr); min-height: calc(100vh - 60px); }
.editor { background: var(--paper); border-right: 1px solid var(--line); padding: 22px 22px 80px; overflow: auto; }
.ed-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.ed-head h1 { font-size: 30px; }

.card { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 14px 16px; margin: 0 0 12px; background: var(--paper); }
fieldset.card { min-width: 0; }
.card legend, .blk-title { font: 700 13px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 4px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.f { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; min-width: 0; }
.f > span { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.f small { font-weight: 400; color: var(--muted); }
.f input, .f textarea, .f select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 7px; background: var(--paper); font-size: 15px; line-height: 1.4; }
.f textarea { resize: vertical; min-height: 64px; }
.f input:focus, .f textarea:focus, .f select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18, 26, 47, .08); }
.f input[aria-invalid="true"], .f textarea[aria-invalid="true"] { border-color: var(--pen); }

.blk { border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 12px; background: var(--paper); }
.blk-head { display: flex; align-items: center; gap: 6px; padding: 10px 8px 10px 14px; border-bottom: 1px solid var(--line); }
.blk-head .blk-name { flex: 1; min-width: 0; border: 0; padding: 4px 0; font: 700 17px/1.2 var(--display); letter-spacing: -0.01em; background: transparent; }
.blk-head .blk-name:focus { outline: none; box-shadow: 0 2px 0 var(--ink); }
.icon { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.icon:hover { background: var(--desk); color: var(--ink); }
.icon svg { width: 16px; height: 16px; }
.icon[disabled] { opacity: .3; cursor: default; background: transparent; }
.items { padding: 4px 14px 14px; }
.item { position: relative; padding: 12px 0 2px; border-top: 1px dashed var(--line); }
.item:first-child { border-top: 0; }
.item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: -4px; }
.item-n { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.item-tools { display: flex; gap: 0; margin-right: -6px; }
.item.unconfirmed { margin: 6px -8px; padding: 14px 8px 8px; border-radius: 8px; border: 1.5px solid #EED36A; background: var(--hi-soft); }
.confirm-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.chk { display: inline-block; padding: 1px 8px; border-radius: 4px; background: var(--hi); color: var(--hi-ink); font-size: 12.5px; font-weight: 700; }
.bullets .bullet { display: grid; grid-template-columns: 1fr 32px; gap: 4px; align-items: start; margin-top: 6px; }
.add-line { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.add-block { margin-top: 18px; padding: 14px; border: 1.5px dashed var(--line); border-radius: var(--r); }
.add-block > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }

.desk { position: relative; padding: 18px 24px 60px; min-width: 0; overflow: auto; }
.desk-tools { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 0 12px; background: linear-gradient(var(--desk) 85%, transparent); }
.fit { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; min-width: 0; }
.fit-label { font-size: 14px; font-weight: 700; white-space: nowrap; }
.fit-track { flex: 1; height: 8px; border-radius: 99px; background: var(--desk-2); overflow: hidden; max-width: 220px; }
.fit-track i { display: block; height: 100%; width: 50%; border-radius: inherit; background: var(--ink); transition: width .25s ease, background .25s; }
.fit.over .fit-label { color: var(--pen); }
.fit.over .fit-track i { background: var(--pen); }
.dl { position: relative; display: flex; gap: 4px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; padding: 6px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--paper); box-shadow: 4px 4px 0 var(--ink); z-index: 20; }
.menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 6px; background: none; font-size: 15px; cursor: pointer; }
.menu button:hover { background: var(--desk); }
.menu .danger { color: var(--pen); }
.issues { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--r); background: var(--paper); border: 1.5px solid var(--pen); max-width: 794px; }
.issues ul { margin: 0; padding-left: 18px; font-size: 15px; }
.issues li { margin: 3px 0; }
.issues li b { color: var(--pen); }
.issues .ok { color: var(--go); font-weight: 700; }

/* The page: A4 at 96dpi is 794 x 1123 px. Scaled to fit the desk. */
.sheet-wrap { transform-origin: top left; width: 794px; }
.sheet { width: 794px; min-height: 1123px; padding: 34px 49px 29px; background: #fff; box-shadow: var(--shadow-sheet); font: 12.8px/1.18 var(--cv); color: #1C1E26; position: relative; }
.sheet .page-line { position: absolute; left: 0; right: 0; top: 1123px; border-top: 2px dashed var(--pen); }
.sheet .page-line span { position: absolute; right: 8px; top: 4px; font: 700 11px var(--body); color: var(--pen); background: #fff; padding: 0 4px; }
.cv-name { font-size: 25px; font-weight: 700; margin: 0 0 3px; }
.cv-head { font-size: 16px; color: var(--navy); margin: 0 0 4px; }
.cv-contact { font-size: 11.3px; color: #5A6070; margin: 0 0 4px; }
.cv-h { font-size: 12px; font-weight: 700; color: var(--navy); letter-spacing: .08em; text-transform: uppercase; margin: 10px 0 1px; padding-bottom: 3px; border-bottom: 0.8px solid #C9CDD6; }
.cv-job { display: flex; justify-content: space-between; gap: 12px; margin: 4px 0 1px; }
.cv-job .w { font-size: 11.3px; color: #5A6070; white-space: nowrap; }
.sheet ul { margin: 0 0 4px; padding-left: 14px; }
.sheet li { margin: 0; }
.sheet li::marker { color: var(--navy); }
.cv-p { margin: 0 0 2px; }
.sheet .pending { background: var(--hi-soft); outline: 1px dashed #D8B400; color: #6B5B12; }
.sheet .placeholder { color: #A6ACB9; }

.preview-toggle { display: none; }

.dlg { border: 1.5px solid var(--ink); border-radius: 14px; padding: 24px; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 24px); box-shadow: 6px 6px 0 var(--ink); }
.dlg::backdrop { background: rgba(18, 26, 47, .35); }
.dlg h2 { font-size: 26px; margin-bottom: 8px; }
.dlg-sub { color: var(--ink-2); font-size: 15.5px; }
.dlg-actions { display: flex; gap: 8px; margin-top: 18px; }
.hint { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.chkbox { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 14.5px; }
.chkbox input { width: 18px; height: 18px; accent-color: var(--ink); }
.err { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--pen-soft); color: #7D1F12; font-size: 14.5px; }
.missing { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--hi-soft); font-size: 14.5px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 16px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 8px; font-weight: 700; font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 99; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .work { grid-template-columns: 1fr; }
  .editor { border-right: 0; padding: 16px 16px 90px; }
  .desk { display: none; padding: 12px 12px 90px; }
  .work.show-preview .editor { display: none; }
  .work.show-preview .desk { display: block; }
  .preview-toggle { display: inline-flex; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40; box-shadow: 3px 3px 0 var(--hi); }
  .tabs a:not([aria-current]) { display: none; }
  .saved { display: none; }
}
@media (max-width: 520px) { .g2, .g3 { grid-template-columns: 1fr; } .bar { padding: 0 14px; gap: 10px; } .ed-head { flex-wrap: wrap; } }
