/* resume-lab — two layers, deliberately separate:
   DOCUMENT: the resume itself (untouched look — resume-blue accents, Google-Doc
   typography, screen metrics == print metrics so page markers are truthful).
   CHROME: the tool holding the paper — quiet slate controls with ONE warm
   accent (Cloudflare orange) reserved for "play": the customize switch, the
   restyle sparkle, tailor weights. Inclusion is always a switch; wordings are
   always dots. Chrome never prints. */

:root {
  /* document */
  --accent: #2e74b5;
  --ink: #1d1d1f;
  --muted: #575760;
  --rule: #c9cdd3;
  --ghost: #9aa0a8;
  --paper: #ffffff;
  --font-body: "Helvetica Neue", Arial, "Segoe UI", sans-serif;
  --fs-body: 10pt;
  --lh-body: 1.32;
  --page-w: 8.5in;
  --pad-x: .55in;
  --pad-y: .5in;
  /* chrome */
  --desk: #eceef1;
  --c-ink: #2a2f3a;
  --c-soft: #5b6472;
  --c-line: #d7dbe2;
  --c-bg: #ffffff;
  --c-hover: #f2f4f7;
  --play: #f6821f;
  --play-deep: #c2590a;
  --play-soft: #fff1e4;
  --note-bg: #fff8e7;
  --note-line: #e8c56e;
  --note-ink: #8a6a12;
  --c-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow-1: 0 1px 3px rgba(24, 28, 36, .10), 0 4px 14px rgba(24, 28, 36, .08);
  --shadow-2: 0 6px 24px rgba(24, 28, 36, .16);
}
body.tpl-serif { --font-body: Cambria, Georgia, "Times New Roman", serif; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--desk);
  font-family: var(--font-body);
  color: var(--ink);
  transition: background-color .35s ease;
}
/* play mode changes the environment, not just the widgets */
body.customize {
  background-color: #e9e9ec;
  background-image: radial-gradient(rgba(246, 130, 31, .14) 1px, transparent 1px);
  background-size: 22px 22px;
}

#sheet {
  position: relative;
  width: var(--page-w);
  max-width: 100%;
  margin: 60px auto 10px;
  background: var(--paper);
  box-shadow: 0 1px 4px rgba(20, 24, 32, .18), 0 8px 28px rgba(20, 24, 32, .10);
  padding: var(--pad-y) var(--pad-x);
  min-height: 11in;
}

/* ================= DOCUMENT (unchanged look) ================= */
#resume { font-size: var(--fs-body); line-height: var(--lh-body); }
.name { font-size: 2em; font-weight: 700; letter-spacing: .01em; margin: 0 0 2px; }
.tagline { font-weight: 700; color: var(--accent); font-size: .93em; margin: 0 0 4px; }
.contact { color: var(--muted); font-size: .85em; margin: 0 0 10px; }
h2.sec {
  color: var(--accent);
  font-size: 1.02em;
  font-weight: 700;
  margin: 12px 0 5px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--rule);
}
.role-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 8px 0 0; position: relative; }
.role-title { font-weight: 700; }
.role-title .org { font-weight: 400; }
.role-dates { font-style: italic; white-space: nowrap; }
.role-sub { font-style: italic; color: var(--muted); font-size: .92em; margin: 0 0 3px; position: relative; }
ul.items { margin: 2px 0 5px; padding-left: 1.25em; }
ul.items li { margin: 0 0 4px; position: relative; }
p.prose { margin: 4px 0 5px; position: relative; }
p.inline-row { margin: 3px 0 5px; position: relative; }
.chip { display: inline; border-radius: 4px; padding: 0 1px; }
.chip-sep { color: var(--muted); }
body.customize li.bank { color: var(--ghost); list-style-type: circle; }
body.customize p.bank, body.customize .chip.bank { color: var(--ghost); }
section { position: relative; }
section.off h2.sec, section.off .role-head, section.off .role-sub { color: var(--ghost); opacity: .55; }

