/* S1 Settings (s1-settings.js): the page is the approved mockup's markup (redesign-v3.css: .hd .tabs .setr .bh .sec .savebar .tog .btn); this file is only glue.
 * Hue means status, ink means action: nothing here adds a colour. */
.s1set-host { display: block; }
.s1set-body { min-width: 0; }
.s1set-tabrow { display: flex; align-items: flex-start; gap: calc(16px * var(--s1-scale, 1)); }
.s1set-tabrow .tabs { flex: 1 1 auto; min-width: 0; }
.s1set-more { flex: none; margin-top: -6px; }
.s1set-grp > .bh { padding: calc(18px * var(--s1-scale, 1)) var(--gut) 0; margin-bottom: 4px; }
.s1set-grp > .bh .hda { margin-left: auto; font: 500 var(--s1-fs-1) var(--ui); }
.s1set-help { margin: 0 0 6px; padding: 0 var(--gut); max-width: 70ch; color: var(--ink-2); font-size: var(--s1-fs-2); line-height: 1.45; }
.s1set-grp > .bh + .s1set-help { margin-top: -2px; }
.s1set-foot { margin: 0; padding: calc(10px * var(--s1-scale, 1)) var(--gut); color: var(--mute); font-size: var(--s1-fs-1); }
.s1set-pg > .k-callout, .s1set-body > .k-callout, .s1set-body > div > .k-callout { margin: 16px var(--gut) 0; }
.s1set-actions { position: sticky; bottom: 0; z-index: 2; }
.s1set-tg { display: inline-flex; cursor: pointer; }
.s1set-tg .s1set-tgi { position: absolute; opacity: 0; width: 0; height: 0; }
.s1set-tgi:focus-visible + .tog { box-shadow: var(--s1-focus-ring); }
.s1set-num { max-width: 120px; }

