/* R026: reserve the native preview scrollbar outside the fixed 820px paper. */
@media (min-width:1281px) {
  body:has(#page-resume.active) #page-resume .preview-area {
    box-sizing: border-box;
    width: calc(100% + 17px);
    max-width: none;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body:has(#page-resume.active) #page-resume .resume-canvas-wrap {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

/* Tpl1's source band starts at the contact grid's content edge; its portrait
   is centered in the final 120px track, matching the source's 10px inset. */
#resume-paper.layout-tpl1 .resume-contact::before {
  left: 0 !important;
}

#resume-paper.layout-tpl1 .resume-photo {
  justify-self: center !important;
}


/* R027: custom theme values apply only to the editor paper, leaving neutral
   text and intentionally gray surfaces unchanged. */
#resume-paper.has-custom-theme.layout-tpl1 .resume-contact::before{
  background:color-mix(in srgb,var(--theme) 20%,white)!important;
}
#resume-paper.has-custom-theme.layout-tpl1 .resume-title{color:var(--theme)!important}
#resume-paper.has-custom-theme.layout-tpl1 .tpl1-module-heading,
#resume-paper.has-custom-theme.layout-tpl1 .tpl1-module-fill{background:#eee!important}
#resume-paper.has-custom-theme.layout-tpl1 .tpl1-module-title{
  display:inline-block!important;width:auto!important;min-width:0!important;
  background:var(--theme)!important;color:#fff!important;
}
#resume-paper.has-custom-theme.layout-tpl2 .resume-section h3{border-bottom-color:var(--theme)!important}
#resume-paper.has-custom-theme.layout-tpl3 .resume-contact::before,
#resume-paper.has-custom-theme.layout-tpl3 .resume-section h3 span,
#resume-paper.has-custom-theme.layout-tpl3 .resume-section h3::after{background-color:var(--theme)!important}
#resume-paper.has-custom-theme.layout-tpl4 .resume-sidebar-intent h3,
#resume-paper.has-custom-theme.layout-tpl4 .resume-sidebar-intro h3{
  border-bottom-color:var(--theme)!important;color:var(--theme)!important;
}
#resume-paper.has-custom-theme.layout-tpl4 .resume-section h3{background:var(--theme)!important}
#resume-paper.has-custom-theme.layout-tpl4 .resume-section h3 span::before{
  border-top-color:color-mix(in srgb,var(--theme) 80%,black)!important;
}
#resume-paper.has-custom-theme.layout-tpl5 .resume-title-hex{color:var(--theme)!important}
#resume-paper.has-custom-theme.layout-tpl5 .resume-title-hex::before{background:var(--theme)!important}
#resume-paper.has-custom-theme.layout-tpl5 .resume-title-hex::after{background:#fff!important}
#resume-paper.has-custom-theme.layout-tpl5 .resume-title-hex>span{
  border-color:var(--theme)!important;background:transparent!important;
}
#resume-paper.has-custom-theme.layout-tpl5 .resume-title::after,
#resume-paper.has-custom-theme.layout-tpl5 .resume-contact::after,
#resume-paper.has-custom-theme.layout-tpl5 .resume-section h3::after{background:var(--theme)!important}
#resume-paper.has-custom-theme.layout-tpl5 .resume-section h3 span,
#resume-paper.has-custom-theme.layout-tpl5 .tpl5-module-label{background:var(--theme)!important}
#resume-paper.has-custom-theme.layout-tpl5 .tpl5-module-label::after{
  border:0!important;
  background:var(--theme)!important;
}
#resume-paper.has-custom-theme.layout-tpl6 .resume-section h3{
  border-bottom-color:var(--theme)!important;color:var(--theme)!important;
}
#resume-paper.has-custom-theme.layout-tpl7 .resume-title::after,
#resume-paper.has-custom-theme.layout-tpl7 .resume-contact::before,
#resume-paper.has-custom-theme.layout-tpl7 .resume-contact::after,
#resume-paper.has-custom-theme.layout-tpl7 .resume-section h3 span,
#resume-paper.has-custom-theme.layout-tpl7 .resume-section h3::after{background-color:var(--theme)!important}
#resume-paper.has-custom-theme.layout-tpl8 .resume-section h3{
  border-left-color:var(--theme)!important;background:#eee!important;color:#111!important;
}
#resume-paper.has-custom-theme.layout-tpl8 .resume-title{
  background:color-mix(in srgb,var(--theme) 80%,black)!important;
}
#resume-paper.has-custom-theme.layout-tpl9 .resume-contact{background:var(--theme)!important}
#resume-paper.has-custom-theme.layout-tpl10 .resume-section h3{
  border-left-color:var(--theme)!important;
  background:linear-gradient(90deg,var(--theme) 0 16%,var(--theme-light) 16%)!important;
  color:#fff!important;
}
#resume-paper.has-custom-theme.layout-tpl10 .resume-section h3 span{
  background:var(--theme)!important;color:#fff!important;
}

