/* QuillResume editor layout */
body.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; font-size: 15px; background: var(--bg); }
.app .site-h { position: static; flex: none; }
.app .site-h .wrap { max-width: none; }
.appbar { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.doc-tabs { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.doc-tabs a { padding: 6px 12px; border-radius: 7px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.doc-tabs a[aria-current="page"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.tb { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: 500 14px var(--font); color: var(--ink-2); cursor: pointer; }
.tb:hover { background: var(--bg); color: var(--ink); }
.appbar .spacer { flex: 1; }
#save-status { font-size: 13px; color: var(--ok); }
.btn-pdf { padding: 9px 16px; font-size: 15px; }

.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(340px, 460px) 1fr; }
.editor { overflow-y: auto; background: #fff; border-right: 1px solid var(--line); padding: 14px 16px 60px; }
.editor .intro { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }

/* form */
details.sec { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; }
details.sec > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.sec[open] > summary::before { transform: rotate(90deg); }
.sec-title { flex: 1; }
.sec-ctl { display: flex; gap: 4px; }
.sec-ctl button, .item-head button { border: 1px solid var(--line); background: #fff; border-radius: 6px; font: 500 12px var(--font); padding: 3px 7px; cursor: pointer; color: var(--ink-2); }
.sec-ctl button:disabled, .item-head button:disabled { opacity: .35; cursor: default; }
.sec-ctl button.off { background: #fdecec; border-color: #f3c2c2; color: #a33; }
.sec-body { padding: 0 14px 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f-wide { grid-column: 1 / -1; }
.f span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.f input, .f textarea { width: 100%; border: 1px solid #cfd5e1; border-radius: 7px; padding: 8px 10px; font: 15px/1.4 var(--font); color: var(--ink); background: #fff; }
.f textarea { resize: vertical; min-height: 84px; }
.f input::placeholder, .f textarea::placeholder { color: #a7afbf; }
.f input:focus, .f textarea:focus { outline: 2px solid #f6b88f; border-color: var(--brand); }
.f-rename { margin-top: 12px; }
.f-rename input { font-size: 13px; padding: 5px 8px; }
.item { border: 1px dashed #d4d9e4; border-radius: 9px; padding: 10px; margin-bottom: 10px; background: #fcfcfe; }
.item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; font-size: 14px; }
.item-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-head span { display: flex; gap: 4px; flex: none; }
.btn-add { width: 100%; border: 1px dashed var(--brand); background: #fff7f1; color: var(--brand-d); border-radius: 8px; padding: 9px; font: 600 14px var(--font); cursor: pointer; margin-top: 4px; }
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* preview */
.preview { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ptools { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.ptools label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.ptools select { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font: 13px var(--font); }
#tpl-list { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.tpl-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 11px; font: 500 13px var(--font); cursor: pointer; color: var(--ink-2); }
.tpl-chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
#swatches { display: flex; gap: 4px; }
#swatches button { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
#accent { width: 28px; height: 24px; border: 1px solid var(--line); border-radius: 6px; padding: 0; background: #fff; cursor: pointer; }
.pill { font-size: 12px; font-weight: 600; background: #e7f5ef; color: var(--ok); padding: 2px 9px; border-radius: 999px; }
.pill.warn { background: #fff1e0; color: #a85a00; }
#preview-scroll { flex: 1; overflow: auto; padding: 16px; position: relative; }
#sheets { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; margin: 0 auto; }
.sheet-label { font-size: 12px; font-weight: 700; color: var(--ink-2); margin: 0 0 6px 2px; }
.sheet { position: relative; overflow: hidden; background: #fff; box-shadow: 0 4px 24px rgba(20,33,61,0.15); }
.sheet-in { position: absolute; top: 0; left: 0; transform-origin: top left; }
.sheet-clip { position: absolute; left: 0; right: 0; overflow: hidden; }
.sheet-clip .page { position: absolute; top: 0; left: 0; }
#page-host { position: absolute; top: 0; left: -20000px; visibility: hidden; pointer-events: none; }

.mobile-tabs { display: none; }
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
  .mobile-tabs { display: flex; gap: 4px; }
  body[data-show="edit"] .preview, body:not([data-show]) .preview { display: none; }
  body[data-show="preview"] .editor { display: none; }
  .editor { border-right: 0; }
  .appbar .tb-lg { display: none; }
  .grid { grid-template-columns: 1fr; }
}

dialog#pdf-tip { border: 0; border-radius: 14px; padding: 24px; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
dialog#pdf-tip::backdrop { background: rgba(20,33,61,0.45); }
dialog#pdf-tip h3 { margin: 0 0 8px; }
dialog#pdf-tip ol { padding-left: 20px; margin: 8px 0 16px; color: var(--ink-2); }
dialog#pdf-tip li { margin: 4px 0; }

/* print: only the page */
@media print {
  html, body.app { height: auto !important; overflow: visible !important; background: #fff !important; display: block !important; }
  body.app > *:not(.workspace), .editor, .ptools, #sheets, dialog { display: none !important; }
  .workspace, .preview, #preview-scroll, #page-host { display: block !important; overflow: visible !important; padding: 0 !important; margin: 0 !important; width: auto !important; height: auto !important; }
  #page-host { position: static !important; visibility: visible !important; left: auto !important; }
  body[data-show="edit"] .preview { display: block !important; }
  #page-host .page { box-shadow: none !important; }
}