/* restyled-line tint (ephemeral AI output) */
.reworded > .txt { color: #7c4a12; }

/* ================= CHROME ================= */

/* ---- the dock ---- */
#dock {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 40;
  display: flex;
  align-items: stretch;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  padding: 5px;
  gap: 5px;
  font-family: var(--c-font);
}
.dock-group { display: flex; align-items: center; gap: 2px; }
.dock-group + .dock-group { border-left: 1px solid var(--c-line); padding-left: 7px; margin-left: 2px; }

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 600 12px/1 var(--c-font);
  color: var(--c-ink);
  background: none;
  border: none;
  border-radius: 8px;
  padding: 8px 9px;
  cursor: pointer;
}
.dock-btn:hover { background: var(--c-hover); }
.dock-btn.quiet { color: var(--c-soft); }
.dock-btn.quiet:hover { color: var(--c-ink); }
.dock-btn.on { background: var(--play-soft); color: var(--play-deep); }
.dock-btn .spark { color: var(--play); }
.dock-btn.save { background: var(--c-hover); color: var(--c-soft); }
.dock-btn.save.dirty { background: var(--play); color: #fff; }

/* the hero: a real switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 6px 9px 6px 6px;
  border-radius: 9px;
  cursor: pointer;
  font: 700 12.5px/1 var(--c-font);
  color: var(--c-ink);
}
.switch:hover { background: var(--c-hover); }
.sw-track {
  width: 36px; height: 21px;
  border-radius: 21px;
  background: #c8cdd6;
  position: relative;
  transition: background .18s ease;
  flex: none;
}
.sw-thumb {
  position: absolute;
  top: 2.5px; left: 2.5px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .18s ease;
}
.switch[aria-checked="true"] .sw-track { background: var(--play); }
.switch[aria-checked="true"] .sw-thumb { transform: translateX(15px); }
.switch[aria-checked="true"] .sw-label { color: var(--play-deep); }
.switch.pulse .sw-track { animation: swpulse 1.6s ease-out 3; }
@keyframes swpulse {
  0% { box-shadow: 0 0 0 0 rgba(246, 130, 31, .45); }
  70% { box-shadow: 0 0 0 9px rgba(246, 130, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(246, 130, 31, 0); }
}

/* ---- toast ---- */
#status {
  position: fixed;
  top: 62px;
  right: 14px;
  font: 12px/1.35 var(--c-font);
  background: #16181d;
  color: #fff;
  padding: 8px 11px;
  border-radius: 8px;
  z-index: 50;
  max-width: 320px;
  box-shadow: var(--shadow-2);
}