.s1set-tags { min-height: 44px; }
.s1set-me { position: relative; overflow: hidden; }
.s1set-me img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
textarea.field { display: block; height: auto; padding: calc(8px * var(--s1-scale, 1)) calc(11px * var(--s1-scale, 1)); line-height: 1.45; resize: vertical; }
[data-s1pub] .mini-l span { white-space: normal; min-width: 0; } /* a CV line is a citation, not a short label: it wraps instead of running past the page (the side-list rule keeps labels on one line) */
.s1pub-frame { display: block; width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.s1set-code { font: 600 var(--s1-text-small) ui-monospace, Menlo, monospace; background: var(--s1-column); border: 1px solid var(--s1-line-soft); border-radius: 6px; padding: 2px calc(8px * var(--s1-scale, 1)); overflow-wrap: anywhere; }

/* Approval rules (coordinator-only) */
.s1apr-steps { display: grid; gap: calc(12px * var(--s1-scale, 1)); margin: 12px 0; }
.s1apr-step { border: 1px solid var(--s1-line, rgba(0,0,0,.12)); border-radius: 12px; padding: calc(12px * var(--s1-scale, 1)) calc(14px * var(--s1-scale, 1)); display: grid; gap: calc(10px * var(--s1-scale, 1)); background: var(--s1-surface, transparent); }
.s1apr-head { display: flex; align-items: center; gap: calc(10px * var(--s1-scale, 1)); }
.s1apr-head .k-input { flex: 1 1 auto; min-width: 0; }
.s1apr-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 var(--s1-text-micro) var(--k-font-ui); background: var(--s1-ink, #111); color: var(--s1-bg, #fff); }
.s1apr-tools { display: inline-flex; gap: 2px; flex: none; }
.s1apr-fs { border: 0; padding: 0; margin: 0; display: grid; gap: calc(6px * var(--s1-scale, 1)); min-width: 0; }
.s1apr-fs legend { font: 600 var(--s1-text-micro) var(--k-font-ui); color: var(--s1-mute); padding: 0 0 4px; }
.s1apr-opts { display: flex; flex-wrap: wrap; gap: calc(6px * var(--s1-scale, 1)) calc(18px * var(--s1-scale, 1)); }
.s1apr-opt, .s1set-check { display: inline-flex; align-items: center; gap: calc(8px * var(--s1-scale, 1)); cursor: pointer; line-height: 1.35; }
.s1apr-opt > span, .s1set-check > span { min-width: 0; }
.s1apr-people { display: grid; gap: calc(6px * var(--s1-scale, 1)); }
.s1apr-person { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 640px) { .s1apr-head { flex-wrap: wrap; } .s1apr-head .k-input { flex-basis: 100%; order: 3; } }

/* Request flows: tabs, send-to order, messages, versions, simulate report. Hue stays status-only (pills use the kit tones). */
.s1flow-tabs { flex-wrap: wrap; }
.s1flow-sends, .s1flow-vers { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: calc(8px * var(--s1-scale, 1)); }
.s1flow-send { display: flex; align-items: center; gap: calc(10px * var(--s1-scale, 1)); flex-wrap: wrap; border: 1px solid var(--s1-line-soft); border-radius: 10px; padding: calc(6px * var(--s1-scale, 1)) calc(10px * var(--s1-scale, 1)); }
.s1flow-send .s1apr-opt { flex: 1 1 auto; }
.s1flow-sendto { display: grid; gap: calc(6px * var(--s1-scale, 1)); margin-top: 10px; }
.s1flow-col { flex-direction: column; gap: calc(10px * var(--s1-scale, 1)); }
.s1flow-ver { border: 1px solid var(--s1-line-soft); border-radius: 12px; padding: calc(10px * var(--s1-scale, 1)) calc(14px * var(--s1-scale, 1)); display: grid; gap: calc(8px * var(--s1-scale, 1)); }
.s1flow-ver-head { display: flex; align-items: flex-start; gap: calc(12px * var(--s1-scale, 1)); flex-wrap: wrap; }
.s1flow-ver-body { border-top: 1px solid var(--s1-line-soft); padding-top: calc(8px * var(--s1-scale, 1)); }
.s1flow-ver-body ul { margin: 0; padding-left: calc(18px * var(--s1-scale, 1)); display: grid; gap: 4px; }
.s1flow-sim td { vertical-align: middle; }
.s1flow-sim td .k-select { min-width: 200px; max-width: 100%; margin-top: 4px; }
.s1set-actions .k-sm[data-sim-note] { margin-right: auto; }
@media (max-width: 640px) { .s1flow-sim td .k-select { min-width: 0; width: 100%; } }
.s1set-fine { margin: 0; padding: calc(14px * var(--s1-scale, 1)) var(--gut); font-size: var(--s1-fs-1); }

/* A .req row with many actions (certificates, the verify queue): on a phone the actions drop under the text so the text keeps its width. */
@media (max-width: 640px) { [data-mc-scope] .req { grid-template-columns: 22px minmax(0, 1fr); } [data-mc-scope] .req > .hda { grid-column: 2; } [data-mc-scope] .setr { grid-template-columns: minmax(0, 1fr); } [data-mc-scope] .setr .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } }
/* A settings row stacks on a phone: the label above, the control full width (the mockup's .setr is a two-column grid). */
@media (max-width: 760px) { .setr { grid-template-columns: minmax(0, 1fr); gap: 10px; } .setr > * { min-width: 0; } .setr .field, .setr .k-dd-btn { width: 100%; max-width: 100%; box-sizing: border-box; } }
@media (max-width: 640px) { .s1set-tabrow { gap: 8px; } .s1set-more { margin-top: 0; } .s1set-more .ddb { height: 34px; font-size: var(--s1-fs-3); } .s1set-more .ddb { min-width: 0; } }
@media (max-width: 640px) { .s1set-tabrow .tabs { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); } }

/* Edit profile (#s1set-profile.s1pf): a who-line, then each group as a heading column on the left and its fields two to a row on the right, labels above.
 * Long text and skills take the whole row. The save bar closes the form and docks to the bottom of the window only while something is unsaved. */