/* R032: keep custom green on the source template's own surfaces.  Tpl1 uses
   a pale full-width band with dark text; its section labels are not pills. */
#resume-paper.has-custom-theme.layout-tpl1 .tpl1-module-heading,
#resume-paper.has-custom-theme.layout-tpl1 .tpl1-module-fill{
  background:var(--theme-light)!important;
  border-color:color-mix(in srgb,var(--theme) 28%,white)!important;
}
#resume-paper.has-custom-theme.layout-tpl1 .tpl1-module-title{
  display:inline-block!important;
  width:auto!important;
  min-width:0!important;
  flex:none!important;
  background:transparent!important;
  color:rgba(0,0,0,.88)!important;
}
#resume-paper.has-custom-theme.layout-tpl1 .resume-title{
  color:var(--theme)!important;
}

/* The source tpl7 ribbon sits on the white paper; keep a legacy overlapping
   divider from showing through the otherwise transparent heading row. */
#resume-paper.has-custom-theme.layout-tpl7 .resume-section .tpl7-module-heading{
  background-color:#fff!important;
}

/* Tpl4's heading is a compact green ribbon on a transparent full-width row.
   The detached fixed-blue triangle was a legacy bevel and is not in the source. */
#resume-paper.has-custom-theme.layout-tpl4 .resume-section h3{
  background:transparent!important;
}
#resume-paper.has-custom-theme.layout-tpl4 .resume-section h3 span{
  background:var(--theme)!important;
  color:#fff!important;
}
#resume-paper.has-custom-theme.layout-tpl4 .resume-section h3::before,
#resume-paper.has-custom-theme.layout-tpl4 .resume-section h3 span::before{
  content:none!important;
  display:none!important;
  background:var(--theme)!important;
  border-color:var(--theme)!important;
}

/* Tpl8 keeps a white title area and gray band, while its label and left rule
   inherit the chosen theme.  Only the label receives white lettering. */
#resume-paper.has-custom-theme.layout-tpl8 .resume-title{
  background:transparent!important;
  color:var(--theme)!important;
}
#resume-paper.has-custom-theme.layout-tpl8 .resume-section h3{
  border-left-color:var(--theme)!important;
  background:#eee!important;
  color:#111!important;
}
#page-resume #resume-paper.has-custom-theme.layout-tpl8 .resume-section h3 span{
  background:var(--theme)!important;
  color:#fff!important;
}

/* R028: undo R024's shared filename outline. The label and value keep their
   own visible edges, with the value's left edge supplying the single seam. */
@media (min-width:1281px){
  #page-resume .toolbar-left .filename{
    box-sizing:border-box!important;
    width:360px!important;
    height:32px!important;
    flex:0 0 360px!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    overflow:visible!important;
  }
  #page-resume .toolbar-left .filename>span{
    box-sizing:border-box!important;
    width:74px!important;
    height:32px!important;
    flex:0 0 74px!important;
    margin:0!important;
    padding:0!important;
    justify-content:center!important;
    border:1px solid #d9e0e9!important;
    border-right:0!important;
    border-radius:8px 0 0 8px!important;
    white-space:nowrap!important;
  }
  #page-resume .toolbar-left .filename>input{
    box-sizing:border-box!important;
    width:287px!important;
    min-width:287px!important;
    height:32px!important;
    flex:0 0 287px!important;
    margin:-1px 0!important;
    margin-left:-1px!important;
    border:1px solid #d9e0e9!important;
    border-radius:0 8px 8px 0!important;
    outline:0!important;
  }
}

/* R029: restore the source title and heading node trees for templates 3/6,
   and correct only the measured local section spacing for templates 1/4/5/7. */
