/* Email Signature Generator - matches the dotinc.tools look (white header, black rule, green accents). */
:root {
  --brand-navy: #1a1a1a; --brand-blue: #6fbf42; --brand-blue-dark: #4a9e35;
  --brand-light-bg: #f4f7f4; --brand-text: #1e2a1e; --brand-muted: #5c6b5c; --line: #e2e8e2;
  --card: #ffffff; --input: #ffffff;
  --pass: #2f7a2f; --pass-bg: #e6f4e3; --warn: #b8790a; --warn-bg: #fbf0dd; --fail: #b13c2e; --fail-bg: #fbe6e2;
  --info: #2b5f8a; --info-bg: #e3eef8;
}
:root[data-theme="dark"] {
  --brand-navy: #0d0f0d; --brand-blue: #7ed957; --brand-blue-dark: #5cb838;
  --brand-light-bg: #141813; --brand-text: #dbe6db; --brand-muted: #8b9b8b; --line: #2b332a;
  --card: #1b1f1a; --input: #141813;
  --pass: #6fd66f; --pass-bg: #1c3320; --warn: #e0a542; --warn-bg: #3a2f14; --fail: #e5766a; --fail-bg: #3a1d19;
  --info: #8cc3f0; --info-bg: #182a3a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--brand-light-bg); color: var(--brand-text); font-family: 'Segoe UI', Arial, sans-serif; display: flex; flex-direction: column; min-height: 100vh; }
header { background: #fff; color: var(--brand-navy); padding: 20px; text-align: center; border-bottom: 4px solid var(--brand-navy); }
:root[data-theme="dark"] header { background: #1b1f1a; color: var(--brand-text); }
header img { height: 56px; margin-bottom: 10px; }
.logo-link { display: inline-block; text-decoration: none; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline; }
header h1 { margin: 0; font-size: 24px; font-weight: 600; }
header p.tagline { margin: 8px auto 0; font-size: 14px; color: var(--brand-muted); max-width: 62ch; line-height: 1.5; }
.topnav { margin-top: 12px; display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; font-size: 14px; }
.topnav a, .linklike { color: var(--brand-navy); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer; }
:root[data-theme="dark"] .topnav a, :root[data-theme="dark"] .linklike { color: var(--brand-text); }
.topnav a:hover, .linklike:hover { color: var(--brand-blue-dark); text-decoration: underline; background: none; }
.topnav .who { color: var(--brand-muted); }
main { flex: 1; padding: 32px 16px 60px; }
.wrap { max-width: 1180px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 12px rgba(13,47,79,0.06); padding: 20px; margin-bottom: 16px; }
.card.narrow { max-width: 440px; margin: 0 auto 16px; }
.card h2 { margin: 0 0 14px; font-size: 18px; }
.card h2 ~ h2 { margin-top: 22px; }
.card h3 { font-size: 14px; margin: 14px 0 6px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
label.check { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 9px 10px; font: inherit; font-size: 14px; color: var(--brand-text); background: var(--input);
  border: 1px solid #ccd5cc; border-radius: 6px; }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { border-color: var(--line); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-blue); outline-offset: 0; border-color: var(--brand-blue); }
input[type=color] { width: 60px; height: 38px; padding: 2px; border: 1px solid #ccd5cc; border-radius: 6px; background: var(--input); }
textarea { resize: vertical; }
button, a.button { display: inline-block; font-family: 'Segoe UI', Arial, sans-serif; font-weight: 600; font-size: 15px; padding: 11px 20px; border: none; border-radius: 6px;
  background: var(--brand-blue); color: #fff; cursor: pointer; text-decoration: none; transition: background 0.15s ease; white-space: nowrap; }
:root[data-theme="dark"] button:not(.secondary):not(.linklike):not(.theme-toggle):not(.danger), :root[data-theme="dark"] a.button:not(.secondary) { color: #0d0f0d; }
button:hover, a.button:hover { background: var(--brand-blue-dark); }
button.secondary, a.button.secondary { background: var(--card); color: var(--brand-text); border: 1px solid #ccd5cc; }
button.secondary:hover, a.button.secondary:hover { background: var(--brand-light-bg); }
button.danger { background: var(--fail-bg); color: var(--fail); border: 1px solid var(--fail); }
button.danger:hover { background: var(--fail); color: #fff; }
button.small { font-size: 12px; padding: 5px 10px; }
form > button[type=submit]:not(.linklike):not(.small) { margin-top: 18px; width: 100%; }
.row-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row-form .field { flex: 1 1 220px; }
.row-form label { margin-top: 0; }
.row-form > button[type=submit]:not(.linklike):not(.small) { width: auto; margin-top: 0; }
form.inline { display: inline; }
.alert { padding: 10px 14px; border-radius: 6px; font-size: 14px; margin: 0 0 14px; }
.alert.success { background: var(--pass-bg); color: var(--pass); }
.alert.error { background: var(--fail-bg); color: var(--fail); }
.alert.info { background: var(--info-bg); color: var(--info); }
.wrap > .alert { max-width: 1180px; }
.muted { color: var(--brand-muted); font-weight: 400; }
.small { font-size: 12px; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.preview-col { position: sticky; top: 16px; }
@media (max-width: 900px) { .preview-col { position: static; } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.field small.err { display: block; color: var(--fail); font-size: 12px; min-height: 0; }
.field.has-error input { border-color: var(--fail); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
/* The preview always shows on white, like an email body. */
.preview-surface { background: #fff; color: #333; border: 1px dashed #ccd5cc; border-radius: 6px; padding: 18px; overflow-x: auto; }
.help ol { padding-left: 20px; margin: 0; font-size: 14px; line-height: 1.6; }
kbd { font-family: Consolas, monospace; font-size: 12px; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; background: var(--brand-light-bg); }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--brand-muted); }
.row-actions { white-space: nowrap; }
.row-actions form { margin-right: 4px; }
footer { text-align: center; padding: 22px 20px; background: var(--brand-navy); color: #cde8c2; font-size: 14px; }
footer a { color: var(--brand-blue); font-weight: 600; text-decoration: none; }
.theme-toggle { position: fixed; top: 14px; right: 14px; z-index: 100; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--brand-navy); font-size: 18px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.theme-toggle:hover { background: #fff; transform: scale(1.07); }
:root[data-theme="dark"] .theme-toggle, :root[data-theme="dark"] .theme-toggle:hover { background: #1b1f1a; color: var(--brand-text); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks label.check { font-size: 13px; }
.ps-domain { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.ps-users { margin: 8px 0 0 22px; }
form > button[type=submit].ps-submit:not(.linklike):not(.small) { margin-top: 6px; width: auto; }
button:disabled { background: #a9b6a9; cursor: not-allowed; }
.ps-help { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.ps-help summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.ps-help pre.cmd { font-family: Consolas, monospace; font-size: 13px; background: var(--brand-light-bg); color: var(--brand-text); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; overflow-x: auto; margin: 6px 0 10px; user-select: all; }
textarea.code { font-family: Consolas, 'Courier New', monospace; font-size: 13px; line-height: 1.45; white-space: pre; overflow-wrap: normal; overflow-x: auto; tab-size: 2; }
.placeholders { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.placeholders .ph { font-family: Consolas, monospace; font-weight: 400; }
.mode-tabs { display: flex; gap: 4px; margin: 4px 0 8px; }
.mode-tabs .tab { background: var(--card); color: var(--brand-text); border: 1px solid var(--line); font-size: 13px; padding: 6px 14px; }
.mode-tabs .tab.active { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.vtoolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; border: 1px solid var(--line); border-bottom: none; border-radius: 6px 6px 0 0; background: var(--brand-light-bg); }
.vtoolbar button { background: var(--card); color: var(--brand-text); border: 1px solid var(--line); font-size: 13px; padding: 4px 9px; min-width: 30px; font-weight: 600; }
.vtoolbar button:hover { background: var(--brand-light-bg); }
.vtoolbar select { width: auto; padding: 4px 6px; font-size: 13px; }
.vtoolbar .vsep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }
.vcolor { position: relative; display: inline-flex; align-items: center; justify-content: center; margin: 0; width: 30px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); font-weight: 700; color: var(--brand-text); cursor: pointer; }
.vcolor input[type=color] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.visual-editor { --ph-accent_color: #6fbf42; min-height: 380px; max-height: 640px; overflow: auto; background: #fff; color: #333; border: 1px solid var(--line); border-radius: 0 0 6px 6px; padding: 16px; font-family: Arial, Helvetica, sans-serif; font-size: 13px; }
.visual-editor:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; }
.visual-editor table td { outline: 1px dashed #c9d3c9; }
.visual-editor img { max-width: 100%; }
.tpl-links a { color: var(--brand-blue); font-weight: 600; }
