:root { color-scheme: light dark;
  /* Same palette as the 1app site: navy ink, one teal accent, navy text on the accent. */
  --bg: #eef1f5; --surface: #ffffff; --ink: #0a1628; --muted: #3a4d68; --line: #dbe1ea;
  --accent: #2f9e8f; --accent-ink: #0a1628; --accent-text: #1c7568; --accent-soft: #dff3ef; --ok: #1c7568; --danger: #c7372f;
  --night: #0a1628; --grad: #2f9e8f; --grad-deep: #0a1628;
  --shadow: 0 1px 2px rgba(10,22,40,.05), 0 12px 32px -12px rgba(10,22,40,.18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #070f1c; --surface: #0f1b2e; --ink: #eef1f5; --muted: #9fb0c6; --line: #1d2c44;
    --accent: #3fb8a7; --accent-text: #74d6c8; --accent-soft: #0f2f2c; --ok: #74d6c8; --danger: #ff7a70; --shadow: 0 12px 32px -12px rgba(0,0,0,.6); }
}
:root[data-theme="dark"] { color-scheme: dark; --bg: #070f1c; --surface: #0f1b2e; --ink: #eef1f5; --muted: #9fb0c6; --line: #1d2c44;
    --accent: #3fb8a7; --accent-text: #74d6c8; --accent-soft: #0f2f2c; --ok: #74d6c8; --danger: #ff7a70; --shadow: 0 12px 32px -12px rgba(0,0,0,.6); }
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

.btn { font-weight: 600; padding: 9px 18px; border-radius: var(--r); border: 1px solid transparent; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); transition: transform .12s ease, filter .12s ease; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); } .btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--line); }
.btn:disabled { opacity: .5; cursor: default; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* Mail window used for every signature preview. The inside stays white: it is an email. */
.window { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.chrome { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: #f1f3f7; border-bottom: 1px solid #e3e7ef; }
.chrome i { width: 11px; height: 11px; border-radius: 50%; background: #d5dae3; }
.chrome b { margin-left: 10px; font-size: 13px; font-weight: 600; color: #5d6677; }
.field { padding: 9px 20px; border-bottom: 1px solid #eef1f5; font-size: 14px; color: #8a93a3; }
.field span { color: #121826; margin-left: 6px; }
.sig { padding: 22px 20px 14px; overflow-x: auto; color: #121826; }

/* Personal page */
.hub-head { display: flex; align-items: center; gap: 12px; max-width: 880px; margin: 0 auto; padding: 20px 16px; }
.hub-head img { width: 36px; height: 36px; border-radius: var(--r); object-fit: contain; }
.hub-head span { font-weight: 650; }

.hub-main { max-width: 880px; margin: 0 auto; padding: 8px 16px 72px; font-size: 16px; }
.hero { display: flex; align-items: center; gap: 16px; margin: 20px 0 28px; }
.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 19px; }
.hub h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.1; letter-spacing: -.03em; margin: 0; text-wrap: balance; }
.hero p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 22px 0 0; }
.hub .btn { padding: 12px 22px; }
#status { color: var(--ok); font-weight: 600; }
.hub h2 { font-size: 22px; letter-spacing: -.02em; margin: 52px 0 6px; }
.lead { margin: 0 0 18px; color: var(--muted); }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.tab { font-weight: 600; padding: 8px 18px; border: 0; border-radius: var(--r); background: transparent; color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--night); color: #fff; }
.steps { list-style: none; counter-reset: step; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; display: flex; gap: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.steps li::before { content: counter(step); flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.steps h3 { margin: 2px 0; font-size: 16px; }
.steps p { margin: 0; color: var(--muted); }
.steps b { color: var(--ink); font-weight: 600; }

/* Editor shell */
.app { display: grid; grid-template-rows: auto 1fr; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: -.02em; }
.topbar { background: var(--grad-deep); border-bottom: 0; color: #fff; }
.topbar .nav { background: rgba(255,255,255,.14); }
.topbar .nav button { color: rgba(255,255,255,.8); }
.topbar .nav button[aria-pressed="true"] { background: #fff; }
.topbar .who { color: rgba(255,255,255,.8); }
.topbar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.topbar .nav button[aria-pressed="true"] { color: var(--night); }
.brand, .auth-brand, .hub-brand { display: inline-flex; align-items: center; font-weight: 800; letter-spacing: -.03em; font-size: 19px; white-space: nowrap; }
.mark { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; margin-right: .28em; border-radius: var(--r); background: #2f9e8f; color: #0a1628; font-style: normal; font-weight: 800; }
.dot-email { color: var(--accent-text); font-weight: 700; }
.topbar .dot-email { color: #6fd3c4; }
.hub-brand { margin-left: auto; font-size: 16px; }
.nav { display: inline-flex; gap: 4px; padding: 3px; border-radius: var(--r); background: var(--bg); }
.nav button { border: 0; background: transparent; padding: 6px 16px; border-radius: var(--r); font-weight: 600; color: var(--muted); cursor: pointer; }
.nav button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(18,24,38,.12); }
.grow { flex: 1; }
.who { color: var(--muted); font-size: 13px; }
.acting { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 14px; border-radius: var(--r); background: #ffd66b; color: #3b2a00; font-size: 13px; }
.acting .btn { background: #3b2a00; color: #fff; }
.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.work { display: grid; grid-template-columns: 220px 92px minmax(300px, 360px) minmax(0, 1fr); min-height: 0; }
.rail { display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; background: var(--surface); border-right: 1px solid var(--line); }
.rail button { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border: 0; border-radius: var(--r); background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.rail button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rail button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-text); }
.panel { overflow-y: auto; padding: 28px 26px 48px; background: var(--surface); border-right: 1px solid var(--line); }
.panel h2 { margin: 0 0 20px; font-size: 20px; letter-spacing: -.02em; }
.panel h3 { margin: 30px 0 10px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.panel p.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
label.f { display: block; margin: 0 0 14px; }
label.f > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 3px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
textarea { min-height: 96px; resize: vertical; }
input[type="range"] { width: 100%; accent-color: var(--accent-text); }
input[type="color"] { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.row { display: flex; align-items: center; gap: 10px; }
.row > * { min-width: 0; }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin: 0 0 10px; }
.seg label { text-align: center; padding: 7px 4px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--accent-soft); color: var(--accent-text); }
.seg label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: -3px; }
.drop { display: grid; place-items: center; gap: 8px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--bg); text-align: center; }
.drop img { max-width: 100%; max-height: 110px; background: #fff; border-radius: 6px; }
.item { padding: 10px; border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 8px; }
.item .row + .row, .item label.f:last-child { margin-top: 8px; margin-bottom: 0; }
.item img.ico { width: 30px; height: 30px; flex: none; }
.nets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 8px 0 12px; }
.nets button { display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer; }
.nets button:hover { border-color: var(--accent); }
.nets img { width: 20px; height: 20px; }
.layouts { display: grid; gap: 8px; }
.layouts label { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font-weight: 600; }
.layouts label:has(input:checked) { border-color: var(--accent-text); background: var(--accent-soft); }
.layouts svg { width: 64px; height: 40px; flex: none; }
.layouts input { position: absolute; opacity: 0; }
.adders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 12px; }
.adders button { padding: 12px 4px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); font-weight: 600; font-size: 13px; cursor: pointer; }
.adders button:hover { border-color: var(--accent); color: var(--accent-text); }
.item h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.item textarea { min-height: 64px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumbs img { height: 44px; border-radius: 6px; background: #fff; }
.ai { position: fixed; top: 0; right: 0; bottom: 0; z-index: 20; width: min(400px, 100vw); display: grid; grid-template-rows: auto 1fr auto; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -18px 0 40px -24px rgba(10,22,40,.45); }
.ai header { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); font-family: Quicksand, Inter, sans-serif; font-size: 17px; }
.ai-log { overflow-y: auto; padding: 16px; display: grid; gap: 10px; align-content: start; }
.ai-log p { margin: 0; padding: 10px 13px; border-radius: var(--r); max-width: 90%; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-log .user { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.ai-log .assistant { justify-self: start; background: var(--bg); border-bottom-left-radius: 4px; }
.ai-log .error { justify-self: start; background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.ai-log .hint { justify-self: center; text-align: center; max-width: 100%; }
.ai form { position: relative; display: grid; gap: 8px; margin: 0 14px 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.ai form:focus-within { border-color: var(--accent); }
.ai textarea { min-height: 96px; padding: 4px 2px 40px; border: 0; background: none; resize: none; outline: none; box-shadow: none; }
.ai-chip { justify-self: start; padding: 4px 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font: 500 12px/1.4 "JetBrains Mono", monospace; color: var(--muted); }
.ai-chip b { color: var(--ink); }
.ai-send { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.ai-send:disabled { opacity: .45; cursor: default; }
.ai-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* While the assistant is open the editor makes room for it, so the preview stays fully visible. */
@media (min-width: 1100px) { body:has(.ai:not([hidden])) .app { padding-right: 400px; } }
#preview [data-block] { cursor: pointer; }
#preview [data-block]:hover { outline: 2px dashed var(--accent); outline-offset: 3px; }
.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.order { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.order li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); cursor: grab; font-weight: 600; font-size: 14px; }
.order li.dragging { opacity: .4; }
.order li.over { border-color: var(--accent-text); background: var(--accent-soft); }
.order .grip { color: var(--muted); letter-spacing: -2px; }
.order button { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); width: 30px; height: 28px; cursor: pointer; }
.order button:disabled { opacity: .35; cursor: default; }
.stage { overflow: auto; padding: 32px; }
.stage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: 900px; margin: 0 auto 14px; }
.stage-bar select { width: auto; background: var(--surface); }
.stage .window { max-width: 900px; margin: 0 auto; }
.swatches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 0 0 10px; }
.swatches label { position: relative; cursor: pointer; border-radius: var(--r); border: 2px solid transparent; overflow: hidden; }
.swatches label:has(input:checked) { border-color: var(--accent-text); }
.swatches input { position: absolute; opacity: 0; }
.swatches canvas { display: block; width: 100%; height: auto; }
.note { color: var(--ok); font-weight: 600; font-size: 13px; }
.note.bad { color: var(--danger); }

/* People */
.people { overflow: auto; padding: 44px 32px 64px; }
.people-in { max-width: 1080px; margin: 0 auto; }
.people-head { display: flex; align-items: center; gap: 16px; margin: 0 0 28px; }
.people-head h1 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.people-head .lead { margin: 4px 0 0; }
.people-head .btn { padding: 12px 22px; }
.people-list { display: grid; gap: 14px; }
.person { display: grid; grid-template-columns: 52px minmax(0, 1.2fr) minmax(0, 1fr) auto; grid-template-areas: "face id meta toggle" "acts acts acts acts";
  align-items: center; gap: 18px 20px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.person.off { opacity: .7; }
.person .face { grid-area: face; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.person .face img { width: 100%; height: 100%; object-fit: cover; }
.person .id { grid-area: id; min-width: 0; }
.person .id b { display: block; font-size: 17px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .id span, .person .meta span:not(.chip) { display: block; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .meta { grid-area: meta; min-width: 0; display: grid; gap: 6px; justify-items: start; }
.org-logo { flex: none; display: grid; place-items: center; width: 84px; height: 84px; padding: 6px; border: 2px dashed var(--line); border-radius: var(--r); background: var(--surface); color: var(--muted); font-size: 11px; line-height: 1.2; text-align: center; cursor: pointer; overflow: hidden; }
.org-logo img { max-width: 100%; max-height: 100%; border-radius: var(--r); }
.org-logo:has(img) { border-style: solid; background: #fff; }
.domain-group { display: grid; gap: 14px; margin-bottom: 26px; }
.domain { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 6px 4px; }
.domain h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.domain select { width: auto; min-width: 190px; background: var(--surface); }
.org-logo.small { width: 60px; height: 60px; border-radius: var(--r); font-size: 10px; }
.people-list { gap: 0; }
.logo-face { border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 800; }
.logo-face:has(img) { background: #fff; border-radius: var(--r); }
.logo-face:has(img) img { object-fit: contain; }
.dropping { outline: 3px dashed var(--accent); outline-offset: 3px; }
.linkish { display: block; max-width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.linkish:hover b { color: var(--accent-text); text-decoration: underline; }
.chip { display: inline-block; padding: 3px 10px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; }
.chip.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.toggle { grid-area: toggle; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.toggle input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s ease; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s ease; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(18px); }
.person .acts { grid-area: acts; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.person .acts .btn { padding: 8px 16px; font-size: 14px; text-decoration: none; }
.person .acts .btn.danger { margin-left: auto; }
.empty { padding: 56px 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); }
@media (max-width: 720px) {
  .people { padding: 24px 16px 48px; }
  .person { grid-template-columns: 52px minmax(0, 1fr); grid-template-areas: "face id" "meta meta" "toggle toggle" "acts acts"; }
  .person .acts .btn.danger { margin-left: 0; }
}
dialog { width: min(480px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10,14,22,.5); }
.user-menu { position: relative; }
.avatar-button { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: #2f9e8f; color: #0a1628; font: 700 13px/1 Inter, sans-serif; cursor: pointer; }
.menu { position: absolute; right: 0; top: 46px; z-index: 30; width: 250px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.menu .who { margin: 6px 10px 8px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.menu button { display: block; width: 100%; padding: 10px; border: 0; border-radius: var(--r); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--accent-soft, rgba(47,158,143,.14)); }
.menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--line); }
#users-dialog { width: min(560px, calc(100vw - 32px)); }
#users-list .item { display: flex; align-items: center; gap: 12px; }
#users-list .item .grow { min-width: 0; overflow-wrap: anywhere; }
#company-dialog { width: min(600px, calc(100vw - 32px)); }
#company-dialog .seg { margin-bottom: 18px; }
#company-colors { gap: 8px; margin-bottom: 4px; }
.swatch { position: relative; }
.swatch button { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 11px; line-height: 1; cursor: pointer; }
#company-logos img { height: 64px; cursor: pointer; border: 1px solid var(--line); padding: 4px; }
#import-dialog { width: min(720px, calc(100vw - 32px)); }
.paste { min-height: 200px; max-height: 46vh; overflow: auto; padding: 16px; border: 1px dashed var(--line); border-radius: var(--r); background: #fff; color: #121826; }
.paste:empty::before { content: "Paste here"; color: #8a93a3; }
dialog h2 { margin: 0 0 14px; font-size: 18px; }
dialog .row { justify-content: flex-end; margin-top: 16px; }

/* Sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth form { width: min(400px, 100%); padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.auth-brand { margin: 0 0 22px; font-size: 24px; }

.auth h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.auth p { margin: 0 0 18px; color: var(--muted); }
.auth .btn { width: 100%; margin-top: 6px; padding: 11px; }
.auth .switch { margin: 16px 0 0; text-align: center; font-size: 14px; }
.auth .switch button { border: 0; background: none; color: var(--accent-text); font-weight: 600; cursor: pointer; padding: 0; }

@media (max-width: 900px) {
  .app { height: auto; }
  .work { grid-template-columns: 1fr; }
  .rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail button { min-width: 72px; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .topbar { flex-wrap: wrap; }
}

/* Type as on digitalmaker.us: Inter for text, Quicksand for headings and the brand, JetBrains Mono for small labels. */
h1, h2, .brand, .auth-brand, .hub-brand, .person .id b, .steps h3 { font-family: Quicksand, Inter, system-ui, sans-serif; }
.panel h3, label.f > span, .chip, .rail button { font-family: "JetBrains Mono", ui-monospace, monospace; letter-spacing: -.01em; }
.panel h3 { letter-spacing: .04em; }

/* Brand in the middle of the top bar and of the sign-in card */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; }
.bar-left { justify-self: start; }
.bar-right { justify-self: end; display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .brand { font-size: 22px; }
.auth-brand { display: flex; justify-content: center; }
.auth h1, .auth form > p:first-of-type { text-align: center; }
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr; justify-items: center; gap: 10px; }
  .bar-left, .bar-right { justify-self: center; flex-wrap: wrap; justify-content: center; }
}

/* Light and dark switch */
.theme-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topbar .theme-toggle { border-color: rgba(255,255,255,.4); color: #fff; }
.theme-toggle .moon, :root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
.auth .theme-toggle { position: fixed; top: 16px; right: 16px; }

/* Handwriting picker */
.fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 14px; max-height: 300px; overflow-y: auto; padding: 2px; }
.fonts button { height: 54px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; color: #1f1f1f; font-size: 26px; line-height: 1; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fonts button[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* Ask AI in the top bar */
.ask-ai { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 0; border-radius: var(--r); background: none; color: #fff; font: 600 14px/1 Inter, sans-serif; white-space: nowrap; cursor: pointer; }
.ask-ai:hover, .ask-ai:focus-visible { background: rgba(255,255,255,.12); }
.ask-ai svg { width: 18px; height: 18px; fill: currentColor; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--r); background: none; color: inherit; cursor: pointer; }
.icon-button:hover, .icon-button:focus-visible { background: var(--bg); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ai-log { background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 14px 14px; }
.ai-welcome { display: grid; gap: 10px; justify-items: center; align-self: center; padding: 24px 8px; text-align: center; }
.ai-log:has(.ai-welcome) { align-content: center; }
.ai-welcome .mark { width: 56px; height: 56px; margin: 0; border-radius: var(--r); font-size: 30px; }
.ai-welcome h3 { margin: 8px 0 0; font: 700 20px/1.2 Quicksand, Inter, sans-serif; text-transform: none; letter-spacing: 0; color: var(--ink); }
.ai-welcome p { margin: 0 0 8px; padding: 0; max-width: none; color: var(--muted); }
.ai-welcome button { display: grid; gap: 2px; width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ai-welcome button:hover, .ai-welcome button:focus-visible { border-color: var(--accent); }
.ai-welcome button span { color: var(--muted); font-size: 13px; }

/* Media library */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.chips button { padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.chips button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.media-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); min-width: 0; }
.media-card .shot { position: relative; display: grid; place-items: center; height: 130px; border-radius: var(--r); background: #fff; overflow: hidden; }
.media-card .shot img { max-width: 100%; max-height: 130px; }
.media-card .badge { position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: var(--r); background: #0a1628; color: #fff; font: 600 11px/1.5 "JetBrains Mono", monospace; text-transform: uppercase; }
.media-card input, .media-card select { width: 100%; min-width: 0; }
.media-grid.pick { max-height: 56vh; overflow-y: auto; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.media-grid.pick button { display: grid; place-items: center; height: 110px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer; }
.media-grid.pick button:hover, .media-grid.pick button:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); }
.media-grid.pick img { max-width: 100%; max-height: 92px; }
#media-dialog { width: min(720px, calc(100vw - 32px)); }

/* AI permissions */
.ai:has(.ai-perms:not([hidden])) .ai-log, .ai:has(.ai-perms:not([hidden])) form { display: none; }
.ai:has(.ai-perms:not([hidden])) { grid-template-rows: auto 1fr; }
.ai-perms { overflow-y: auto; padding: 18px 16px; display: grid; gap: 12px; align-content: start; }
.ai-perms h3 { margin: 0; }
.perm-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.perm-modes label { display: grid; gap: 3px; padding: 12px 8px; border: 1px solid var(--line); border-radius: var(--r); text-align: center; cursor: pointer; }
.perm-modes input { position: absolute; opacity: 0; }
.perm-modes span { font-size: 12px; color: var(--muted); }
.perm-modes label:has(:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.perm-modes label:has(:focus-visible) { outline: 2px solid var(--accent); }
.perm-list { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.perm-list label { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.perm-list label:last-child { border-bottom: 0; }
.perm-list small { display: block; color: var(--muted); }
.perm-list .pill { margin-left: auto; padding: 4px 12px; border-radius: var(--r); border: 1px solid var(--line); font: 600 12px/1.5 Inter, sans-serif; color: var(--muted); white-space: nowrap; }
.perm-list input { position: absolute; opacity: 0; }
.perm-list input:checked + .pill { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.perm-list input:focus-visible + .pill { outline: 2px solid var(--accent); outline-offset: 2px; }
.perm-list input:disabled + .pill { opacity: .6; }
.icon-button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.key-status { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); }
.key-status.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.ai .key-form { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; background: none; }
.ai .key-form .row { justify-content: flex-end; }
.ai:has(.ai-perms:not([hidden])) #ai-form { display: none; }
.ai:has(.ai-perms:not([hidden])) .key-form { display: grid; }
.ai-connect { display: grid; gap: 10px; justify-items: center; width: 100%; padding: 16px; border: 1px dashed var(--accent); border-radius: var(--r); }
.ai-welcome .ai-connect button { width: auto; text-align: center; }
.ai-attach { position: absolute; left: 10px; bottom: 10px; }
.ai-shot { position: relative; justify-self: start; }
.ai-shot img { display: block; max-height: 72px; max-width: 100%; border-radius: var(--r); border: 1px solid var(--line); background: #fff; }
.ai-shot button { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: inherit; line-height: 1; cursor: pointer; }
.ai.dropping { outline-offset: -6px; }

/* Icon picker */
#icon-dialog { width: min(640px, calc(100vw - 32px)); }
#icon-search { width: 100%; margin-bottom: 12px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; height: min(50vh, 380px); overflow-y: auto; align-content: start; }
.icon-grid button, .icon-pick { display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 0; border: 1px solid transparent; border-radius: var(--r); background: none; color: var(--ink); cursor: pointer; }
.icon-grid button:hover, .icon-grid button:focus-visible, .icon-pick:hover, .icon-pick:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.icon-grid svg, .icon-pick svg { width: 22px; height: 22px; fill: currentColor; }
.icon-pick { width: 44px; border-color: var(--line); flex: none; }
.icon-pick.stroke svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Signatures list */
.people-in.wide { max-width: 1280px; }
.sig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; }
.sig-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); min-width: 0; }
.sig-card h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig-card .who { margin: 0; }
.sig-shot { position: relative; height: 230px; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: #fff; color: #121826; overflow: hidden; cursor: zoom-in; text-align: left; }
.sig-shot > div { width: 720px; padding: 18px; transform-origin: top left; pointer-events: none; }
.sig-shot::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40px; background: linear-gradient(transparent, #fff); }
.sig-shot:hover, .sig-shot:focus-visible { border-color: var(--accent); }
.sig-card .groups { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; align-content: start; }
.sig-card .groups button, #group-list .group { padding: 5px 12px; border: 1px solid var(--line); border-radius: var(--r); background: none; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.sig-card .groups button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.sig-card .acts { display: flex; flex-wrap: wrap; gap: 8px; }
#group-list .group { display: inline-flex; align-items: center; gap: 8px; cursor: default; background: var(--surface); }
#group-list .group button { padding: 0 4px; border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
#group-list:empty { display: none; }
#sig-preview-dialog { width: min(860px, calc(100vw - 32px)); }
#sig-preview-dialog .sig { overflow-x: auto; }
@media (max-width: 480px) { .sig-grid { grid-template-columns: 1fr; } }

/* Design style page */
.style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.style-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); min-width: 0; }
.style-card.wide { grid-column: 1 / -1; }
.style-card h2 { margin: 0 0 6px; font-size: 18px; }
.style-card .hint { margin: 0 0 14px; }
.style-thumbs { display: flex; flex-wrap: wrap; gap: 10px; min-height: 96px; padding: 10px; border: 1px dashed var(--line); border-radius: var(--r); }
.style-thumbs figure { position: relative; margin: 0; display: grid; place-items: center; width: 96px; height: 76px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); }
.style-thumbs img { max-width: 88px; max-height: 68px; }
.style-thumbs figure button { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: inherit; line-height: 1; cursor: pointer; }
.style-thumbs .add { width: 96px; height: 76px; border: 1px dashed var(--line); border-radius: var(--r); background: none; color: var(--muted); font: inherit; cursor: pointer; }
.style-thumbs .add:hover, .style-thumbs .add:focus-visible { border-color: var(--accent); color: var(--accent-text); }
#style-colors { gap: 10px; }
#style-colors input[type="color"] { width: 48px; height: 48px; }
.found { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.found:hover, .found:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
#style-found-box { margin-top: 16px; }
@media (max-width: 800px) { .style-grid { grid-template-columns: 1fr; } }

/* Pictures made by the account's image server */
#pix-dialog { width: min(760px, calc(100vw - 32px)); }
.variants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.variants:empty { display: none; }
.variants button { position: relative; padding: 0; border: 2px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden; cursor: pointer; min-height: 70px; }
.variants button img { display: block; width: 100%; }
.variants button:hover, .variants button:focus-visible { border-color: var(--accent); }
.variants .wait { display: grid; place-items: center; color: var(--muted); background: var(--bg); cursor: default; font-size: 13px; }
.ai-log .variants { grid-template-columns: 1fr 1fr; width: 100%; }

/* Preview size and weight */
.device-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; max-width: 900px; margin: 0 auto 12px; }
.device-bar .seg { flex: none; }
.stats { margin: 0; color: var(--muted); font-size: 13px; }
.stats b { color: var(--ink); font-weight: 600; }
.stats .warn { color: var(--danger); font-weight: 600; }
.stage .window[data-device="tablet"] { max-width: 600px; }
.stage .window[data-device="mobile"] { max-width: 375px; }

/* People as a compact list: one row per person, secondary actions under "more" */
#people-rows .domain-group { gap: 0; margin-bottom: 30px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
#people-rows .domain { padding: 14px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 60%, var(--surface)); border-radius: var(--r) var(--r) 0 0; }
#people-rows .domain:last-child { border-bottom: 0; border-radius: var(--r); }
#people-rows .person { grid-template-columns: 40px minmax(0, 1.3fr) minmax(0, 1.2fr) auto auto; grid-template-areas: "face id meta toggle acts"; gap: 14px; padding: 12px 18px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: none; }
#people-rows .person:last-child { border-bottom: 0; }
#people-rows .person:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
#people-rows .person .face { width: 40px; height: 40px; font-size: 14px; }
#people-rows .person .id b { font-size: 15px; }
#people-rows .person .id span, #people-rows .person .meta span:not(.chip) { font-size: 13px; }
#people-rows .person .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
#people-rows .person .meta span:not(.chip) { flex: 1 1 100%; }
#people-rows .person .acts { flex-wrap: nowrap; align-items: center; padding: 0; border: 0; }
#people-rows .toggle span { display: none; }
.more { position: relative; }
.more summary { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r); border: 1px solid var(--line); list-style: none; cursor: pointer; font-size: 20px; line-height: 1; user-select: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary:hover, .more[open] summary { background: var(--accent-soft); border-color: var(--accent); }
.more .menu { top: 42px; width: 200px; }
.more .menu a { display: block; padding: 10px; border-radius: var(--r); color: inherit; text-decoration: none; }
.more .menu a:hover, .more .menu a:focus-visible { background: var(--accent-soft); }
.more .menu .danger { color: var(--danger); }
.more .menu button:disabled { opacity: .45; cursor: default; }
@media (max-width: 760px) {
  #people-rows .person { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "face id acts" "meta meta toggle"; }
}
.device-bar { justify-content: center; }
.device-bar .seg label { display: grid; place-items: center; padding: 8px 16px; }
.device-bar .seg svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stage > .stats { max-width: 900px; margin: 14px auto 0; text-align: center; line-height: 1.7; }

/* Signatures sidebar in the editor: tools on top, the list, Save at the bottom */
.sigbar { order: -1; display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.sigbar-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sigbar-tools .btn { padding: 8px 6px; }
.sigbar h3 { margin: 8px 0 0; }
.sigbar-list { flex: 1; min-height: 60px; overflow-y: auto; display: grid; gap: 4px; align-content: start; }
.sigbar-list button { padding: 10px 12px; border: 1px solid transparent; border-radius: var(--r); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sigbar-list button:hover, .sigbar-list button:focus-visible { background: var(--bg); }
.sigbar-list button[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.sigbar-list small { display: block; font-weight: 400; color: var(--muted); }
.sigbar-foot { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.sigbar-foot .note { min-height: 1.3em; text-align: center; }
.sigbar-foot .btn { width: 100%; }
@media (max-width: 1150px) { .work { grid-template-columns: 180px 76px minmax(260px, 320px) minmax(0, 1fr); } }
@media (max-width: 900px) {
  .sigbar { border-right: 0; border-bottom: 1px solid var(--line); }
  .sigbar-tools { grid-template-columns: repeat(3, 1fr); }
  .sigbar-list { max-height: 160px; }
}

/* Pictures of people and companies that can be changed */
.avatar-button img, .avatar-edit img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-button { overflow: hidden; }
.avatar-edit { width: 72px; height: 72px; padding: 0; border: 2px dashed var(--line); border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 800 22px/1 Inter, sans-serif; cursor: pointer; overflow: hidden; flex: none; }
.avatar-edit:has(img) { border-style: solid; }
dialog .avatar-row { margin: 0 0 16px; gap: 16px; }
#client-rows .logo-face { position: relative; }
#client-rows .logo-face::after { content: "Edit"; position: absolute; inset: auto 0 0 0; padding: 2px 0; background: rgba(10,22,40,.72); color: #fff; font: 600 10px/1.4 Inter, sans-serif; opacity: 0; }
#client-rows .logo-face:hover::after, #client-rows .logo-face:focus-visible::after { opacity: 1; }
.enter-people { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--r); }
.enter-people svg { width: 22px; height: 22px; }
.enter-people:hover, .enter-people:focus-visible { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }

/* Style configurator */
.look-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
.look-grid .f { margin: 0; }
.look-grid .seg { margin-top: 6px; }
.look-grid input[type="range"] { width: 100%; }
@media (max-width: 800px) { .look-grid { grid-template-columns: 1fr; } }

/* Columns of the editor that can be folded away to leave room for the preview */
.fold { border: 1px solid var(--line); }
.fold[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.device-bar .grow { flex: 1; }
@media (min-width: 901px) {
  .work.no-list { grid-template-columns: 92px minmax(300px, 360px) minmax(0, 1fr); }
  .work.no-panel { grid-template-columns: 220px 92px minmax(0, 1fr); }
  .work.no-list.no-panel { grid-template-columns: 92px minmax(0, 1fr); }
}
.work.no-list .sigbar, .work.no-panel .panel { display: none; }
/* Keys and tokens are hidden like passwords without being password fields, so the browser does not offer saved logins. */

/* Settings of the assistant: sections that open and close with an arrow */
.fold-sec { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.fold-sec > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; list-style: none; cursor: pointer; }
.fold-sec > summary::-webkit-details-marker { display: none; }
.fold-sec > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s ease; flex: none; margin-right: 4px; }
.fold-sec[open] > summary::after { transform: rotate(-135deg); }
.fold-sec > summary b { display: block; font-family: Quicksand, Inter, sans-serif; font-size: 15px; }
.fold-sec > summary small { display: block; color: var(--muted); font-size: 12px; }
.fold-sec > summary small.on { color: var(--accent-text); font-weight: 600; }
.fold-sec > :not(summary) { margin-left: 16px; margin-right: 16px; }
.fold-sec > :last-child { margin-bottom: 16px; }
.fold-sec .perm-modes, .fold-sec .perm-list { margin-bottom: 12px; }
.fold-sec .btn#ai-perm-save { width: calc(100% - 32px); }
.fold-sec h4 { margin: 14px 0 0; font-size: 13px; }
.ai:has(.ai-perms:not([hidden])) .fold-sec .key-form { display: grid; }
.mcp-item { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mcp-item b { overflow-wrap: anywhere; }
.mcp-item span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; font-family: "JetBrains Mono", ui-monospace, monospace; }
.mcp-item .row { justify-content: flex-start; margin-top: 4px; }
.mcp-item .note { margin: 0; font-size: 12px; }
.mcp-item i { font-style: normal; font-size: 13px; color: var(--ink); }

/* One corner shape for the whole app: the rounded square of the "1" mark (radius = 28% of its side). */
:root { --r: 10px; --r-small: 10px; }
.btn, .tabs, .nav, .acting, .ask-ai, .chips button, .seg, .more summary, .icon-button, .theme-toggle, .fold, .enter-people,
.sig-card .groups button, #group-list .group, .sigbar-list button, .menu button, .perm-modes label, .ai-send, .avatar-edit, .org-logo, .org-logo.small { border-radius: var(--r); }
.tab, .nav button, .chip, .media-card .badge, .perm-list .pill, .seg label, .btn.small { border-radius: var(--r-small); }
.avatar-button, .person .face, .avatar, .avatar-edit, .logo-face, .logo-face:has(img) { border-radius: var(--r); }
.avatar-button img, .avatar-edit img { border-radius: 0; }
/* Company logos always sit in a square, whole, on white. */
.person .face.logo-face:has(img), .org-logo:has(img) { background: #fff; }
.person .face.logo-face img, .org-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; padding: 4px; }
.avatar-row .hint { margin: 8px 0 0; }

/* Lists of values in the company profile */
.multi { margin: 0 0 18px; }
.multi h4 { margin: 0 0 8px; font-size: 13px; }
.multi .rows { display: grid; gap: 8px; margin-bottom: 8px; }
.multi .rows > div { display: flex; gap: 8px; align-items: center; }
.multi .rows input { flex: 1; min-width: 0; }
.multi .rows select { width: auto; flex: none; }
.multi .rows button { flex: none; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-small); background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.multi .rows button:hover { color: var(--danger); border-color: var(--danger); }

/* Page background: the blueprint sheet of the DigitalMaker site. Squares of 10px with a stronger line every 50px,
   fading out towards the top, and a few squares that light up. Fixed layers of their own keep scrolling smooth on iPad. */
:root { --grid-fine: rgba(90,110,140,.10); --grid-main: rgba(90,110,140,.22); --grid-dot: rgba(47,158,143,.35); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #102445; --grid-fine: rgba(140,170,210,.09); --grid-main: rgba(140,170,210,.24); --grid-dot: rgba(70,140,200,.6); } }
:root[data-theme="dark"] { --bg: #102445; --grid-fine: rgba(140,170,210,.09); --grid-main: rgba(140,170,210,.24); --grid-dot: rgba(70,140,200,.6); }
body { isolation: isolate; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-main) 1px, transparent 1px), linear-gradient(90deg, var(--grid-main) 1px, transparent 1px),
    linear-gradient(var(--grid-fine) 1px, transparent 1px), linear-gradient(90deg, var(--grid-fine) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px;
  background-position: 16px 0;
  -webkit-mask-image: linear-gradient(transparent 60px, #000 320px);
  mask-image: linear-gradient(transparent 60px, #000 320px);
}
body::after {
  content: ""; position: fixed; left: 17px; top: 1px; width: 9px; height: 9px; z-index: -1; pointer-events: none; color: var(--grid-dot);
  box-shadow: 20px 280px, 330px 220px color-mix(in srgb, currentColor 45%, transparent), 140px 490px, 640px 410px color-mix(in srgb, currentColor 40%, transparent),
    260px 630px color-mix(in srgb, currentColor 55%, transparent), 890px 340px, 1090px 560px color-mix(in srgb, currentColor 50%, transparent), 760px 700px,
    1330px 280px color-mix(in srgb, currentColor 45%, transparent), 1510px 620px, 470px 820px color-mix(in srgb, currentColor 40%, transparent), 1210px 840px;
  animation: grid-dots 6s ease-in-out infinite alternate;
}
@keyframes grid-dots { from { opacity: .35; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body::after { animation: none; opacity: .6; } }

/* Where you are: the company and the domain being worked on, always in view under the top bar */
.app { grid-template-rows: auto auto 1fr; }
.where { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 24px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 14px; }
.where-logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); font: 800 12px/1 Inter, sans-serif; overflow: hidden; flex: none; }
.where-logo:has(img) { background: #fff; }
.where-logo img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.where b { font-family: Quicksand, Inter, sans-serif; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.where-sep { color: var(--muted); }
.where select { width: auto; padding: 6px 30px 6px 10px; background-color: var(--bg); font-weight: 600; }
.where .acting { padding: 4px 4px 4px 12px; font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 720px) { .where { padding: 6px 14px; flex-wrap: wrap; } }

/* The account's own main color tints the app while you are inside it. */
:root[data-brand] { --accent: var(--brand); --accent-ink: var(--brand-ink); --accent-text: color-mix(in srgb, var(--brand) 72%, #000); --accent-soft: color-mix(in srgb, var(--brand) 14%, var(--surface)); --ok: var(--accent-text); }
@media (prefers-color-scheme: dark) { :root[data-brand]:not([data-theme="light"]) { --accent-text: color-mix(in srgb, var(--brand) 55%, #fff); --accent-soft: color-mix(in srgb, var(--brand) 22%, var(--surface)); } }
:root[data-brand][data-theme="dark"] { --accent-text: color-mix(in srgb, var(--brand) 55%, #fff); --accent-soft: color-mix(in srgb, var(--brand) 22%, var(--surface)); }

/* Template gallery */
#tpl-dialog { width: min(1080px, calc(100vw - 32px)); }
.tpl { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
.tpl-cats { display: grid; gap: 4px; align-content: start; }
.tpl-cats button { padding: 10px 12px; border: 1px solid transparent; border-radius: var(--r); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tpl-cats button:hover { background: var(--bg); }
.tpl-cats button[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.tpl-cats hr { width: 100%; margin: 6px 0; border: 0; border-top: 1px solid var(--line); }
.tpl-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); max-height: 60vh; overflow-y: auto; margin-top: 12px; padding: 2px; }
.tpl-grid .sig-card { grid-template-rows: auto auto; cursor: pointer; }
.tpl-grid .sig-card:hover, .tpl-grid .sig-card:focus-visible { border-color: var(--accent); }
.tpl-grid .sig-shot { height: 190px; cursor: pointer; }
.tpl-grid .tag { font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { .tpl { grid-template-columns: 1fr; } .tpl-cats { grid-auto-flow: column; overflow-x: auto; } .tpl-cats hr { display: none; } }
#invite-dialog { width: min(600px, calc(100vw - 32px)); }
#invite-dialog a.btn { text-decoration: none; }
.auth .switch a { color: var(--accent-text); font-weight: 600; }
