:root {
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --selected: #eaf2ff;
  --bg: #f8fafc;
  --paper-bg: #edf1f6;
  --line: #dce4f0;
  --text: #111827;
  --muted: #64748b;
  --radius: 8px;
  --sidebar: 230px;
  --editor-fraction: .46;
  font: 14px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC',system-ui,sans-serif;
  color: var(--text);
  background: white;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button,input,select,textarea {
  font: inherit;
  color: inherit;
}

button,select {
  cursor: pointer;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius);
  white-space: nowrap;
  padding: 7px 11px;
  font-weight: 550;
}

button:hover {
  background: #eef4fc;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible,[role=separator]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

input,select {
  min-width: 0;
}

select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px;
  background: white;
}

a {
  color: var(--brand);
}

[hidden] {
  display: none!important;
}

.symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

button svg,.search svg,.status svg,.resume-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon {
  width: 34px;
  height: 34px;
  padding: 0;
  flex: none;
}

.quiet {
  color: var(--muted);
}

.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.primary:hover {
  background: var(--brand-hover);
}

.secondary {
  border-color: var(--line);
  background: white;
  color: var(--brand);
}

.secondary:hover {
  border-color: #9dbdff;
  background: #f5f9ff;
}

.topbar {
  height: 62px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: white;
  position: relative;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-right: 18px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}

.brand img {
  width: 31px;
  height: 31px;
}

.brand strong {
  font-size: 19px;
  letter-spacing: -.6px;
}

.document-title {
  display: flex;
  align-items: center;
  min-width: 100px;
  flex: 0 1 auto;
}

.document-title input {
  field-sizing: content;
  width: auto;
  min-width: 64px;
  max-width: 100%;
  flex: 0 1 auto;
  padding: 5px 3px;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 650;
  text-overflow: ellipsis;
}

.document-title #rename {
  flex: none;
}

.document-title input:focus {
  border-color: var(--line);
  border-radius: 6px;
  background: white;
}

.status-area {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex-wrap: wrap;
}

.status-area #print-fallback {
  font-size: 12px;
  white-space: nowrap;
  font-weight: 600;
}

.status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.status.saved {
  color: #15803d;
}

.status.error {
  color: #b91c1c;
}

.status a {
  font-weight: 600;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  flex: none;
}

.export-group {
  position: relative;
  display: flex;
}

.export-group #export-download {
  border-radius: 8px 0 0 8px;
}

.export-arrow {
  border-radius: 0 8px 8px 0;
  border-left: 1px solid #ffffff55;
  padding-inline: 8px;
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 15;
  min-width: 155px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 7px 22px #1e3a5f18;
  padding: 5px;
}

.menu button {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  font-size: 13px;
}

.menu .danger {
  color: #dc2626;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0,calc((100% - var(--sidebar) - 7px)*var(--editor-fraction))) 7px minmax(0,1fr);
}

.workspace[data-mode=edit] {
  grid-template-columns: var(--sidebar) minmax(0,1fr);
}

.workspace[data-mode=edit] .preview-panel,.workspace[data-mode=edit] .splitter,.workspace[data-mode=preview] .editor,.workspace[data-mode=preview] .splitter {
  display: none;
}

.workspace[data-mode=preview] {
  grid-template-columns: var(--sidebar) minmax(0,1fr);
}

.library,.editor,.preview-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.library {
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 13px 11px;
  gap: 13px;
}

.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px;
}

.library-head h1 {
  font-size: 15px;
  margin: 0;
  font-weight: 700;
}

.library-head h1 span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 3px;
}

.search {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 8px 9px;
  color: var(--muted);
}

.search input {
  border: 0;
  background: none;
  outline: none;
  width: 100%;
  font-size: 13px;
}

.search:focus-within {
  border-color: var(--brand);
}

.resume-list {
  overflow: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 8px;
}

.resume-row {
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  gap: 2px;
  min-width: 0;
  padding: 3px;
}

.resume-row.active {
  background: var(--selected);
  border-color: #c8dcff;
}

.resume-row:hover:not(.active) {
  background: #f0f4f9;
}

.resume-select {
  display: flex;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  text-align: left;
  padding: 5px;
  gap: 8px;
  font-weight: 500;
}

.resume-select:hover {
  background: transparent;
}

.resume-icon {
  width: 30px;
  height: 34px;
  background: #e9edf5;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #53657e;
  flex: none;
}

.active .resume-icon {
  color: var(--brand);
  background: #deebff;
}

.resume-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.resume-info strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resume-info small {
  font-size: 11px;
  color: var(--muted);
}