.s1pf-who { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: calc(16px * var(--s1-scale, 1)); align-items: center; padding: calc(18px * var(--s1-scale, 1)) var(--gut); border-bottom: 1px solid var(--line-soft); }
.s1pf-who .av.l { width: 56px; height: 56px; }
.s1pf-whot { display: grid; gap: 2px; min-width: 0; font-size: var(--s1-fs-2); }
.s1pf-whot b { font-size: var(--s1-fs-4); }
.s1pf-todo { color: var(--ink-2); }
.s1pf-todo .ob { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.s1pf-whoact { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.s1pf-grp { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: calc(28px * var(--s1-scale, 1)); padding: calc(20px * var(--s1-scale, 1)) var(--gut); border-bottom: 1px solid var(--line-soft); }
.s1pf-gh h2 { font: 650 var(--s1-fs-3)/1.3 var(--ui); margin: 0 0 4px; }
.s1pf-gh p { margin: 0; color: var(--mute); font-size: var(--s1-fs-1); line-height: 1.45; }
.s1pf-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(14px * var(--s1-scale, 1)) calc(20px * var(--s1-scale, 1)); align-content: start; }
.s1pf-fields > .setr { display: flex; flex-direction: column; gap: 5px; padding: 0; border: 0; min-width: 0; }
.s1pf-fields > .setr { align-items: stretch; }
.s1pf-fields > .setr > div { min-width: 0; width: 100%; margin: 0; align-self: stretch; }
.s1pf-fields > .setr:has(.s1set-tg) > div { width: auto; }
.s1pf-fields > .setr h3 { font: 600 var(--s1-fs-1)/1.3 var(--ui); color: var(--ink-2); margin: 0; }
.s1pf-fields > .setr > div:first-child p { font-size: var(--s1-fs-1); }
.s1pf-fields > .setr:has(textarea), .s1pf-fields > .setr:has(.s1set-tags) { grid-column: 1 / -1; }
.s1pf-fields > .setr:has(.s1set-tg) { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; padding: 6px 0; }
.s1pf-fields > .setr:has(.s1set-tg) > div:first-child { order: 2; }
.s1pf-fields .field:not(.sm), .s1pf-fields .k-dd-btn, .s1pf-fields .ddb { width: 100%; max-width: none; min-width: 0; box-sizing: border-box; }
.s1pf-fields textarea.field { min-height: 0; }
.s1pf-fields .hda { display: grid; gap: 6px; }
.s1pf .s1set-actions { position: static; }
.s1pf-fields > .s1pf-wide { grid-column: 1 / -1; }
.s1pf-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.s1pf-inline .field { flex: 1 1 240px; max-width: 372px; }
.s1pf-note { margin: 0; color: var(--mute); font-size: var(--s1-fs-1); }
.s1pf-note:empty { display: none; }
.s1pf-drive .s1pf-grp { border-bottom: 0; }
.s1pf .s1set-actions.is-dirty { position: sticky; bottom: 0; box-shadow: 0 -6px 16px rgb(0 0 0 / .06); }
.s1pf .s1set-actions:not(.is-dirty) { padding-bottom: 14px; } /* the phone's dock clearance is only needed while the bar is docked */
@media (max-width: 900px) { .s1pf-grp { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
@media (max-width: 640px) { .s1pf-fields { grid-template-columns: minmax(0, 1fr); } .s1pf-who { grid-template-columns: auto minmax(0, 1fr); } .s1pf-whoact { grid-column: 1 / -1; justify-content: flex-start; } }
/* Appearance: three swatches beside each look's name. */
.s1set-sw { display: inline-flex; margin-right: 10px; vertical-align: -3px; border: 1px solid var(--s1-line); border-radius: 999px; overflow: hidden; }
.s1set-sw i { display: block; width: 14px; height: 14px; }
/* Email and alerts, Account and sign-in (.s1nt, and the push panel inside it): a dense list per group. A row is its name and one line on the left and its
 * switch or button at the end of the same row, within a readable width, so the eye never crosses an empty half of the screen to find the switch. */
.s1nt .setr, [data-section="notifications"] #s1set-push .setr { grid-template-columns: minmax(0, 1fr) auto; max-width: 880px; gap: calc(20px * var(--s1-scale, 1)); padding: calc(12px * var(--s1-scale, 1)) var(--gut); align-items: center; }
.s1nt .setr > div:last-child, [data-section="notifications"] #s1set-push .setr > div:last-child { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.s1nt .s1set-grp > .bh, [data-section="notifications"] #s1set-push .s1set-grp > .bh { padding-top: calc(16px * var(--s1-scale, 1)); }
.s1nt .s1set-help { margin-bottom: 2px; }
.s1nt-lead { padding-bottom: 0; }
.s1nt-val { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 640px) { .s1nt .setr, [data-section="notifications"] #s1set-push .setr { grid-template-columns: minmax(0, 1fr) auto; } .s1nt .setr:has(.btn), .s1nt .setr:has(.s1nt-val) { grid-template-columns: minmax(0, 1fr); } .s1nt .setr:has(.s1nt-val) > div:last-child { justify-content: flex-start; } .s1nt .setr:has(.btn) > div:last-child { justify-content: flex-start; } }