#resume-paper.layout-tpl3 .tpl3-title-wrap{
  display:block!important;position:relative!important;box-sizing:border-box!important;
  width:100%!important;height:66px!important;min-height:66px!important;
  margin:0 0 20px!important;padding:0!important;border:0!important;border-radius:0!important;
  overflow:visible!important;background:transparent!important;color:inherit!important;
  font-size:14px!important;font-weight:400!important;line-height:normal!important;
  letter-spacing:0!important;text-align:left!important;
}
#resume-paper.layout-tpl3 .tpl3-title-decoration{
  position:absolute!important;z-index:1!important;left:-20px!important;top:0!important;
  width:220px!important;height:66px!important;border-radius:0 66px 66px 0!important;
  background:var(--theme)!important;
}
#resume-paper.layout-tpl3 .tpl3-title-text{
  position:relative!important;z-index:2!important;box-sizing:border-box!important;
  width:100%!important;height:66px!important;padding-left:20px!important;
  color:#fff!important;font-size:32px!important;font-weight:400!important;
  line-height:66px!important;text-align:left!important;letter-spacing:0!important;
}
#resume-paper.layout-tpl3 .resume-section>.tpl3-module-heading{
  display:block!important;position:relative!important;box-sizing:border-box!important;
  width:100%!important;height:32px!important;min-height:32px!important;margin:0!important;
  padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;
  color:inherit!important;font-size:16px!important;font-weight:700!important;line-height:32px!important;
}
#resume-paper.layout-tpl3 .tpl3-module-label{
  display:inline-block!important;position:relative!important;z-index:2!important;
  box-sizing:content-box!important;padding:0 25px!important;transform:translateX(-15px)!important;
  border-radius:32px!important;background:var(--theme)!important;color:#fff!important;
  font-size:16px!important;font-weight:700!important;line-height:32px!important;white-space:nowrap!important;
}
#resume-paper.layout-tpl3 .tpl3-module-rule{
  position:absolute!important;z-index:1!important;top:50%!important;left:0!important;right:0!important;
  height:1px!important;transform:translateY(-50%)!important;background:var(--theme)!important;
}
#resume-paper.layout-tpl6 .resume-section>.tpl6-module-heading{
  display:block!important;position:relative!important;box-sizing:content-box!important;
  width:100%!important;height:auto!important;min-height:0!important;margin:0!important;
  padding:0 0 5px!important;border:0!important;border-bottom:1px solid var(--theme)!important;
  border-radius:0!important;background:transparent!important;color:inherit!important;
  font-size:16px!important;font-weight:700!important;line-height:28px!important;text-align:left!important;
}
#resume-paper.layout-tpl6 .tpl6-module-label{
  display:inline-block!important;position:static!important;margin:0!important;padding:0!important;
  border:0!important;background:transparent!important;color:var(--theme)!important;
  font-size:16px!important;font-weight:700!important;line-height:28px!important;
}
#resume-paper.has-custom-theme.layout-tpl3 .tpl3-module-label,
#resume-paper.has-custom-theme.layout-tpl3 .tpl3-module-rule{background:var(--theme)!important}
#resume-paper.has-custom-theme.layout-tpl6 .tpl6-module-heading{border-bottom-color:var(--theme)!important}
#resume-paper.has-custom-theme.layout-tpl6 .tpl6-module-label{color:var(--theme)!important}

/* The previous -2px offset left the measured tpl4 title 1px too far right. */
#resume-paper.layout-tpl4 .tpl4-sidebar .resume-title{transform:translateX(-3px)!important}
/* Source intent title is a 47px box: 16px line box + 20px top + 10px bottom + 1px rule. */
#page-resume .editor-workspace #resume-paper.layout-tpl4 .tpl4-sidebar-content .resume-sidebar-intent{margin-top:10px!important}
.editor-workspace #resume-paper.layout-tpl4 .resume-sidebar-intent h3{
  box-sizing:border-box!important;height:47px!important;min-height:47px!important;
  margin:0 10px 0 12px!important;padding:20px 0 10px!important;line-height:16px!important;
}
/* tpl7's isolated top:-8px caused the entire education section to start 8px early. */
#resume-paper.layout-tpl7 .resume-body>.resume-section:nth-of-type(3){position:static!important;top:auto!important}
/* Keep tpl1 row flow height constant while removing its extra 1px top margin. */
#resume-paper.layout-tpl1 .resume-item-head{margin:0 0 10px!important}

/* R031: source item heads have zero top margin and a 10px bottom gap;
   matching both removes the initial drop and restores the source row pitch.
   Tpl5 list bodies need a 9px bottom inset under this template's existing
   section flow; that makes each following heading land on the source y.
   Contact grids use two 50% columns; the right inset and zero tpl7 gap align
   the local field boxes. Body text follows the source near-black foreground. */
#resume-paper.layout-tpl5 .resume-item-head,
#resume-paper.layout-tpl7 .resume-item-head{margin:0 0 10px!important}
#resume-paper.layout-tpl5 .resume-contact-fields{padding-right:4px!important}
#resume-paper.layout-tpl5 .resume-body>.resume-section:nth-child(n+3)>.resume-section-body{padding-bottom:9px!important}
#resume-paper.layout-tpl7 .resume-contact-fields{padding-right:4px!important;column-gap:0!important}
.editor-workspace #resume-paper.layout-tpl5 .resume-contact-fields,
.editor-workspace #resume-paper.layout-tpl5 .resume-section-body,
.editor-workspace #resume-paper.layout-tpl7 .resume-contact-fields,
.editor-workspace #resume-paper.layout-tpl7 .resume-section-body{color:rgba(0,0,0,.88)!important}