/* ---- shared small controls ---- */
.ctl {
  font: 600 11px/1 var(--c-font);
  color: var(--c-soft);
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.ctl:hover { color: var(--c-ink); border-color: #b9c0cb; background: var(--c-hover); }
.ctl.danger:hover { color: #b42318; border-color: #e4b6b0; background: #fdf3f2; }
.ctl.primary { color: #fff; background: var(--c-ink); border-color: var(--c-ink); }
.ctl.primary:hover { background: #000; color: #fff; }
.hidden { display: none !important; }

/* ---- per-line gutter cluster ---- */
.gut {
  position: absolute;
  left: 100%;
  top: -3px;
  margin-left: calc(var(--pad-x) + 4px);
  display: flex;
  gap: 3px;
  align-items: center;
  height: 24px;
  width: max-content;
  padding: 2px 4px;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  box-shadow: var(--shadow-1);
  opacity: 0;
  transition: opacity .12s;
  z-index: 6;
  font-family: var(--c-font);
}
body.customize li > .gut, body.customize p > .gut { opacity: .38; }
body.customize li:hover > .gut, body.customize p:hover > .gut,
body.customize .gut:hover, body.customize .gut.pinned { opacity: 1; }

.gut button { background: none; border: none; padding: 3px; border-radius: 5px; cursor: pointer; color: var(--c-soft); display: inline-flex; align-items: center; }
.gut button:hover { background: var(--c-hover); color: var(--c-ink); }
.gut .g-spark { color: var(--play); }
.gut .g-spark:hover { background: var(--play-soft); color: var(--play-deep); }

/* mini include switch */
.mini-sw { width: 26px; height: 15px; border-radius: 15px; background: #c8cdd6; position: relative; flex: none; transition: background .15s; }
.mini-sw::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 1.5px rgba(0,0,0,.3);
  transition: transform .15s;
}
button[aria-checked="true"] .mini-sw { background: var(--play); }
button[aria-checked="true"] .mini-sw::after { transform: translateX(11px); }

/* variant dots */
.vdots { display: inline-flex; gap: 4px; align-items: center; padding: 0 2px; }
.vdots .dot { width: 7px; height: 7px; border-radius: 50%; background: #cdd2da; border: none; padding: 0; cursor: pointer; }
.vdots .dot:hover { background: var(--c-soft); }
.vdots .dot.cur { background: var(--play); }
.varrow { font: 700 12px/1 var(--c-font); }

/* drag handle (edit) */
.drag-handle {
  position: absolute;
  left: -1.45em;
  top: .1em;
  width: 14px; height: 16px;
  color: #c3c9d2;
  cursor: grab;
  opacity: 0;
  transition: opacity .12s;
}
body.editmode li:hover > .drag-handle, body.editmode p:hover > .drag-handle { opacity: 1; }
.drag-handle:active { cursor: grabbing; }
li.dragging, p.dragging { opacity: .35; }
li.drop-above { box-shadow: inset 0 2px 0 var(--play); }
li.drop-below { box-shadow: inset 0 -2px 0 var(--play); }

/* tailor flash when a line swaps in/out */
li.flash, p.flash { animation: swapin 1.1s ease-out 1; }
@keyframes swapin {
  0% { background: var(--play-soft); }
  100% { background: transparent; }
}

/* ---- restyle popover ---- */
.rw-card {
  position: absolute;
  top: 26px;
  right: 0;
  width: 232px;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  padding: 10px;
  z-index: 30;
  font-family: var(--c-font);
  cursor: default;
  text-align: left;
}
#dock .rw-card { top: 44px; right: 6px; position: absolute; }
.rw-head { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.rw-head .t { font: 700 12px/1.2 var(--c-font); color: var(--c-ink); flex: 1; }
.rw-wai {
  display: inline-flex; align-items: center; gap: 4px;
  font: 600 9.5px/1 var(--c-font);
  color: var(--c-soft);
  letter-spacing: .02em;
}
.rw-wai svg { flex: none; }
.rw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.rw-chip {
  font: 600 11.5px/1 var(--c-font);
  color: var(--c-ink);
  background: var(--c-hover);
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 6px;
  cursor: pointer;
  text-align: center;
}
.rw-chip:hover { border-color: var(--play); background: var(--play-soft); color: var(--play-deep); }
.rw-chip:disabled { opacity: .5; cursor: wait; }
.rw-custom { display: flex; gap: 5px; margin-top: 6px; }
.rw-custom input {
  flex: 1;
  font: 11.5px/1.2 var(--c-font);
  border: 1px solid var(--c-line);
  border-radius: 7px;
  padding: 6px 8px;
  color: var(--c-ink);
  min-width: 0;
}
.rw-custom input:focus { outline: 2px solid var(--play); outline-offset: 0; border-color: transparent; }
.rw-go {
  font: 700 11.5px/1 var(--c-font);
  background: var(--play);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 6px 10px;
  cursor: pointer;
}
.rw-go:hover { background: var(--play-deep); }
.rw-foot { font: 10px/1.4 var(--c-font); color: var(--c-soft); margin: 7px 0 0; }
.rw-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font: 600 9.5px/1 var(--c-font);
  color: var(--play-deep);
  border: 1px solid #f3c99d;
  background: var(--play-soft);
  border-radius: 5px;
  padding: 2px 6px;
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: 1px;
}
.rw-badge a { color: inherit; font-weight: 700; }

/* ---- margin comment bubbles (edit only) ---- */
.note {
  position: absolute;
  left: 100%;
  margin-left: calc(var(--pad-x) + 4px);
  top: 26px;
  width: 228px;
  font: 10.5px/1.45 var(--c-font);
  color: var(--note-ink);
  background: var(--note-bg);
  border: 1px solid var(--note-line);
  border-left: 3px solid var(--note-line);
  border-radius: 0 8px 8px 8px;
  padding: 6px 8px;
  z-index: 5;
  opacity: .5;
  transition: opacity .12s;
}
li:hover > .note, p:hover > .note, .note:hover { opacity: 1; }

/* ---- inline editor row ---- */
textarea.editbox {
  width: 100%;
  font: inherit;
  line-height: inherit;
  color: inherit;
  border: 1px solid var(--c-ink);
  border-radius: 6px;
  padding: 6px 7px;
  min-height: 84px;
  background: #fbfcfe;
}
.editrow { margin: 4px 0 6px; font-family: var(--c-font); }
.editrow .ctl { margin-right: 5px; margin-top: 5px; }
.editrow input.ctl { cursor: text; }

/* section tools (edit) */
.sec-gut {
  position: absolute;
  left: 100%;
  margin-left: calc(var(--pad-x) + 4px);
  top: 0;
  display: flex;
  gap: 4px;
  width: max-content;
  opacity: 0;
  font-family: var(--c-font);
}
body.editmode section:hover > .sec-gut { opacity: 1; }

/* ---- page-break line (no words) ---- */
.page-mark {
  position: absolute;
  left: 0; right: 0;
  border-top: 1.5px dashed #eaaa6b;
  opacity: .8;
  pointer-events: none;
  z-index: 4;
}

/* ---- tailor: a weight matrix, not five sliders ---- */
#tailor {
  position: fixed;
  top: 74px;
  left: 16px;
  width: 216px;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  padding: 12px 13px;
  z-index: 40;
  font-family: var(--c-font);
}
#tailor header { display: flex; align-items: center; justify-content: space-between; margin: 0 0 2px; }
#tailor h3 { margin: 0; font: 700 13px/1 var(--c-font); color: var(--c-ink); }
#tailor .hint { color: var(--c-soft); font-size: 10.5px; line-height: 1.45; margin: 4px 0 10px; }
.tgrid { display: grid; grid-template-columns: 1fr auto; gap: 7px 8px; align-items: center; }
.tgrid .tlabel { font: 600 11px/1.2 var(--c-font); color: var(--c-ink); }
.seg { display: inline-flex; background: var(--c-hover); border-radius: 7px; padding: 2px; gap: 1px; }
.seg button {
  width: 24px; height: 20px;
  border: none;
  background: none;
  border-radius: 5px;
  font: 700 11px/1 var(--c-font);
  color: #a4abb6;
  cursor: pointer;
}
.seg button:hover { color: var(--c-ink); }
.seg button.on { background: #fff; color: var(--c-ink); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.seg button.on[data-w="0"] { color: #98a1ad; }
.seg button.on[data-w="2"] { background: var(--play); color: #fff; }
#tailor .delta { font: 600 10.5px/1.3 var(--c-font); color: var(--play-deep); margin: 9px 0 0; }

/* ---- built-on badge ---- */
#cf-badge {
  text-align: center;
  font: 11.5px/1.5 var(--c-font);
  color: var(--c-soft);
  padding: 8px 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
#cf-badge a { color: var(--c-soft); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
#cf-badge a:hover { color: var(--c-ink); }
#cf-badge strong { color: var(--c-ink); font-weight: 700; }
#cf-badge .sep { color: #c3c9d2; }
#cf-badge svg { vertical-align: -2px; }

/* ---- a11y + motion ---- */
:is(button, input, [contenteditable]):focus-visible { outline: 2px solid var(--play); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 1300px) {
  #tailor { left: 8px; width: 190px; }
}
@media (max-width: 1120px) {
  #tailor { position: static; width: auto; max-width: var(--page-w); margin: 10px auto 0; }
  .gut { margin-left: 8px; }
  .note { display: none; }
}

/* ================= PRINT: the artifact ================= */
@page { size: letter; margin: .5in .55in; }
@media print {
  body { background: #fff !important; background-image: none !important; }
  #dock, #status, #cf-badge, #tailor, .ctl, .gut, .sec-gut, .note,
  .page-mark, .rw-card, .rw-badge, .drag-handle { display: none !important; }
  #sheet { box-shadow: none; margin: 0; padding: 0; width: auto; min-height: 0; }
  li.bank, p.bank, .chip.bank, section.off { display: none !important; }
  textarea.editbox, .editrow { display: none !important; }
  .reworded > .txt { color: inherit; }
  h2.sec { break-after: avoid; }
  ul.items li, p.prose { break-inside: avoid; }
  .role-head { break-after: avoid; }
  a { color: inherit; text-decoration: none; }
}
