/* Configuration → Email signatures (signatures.js), drawn in the
   Configuration sheet's detail pane (config.css). It leans on the sheet's
   .cfg-head and the app's .set-* helpers; only what is new lives here. */

.sg-h3 { font: 700 16px var(--display); margin: 0 0 6px; }
.sg-h3 + p { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }

.sg .spacer { flex: 1; }
.sg h4 { font: 700 13.5px var(--sans); margin: 0; }
.sg .lab { display: block; margin-bottom: 6px; }
.sg input[type=checkbox], .sg input[type=radio] { width: auto; margin: 0; flex-shrink: 0; }
.sg-mono { font: 400 11.5px var(--mono); word-break: break-all; }
.sg-bad { color: var(--danger-ink); }

/* the Workspace connection */
.sg-card {
  background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px;
}
.sg-card .set-hint, .sg-card .set-steps { margin: 0; }
.sg-card-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.sg-card-head b { font-size: 13.5px; }
.sg-file { align-self: flex-start; cursor: pointer; }
.sg-link { color: var(--accent); text-decoration: underline; cursor: pointer; }
.sg-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.sg-checks li { display: flex; gap: 8px; align-items: flex-start; }
.sg-checks svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 3px; }
.sg-checks li.ok svg { color: var(--ok); }
.sg-checks li.bad { color: var(--danger-ink); }
.sg-auth summary { cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--accent-deep); }
.sg-auth[open] summary { margin-bottom: 6px; }
.sg-copyrow { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.sg-copyrow .lab { margin: 0; }
.sg-copyrow .set-code { margin: 0; white-space: nowrap; overflow-x: auto; scrollbar-width: thin; }

/* notes */
.sg-note { font-size: 12.5px; line-height: 1.5; padding: 8px 12px; border-radius: 12px; margin: 8px 0; border: 1px solid; }
.sg-note.warn { color: var(--warn); border-color: rgba(154, 106, 18, .35); background: rgba(245, 197, 24, .12); }
.sg-note.bad { color: var(--danger-ink); border-color: var(--danger-line); background: var(--danger-bg); }
.sg-pill { padding: 3px 8px; }
.sg-pill.busy { color: var(--accent); border-color: rgba(123, 30, 46, .4); }
.sg-pill.busy::before { animation: sg-blink 1s ease-in-out infinite; }
.sg-pill.warn { color: var(--warn); border-color: rgba(154, 106, 18, .4); }
@keyframes sg-blink { 50% { opacity: .25; } }

/* the list */
.sg-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.sg-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.sg-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: rgba(255, 255, 255, .6); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 14px;
  transition: border-color .16s var(--ease-out), background .16s var(--ease-out);
}
.sg-row:hover { border-color: rgba(123, 30, 46, .4); background: #FFFFFF; }
.sg-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sg-row-main { display: flex; flex-direction: column; min-width: 0; }
.sg-row-main b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-row-main span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-row-state { display: flex; gap: 6px; }
.sg-row-when { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.sg-hist-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.sg-hist-list li { border-bottom: 1px solid var(--line-soft); }
.sg-hist {
  display: flex; gap: 12px; justify-content: space-between; width: 100%; padding: 8px 2px;
  background: none; border: 0; font: 400 12.5px var(--sans); color: var(--ink); text-align: left; cursor: pointer;
}
.sg-hist:disabled { cursor: default; }
.sg-hist-when { color: var(--muted); white-space: nowrap; font-size: 11.5px; }
.sg-hist-det { font: 400 11.5px var(--mono); padding: 0 2px 10px; max-height: 220px; overflow-y: auto; line-height: 1.6; }

/* add signature */
.sg-bar { display: flex; align-items: center; gap: 8px; margin: -4px 0 10px; }
.sg-bar .btn.ghost { padding-left: 8px; }
.sg-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 16px 0; }
.sg-pick {
  display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: rgba(255, 255, 255, .6); border: 1.5px solid var(--line-soft); border-radius: 14px; padding: 10px;
  transition: border-color .16s var(--ease-out), box-shadow .25s var(--ease-out);
}
.sg-pick:hover { border-color: rgba(123, 30, 46, .4); }
.sg-pick.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123, 30, 46, .14); }
.sg-pick b { font-size: 13px; margin-top: 6px; }
.sg-pick > span:last-child { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.sg-pick-prev { display: block; height: 118px; overflow: hidden; border-radius: 6px; background: #FFFFFF; border: 1px solid var(--line-soft); }
.sg-pick-prev iframe { pointer-events: none; transform: scale(.62); transform-origin: 0 0; width: 161%; }
.sg-pick-code { display: grid; place-items: center; }
.sg-pick-code code { font: 400 11px/1.6 var(--mono); color: var(--accent-deep); }
.sg-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* the editor */
.sg-titlerow { margin-bottom: 10px; }
.sg-name { font: 700 18px var(--sans); padding: 6px 10px; border-color: transparent; background: transparent; }
.sg-name:hover { border-color: var(--line); }
.sg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.sg-actions .btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.sg-del:not(:disabled) { color: var(--danger-ink); }
.sg-send { margin-bottom: 4px; }
.sg-send + .set-hint { margin: 0 0 12px; }

.sg-preview { margin-bottom: 16px; }
.sg-preview-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sg-preview-head .lab { margin: 0; white-space: nowrap; }
.sg-preview-head select { flex: 1; min-width: 0; padding: 6px 10px; font-size: 12.5px; }
.sg-len { font: 500 11px var(--mono); color: var(--muted); white-space: nowrap; }
.sg-mail { background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.sg-mail-body { padding: 14px 18px 0; font: 14px Arial, sans-serif; color: #202124; }
.sg-mail-body::after { content: '--'; display: block; margin-top: 12px; color: #5F6368; }
.sg-frame { display: block; width: 100%; border: 0; height: 120px; }
.sg-frame.mini { height: 190px; }

.sg-tabs { margin-bottom: 14px; }
.sg-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.sg-fs:disabled { opacity: .55; }
.sg-sec { margin-bottom: 18px; }
.sg-sec > .set-hint:first-of-type { margin: 0 0 8px; }
.sg-sub { font: 600 11px var(--sans); color: var(--muted); margin: 10px 0 4px; }
.sg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.sg-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sg-field > span:first-child { font-size: 12px; font-weight: 600; }
.sg-field input, .sg-field select { padding: 7px 11px; font-size: 13px; }
.sg-color-in { display: flex; gap: 6px; align-items: center; }
.sg-color-in input[type=color] { width: 38px; height: 34px; padding: 2px; flex-shrink: 0; cursor: pointer; }
.sg-chk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.sg-chk { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: 12.5px; cursor: pointer; }
.sg-chk i { font-style: normal; color: var(--muted); font-size: 11px; margin-left: 6px; opacity: .8; }

.sg-html { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; margin-bottom: 18px; }
.sg-src textarea { font: 400 12px/1.55 var(--mono); resize: vertical; min-height: 280px; white-space: pre; tab-size: 2; }
.sg-src .set-hint { margin: 6px 0 0; }
.sg-vars { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.sg-vars .set-hint { margin: 0 0 4px; }
.sg-var {
  font: 400 11px var(--mono); color: var(--accent-deep); background: var(--accent-soft); border: 0;
  border-radius: 6px; padding: 3px 7px; cursor: pointer; text-align: left; max-width: 100%; overflow-wrap: anywhere;
}
.sg-var:hover { background: rgba(123, 30, 46, .2); }

.sg-radio { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.sg-radio input { margin-top: 3px !important; }
.sg-radio span { display: flex; flex-direction: column; }
.sg-radio b { font-size: 13px; }
.sg-radio i { font-style: normal; font-size: 12px; color: var(--muted); }
.sg-people { max-height: 320px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255, 255, 255, .5); }
.sg-person { display: flex; gap: 10px; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.sg-person:last-child { border-bottom: 0; }
.sg-person:hover { background: rgba(255, 255, 255, .8); }
.sg-person span { display: flex; flex-direction: column; min-width: 0; }
.sg-person b { font-size: 12.5px; }
.sg-person i { font-style: normal; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-people .set-hint { padding: 6px 12px; margin: 0; }
.sg-reach { font-size: 13px; margin: 0 0 8px; }

@media (max-width: 760px) {
  .sg-html { grid-template-columns: minmax(0, 1fr); }
  .sg-vars { max-height: 200px; flex-direction: row; flex-wrap: wrap; }
  .sg-chk-grid { grid-template-columns: minmax(0, 1fr); }
  .sg-row { grid-template-columns: minmax(0, 1fr) auto; }
  .sg-row-when { display: none; }
  .sg-copyrow { grid-template-columns: minmax(0, 1fr) auto; }
  .sg-copyrow .lab { grid-column: 1 / -1; }
}