.row-menu {
  width: 27px;
  height: 31px;
}

.row-popover {
  position: fixed;
  z-index: 30;
  top: auto;
  right: auto;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 18px 4px;
}

.library-foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
  text-align: center;
}

.library-foot small {
  font-size: 11px;
  color: var(--muted);
}

.bar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 0 9px;
  border-bottom: 1px solid var(--line);
  background: #f8faff;
  flex: none;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  align-items: stretch;
  min-height: 51px;
  gap: 5px;
}

.tab {
  border-radius: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 9px;
  color: #475569;
  font-size: 13px;
}

.tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 650;
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  font-size: 12px;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
  color: #475569;
  white-space: nowrap;
}

.switch-label input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch {
  display: block;
  background: #cbd5e1;
  width: 31px;
  height: 18px;
  border-radius: 12px;
  pointer-events: none;
  position: relative;
}

.switch:after {
  content: '';
  display: block;
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 100%;
  transition: transform .12s;
}

.switch-label input:checked+.switch {
  background: var(--brand);
}

.switch-label input:checked+.switch:after {
  transform: translateX(13px);
}

.switch-label input:focus-visible+.switch {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.format {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  padding: 5px 10px;
  min-height: 40px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.format button {
  min-width: 27px;
  padding: 4px 6px;
  font-size: 14px;
  color: #334155;
}

.format span {
  height: 19px;
  width: 1px;
  background: var(--line);
  margin: 0 3px;
}

.editor-surface {
  position: relative;
  flex: 1;
  min-height: 0;
  --gutter-width: 44px;
  background: white;
  overflow: hidden;
}

.editor-surface textarea,.highlight {
  font: 14px/1.8 ui-monospace,SFMono-Regular,Menlo,Consolas,'PingFang SC',monospace;
  letter-spacing: 0;
  tab-size: 4;
  word-break: normal;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  padding: 17px 17px 24px 12px;
  margin: 0;
  border: 0;
  position: absolute;
  inset: 0 0 0 var(--gutter-width);
  box-sizing: border-box;
}

.editor-surface textarea {
  resize: none;
  outline: none;
  width: calc(100% - var(--gutter-width));
  height: 100%;
  background: transparent;
  color: transparent;
  caret-color: var(--text);
  -webkit-text-fill-color: transparent;
  overflow: auto;
  z-index: 2;
}

.editor-surface textarea::selection {
  background: #bad4ff88;
}

.highlight {
  color: var(--text);
  pointer-events: none;
  overflow: hidden;
}

.highlight .line {
  display: block;
  position: relative;
  min-height: 1.8em;
}

.line-gutter {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--gutter-width);
  overflow: hidden;
  background: #f6f8fc;
  border-right: 1px solid #e8edf5;
  pointer-events: none;
  user-select: none;
  z-index: 3;
}

#line-numbers {
  position: absolute;
  inset: 0 0 auto 0;
  font: 12px/25.2px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.line-number {
  position: absolute;
  right: 10px;
  text-align: right;
}

.line-number.current {
  color: #475569;
}

.highlight .heading {
  color: var(--brand);
}

.highlight .syntax {
  color: #2563eb;
}

.highlight .strong {
  color: #17439b;
}

.editor-surface.no-wrap textarea,.editor-surface.no-wrap .highlight {
  white-space: pre;
  overflow-wrap: normal;
}

.editor-surface.composing textarea {
  color: var(--text);
  -webkit-text-fill-color: initial;
}

.editor-surface.composing .line {
  color: transparent!important;
}

.editor-surface.composing .line span {
  color: transparent!important;
}

.html-source {
  flex: 1;
  min-height: 0;
  resize: none;
  border: 0;
  background: white;
  outline: none;
  font: 13px/1.7 ui-monospace,monospace;
  padding: 16px;
  white-space: pre;
  overflow: auto;
}

.editor-footer,.preview-footer {
  height: 35px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  background: var(--bg);
}

.splitter {
  background: #eef2f7;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  cursor: col-resize;
  touch-action: none;
  position: relative;
}

.splitter:before {
  content: '';
  position: absolute;
  width: 2px;
  height: 28px;
  top: 50%;
  left: 2px;
  border-radius: 3px;
  background: #9db5d5;
}

.splitter:hover,.splitter:focus-visible,.dragging .splitter {
  background: #bfdbfe;
}

.dragging iframe {
  pointer-events: none;
}

.dragging {
  user-select: none;
}

.preview-panel {
  background: var(--paper-bg);
}

.preview-options {
  gap: 5px;
}

.size-label {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.zoom {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  white-space: nowrap;
}

.zoom button {
  padding: 5px 7px;
  border: 0;
  font-size: 12px;
}

.zoom button:first-child,.zoom button:last-child {
  font-size: 15px;
}

.paper {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: safe center;
}

.paper-sheet {
  position: relative;
  flex: none;
  background: white;
  box-shadow: 0 2px 12px #20334f17;
}

.paper-sheet iframe {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 210mm;
  height: 297mm;
  border: 0;
  transform-origin: top left;
  background: white;
}

.preview-footer {
  justify-content: center;
  text-align: center;
  min-height: 35px;
  height: auto;
  padding: 7px 8px;
}

.pdf-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pdf-message {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}

.pdf-message button {
  margin-left: auto;
  font-size: 12px;
}

.pdf-pane iframe {
  width: 100%;
  flex: 1;
  border: 0;
  min-height: 0;
  background: #e5e9f0;
}

@media(max-width:1200px) {
  :root {
    --sidebar: 200px;
  }
  .topbar {
    gap: 10px;
    padding: 0 12px;
  }
  .bar {
    padding: 0 6px;
  }
  .bar-actions {
    gap: 4px;
  }
  .tab {
    padding-inline: 6px;
  }
  .brand {
    padding-right: 10px;
  }
  .paper {
    padding: 14px;
  }
  .size-label {
    font-size: 0;
  }
  .size-label select {
    font-size: 12px;
  }
}

@media(max-width:900px) {
  :root {
    --sidebar: 180px;
  }
  .workspace[data-mode=split] {
    grid-template-columns: var(--sidebar) minmax(0,1fr)!important;
    grid-template-rows: minmax(420px,1fr) minmax(420px,1fr);
    overflow: auto;
  }
  .workspace[data-mode=split] .library {
    grid-row: 1/-1;
  }
  .workspace[data-mode=split] .splitter {
    display: none;
  }
  .workspace[data-mode=split] .preview-panel {
    grid-column: 2;
  }
  .topbar {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    padding: 10px;
  }
  .top-actions {
    margin-left: 0;
  }
  .document-title {
    max-width: 100%;
  }
  .status {
    max-width: 230px;
  }
}

@media(max-width:600px) {
  :root {
    --sidebar: 125px;
  }
  .brand strong {
    font-size: 16px;
  }
  .brand img {
    width: 25px;
    height: 25px;
  }
  .library {
    padding: 9px 5px;
  }
  .library-head h1 {
    font-size: 12px;
  }
  .library-head .icon {
    width: 27px;
    height: 27px;
  }
  .resume-icon {
    display: none;
  }
  .resume-select {
    padding: 4px;
  }
  .library-foot button {
    font-size: 11px;
    padding: 6px;
  }
  .search {
    padding: 6px;
  }
  .editor-footer {
    flex-wrap: wrap;
    height: auto;
    padding: 5px;
  }
  .top-actions {
    gap: 4px;
  }
  .top-actions button {
    font-size: 12px;
    padding-inline: 6px;
  }
  .document-title {
    flex: 0 1 auto;
  }
  .format {
    gap: 0;
    padding-inline: 4px;
  }
}

@media(forced-colors:active) {
  .highlight {
    display: none;
  }
  .editor-surface textarea {
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
    background: Canvas;
  }
}

.format button[aria-pressed="true"], .menu button[aria-pressed="true"], .bar-actions button[aria-pressed="true"] {
  background: var(--selected);
  color: var(--brand);
}

/* Theme gallery: document styles never change the RoleMI-style workspace. */
/* Shared chevron: same geometry for buttons and the native font-size select. */
.dropdown-chevron {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  background-color: currentColor;
  --chevron-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.25L6 7.75l3.5-3.5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask: var(--chevron-mask) center / contain no-repeat;
  mask: var(--chevron-mask) center / contain no-repeat;
  transition: transform 150ms ease;
}
#export-menu[aria-expanded="true"] .dropdown-chevron,
body:has(#template-dialog[open]) #theme-picker .dropdown-chevron {
  transform: rotate(180deg);
}
.theme-picker, .select-shell select {
  height: 32px;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.4;
}
.theme-picker { padding: 0 8px; gap: 6px; }
.select-shell { position: relative; display: inline-flex; align-items: center; color: var(--brand); }
.select-shell select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 26px 0 8px;
  color: var(--text);
  background: white;
}
.select-shell .dropdown-chevron { position: absolute; right: 8px; pointer-events: none; }
.select-shell select:hover { border-color: #9dbdff; background: #f5f9ff; }
.preview-options .zoom { height: 32px; border-radius: var(--radius); }
@media (prefers-reduced-motion: reduce) { .dropdown-chevron { transition: none; } }
.template-dialog { width: min(510px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 60px #16284828; color: var(--text); background: #fff; }
.template-dialog::backdrop { background: #182b4652; }
.template-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.template-head h2 { font-size: 19px; margin: 0 0 4px; }
.template-head p, .template-note { color: var(--muted); font-size: 12px; margin: 0; }
.template-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.template-card { position: relative; flex-direction: column; align-items: stretch; padding: 10px; gap: 10px; border: 1px solid var(--line); text-align: left; background: #fff; white-space: normal; }
.template-card:hover { border-color: #92b6ff; background: #f8fbff; }
.template-card[aria-pressed=true] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: #f4f8ff; }
.template-tick { display: none; position: absolute; right: 7px; top: 7px; border-radius: 50%; width: 21px; height: 21px; place-items: center; background: var(--brand); color: white; }
.template-card[aria-pressed=true] .template-tick { display: grid; }
.template-caption { display: flex; flex-direction: column; gap: 3px; }
.template-caption small { font-size: 11px; font-weight: 400; color: var(--muted); }
.template-thumb { display: block; aspect-ratio: 210/297; border: 1px solid #dce3ea; background: white; padding: 10%; box-shadow: 0 1px 5px #1e293b12; overflow: hidden; }
.template-thumb i, .template-thumb b { display: block; height: 2px; background: #c3c9d1; border-radius: 1px; margin: 5px 0; }
.template-thumb b:nth-child(3n) { width: 78%; }
.template-thumb .thumb-name { width: 42%; height: 6px; background: #242b35; margin: 4px 0; }
.template-thumb .thumb-contact { width: 68%; height: 2px; margin: 7px 0 9px; }
.thumb-identity { position: relative; display: block; padding: 7% 26% 7% 0; }
.template-thumb .thumb-photo { position: absolute; right: 0; top: 0; width: 19%; height: 26px; background: #c7d8ea; border-radius: 0; }
.thumb-body { display: block; }
.thumb-body i { margin-top: 10px; height: 3px; background: #454c57; width: 100%; }
.thumb-business .thumb-band { height: 5px; width: 100%; margin: 0 0 7px; background: #12377f; }
.thumb-business .thumb-body i { background: #24518e; }
.photo-settings { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 15px 0; margin-top: 16px; border-top: 1px solid var(--line); }
.photo-settings img { width: 42px; height: 56px; object-fit: contain; border: 1px solid var(--line); }
.photo-description { display: flex; flex: 1 1 180px; flex-direction: column; gap: 3px; }
.photo-description small, #photo-status { font-size: 11px; color: var(--muted); }
@media(max-width:500px) { .template-dialog { padding: 14px; } .template-grid { gap: 6px; } .template-card { padding: 6px; } .template-caption small { font-size: 10px; } .template-thumb i,.template-thumb b { margin: 3px 0; } }

/* Non-modal formatting drawer: preview remains visible while editing settings. */
.typography-toggle { height: 32px; font-size: 12px; padding: 0 8px; gap: 5px; }
.typography-toggle[aria-expanded=true] { background: var(--selected); border-color: #9dbdff; }
.preview-content { display: flex; flex: 1; min-width: 0; min-height: 0; overflow: hidden; }
.preview-content > .paper, .preview-content > .pdf-pane { min-width: 0; }
.typography-panel { width: min(310px, 48%); flex: 0 0 auto; min-height: 0; display: flex; flex-direction: column; gap: 0; padding: 0; background: #fff; border-left: 1px solid var(--line); }
.typography-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 14px 12px; border-bottom: 1px solid var(--line); }
.typography-head h2 { font-size: 16px; margin: 0 0 2px; }
.typography-head small { color: var(--muted); font-size: 11px; }
.typography-scroll { overflow: auto; min-height: 0; flex: 1; padding: 10px 14px; }
.typography-panel fieldset { border: 0; border-top: 1px solid var(--line); padding: 8px 0 12px; margin: 0 0 8px; min-width: 0; }
.typography-panel legend { font-size: 12px; font-weight: 700; color: var(--brand); padding-right: 8px; }
.type-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0, 1.15fr); align-items: center; gap: 8px; margin: 5px 0; font-size: 12px; }
.type-row input:not([type=color]) { width: 100%; min-width: 0; height: 31px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; background: #fff; font-size: 12px; }
.type-row input::placeholder { color: #8491a3; opacity: 1; }
.type-row input:invalid { border-color: #dc2626; }
.type-color { display: flex; align-items: center; gap: 5px; min-width: 0; }
.type-color input[type=color] { width: 25px; height: 25px; padding: 0; border: 0; background: transparent; flex: none; cursor: pointer; }
.typography-foot { padding: 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.typography-foot button { font-size: 12px; }
@media(max-width:650px) { .preview-content:has(.typography-panel:not([hidden])) { flex-direction: column; } .typography-panel { width: 100%; height: min(420px, 55%); border-left: 0; border-top: 1px solid var(--line); } }

/* Shared font combobox, independent of the browser's native datalist popup. */
.font-combobox { position: relative; min-width: 0; }
.type-row .font-combobox input { padding-right: 29px; border-radius: var(--radius); text-overflow: ellipsis; }
.font-trigger { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 26px; padding: 0; border: 0; border-radius: 0 7px 7px 0; color: var(--brand); }
.font-trigger[aria-expanded=true] .dropdown-chevron { transform: rotate(180deg); }
.font-popup { position: fixed; z-index: 50; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: white; color: var(--text); box-shadow: 0 8px 24px #1e3a5f20; overflow: hidden; font-size: 12px; }
.font-search { padding: 8px; border-bottom: 1px solid var(--line); flex: none; }
.font-search input { width: 100%; min-width: 0; height: 32px; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.font-options { overflow-y: auto; min-height: 0; max-height: 280px; padding: 4px; }
.font-group-label { padding: 7px 8px 3px; font-size: 11px; color: var(--muted); }
.font-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; padding: 5px 8px; border-radius: 5px; cursor: pointer; }
.font-option > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.font-option:hover, .font-option.keyboard-active { background: #f0f5ff; }
.font-option[aria-selected=true] { background: var(--selected); color: var(--brand); }
.font-tick { flex: none; color: var(--brand); font-family: system-ui, sans-serif; }
.font-popup-foot { flex: none; padding: 6px 8px; border-top: 1px solid var(--line); }
.font-popup-foot .local-fonts { width: 100%; font-size: 12px; padding: 5px 8px; }
#local-fonts-status { color: var(--muted); font-size: 11px; margin: 5px 0 0; }

/* Collapsible resume library. The grid already derives every mode from --sidebar. */
.library-actions { display: flex; align-items: center; gap: 4px; flex: none; }
#sidebar-toggle { width: 30px; height: 34px; }
.workspace[data-sidebar=collapsed] { --sidebar: 48px; }
.workspace[data-sidebar=collapsed] .library { padding: 10px 5px; gap: 10px; }
.workspace[data-sidebar=collapsed] .library-head { padding: 0; justify-content: center; }
.workspace[data-sidebar=collapsed] .library-actions { flex-direction: column-reverse; gap: 8px; }
.workspace[data-sidebar=collapsed] #sidebar-toggle svg { transform: rotate(180deg); }
.workspace[data-sidebar=collapsed] .library-head h1,
.workspace[data-sidebar=collapsed] .search,
.workspace[data-sidebar=collapsed] .resume-info,
.workspace[data-sidebar=collapsed] .row-menu,
.workspace[data-sidebar=collapsed] .library-foot small,
.workspace[data-sidebar=collapsed] #import span,
.workspace[data-sidebar=collapsed] .empty { display: none; }
.workspace[data-sidebar=collapsed] .resume-list { gap: 5px; overflow-x: hidden; }
.workspace[data-sidebar=collapsed] .resume-row { padding: 0; }
.workspace[data-sidebar=collapsed] .resume-select { justify-content: center; padding: 2px 0; min-height: 36px; }
.workspace[data-sidebar=collapsed] .resume-icon { display: grid; width: 28px; height: 30px; }
.workspace[data-sidebar=collapsed] #import { width: 34px; height: 34px; padding: 0; justify-self: center; }
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .workspace:not(.dragging) { transition: grid-template-columns 180ms ease; }
}
@media (max-width: 600px) {
  .library-head { flex-wrap: wrap; gap: 4px; }
  .library-actions { margin-left: auto; }
  .workspace[data-sidebar=collapsed] .library-actions { margin-left: 0; }
}

/* Transient operation feedback is independent of the save indicator. */
.operation-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  max-width: min(360px, calc(100vw - 48px));
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: #334155;
  box-shadow: 0 4px 16px #0002;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.operation-notice.error { color: #b91c1c; }
.operation-notice[hidden] { display: none; }
