:root {
	color-scheme: dark;
	--bg: #0d1117; --panel: #161b22; --panel2: #1c2128; --hover: #21262d; --line: #30363d;
	--text: #e6edf3; --muted: #8b949e; --blue: #58a6ff; --green: #3fb950; --red: #f85149; --orange: #f78166; --purple: #a371f7;
	--gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	--shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
html.modal-scroll-locked, html:has(dialog[open]), html:has(#dock:not([hidden])) { overflow: hidden; overscroll-behavior: none; }
html.modal-scroll-locked body { position: fixed; top: var(--modal-scroll-top); left: var(--modal-scroll-left); width: 100%; overflow: hidden; }
dialog[open], dialog[open] *, #dock, #dock * { overscroll-behavior: contain; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
[hidden] { display: none !important; }
#system-update-overlay { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; background: rgba(13, 17, 23, .97); color: var(--text); text-align: center; padding: 24px; }
#system-update-overlay[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
#system-update-overlay::backdrop { background: var(--bg); }
#system-update-overlay h2 { font-size: clamp(32px, 6vw, 52px); margin: 24px 0 12px; }
#system-update-overlay p { color: var(--muted); }
#system-update-output { text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 900px; max-height: 40vh; overflow: auto; margin: 24px auto; }
.update-spinner { width: 100px; height: 100px; flex: none; margin: 0 auto; border: 8px solid var(--line); border-top-color: var(--purple); border-radius: 50%; animation: update-spin 1s linear infinite; }
@keyframes update-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .update-spinner { animation-duration: 3s; } }

button, select, input, textarea { font: inherit; color: inherit; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; transition: border-color .15s, background .15s; }
/* Fields only get a slightly brighter edge when focused. Buttons keep a ring for the keyboard. */
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(88, 166, 255, .55); }
button:focus-visible { outline: none; border-color: rgba(88, 166, 255, .55); }
button { cursor: pointer; white-space: nowrap; }
label:has(input[type="checkbox"]), input[type="checkbox"] { cursor: pointer; }
button:hover { background: var(--hover); border-color: var(--muted); }
button.primary { background: #238636; border-color: #2ea043; color: #fff; font-weight: 600; }
button.primary:hover { background: #2ea043; }
/* A button that cannot be used yet: grey and quiet, whatever colour it has when it can (as the confirmations' OK) */
button:disabled, button:disabled:hover, button.primary:disabled, button.primary[data-tone]:disabled, button.primary.danger-primary:disabled,
button.danger:disabled { opacity: .45; cursor: not-allowed; background: var(--panel2); border-color: var(--line); color: var(--muted); box-shadow: none; }
button.danger { color: var(--red); }
button.danger:hover { background: rgba(248, 81, 73, .15); border-color: var(--red); }
button.ghost { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); color: #fff; }
button.ghost:hover { background: rgba(255, 255, 255, .25); }
button.small, select.small { padding: 3px 9px; font-size: 12.5px; }
button.wide { width: 100%; padding: 9px; }

.page-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: var(--gradient); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand h1 { margin: 0; font-size: 20px; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.brand .logo { display: block; width: 38px; height: 38px; flex: none; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35), 0 4px 12px rgba(0, 0, 0, .25); }
/* The page's foot: Powered by VNS, at the bottom of the window when the page is shorter */
body:has(> .page-footer) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body:has(> .page-footer) > main { flex: 1 0 auto; width: 100%; }
.page-footer { display: flex; justify-content: center; padding: 20px 24px 24px; }
.powered-by { display: inline-flex; align-items: center; gap: 8px; color: #8b95b8; font-size: 12px; font-weight: 600; text-decoration: none; opacity: .6; transition: opacity .2s; }
.powered-by:hover { opacity: 1; }
.powered-by img { display: block; width: 30px; height: auto; }
.brand .host { color: rgba(255, 255, 255, .8); font-size: 13px; }
.page-header nav { display: flex; gap: 6px; flex: 1; }
.page-header nav button { background: transparent; border-color: transparent; color: rgba(255, 255, 255, .85); font-weight: 500; }
.page-header nav button:hover { background: rgba(255, 255, 255, .15); }
.page-header nav button.active { background: rgba(255, 255, 255, .22); color: #fff; border-color: rgba(255, 255, 255, .35); }
.page-header form { margin: 0; }
.count { background: rgba(0, 0, 0, .3); border-radius: 10px; padding: 0 7px; font-size: 12px; }
.count:empty { display: none; }

main { padding: 20px 24px; max-width: 1600px; margin: 0 auto; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.sites-empty { min-height: calc(100dvh - 220px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; text-align: center; }
.sites-empty-icon { display: grid; place-items: center; width: 112px; height: 112px; margin-bottom: 24px; border: 1px solid rgba(163, 113, 247, .3); border-radius: 32px; color: #b9d8ff; background: linear-gradient(135deg, rgba(88, 166, 255, .16), rgba(163, 113, 247, .2)); box-shadow: 0 0 60px rgba(163, 113, 247, .1); }
.sites-empty-icon .ico { width: 58px; height: 58px; }
.sites-empty h2 { margin: 0 0 12px; font-size: clamp(24px, 4vw, 32px); letter-spacing: -.03em; }
.sites-empty p { max-width: 400px; margin: 0 0 28px; color: var(--muted); font-size: 15px; line-height: 1.7; }
#btn-empty-new-site, #btn-empty-add-environment { display: inline-flex; align-items: center; gap: 10px; padding: 13px 28px; font-size: 16px; border-radius: 10px; box-shadow: 0 4px 24px rgba(63, 185, 80, .2); }
#btn-empty-new-site .ico, #btn-empty-add-environment .ico { width: 20px; height: 20px; }
.hint { color: var(--muted); font-size: 12px; }
/* A large dialog: the script has a fixed height, and the result takes the rest */
dialog.wide.sql-query-dialog { width: min(1200px, 92vw); height: min(760px, 84vh); }
dialog.sql-query-dialog[open] { display: flex; flex-direction: column; }
.sql-query-dialog textarea { flex: none; width: 100%; height: 140px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; resize: none; }
.sql-query-dialog .sql-query-output { flex: 1; min-height: 0; overflow: auto; margin: 12px 0 0; display: flex; flex-direction: column; gap: 14px; }
.sql-query-output:empty { display: none; }
.sql-result { flex: none; display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.sql-result-count { padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; background: linear-gradient(110deg, rgba(163, 113, 247, .08), transparent); }
.sql-result-scroll { overflow: auto; max-height: 52vh; }
/* One result fills the space there is and scrolls under its fixed header, without a second scroll bar */
.sql-result:only-of-type { flex: 1 1 0; }
.sql-result:only-of-type .sql-result-scroll { flex: 1 1 0; max-height: none; min-height: 0; }
.sql-result-table { width: 100%; border-collapse: collapse; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.sql-result-table th { position: sticky; top: 0; z-index: 1; padding: 7px 12px; background: var(--panel2, #1c2129); color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.sql-result-table td { max-width: 420px; padding: 6px 12px; border-bottom: 1px solid rgba(255, 255, 255, .05); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sql-result-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
.sql-result-table tbody tr:hover td { background: rgba(88, 166, 255, .08); }
.sql-result-table .num { text-align: right; }
.sql-result-table .sql-null { color: var(--muted); font-style: italic; opacity: .7; }
.sql-result-message, .sql-query-output > pre { margin: 0; padding: 10px 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; white-space: pre-wrap; }
.sql-result-empty { margin: 0; }
.sql-query-output.sql-query-error > pre { color: #f85149; }
.sql-query-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sql-query-head h2 { margin: 0; }
.dialog-x { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.dialog-x:hover, .dialog-x:focus-visible { background: rgba(255, 255, 255, .08); color: var(--text, #e6edf3); }
.sql-query-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.sql-query-bar .hint { flex: 1; margin: 0; }
.sql-query-bar #sql-query-status { font-size: 12px; white-space: nowrap; }
.sql-backup-history summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.sql-backup-history table { margin-top: 8px; }
.error { color: var(--red); }
#search { min-width: 260px; }

.stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.chip:hover { border-color: var(--blue); }
.chip.active { border-color: var(--blue); background: rgba(88, 166, 255, .15); box-shadow: 0 0 14px rgba(88, 166, 255, .25); }
.chip b { font-size: 16px; }
.chip span { color: var(--muted); font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); grid-auto-rows: 1fr; align-items: stretch; gap: 16px; }
.cards > .site { min-width: 0; }
.site-activity { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; color: var(--blue); background: rgba(88, 166, 255, .12); font-size: 11px; }
.activity-spinner { width: 12px; height: 12px; border: 2px solid rgba(88, 166, 255, .25); border-top-color: var(--blue); border-radius: 50%; animation: activity-spin .8s linear infinite; }
@keyframes activity-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .activity-spinner { animation: none; } }
.multi-select { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(88, 166, 255, .08); cursor: pointer; }
.multi-select input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.site:has(.multi-select input:checked) { border-color: var(--blue); }
#multi-selection, #multi-skipped { overflow-wrap: anywhere; }
#multi-selection { display: flex; flex-wrap: wrap; gap: 7px; max-height: 120px; overflow-y: auto; margin: 0 0 6px; padding: 2px; font-size: 12px; }
.multi-site-tag { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 6px 10px; border: 1px solid rgba(163, 113, 247, .3); border-radius: 8px; color: #d3baff; background: rgba(163, 113, 247, .1); }
.multi-site-tag .ico { width: 14px; height: 14px; flex: none; }
.multi-site-tag > span { min-width: 0; overflow-wrap: anywhere; }
#multi-action-description { font-size: 13px; line-height: 1.6; }
.site { background: linear-gradient(135deg, rgba(88, 166, 255, .04), transparent 60%), var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 4px 16px rgba(0, 0, 0, .15); display: flex; flex-direction: column; gap: 20px; position: relative; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.site:hover { border-color: rgba(88, 166, 255, .5); box-shadow: 0 10px 28px rgba(0, 0, 0, .3), 0 0 20px rgba(88, 166, 255, .07); }
.site.is-admin { border-color: rgba(163, 113, 247, .5); }
.site-head { display: flex; align-items: center; gap: 12px; }
.site-identity { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.site-identity .badge { font-size: 10px; padding: 2px 7px; }
.site-emblem { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border: 1px solid rgba(163, 113, 247, .25); border-radius: 12px; background: linear-gradient(135deg, rgba(88, 166, 255, .15), rgba(163, 113, 247, .18)); color: #b9d8ff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.site-emblem .ico { width: 23px; height: 23px; }
.site-head > .dot { margin-left: auto; }
.card-update-check { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-size: 12px; }
.card-update-check.up-to-date { color: var(--green); }
@media (prefers-reduced-motion: reduce) { .site { transition: none; } }
.site-title { font-size: 15px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.active { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.failed, .dot.inactive { background: var(--red); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--hover); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.badge.umbraco { background: linear-gradient(135deg, #3544b1, #00bcd4); color: #fff; }
.badge.csharp { background: #512bd4; color: #fff; }
.badge.python { background: #3776ab; color: #fff; }
.badge.html { background: #e34f26; color: #fff; }
.badge.admin { background: var(--purple); color: #fff; }
.badge.state-active { background: rgba(63, 185, 80, .2); color: var(--green); }
.badge.env-missing { background: rgba(248, 81, 73, .18); color: #f85149; }
.badge.publish-pending { background: rgba(210, 153, 34, .2); color: #d29922; }
.badge.updates-available { background: rgba(210, 153, 34, .2); color: #d29922; }
.badge.updates-error { background: rgba(248, 81, 73, .2); color: var(--red); }
.publish-status { flex-basis: 100%; display: flex; }
.badge.state-failed, .badge.state-inactive { background: rgba(248, 81, 73, .2); color: var(--red); }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 13px; }
.meta dt { color: var(--muted); }
.meta .database-name { overflow-wrap: anywhere; min-width: 0; }
.meta .aliases a { font-style: italic; }
.meta dd { margin: 0; overflow-wrap: anywhere; }
a.link { color: var(--blue); cursor: pointer; text-decoration: none; }
a.link:hover { text-decoration: underline; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.sql-connection-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 16px; }
.sql-connection-bar > button { min-height: 42px; }
.sql-connection-bar label { margin: 0; min-width: 220px; }
.sql-connection-bar label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; }
#sql-connection { appearance: none; width: min(320px, 100%); padding: 10px 40px 10px 14px; border-radius: 10px; border-color: rgba(163, 113, 247, .45); color: var(--text); font-size: 14px; font-weight: 600; background: var(--panel2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
#sql-connection:hover { border-color: var(--purple); }
.sql-system-databases { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.sql-system-databases summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 0; }
.sql-system-databases table { margin-top: 8px; }
.sql-table { margin-top: 16px; padding: 16px; overflow-x: auto; }
.sql-table h3 { margin-top: 0; }
.sql-databases-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sql-databases-header h3 { margin: 0; }
.sql-databases-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.sql-table td { overflow-wrap: anywhere; }
.sql-table .actions { flex-wrap: wrap; gap: 6px; justify-content: flex-end; border-top: 0; padding-top: 0; }
.sql-table > table th:last-child, .sql-table > table td:last-child:not([colspan]) { text-align: right; }
#sql-databases-panel table th:first-child, #sql-databases-panel table td:first-child { width: 100%; }
#sql-databases-panel table th:not(:first-child), #sql-databases-panel table td:not(:first-child) { white-space: nowrap; }
#sql-databases-panel .actions { flex-wrap: nowrap; }
#sql-databases-panel .sql-state-online { color: var(--green); }
#sql-databases-panel .sql-state-offline, #sql-databases-panel .sql-state-offline_secondary, #sql-databases-panel .sql-state-suspect { color: var(--red); }
#sql-databases-panel .sql-state-restoring, #sql-databases-panel .sql-state-copying { color: var(--blue); }
#sql-databases-panel .sql-state-recovering { color: #39c5cf; }
#sql-databases-panel .sql-state-recovery_pending { color: #d29922; }
#sql-databases-panel .sql-state-emergency { color: var(--orange); }
#form-sql-connection input[type=checkbox] { width: auto; }
#dlg-sql-connection { min-width: 0; }
#dlg-sql-restore { width: min(520px, 92vw); min-width: 0; max-height: 90vh; overflow-y: auto; }
#prompt-checkbox-row, #prompt-login-row { flex-direction: row; align-items: flex-start; gap: 12px; margin: 16px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); color: var(--text); font-size: 14px; line-height: 1.5; cursor: pointer; }
#prompt-checkbox, #prompt-login-checkbox { flex: none; width: 18px; height: 18px; margin: 2px 0 0; padding: 0; accent-color: var(--blue); }
#prompt-checkbox-label { min-width: 0; overflow-wrap: anywhere; }
#form-sql-connection .sql-option { flex-direction: row; align-items: flex-start; gap: 12px; margin: 0 0 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); color: var(--text); cursor: pointer; }
#form-sql-connection .sql-option input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); }
#form-sql-connection .sql-option > span { min-width: 0; }
#form-sql-connection .sql-option strong { display: block; font-size: 14px; line-height: 1.5; }
#form-sql-connection .sql-option .hint { display: block; margin-top: 4px; line-height: 1.5; color: var(--muted); }
#form-sql-connection .sql-option:has(input:checked) { border-color: var(--blue); background: rgba(88, 166, 255, .08); }
#form-sql-connection .sql-connection-note { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.5; }
#form-sql-connection .ns-grid > label { min-width: 0; }
#form-sql-connection .ns-section:not(:first-of-type) { margin-top: 8px; }
#sql-ssh-fields { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
#sql-ssh-fields legend { color: var(--muted); padding: 0 6px; }
.system-update-available { color: var(--orange); background: rgba(210, 153, 34, .15); }
.package-panel { margin-top: 16px; overflow: hidden; }
.package-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(110deg, rgba(163, 113, 247, .08), transparent); }
.package-heading { display: flex; align-items: center; gap: 10px; }
.package-head h3 { margin: 0; font-size: 15px; }
.package-count { padding: 2px 8px; border-radius: 12px; background: rgba(163, 113, 247, .15); color: var(--purple); font-size: 12px; font-weight: 600; }
.package-actions { margin-top: auto; padding: 12px 20px 18px; }
.package-actions .package-add { margin-left: auto; }
.package-list { display: flex; flex-direction: column; gap: 8px; padding: 12px 20px; }
.package-list > p { margin: 12px 0; }
.package-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: transparent; text-align: left; white-space: normal; }
.package-row:hover { background: var(--hover); }
.package-copy { min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; white-space: normal; }
.package-row { cursor: pointer; }
.package-copy:hover, .package-row:hover .package-copy { background: transparent; color: var(--blue); }
.package-versions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.package-version.package-latest { color: var(--green); border-color: rgba(63, 185, 80, .4); background: rgba(63, 185, 80, .1); }
.package-row.has-update { background: rgba(63, 185, 80, .04); }
.package-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.package-name .ico { flex: none; width: 18px; height: 18px; color: var(--purple); }
.package-name > span { min-width: 0; }
.package-version { max-width: 100%; padding: 5px 12px; border: 1px solid rgba(88, 166, 255, .5); border-radius: 6px; background: rgba(88, 166, 255, .15); color: var(--blue); font: 600 14px ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.package-error { margin: 12px 20px; color: var(--orange); font-size: 12px; }
#files th:first-child, #files td:first-child { width: 100%; white-space: nowrap; }
#files .file-size, #files .file-modified { text-align: right; white-space: nowrap; }
#files .file-permissions, #files .file-owner { white-space: nowrap; }
#files .file-permissions { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
#files .file-folder-row, #files .file-open-row { cursor: pointer; }
#files .file-empty-row:hover { background: transparent; }
#files .file-empty-row { cursor: default; }
.files-navigation { align-items: stretch; }
#files-search { flex: 1; min-width: 180px; width: 0; box-sizing: border-box; }
.files-navigation > button, #files-search { height: 34px; }
#files .file-entry { display: inline-flex; align-items: center; gap: 10px; }
#files .file-entry .ico { width: 20px; height: 20px; flex: none; margin: 0; }
#files .file-name { padding: 0; border: 0; background: transparent; color: var(--blue); text-align: left; }
#files .file-folder { color: var(--blue); }
#files .file-document.file-name { color: var(--text); }
#files .file-name:hover { background: transparent; }
#files .tools { cursor: default; }
#files .file-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
#files .file-action { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; margin: 0; border-radius: 8px; }
#files .file-action .ico { width: 16px; height: 16px; margin: 0; }
#files .file-download { box-sizing: border-box; vertical-align: middle; color: var(--blue); border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line)); background: color-mix(in srgb, var(--blue) 9%, var(--panel2)); text-decoration: none; }
#files .file-download:hover { background: color-mix(in srgb, var(--blue) 20%, var(--panel2)); border-color: var(--blue); }
.file-uneditable { color: var(--muted); opacity: .65; cursor: default; }
#files-filter[aria-pressed=true] { border-color: var(--blue); color: var(--blue); }
.list.dragging { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.drop-hint { display: none; position: absolute; inset: 0; pointer-events: none; background: rgba(13, 17, 23, .85); align-items: center; justify-content: center; font-size: 18px; color: var(--blue); }
.list.dragging .drop-hint { display: flex; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: var(--hover); }
.num { text-align: right; white-space: nowrap; }
td.tools { white-space: nowrap; text-align: right; }
td.tools a { margin-left: 10px; font-size: 13px; }
.dirty { color: var(--orange); font-size: 12px; }

#tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
#tabs .tab { display: flex; gap: 8px; align-items: center; padding: 5px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
#tabs .tab:hover { border-color: var(--muted); }
#tabs .tab.active { border-color: var(--blue); background: rgba(88, 166, 255, .15); }
#tabs .tab .x { color: var(--muted); padding: 0 2px; }
#tabs .tab .x:hover { color: var(--red); }
#panes .pane { height: calc(100vh - 190px); min-height: 300px; background: #000; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 22px; min-width: min(440px, 92vw); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(2px); }
dialog h2 { margin: 0 0 10px; font-size: 18px; }
dialog p { margin: 0 0 12px; white-space: pre-line; color: var(--muted); }
dialog input, dialog select { width: 100%; }
dialog label, .card label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; color: var(--muted); font-size: 12.5px; }
dialog label input, dialog label select { color: var(--text); font-size: 14px; }
dialog fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 12px; padding: 10px 12px 0; }
dialog legend { color: var(--muted); font-size: 12px; padding: 0 6px; }
dialog menu { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 0; margin: 14px 0 0; }
dialog menu .cancel-link { margin-right: auto; align-self: center; padding: 8px 0; border: 0; background: transparent; color: var(--blue); font: inherit; text-decoration: none; cursor: pointer; }
dialog menu .cancel-link:hover { background: transparent; text-decoration: underline; }
dialog.danger h2 { color: var(--red); }
dialog.danger .primary { background: #da3633; border-color: var(--red); }
#prompt-ok:disabled { opacity: .4; cursor: not-allowed; background: var(--panel2); border-color: var(--line); color: var(--muted); }
#dlg-prompt { width: min(520px, 92vw); min-width: 0; }
#prompt-message { overflow-wrap: anywhere; }
#dlg-prompt .confirmation-copy { white-space: normal; }
#dlg-prompt .prompt-extra-row { margin-top: 16px; }
#dlg-prompt #prompt-extra { width: 100%; height: 160px; resize: none; overflow-y: auto; font: inherit; }

#toasts { position: fixed; inset: auto 18px 18px auto; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; max-width: calc(100vw - 36px); max-height: calc(100vh - 36px); overflow: auto; display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 8px; padding: 10px 14px; box-shadow: var(--shadow); max-width: 420px; animation: pop .15s ease-out; }
.toast.error { border-left-color: var(--red); }
.toast { display: flex; align-items: flex-start; gap: 12px; pointer-events: auto; }
.toast span { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.toast button { flex-shrink: 0; }
.toast.ok { border-left-color: var(--green); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

body.login { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 32px 16px; background: radial-gradient(ellipse at 25% 15%, rgba(102, 126, 234, .16), transparent 55%), radial-gradient(ellipse at 85% 85%, rgba(118, 75, 162, .12), transparent 50%), var(--bg); }
.login-shell { width: min(440px, 100%); padding: 0; }
.login-card.card { width: 100%; border-color: rgba(139, 148, 180, .24); border-radius: 20px; box-shadow: 0 24px 80px rgba(0, 0, 0, .4), 0 0 50px rgba(108, 123, 255, .05); }
.login-heading { padding: 32px 32px 26px; background: radial-gradient(ellipse at top left, rgba(108, 123, 255, .18), transparent 85%); border-bottom: 1px solid var(--line); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login-logo { display: block; width: 56px; height: 56px; border-radius: 15px; box-shadow: 0 8px 24px rgba(108, 123, 255, .28); }
.login-brand-name { display: flex; flex-direction: column; font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: #fff; }
.login-brand-name span { margin-top: 2px; font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #b4bcff; }
.login-heading h1 { margin: 0; font-size: clamp(22px, 5vw, 28px); line-height: 1.25; letter-spacing: -.035em; }
.login-heading p { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.login-card .card-body { padding: 26px 32px 32px; }
.login-card h2 { margin: 0; font-size: 18px; }
.login-intro { margin: 5px 0 22px; font-size: 13px; color: var(--muted); }
.login-card label { gap: 7px; margin-bottom: 18px; }
.login-card input { min-height: 44px; border-radius: 9px; }
.login-card button.primary { min-height: 44px; margin-top: 4px; border-radius: 9px; background: linear-gradient(135deg, #5865d8, #7548ba); border-color: #8580e6; box-shadow: 0 4px 16px rgba(108, 123, 255, .16); }
.login-card button.primary:hover { background: linear-gradient(135deg, #6673e7, #8658cb); border-color: #b4bcff; }
.login-error { padding: 10px 12px; border: 1px solid rgba(248, 81, 73, .35); border-radius: 9px; background: rgba(248, 81, 73, .08); }
.login-footer { display: flex; justify-content: center; margin: 28px 0 0; }
@media (max-width: 480px) { .login-heading { padding: 26px 24px 22px; } .login-card .card-body { padding: 24px; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: min(360px, 92vw); box-shadow: var(--shadow); overflow: hidden; }
.card-head { background: var(--gradient); padding: 22px 24px; }
.card-head h1 { margin: 0; font-size: 22px; color: #fff; }
.card-head p { margin: 4px 0 0; color: rgba(255, 255, 255, .8); }
.card-body { padding: 22px 24px 24px; }
.card-body input { width: 100%; color: var(--text); font-size: 15px; padding: 8px 12px; }

@media (max-width: 800px) {
	main { padding: 12px; }
	.page-header { padding: 12px; gap: 10px; }
	#search { min-width: 0; flex: 1; }
	th:nth-child(3), td:nth-child(3) { display: none; }
}

/* ---- v2: header, account menu, environments, dock ---- */
.brand h1 { font-size: 17px; line-height: 1.1; }
.brand .host { display: block; font-size: 12px; }
.user { position: relative; }
.avatar { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .5); color: #fff; font-weight: 700; font-size: 15px; }
.avatar:hover { background: rgba(255, 255, 255, .35); border-color: #fff; }
.menu { position: absolute; right: 0; top: 46px; min-width: 200px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.menu form { margin: 0; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; }
.menu button:hover { background: var(--hover); }
#settings-update { display: flex; align-items: center; gap: 6px; }
#system-update-badge { font-size: 10px; padding: 2px 6px; }
.menu-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-group:not([hidden]) ~ .menu-group:not([hidden]) { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.menu-group-title { padding: 5px 10px; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
#btn-dock .count { margin-left: 4px; background: #fff; color: #4b3a8c; font-weight: 700; }
/* The filters take the room there is and wrap inside it, so the buttons stay together on the right */
.toolbar .stats { margin: 0; flex: 1 1 auto; min-width: 0; }
@media (min-width: 900px) { #view-sites > .toolbar { flex-wrap: nowrap; align-items: flex-start; } #view-sites > .toolbar > :not(.stats, .spacer) { flex: none; } }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 500; }
.back .ico { width: 18px; height: 18px; }

.site { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.site:hover { border-color: var(--blue); }
.env-rows { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.env-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.env-label { font-weight: 600; }
.dot.remote { background: var(--purple); }

.detail-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.detail-title h2 { margin: 0; font-size: 26px; }
.detail-title .detail-title-action { margin-left: auto; }
/* Several actions beside the title: only the first is pushed right, the rest follow it */
.detail-title .detail-title-action ~ .detail-title-action { margin-left: 0; }
.sql-heading { margin-bottom: 16px; }
#site-head > .detail-title:last-child { margin-bottom: 16px; }
#site-head > .actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 20px; margin-bottom: 20px; }
.envs { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.env { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px 18px; border-top: 3px solid var(--blue); }
.env.prod { border-top-color: var(--orange); }
/* Same header as the NuGet panel beside it */
.env-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 -20px 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); border-radius: 9px 9px 0 0; background: linear-gradient(110deg, rgba(163, 113, 247, .08), transparent); }
.env > .actions:last-child:not(.quick) { margin-top: auto; padding-top: 12px; }
/* The last row of quick buttons keeps a gap above the Site row's line, also when the card is not taller than its content */
.env > .actions.quick:has(+ .actions:not(.quick)) { margin-bottom: 14px; }
.env-head, .package-head { min-height: 62px; }
.env-head .publish-status { flex-basis: auto; }
.env-head h3 { margin: 0 auto 0 0; min-width: 0; font-size: 18px; overflow-wrap: anywhere; }
.site-layout.with-packages { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.site-layout.with-packages .envs { grid-template-columns: minmax(0, 1fr); }
/* The main site sets the height: a long package list scrolls inside the panel instead of stretching the row */
.site-layout.with-packages .package-panel { margin-top: 0; display: flex; flex-direction: column; contain: size; border-top: 3px solid var(--blue); }
.site-layout.with-packages .package-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.targets-empty { min-height: 0; padding: 48px 20px; border: 1px dashed var(--line); border-radius: 12px; }
body[data-view="sql"] .page-header .search-box { display: none; }
dialog.newsite .hint { margin-top: 8px; line-height: 1.55; }
dialog.newsite .hint + .hint { margin-top: 10px; }
dialog.newsite .copy-connection-toggle + .hint { margin-top: 12px; }
#copy-destination-row { margin-top: 4px; }
.copy-server-fields { margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.copy-server-fields legend { padding: 0 6px; color: var(--muted); font-size: 12px; }
#prod-move-options, #prod-copy-options { margin-top: 12px; }
.prod-dest-path { color: var(--text, inherit); }
.site-targets { margin-top: 32px; }
.site-targets-head .actions.site-targets-right { margin-left: auto; }
/* In the middle of the bar: the free space is shared with the buttons on the right */
/* The environment filter, shaped like the site search in the header: the same corners, icon and clear button */
.targets-search-box { position: relative; display: flex; align-items: center; flex: 0 1 340px; min-width: 180px; margin-left: auto; }
.targets-search-box:has(#targets-search[hidden]) { display: none; }
.site-targets-head .targets-search { width: 100%; min-width: 0; height: 36px; padding: 0 38px 0 36px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .22); font-size: 13.5px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03); transition: background .15s, border-color .15s, box-shadow .15s; }
.site-targets-head .targets-search:hover { border-color: rgba(255, 255, 255, .16); }
.site-targets-head .targets-search:focus { outline: none; background: rgba(0, 0, 0, .3); border-color: rgba(88, 166, 255, .55); box-shadow: 0 0 0 3px rgba(88, 166, 255, .14); }
.site-targets-head .targets-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.targets-search-box .search-icon { left: 12px; width: 15px; height: 15px; color: var(--muted); }
.targets-search-box .search-clear { right: 7px; background: rgba(255, 255, 255, .12); color: var(--text); }
.targets-search-box .search-clear:hover, .targets-search-box .search-clear:focus-visible { background: rgba(255, 255, 255, .24); }
.targets-search-box:has(#targets-search:not(:placeholder-shown)) .search-clear { display: grid; }
.site-targets-head .targets-search:not([hidden]) ~ .site-targets-right:empty { display: none; }
@media (max-width: 700px) { .site-targets-head .targets-search { flex-basis: 100%; order: 3; margin-left: 0; } }
.site-danger { display: flex; justify-content: flex-end; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
/* A header bar in the style of the panels, so the section reads as one block with its cards */
.site-targets-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 20px; background: linear-gradient(110deg, rgba(163, 113, 247, .1), transparent), var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.site-targets-title { display: flex; align-items: center; gap: 10px; }
.site-targets-head h3 { margin: 0; font-size: 18px; }
.site-targets-head .actions { margin: 0; padding: 0; border: 0; }
.env-targets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .site-layout.with-packages { grid-template-columns: minmax(0, 1fr); } .site-layout.with-packages .package-panel { contain: none; } .env-targets { grid-template-columns: minmax(0, 1fr); } }
.env .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; }

#dock { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(1, 4, 9, .72); backdrop-filter: blur(3px); }
.dock-window { display: flex; flex-direction: column; width: min(1200px, 94vw); height: min(720px, 86vh); background: #000; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .7); }
#dock.max .dock-window { width: 98vw; height: 96vh; }
.dock-bar { display: flex; align-items: center; gap: 6px; background: var(--panel); padding: 6px 10px; border-bottom: 1px solid var(--line); }
.dock-bar .ghost { color: var(--text); }
#dock #tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0; flex-wrap: nowrap; }
#dock #panes { flex: 1; min-height: 0; position: relative; }
#dock #panes .pane { position: absolute; inset: 0; height: auto; min-height: 0; padding: 6px 10px; border: 0; border-radius: 0; overflow: hidden; }

dialog.editor { padding: 14px 18px; flex-direction: column; }
dialog.editor[open] { display: flex; }
dialog.editor .toolbar { margin-bottom: 10px; }
dialog.editor textarea { flex: 1; min-height: 0; width: 100%; resize: none; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; tab-size: 4; }
dialog.wide { width: min(1000px, 94vw); }
dialog.editor, dialog.files-dialog, #dlg-logs { width: min(1100px, 94vw); height: min(740px, 86vh); }
#dlg-logs { padding: 18px; flex-direction: column; }
#dlg-logs[open] { display: flex; }
dialog.files-dialog { padding: 18px; }
.files-dialog #view-files { display: flex; flex-direction: column; height: 100%; }
.files-heading h2 { margin: 0; font-size: 18px; }
.files-dialog #drop { flex: 1; min-height: 0; overflow: auto; }
@media (max-width: 800px) { .page-header .search-box { min-width: 0; width: 0; flex: 1; } .page-header:has(#search:not([hidden])) > .spacer { display: none; } .brand h1, .brand .host { display: none; } .envs { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
	.env .desktop-only, .env .actions:not(:has(> button:not(.desktop-only))) { display: none; }
	.package-row { flex-wrap: nowrap; gap: 10px; }
	.package-copy { flex: 1; }
	.package-versions { flex: 0 0 auto; max-width: 55%; justify-content: flex-end; }
	.package-version { white-space: nowrap; overflow-wrap: normal; }
	#view-sql { min-width: 0; }
	#sql-status { overflow-wrap: anywhere; }
	.sql-connection-bar label { min-width: 0; width: 100%; }
	#sql-connection { width: 100%; }
	.sql-connection-bar .spacer { display: none; }
	.sql-table { padding: 12px; overflow-x: visible; min-width: 0; }
	#view-sql table, #view-sql tbody { display: block; width: 100%; }
	#view-sql thead { display: none; }
	#view-sql tbody > tr { display: block; margin-top: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
	#view-sql td:not([colspan]) { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; width: 100%; padding: 6px 0; border: 0; white-space: normal; text-align: left; overflow-wrap: anywhere; }
	#view-sql td[data-label]::before { content: attr(data-label); color: var(--muted); font-weight: 400; }
	#view-sql td[colspan] { display: block; padding: 0; border: 0; }
	#view-sql .actions { flex-wrap: wrap; justify-content: flex-start; min-width: 0; margin: 0; }
	#view-sql .sql-backup-history { min-width: 0; overflow-wrap: anywhere; }
}

.list { position: relative; overflow-x: auto; }
.env .actions.quick { margin-top: 12px; }
.env .actions.quick button { background: var(--accent-soft, transparent); }
.env .actions.quick .script-menu-trigger { background: linear-gradient(135deg, rgba(88, 166, 255, .13), rgba(163, 113, 247, .1)); }
.env .actions.quick .script-menu-trigger:hover, .env .actions.quick .script-menu-trigger[aria-expanded="true"] { background: rgba(88, 166, 255, .18); }
.env .actions.quick .script-menu-item { background: transparent; }
.env .actions.quick .script-menu-item:hover, .env .actions.quick .script-menu-item:focus-visible { background: rgba(88, 166, 255, .1); }
.site:has(.script-menu-panel:not([hidden])), .env:has(.script-menu-panel:not([hidden])) { z-index: 10; }
.script-menu { position: relative; display: inline-flex; }
.script-menu-trigger { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; border-color: rgba(88, 166, 255, .4); color: var(--blue); background: linear-gradient(135deg, rgba(88, 166, 255, .13), rgba(163, 113, 247, .1)); }
.script-menu-trigger:hover, .script-menu-trigger[aria-expanded="true"] { border-color: var(--blue); background: rgba(88, 166, 255, .18); }
.script-menu-trigger .ico { width: 14px; height: 14px; margin: 0; }
.script-menu-chevron { width: 9px; height: 9px; margin: -4px 2px 0 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; color: var(--muted); transform: rotate(45deg); transition: transform .15s; }
.script-menu-trigger[aria-expanded="true"] .script-menu-chevron { margin-top: 5px; transform: rotate(225deg); }
.script-menu-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: min(360px, calc(100vw - 40px)); max-height: min(460px, 65vh); overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 8px; border: 1px solid rgba(88, 166, 255, .28); border-radius: 12px; background: linear-gradient(145deg, rgba(88, 166, 255, .08), transparent 48%), var(--panel); box-shadow: 0 18px 48px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .025); }
.script-menu.push-right .script-menu-panel { right: 0; left: auto; }
.script-menu-header { position: sticky; top: -8px; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; margin: -8px -8px 4px; padding: 13px 14px 11px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 94%, #20334a); }
.script-menu-eyebrow { grid-column: 1 / -1; color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.script-menu-header strong { font-size: 13px; }
.script-menu-count { align-self: center; color: var(--muted); font-size: 11px; }
.script-menu-group { padding: 7px 4px 5px; }
.script-menu-group + .script-menu-group { border-top: 1px solid var(--line); }
.script-menu-group h4 { margin: 0 0 5px; padding: 0 8px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.script-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; padding: 8px; border-color: transparent; background: transparent; text-align: left; }
.script-menu-item:hover, .script-menu-item:focus-visible { border-color: rgba(88, 166, 255, .25); background: rgba(88, 166, 255, .1); }
.script-menu-item-label { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.script-menu-item code { max-width: 52%; overflow: hidden; color: var(--muted); font: 10px/1.4 ui-monospace, Menlo, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .script-menu-chevron { transition: none; } }
.badge.version { text-transform: none; color: #fff; background: #57606a; }
.badge.version[data-major="0"] { background: #8250df; }
.badge.version[data-major="1"] { background: #0969da; }
.badge.version[data-major="2"] { background: #1a7f37; }
.badge.version[data-major="3"] { background: #bf8700; }
.badge.version[data-major="4"] { background: #cf222e; }
.badge.version[data-major="5"] { background: #bf3989; }
.badge.version[data-major="6"] { background: #0a7f8f; }
.badge.version[data-major="7"] { background: #953800; }

/* Button icons and tones */
button .ico { width: 1.1em; height: 1.1em; margin: -2px 6px -2px -2px; vertical-align: middle; }
button[data-tone] { --tone: var(--muted); color: var(--tone); border-color: color-mix(in srgb, var(--tone) 35%, var(--line)); background: color-mix(in srgb, var(--tone) 9%, var(--panel2)); }
button[data-tone]:hover { background: color-mix(in srgb, var(--tone) 20%, var(--panel2)); border-color: var(--tone); }
button[data-tone="blue"] { --tone: var(--blue); }
button[data-tone="green"] { --tone: var(--green); }
button[data-tone="red"] { --tone: var(--red); }
button[data-tone="amber"] { --tone: #d29922; }
button[data-tone="teal"] { --tone: #39c5cf; }
button[data-tone="purple"] { --tone: var(--purple); }
button[data-tone="gray"] { --tone: #9da7b3; }
.menu button[data-tone] { background: transparent; border-color: transparent; color: var(--text); }
.menu button[data-tone] .ico { color: var(--tone); }
.menu button[data-tone]:hover { background: var(--hover); border-color: transparent; }
button.primary[data-tone] { background: #238636; border-color: #2ea043; color: #fff; }
#sql-remove-connection { padding-left: 0; padding-right: 0; border: 0; background: transparent; color: var(--red); align-self: center; }
#sql-remove-connection:hover { background: transparent; text-decoration: underline; }
#form-sql-connection menu { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
#sql-connection-cancel { grid-column: 1; grid-row: 1; justify-self: start; }
#sql-remove-connection { grid-column: 2; grid-row: 1; justify-self: center; }
#form-sql-connection menu > button[type="submit"] { grid-column: 3; grid-row: 1; justify-self: end; }
@media (max-width: 560px) {
	#form-sql-connection menu { grid-template-columns: minmax(0, 1fr) auto; }
	#form-sql-connection menu > button[type="submit"] { grid-column: 2; }
	#sql-remove-connection { grid-column: 1 / -1; grid-row: 2; }
}
/* Delete buttons stand alone at the far right of their row */
.actions > button.danger, #site-head .actions > button.danger { margin-left: auto; }
dialog.editor #editor-box { flex: 1; min-height: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }

/* New site dialog */
dialog.newsite { width: min(640px, 94vw); max-height: 90vh; max-height: 90dvh; padding: 0; overflow-y: auto; }
dialog.newsite form { padding: 0 24px 20px; }
.ns-head { display: flex; align-items: center; gap: 14px; margin: 0 -24px 18px; padding: 20px 24px; background: linear-gradient(135deg, rgba(88,101,242,.35), rgba(139,92,246,.22)); border-bottom: 1px solid var(--line); }
.ns-head h2 { margin: 0; font-size: 20px; }
.ns-head p { margin: 2px 0 0; font-size: 13px; }
.ns-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; color: #fff; background: linear-gradient(135deg, #6c7bff, #8b5cf6); box-shadow: 0 4px 14px rgba(108,123,255,.4); }
.ns-icon .ico { width: 24px; height: 24px; }
.ns-head > div { min-width: 0; overflow-wrap: anywhere; }
.ns-section { margin: 4px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.type-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
dialog .type-card { position: relative; display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: rgba(255,255,255,.02); transition: border-color .15s, background .15s; }
.type-card:hover { border-color: var(--blue); }
.type-card input { position: absolute; opacity: 0; pointer-events: none; width: auto; }
.type-card .tc-title { color: var(--text); font-size: 14px; font-weight: 600; }
.type-card .tc-sub { font-size: 12px; color: var(--muted); }
.type-card:has(input:checked) { border-color: var(--blue); background: rgba(88,166,255,.12); box-shadow: 0 0 0 1px var(--blue) inset; }
/* No focus ring: the arrow keys move the choice, so the chosen card also shows where the keyboard is */
.ns-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
dialog.newsite .hint { margin: 2px 0 0; font-size: 12px; }
dialog.newsite .template-status { height: 16px; line-height: 16px; overflow-y: auto; }
@media (max-width: 560px) { dialog.newsite .template-status { height: 32px; } }
dialog.newsite menu { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); list-style: none; align-items: center; }
dialog.newsite menu .cancel-action { margin-right: auto; }
@media (max-width: 560px) { .type-cards, .ns-grid { grid-template-columns: 1fr; } }
dialog.newsite input:not([type=radio]):not([type=checkbox]), dialog.newsite select { height: 38px; padding: 0 12px; font-size: 14px; line-height: 1.2; }
dialog.newsite .copy-connection-toggle input[type=checkbox] { width: auto; height: auto; padding: 0; flex-shrink: 0; }
dialog.newsite .copy-connection-toggle { flex-direction: row; align-items: center; gap: 9px; margin: 16px 0 0; padding: 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); cursor: pointer; }
#dlg-copy-site .copy-dns-hint { margin-top: 0; }
#copy-sql-fields, #sql-database-login, #sql-restore-login, #sql-restore-overwrite { margin: 12px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
#copy-sql-fields .hint, #sql-database-login .hint, #sql-restore-login .hint, #sql-restore-overwrite .hint { margin-bottom: 12px; }
#copy-sql-fields label, #sql-database-login label, #sql-restore-login label, #sql-restore-overwrite label { min-width: 0; }
dialog.newsite select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
dialog.newsite select option { background: var(--panel2); color: var(--text); }
.actions > .push-right { margin-left: auto; }
.actions > .push-right + button.danger { margin-left: 0; }
.env-binding { display: flex; gap: 8px; align-items: baseline; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.env-tags { display: flex; gap: 6px; align-items: center; }
.badge.env-development { background: rgba(88, 166, 255, .2); color: var(--blue); }
.badge.env-test { background: rgba(210, 153, 34, .2); color: #d29922; }
.badge.env-staging { background: rgba(163, 113, 247, .2); color: #a371f7; }
.badge.env-production { background: rgba(248, 81, 73, .2); color: var(--red); }
.environment-current { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; color: var(--muted); font-size: 13px; }
.environment-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border: 0; padding: 0; margin: 0 0 18px; }
.environment-options legend { margin-bottom: 12px; padding: 0; }
.environment-option { --env-tone: var(--blue); min-height: 76px; justify-content: center; }
.environment-option.env-test { --env-tone: #d29922; }
.environment-option.env-staging { --env-tone: var(--purple); }
.environment-option.env-production { --env-tone: var(--red); }
.environment-option .tc-title { color: var(--env-tone); }
.environment-option:has(input:checked) { border-color: var(--env-tone); background: color-mix(in srgb, var(--env-tone) 12%, transparent); box-shadow: 0 0 0 1px var(--env-tone) inset; }
dialog .environment-notice { padding: 12px 14px; border: 1px solid rgba(210, 153, 34, .25); border-radius: 10px; background: rgba(210, 153, 34, .07); font-size: 12px; color: #d29922; }
@media (max-width: 440px) { .environment-options { grid-template-columns: 1fr; } }
a.btn-link { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px; font-size: 12.5px; color: var(--blue); text-decoration: none; background: rgba(88, 166, 255, .1); border: 1px solid rgba(88, 166, 255, .35); border-radius: 6px; transition: background .15s, border-color .15s; }
a.btn-link:hover { background: rgba(88, 166, 255, .2); border-color: var(--blue); }
a.btn-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.btn-link .ico { width: 13px; height: 13px; flex: none; }
.site-links { display: flex; flex-direction: column; margin-top: auto; border: 1px solid var(--line); border-radius: 10px; background: rgba(1, 4, 9, .16); overflow: hidden; }
.site-link-group { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 12px; }
.site-link-group + .site-link-group { border-top: 1px solid var(--line); }
.site-environment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-environment-head .badge { font-size: 10px; padding: 4px 7px; }
.site-environment-links { display: flex; align-items: stretch; gap: 6px; flex-shrink: 0; }
.site-link-group.compact { padding: 7px 12px; }
.site-link-group.compact .site-environment-head { flex-shrink: 0; flex-wrap: nowrap; }
.site-link-group.compact .site-environment-links { flex-shrink: 1; min-width: 0; }
.site-link-group.compact a.btn-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-link-group.compact a.btn-link svg { flex-shrink: 0; }
.site-link-group.compact a.btn-link { min-width: 0; }
.site-link-group.compact a.btn-link.backend { flex-shrink: 0; }
.site-link-group.compact .badge { flex-shrink: 0; }
.site-link-group.compact a.btn-link { padding: 3px 8px; font-size: 12px; }
.site-links .site-link-more { display: block; width: 100%; margin: 0; padding: 8px 12px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--muted); font-size: 12px; text-align: left; cursor: pointer; }
.site-links .site-link-more:hover, .site-links .site-link-more:focus-visible { background: var(--hover); color: var(--text); }
.site-links:has(.publish-status) .site-environment-links { flex-direction: column; }
@media (max-width: 420px) {
	.site { padding: 16px; }
	.site-link-group { flex-wrap: wrap; }
	.site-environment-links { margin-left: auto; }
}
.https-lock { display: inline-flex; align-items: center; flex: none; }
.confirmation-copy { display: inline; padding: 0; border: 0; border-radius: 2px; background: transparent; color: inherit; font: inherit; overflow-wrap: anywhere; cursor: pointer; }
.confirmation-copy:hover { background: transparent; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
#form-prompt menu { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; list-style: none; }
#prompt-copy-status { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.clipboard-transfer { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.https-lock.secure { color: #e3b341; }
.https-lock.insecure { color: var(--red); }
.https-lock.unknown { color: var(--muted); }
.remote-icon { display: inline-flex; align-items: center; color: var(--purple); }
.remote-icon .ico { width: 16px; height: 16px; }
.https-lock .ico { width: 15px; height: 15px; }
.site-link-group .frontend { --link-tone: var(--blue); }
.site-link-group .backend { --link-tone: var(--purple); }
.site-link-group.production .frontend { --link-tone: var(--green); }
.site-link-group.production .backend { --link-tone: #39c5cf; }
.site-link-group a.btn-link { color: var(--link-tone); background: color-mix(in srgb, var(--link-tone) 10%, transparent); border-color: color-mix(in srgb, var(--link-tone) 35%, transparent); }
.site-link-group a.btn-link:hover { background: color-mix(in srgb, var(--link-tone) 20%, transparent); border-color: var(--link-tone); }
.env-binding { flex-wrap: wrap; gap: 6px; }
.env-row { justify-content: space-between; }
.env-row > a.btn-link { justify-self: start; }
.env-tags { justify-self: end; }
#btn-new-site { margin-right: 14px; padding: 7px 18px; font-weight: 600; box-shadow: 0 2px 10px rgba(63, 185, 80, .25); }

/* A database unfolds into its tables */
.sql-database-name { display: flex; align-items: center; gap: 6px; }
.sql-tables-toggle { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: -4px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.sql-tables-toggle:hover, .sql-tables-toggle:focus-visible { background: rgba(255, 255, 255, .08); color: var(--text, #e6edf3); }
.sql-tables-toggle svg { transition: transform .15s ease; }
.sql-tables-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
#sql-databases-panel table tr.sql-tables-row > td { width: auto; padding: 0 0 12px 30px; border-top: 0; }
.sql-tables { padding: 4px 0 0; font-size: 13px; }
.sql-tables-count { margin: 0 0 6px; font-size: 12px; }
.sql-tables ul { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 16px; }
.sql-tables li button { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sql-tables li button:hover { background: rgba(88, 166, 255, .08); }
.sql-table-name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sql-table-meta { font-size: 11px; white-space: nowrap; }
.sql-tables p { margin: 0; }
.sql-tables-error { color: #f85149; }

/* Data sync settings of a site */
#dlg-data-sync .copy-connection-toggle > span { display: flex; flex-direction: column; gap: 2px; }
#dlg-data-sync .copy-connection-toggle small { color: var(--muted); font-size: 12px; font-weight: 400; }
#dlg-data-sync .data-sync-main { margin-top: 4px; }
.data-sync-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; transition: opacity .15s ease; }
.data-sync-options fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.data-sync-options legend { padding: 0; margin: 16px 0 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
#dlg-data-sync .data-sync-options .copy-connection-toggle { margin-top: 8px; }
.data-sync-options.off { opacity: .45; }
.data-sync-options.off .copy-connection-toggle { cursor: default; }
@media (max-width: 560px) { .data-sync-options { grid-template-columns: 1fr; gap: 0; } }

/* The rows of an environment card, each named by its group at the left; wrapped buttons line up under the first */
.env .actions[data-group] { position: relative; padding-left: 72px; }
.env .actions[data-group]::before { content: attr(data-group); position: absolute; left: 0; top: 10px; height: 26px; display: flex; align-items: center; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
@media (max-width: 700px) {
	.env .actions[data-group] { padding-left: 0; }
	.env .actions[data-group]::before { position: static; flex-basis: 100%; height: auto; }
}
#sql-databases-panel tr.sql-database-row { cursor: pointer; }
#sql-databases-panel tr.sql-database-row:hover > td { background: rgba(255, 255, 255, .025); }
#sql-databases-panel tr.sql-database-row .actions button { cursor: pointer; }

/* Sync dialog: where from, and a card per destination */
.sync-from { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 18px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .02); font-size: 13px; }
.sync-from-label { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.sync-env-name { --env-tone: var(--blue); color: var(--env-tone); font-weight: 600; }
.sync-env-name.env-test { --env-tone: #d29922; }
.sync-env-name.env-staging { --env-tone: var(--purple); }
.sync-env-name.env-production { --env-tone: var(--red); }
.sync-options { display: block; margin-bottom: 4px; }
.sync-options legend { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.sync-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sync-choice { min-height: 68px; }
.sync-choice .tc-sub { overflow-wrap: anywhere; }
.sync-choice.env-all { --env-tone: var(--green); grid-column: 1 / -1; min-height: 0; }
.sync-chips { display: flex; gap: 6px; margin-top: 6px; }
/* Each destination's last syncs, as the dashboard in Umbraco shows them */
.sync-status { display: grid; gap: 3px; margin-top: 8px; font-size: 12px; }
.sync-status-row { display: flex; align-items: center; gap: 8px; }
.sync-status-kind { min-width: 56px; color: var(--text); font-weight: 600; }
.sync-status-when { color: var(--muted); white-space: nowrap; }
.sync-status-pill { margin-left: auto; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.sync-status-row.current .sync-status-pill { background: rgba(63, 185, 80, .15); color: var(--green); }
.sync-status-row.changed .sync-status-pill, .sync-status-row.behind .sync-status-pill { background: rgba(210, 153, 34, .16); color: #d29922; }
.sync-status-row.failed .sync-status-pill { background: rgba(248, 81, 73, .15); color: var(--red); }
.sync-status-row.never .sync-status-pill { background: rgba(255, 255, 255, .06); color: var(--muted); }
.sync-choice.up-to-date, .sync-choice.settings-behind { opacity: .6; cursor: not-allowed; }
.sync-choice.up-to-date::after { content: "Nothing to sync"; position: absolute; top: 10px; right: 12px; color: var(--green); font-size: 11px; font-weight: 700; }
.sync-anyway-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; font-size: 12px; }
dialog .sync-settings-first { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; margin: 14px 0 0; padding: 10px 12px; border: 1px solid rgba(210, 153, 34, .35); border-radius: 10px; background: rgba(210, 153, 34, .08); cursor: pointer; text-align: left; }
dialog .sync-settings-first input { flex: none; width: 16px; height: 16px; min-height: 0; margin: 2px 0 0; padding: 0; }
.sync-settings-first span { display: grid; gap: 2px; }
.sync-settings-first small { color: var(--muted); }
.sync-recent { margin-top: 14px; font-size: 12px; }
.sync-recent-title { margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.sync-recent table { width: 100%; border-collapse: collapse; }
.sync-recent td { padding: 4px 8px 4px 0; border-top: 1px solid var(--line); white-space: nowrap; }
.sync-recent tr:first-child td { border-top: 0; }
.sync-recent-result { text-align: right; color: var(--green); }
.sync-recent tr.failed .sync-recent-result { color: var(--red); }
.sync-chip { padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--env-tone) 16%, transparent); color: var(--env-tone); font-size: 11px; font-weight: 600; text-transform: capitalize; }
@media (max-width: 440px) { .sync-choices { grid-template-columns: 1fr; } }
dialog.newsite .sync-options ~ .hint { margin-top: 12px; }
dialog.newsite .data-sync-options ~ .hint { margin-top: 22px; }
/* With a Manage row, the Site row above it starts the bottom block of the card */
.env > .actions:not(.quick):has(+ .actions:last-child:not(.quick)) { margin-top: auto; padding-top: 10px; }
.env > .actions:not(.quick) + .actions:last-child:not(.quick) { margin-top: 10px; padding-top: 10px; }
.remote-icon { gap: 5px; }
.remote-icon .os-logo { display: inline-flex; }
.remote-icon .os-logo svg { width: 16px; height: 16px; }
.remote-icon .os-linux svg { width: 19px; height: 19px; margin: -2px 0; }
.sync-options legend { display: flex; align-items: center; width: 100%; }
dialog.newsite .sync-select-all { margin-left: auto; padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; cursor: pointer; }
dialog.newsite .sync-select-all:hover { background: transparent; text-decoration: underline; }
.sync-choice:has(input:checked)::after { content: "\2713"; position: absolute; top: 10px; right: 12px; color: var(--env-tone); font-weight: 700; }
#files.files-windows th:nth-child(4), #files.files-windows td:nth-child(4), #files.files-windows th:nth-child(5), #files.files-windows td:nth-child(5) { display: none; }
.meta .badge.any-name { margin-left: 8px; background: rgba(63, 185, 80, .15); color: var(--green); vertical-align: middle; }
.data-sync-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#dlg-data-sync .data-sync-settings .copy-connection-toggle { margin-top: 0; }
#dlg-data-sync .data-sync-settings .copy-connection-toggle[hidden] { display: none; }
#dlg-data-sync .ns-section + .data-sync-main { margin-top: 0; }
#dlg-data-sync .data-sync-settings + .ns-section { margin-top: 22px; }
@media (max-width: 560px) { .data-sync-settings { grid-template-columns: 1fr; } }
/* A destination card names the site, with its environment below in the environment's colour */
.sync-choice .tc-title { color: var(--text); overflow-wrap: anywhere; }
.sync-choice .tc-sub { color: var(--env-tone); font-weight: 600; font-size: 12px; }
.sync-from-site { color: var(--text); font-weight: 600; }
button[data-tone="pink"] { --tone: #db61a2; }

/* Sync setup: cards to turn on, with arrows for the direction. Send points up and out, receive down and in. */
#dlg-data-sync .ns-section { display: flex; align-items: baseline; gap: 10px; }
.sync-section-note { color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.sync-options-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.sync-options-row:first-child { margin-top: 0; }
.sync-option { --option-tone: var(--blue); position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .02); cursor: pointer; transition: border-color .15s, background .15s; }
.sync-option.out { --option-tone: var(--green); }
.sync-option.in { --option-tone: #39c5cf; }
.sync-option.main { --option-tone: #db61a2; margin-bottom: 12px; }
.sync-option[hidden] { display: none; }
.sync-option input { position: absolute; opacity: 0; pointer-events: none; }
.sync-option:hover { border-color: color-mix(in srgb, var(--option-tone) 60%, var(--line)); }
.sync-option-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .04); color: var(--muted); transition: background .15s, color .15s; }
.sync-option-icon .ico { width: 18px; height: 18px; margin: 0; }
.sync-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sync-option-title { color: var(--text); font-size: 14px; font-weight: 600; }
.sync-option-sub { color: var(--muted); font-size: 12px; }
.sync-option:has(input:checked) { border-color: var(--option-tone); background: color-mix(in srgb, var(--option-tone) 10%, transparent); box-shadow: 0 0 0 1px var(--option-tone) inset; }
.sync-option:has(input:checked) .sync-option-icon { background: color-mix(in srgb, var(--option-tone) 22%, transparent); color: var(--option-tone); }
.sync-option:has(input:checked)::after { content: "\2713"; position: absolute; top: 8px; right: 12px; color: var(--option-tone); font-weight: 700; }
/* Focus shows on the title only, so a card that has the focus never looks chosen */
.sync-option:has(input:focus-visible) .sync-option-title { text-decoration: underline; text-underline-offset: 3px; }
.data-sync-options.off .sync-option { cursor: default; }
.data-sync-options.off .sync-option:hover { border-color: var(--line); }
#dlg-data-sync .data-sync-options { display: block; margin-top: 0; }
#dlg-data-sync .ns-section + .sync-options-row { margin-top: 0; }
@media (max-width: 560px) { .sync-options-row { grid-template-columns: 1fr; } }
/* Beside the dialog's own label layout, which stacks a label's contents */
#dlg-data-sync label.sync-option { flex-direction: row; align-items: center; justify-content: flex-start; margin: 0; text-align: left; font-size: inherit; color: inherit; }
#dlg-data-sync label.sync-option.main { margin-bottom: 12px; }
#dlg-data-sync .sync-options-row + .ns-section { margin-top: 24px; }
/* The environment's colour marks the card and its name; what is synced is shown in neutral chips */
.sync-chip { background: rgba(255, 255, 255, .07); color: var(--muted); }
.sync-choice:has(input:checked) { background: color-mix(in srgb, var(--env-tone) 6%, transparent); }

/* Phones zoom in on a field with text below 16px when it gets the focus: fields are 16px there */
@media (max-width: 700px) {
	input, select, textarea { font-size: 16px !important; }
}
.badge.not-set-up { background: rgba(210, 153, 34, .18); color: #d29922; }

/* The update dialog: versions, then the notes of each release or the latest commit */
dialog.wide.system-update-dialog { width: min(720px, 92vw); }
.system-update-notes { display: flex; flex-direction: column; gap: 12px; max-height: 52vh; overflow: auto; margin-top: 4px; }
.system-update-release { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .02); }
.system-update-release-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.system-update-release-head a { margin-left: auto; color: var(--blue); font-size: 12px; text-decoration: none; }
.system-update-release-head a:hover { text-decoration: underline; }
.system-update-subject { margin: 0; font-weight: 600; }
.release-notes h4 { margin: 12px 0 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.release-notes h4:first-child { margin-top: 2px; }
.release-notes ul { margin: 0; padding-left: 18px; }
.release-notes li { margin: 3px 0; }
.release-notes li.nested { margin-left: 16px; list-style: circle; }
.release-notes p { margin: 6px 0; }
.system-update-changes { display: inline-block; margin-top: 12px; color: var(--blue); font-size: 13px; text-decoration: none; }
.system-update-changes:hover { text-decoration: underline; }
.system-update-changes[hidden] { display: none; }
.settings-version { margin-top: 6px; padding: 8px 12px 4px; border-top: 1px solid var(--line); font-size: 11px; text-align: center; }
.settings-version:empty { display: none; }
#dlg-system-update .system-update-notes + .hint { margin-top: 14px; }
/* While VNS updates: from which version to which, and the step it is on */
.system-update-versions-line { margin: 4px 0 10px; color: var(--purple); font-size: 15px; font-weight: 600; }
.system-update-step { max-width: min(560px, 90vw); margin: 14px auto 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sites | SQL Server in the header: the two sections of the admin, always in reach */
.view-switch { display: inline-flex; gap: 2px; margin-left: 18px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .03); }
.view-switch button { padding: 6px 14px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.view-switch button:hover { color: var(--text); background: var(--hover); }
.view-switch button.active { background: rgba(163, 113, 247, .16); color: var(--text); box-shadow: 0 0 0 1px rgba(163, 113, 247, .35) inset; }
@media (max-width: 700px) { .view-switch { margin-left: 8px; } .view-switch button { padding: 5px 9px; font-size: 12px; } }

/* The Server menu's bottom: the version, and an update when there is one */
.settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding: 8px 10px 4px; border-top: 1px solid var(--line); }
.settings-footer .settings-version { margin: 0; padding: 0; border: 0; color: var(--muted); font-size: 12px; text-align: left; }
.settings-uptodate { color: var(--green); font-size: 12px; }
.settings-footer #settings-update { width: auto; padding: 5px 10px; font-size: 12px; }
.menu button.menu-danger:hover { background: rgba(248, 81, 73, .12); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.preferences-interval { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.preferences-interval input { max-width: 160px; }
.page-header .view-switch { flex: none; width: auto; border-color: rgba(255, 255, 255, .28); background: rgba(0, 0, 0, .12); }
.page-header .view-switch button { color: rgba(255, 255, 255, .78); }
.page-header .view-switch button:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.page-header .view-switch button.active { color: #fff; background: rgba(255, 255, 255, .22); box-shadow: none; }

/* Preferences: keep-alive as a card that turns on, and the interval as quick choices */
#dlg-preferences label.sync-option { flex-direction: row; align-items: center; justify-content: flex-start; margin: 0; text-align: left; font-size: inherit; color: inherit; }
.keep-alive-option { --option-tone: var(--green); }
.keep-alive-interval { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; transition: opacity .15s; }
.keep-alive-interval.off { opacity: .45; }
.keep-alive-every { margin-right: 4px; color: var(--muted); font-size: 13px; }
.keep-alive-interval button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .02); color: var(--text); font-size: 13px; cursor: pointer; }
.keep-alive-interval button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--green) 60%, var(--line)); }
.keep-alive-interval button.active { border-color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); font-weight: 600; }
.keep-alive-interval button:disabled { cursor: default; }
#dlg-preferences .keep-alive-custom { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0 0 0 6px; color: var(--muted); font-size: 13px; }
#dlg-preferences .keep-alive-custom input { width: 76px; height: 32px; }

/* Multi action: the selected sites, then the actions as cards */
#dlg-multi { width: min(720px, 94vw); max-height: 90dvh; overflow-y: auto; }
#dlg-multi #multi-selection { margin: 2px 0 6px; }
.multi-choices { margin-bottom: 6px; }
.multi-choices-4 { grid-template-columns: repeat(4, 1fr); }
.multi-choice .tc-sub { font-size: 12px; }
#dlg-multi .ns-section { margin-top: 14px; }
@media (max-width: 640px) { .multi-choices-4 { grid-template-columns: repeat(2, 1fr); } }

/* Logs as a list: time, level, source and message, with a filter */
dialog.wide.logs-dialog { width: min(1180px, 94vw); height: min(780px, 86vh); }
dialog.logs-dialog[open] { display: flex; flex-direction: column; }
.logs-dialog h2 { margin: 0 0 12px; }
.logs-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.logs-toolbar #logs-search { flex: 1 1 220px; height: 34px; }
.logs-levels { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; }
.logs-levels button { padding: 4px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.logs-levels button span { margin-left: 4px; opacity: .8; }
.logs-levels button.active { background: rgba(255, 255, 255, .08); color: var(--text); }
.logs-levels button[data-level="error"].active { background: rgba(248, 81, 73, .16); color: #ff7b72; }
.logs-levels button[data-level="warn"].active { background: rgba(210, 153, 34, .18); color: #e3b341; }
.logs-raw { padding: 6px 12px; font-size: 12px; }
.logs-raw[aria-pressed="true"] { border-color: var(--blue); color: var(--blue); }
.logs-list, .logs-raw-text { flex: 1; min-height: 0; overflow: auto; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .22); }
.logs-raw-text { padding: 12px; font-size: 12px; white-space: pre-wrap; }
.log-row { display: grid; grid-template-columns: 140px 72px minmax(0, 150px) minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 6px 12px; border-bottom: 1px solid rgba(255, 255, 255, .04); font-size: 12px; }
.log-row:hover { background: rgba(255, 255, 255, .03); }
.log-time { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; overflow: hidden; }
.log-level { justify-self: start; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, .06); color: var(--muted); }
.log-row.level-error { background: rgba(248, 81, 73, .05); }
.log-row.level-error .log-level { background: rgba(248, 81, 73, .18); color: #ff7b72; }
.log-row.level-warn .log-level { background: rgba(210, 153, 34, .2); color: #e3b341; }
.log-source { color: #79c0ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-message { color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.logs-empty, .logs-error { margin: 0; padding: 14px; }
.logs-error { color: #f85149; }
.logs-dialog menu { align-items: center; }
.logs-count { margin-right: auto; font-size: 12px; }
@media (max-width: 700px) {
	.log-row { grid-template-columns: auto auto 1fr; }
	.log-message { grid-column: 1 / -1; }
}
.multi-package-fields { margin-top: 10px; }
#dlg-multi #multi-action-description:not(:empty) { margin-top: 12px; }
.logs-levels:not(:has(button:not([hidden]):not([data-level="all"]))) { display: none; }
.logs-dialog h2 + .logs-source { margin: -8px 0 12px; }
.logs-source { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; }
.log-file { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 5px 8px 5px 12px; border-bottom: 1px solid var(--line); background: var(--panel2, #1c2129); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 600; }
.log-file > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-file-clear { margin-left: auto; padding: 2px 10px; font-family: inherit; font-size: 12px; font-weight: 500; }
.log-file-clear:hover { border-color: var(--red, #f85149); color: var(--red, #f85149); }
#preferences-keep-alive-hint { margin-top: 14px; }
#sql-restore-overwrite { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
#sql-restore-overwrite legend { color: var(--red); }
#sql-restore-submit.primary.danger { background: #da3633; border-color: var(--red); color: #fff; }

/* .NET versions: each major its own colour. Outlined, so they are not taken for the Umbraco version next to them. */
.badge.dotnet { --tone: #a371f7; text-transform: none; color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 55%, transparent); }
.badge.dotnet[data-major="8"] { --tone: #8b949e; }
.badge.dotnet[data-major="9"] { --tone: #d29922; }
.badge.dotnet[data-major="10"] { --tone: #a371f7; }
.badge.dotnet[data-major="11"] { --tone: #39c5cf; }
.badge.dotnet[data-major="12"] { --tone: #3fb950; }
.badge.dotnet[data-major="13"] { --tone: #f778ba; }

/* Grid or list in the overview */
.layout-toggle { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.layout-toggle button { display: grid; place-items: center; width: 32px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
/* No text beside the icon, so none of the space buttons keep between an icon and its text */
.layout-toggle button .ico { width: 16px; height: 16px; margin: 0; }
/* The chosen layout is lit in blue; the other stays dim until hovered, so the choice reads at a glance */
.layout-toggle button { opacity: .55; transition: color .15s, background .15s, opacity .15s; }
.layout-toggle button:hover { opacity: 1; color: var(--text); background: rgba(255, 255, 255, .04); }
.layout-toggle button[aria-pressed="true"] { opacity: 1; color: #cfe3ff; background: rgba(88, 166, 255, .2); box-shadow: inset 0 0 0 1px rgba(88, 166, 255, .45), 0 1px 6px rgba(88, 166, 255, .18); }
.cards.list { display: flex; flex-direction: column; gap: 8px; }
.cards.list > .site { flex-direction: row; align-items: center; gap: 20px; padding: 12px 16px; border-radius: 10px; }
.cards.list > .site .site-head { flex: 0 0 min(40%, 420px); min-width: 0; }
.cards.list > .site .site-emblem { width: 34px; height: 34px; border-radius: 10px; }
.cards.list > .site .site-emblem .ico { width: 18px; height: 18px; }
/* The name above its badges in every row, so the rows look alike however long the name is */
.cards.list > .site .site-identity { gap: 6px; }
/* Each environment line in columns: environment, its status, its links. The columns line up down the list. */
.cards.list .site-link-group.compact { display: grid; grid-template-columns: 170px 110px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.cards.list .site-link-group.compact > .site-environment-head { grid-column: 1; }
.cards.list .site-link-group.compact > .env-state { grid-column: 2; display: inline-flex; align-items: center; gap: 8px; }
.cards.list .site-link-group.compact > .env-state .badge { font-size: 10px; }
.cards.list .site-link-group.compact > .badge, .cards.list .site-link-group.compact > .publish-status { grid-column: 3; justify-self: start; }
.cards.list .site-link-group.compact > .site-environment-links, .cards.list .site-link-group.compact > .muted { grid-column: 4; justify-self: end; }
.cards.list > .site .site-head > .dot { order: -1; margin: 0 2px 0 0; }
.cards.list > .site .site-links { flex: 1; min-width: 0; margin: 0; }
.cards.list > .site .multi-select { flex: none; }
@media (max-width: 760px) {
	.cards.list > .site { flex-direction: column; align-items: stretch; gap: 12px; }
	.cards.list > .site .site-head { flex-basis: auto; }
}
.site.selectable { user-select: none; }
.site.selectable:hover { border-color: var(--blue); }

/* Sites with something waiting: after the other filters, in amber */
.chip-divider { align-self: stretch; width: 1px; margin: 4px 4px; background: var(--line); }
.chip.attention b { color: #d29922; }
.chip.attention:hover, .chip.attention.active { border-color: #d29922; }
.chip.attention.active { background: rgba(210, 153, 34, .14); box-shadow: 0 0 14px rgba(210, 153, 34, .2); }
/* A link to an environment never shrinks away beside a status badge */
.site-link-group.compact a.btn-link.frontend { min-width: 84px; }
/* On a card, a pending publish is an icon: the row has no room for the words */
.publish-pending-icon { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; color: #d29922; background: rgba(210, 153, 34, .14); }
.publish-pending-icon .ico { width: 13px; height: 13px; margin: 0; }

/* Environments as a list: a row per environment with its most used buttons; the chevron unfolds the whole card */
.site-targets-head .layout-toggle { flex: none; }
.env-targets.list { display: flex; flex-direction: column; gap: 8px; }
.env-targets.list > .env-listed { padding-bottom: 0; }
.env-targets.list > .env-listed > .env-head { margin-bottom: 0; border-bottom: 0; border-radius: 9px; cursor: pointer; min-height: 0; padding: 10px 14px 10px 20px; }
.env-targets.list > .env-listed > .env-head h3 { font-size: 16px; }
.env-targets.list > .env-listed:not(.unfolded) > :not(.env-head) { display: none; }
.env-targets.list > .env-listed.unfolded { padding-bottom: 18px; }
.env-targets.list > .env-listed.unfolded > .env-head { margin-bottom: 14px; border-bottom: 1px solid var(--line); border-radius: 9px 9px 0 0; }
.env-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.env-row-actions button { white-space: nowrap; }
.env-row-toggle { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); }
.env-row-toggle:hover { color: var(--text); background: var(--hover); }
.env-row-toggle .ico { width: 16px; height: 16px; margin: 0; transition: transform .15s; }
.env-row-toggle[aria-expanded="true"] .ico { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .env-row-toggle .ico { transition: none; } }
/* The editor's toolbar on one line: the file and what happened to it on the left, the actions on the right */
dialog.editor .editor-toolbar { flex-wrap: nowrap; align-items: center; gap: 10px; }
.editor-file { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.editor-file-line { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.editor-file-line strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-file-line .dirty { flex: none; }
#editor-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
#editor-status:empty { display: none; }
dialog.editor .editor-toolbar > button, dialog.editor .editor-toolbar > select { flex: none; }
@media (max-width: 700px) { dialog.editor .editor-toolbar { flex-wrap: wrap; } .editor-file { flex-basis: 100%; } }
#dlg-snippet { width: min(520px, 92vw); }
.snippet-fields { display: grid; gap: 12px; }
.snippet-fields label { display: grid; gap: 6px; }
.snippet-fields .hint { margin: 0; }
/* The snippet menu, like the custom scripts menu: a panel of rules with an icon and a line about each */
.snippet-menu { position: relative; flex: none; }
.snippet-trigger { display: inline-flex; align-items: center; gap: 7px; height: 34px; border-color: rgba(88, 166, 255, .4); color: var(--blue); background: linear-gradient(135deg, rgba(88, 166, 255, .13), rgba(163, 113, 247, .1)); }
.snippet-trigger .ico { width: 15px; height: 15px; margin: 0; }
.snippet-trigger[aria-expanded="true"], .snippet-trigger:hover { background: rgba(88, 166, 255, .18); }
.snippet-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: min(340px, calc(100vw - 40px)); max-height: min(480px, 70vh); overflow: auto; padding: 8px; border: 1px solid rgba(88, 166, 255, .28); border-radius: 12px; background: linear-gradient(145deg, rgba(88, 166, 255, .08), transparent 48%), var(--panel); box-shadow: 0 18px 48px rgba(0, 0, 0, .55); }
.snippet-panel-head { display: grid; gap: 3px; margin: -8px -8px 6px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.snippet-panel-head span { color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.snippet-panel-head strong { font-size: 13px; }
.snippet-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; }
.snippet-item:hover, .snippet-item:focus-visible { border-color: rgba(88, 166, 255, .25); background: rgba(88, 166, 255, .1); outline: none; }
.snippet-item-icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; color: #b9d8ff; background: linear-gradient(135deg, rgba(88, 166, 255, .16), rgba(163, 113, 247, .16)); }
.snippet-item-icon .ico { width: 15px; height: 15px; margin: 0; }
.snippet-item-text { display: grid; gap: 1px; min-width: 0; }
.snippet-item-text strong { font-size: 13px; font-weight: 600; }
.snippet-item-text small { color: var(--muted); font-size: 11.5px; }
.snippet-fields select { width: 100%; }
/* The search in the header, shaped like the Web Server | SQL Server switch beside it: the same corners, edge and height */
.page-header .search-box { position: relative; display: flex; align-items: center; min-width: 300px; margin-left: 12px; }
.page-header .search-box:has(#search[hidden]) { display: none; }
.page-header .search-box #search { width: 100%; min-width: 0; height: 38px; padding: 0 40px 0 38px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 10px; background: rgba(0, 0, 0, .12); color: #fff; font-size: 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); transition: background .15s, border-color .15s, box-shadow .15s; }
.page-header .search-box #search::placeholder { color: rgba(255, 255, 255, .7); }
.page-header .search-box #search:hover { background: rgba(0, 0, 0, .18); }
.page-header .search-box #search:focus { outline: none; background: rgba(0, 0, 0, .28); border-color: rgba(255, 255, 255, .55); box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); }
/* The browser's own clear cross is hard to see on the header: ours replaces it */
.page-header .search-box #search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.search-clear { position: absolute; right: 8px; display: none; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .22); color: #fff; cursor: pointer; transition: background .15s; }
.search-clear:hover, .search-clear:focus-visible { background: rgba(255, 255, 255, .38); outline: none; }
.search-box:has(#search:not(:placeholder-shown)) .search-clear { display: grid; }
.search-icon { position: absolute; left: 12px; width: 16px; height: 16px; color: rgba(255, 255, 255, .75); pointer-events: none; }
.search-key { position: absolute; right: 9px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 6px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .85); font: 600 12px/1 ui-monospace, Menlo, monospace; pointer-events: none; }
/* The shortcut is only shown on an empty field that is not being typed in */
.search-box:has(#search:focus) .search-key, .search-box:has(#search:not(:placeholder-shown)) .search-key { display: none; }
@media (max-width: 800px) { .page-header .search-box { margin-left: 8px; } .search-key { display: none; } }
/* An environment row's addresses, coloured like the production links on the overview's cards */
.env-row-links { display: flex; gap: 6px; }
.env-row-links a.btn-link { padding: 3px 8px; font-size: 12px; color: var(--link-tone); background: color-mix(in srgb, var(--link-tone) 10%, transparent); border-color: color-mix(in srgb, var(--link-tone) 35%, transparent); }
.env-row-links .frontend { --link-tone: var(--green); }
.env-row-links .backend { --link-tone: #39c5cf; }
/* An environment row in fixed columns: name, state, environment, icons and status line up in every row */
.env-targets.list > .env-listed > .env-head { display: grid; grid-template-columns: minmax(0, 280px) 112px 112px 22px minmax(0, 1fr) auto 30px; flex-wrap: nowrap; gap: 12px; }
.env-col { display: flex; align-items: center; gap: 8px; min-width: 0; }
.env-col-name h3 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.env-col-actions { justify-content: flex-end; gap: 10px; }
.env-col-actions .env-row-links { min-width: 0; }
.env-col-actions .env-row-links a.btn-link { min-width: 0; }
.env-col-actions .env-row-links a.btn-link.frontend { max-width: 300px; }
.env-col-actions .env-row-links a.btn-link { white-space: nowrap; flex: none; }
.env-row-actions { flex-wrap: nowrap; }
.env-col-note .publish-status, .env-col-note .badge { white-space: nowrap; }
.env-col { overflow: hidden; }
.env-col-actions { overflow: visible; }
@media (max-width: 1200px) {
	.env-targets.list > .env-listed > .env-head { grid-template-columns: minmax(0, 1fr) auto auto auto 30px; }
	.env-targets.list > .env-listed > .env-head .env-col-note { display: none; }
	.env-targets.list > .env-listed > .env-head .env-col-actions { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; flex-wrap: wrap; }
}
/* In the list the coloured top edge of each card would make a stripe per row: a row has its colour on the left */
.env-targets.list > .env-listed, .env-targets.list > .env-listed.prod { border-top: 1px solid var(--line); border-left: 3px solid var(--env-tone, var(--line)); }
.env-targets.list > .env-listed:hover { border-color: rgba(88, 166, 255, .35); }
/* Four places to run (Migrate offers "Separate site" too): one row of four, two by two on a narrow screen */
.prod-target-cards:has(> .type-card:nth-child(4):not([hidden])) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .prod-target-cards:has(> .type-card:nth-child(4):not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* The binding alone on its line (the other site fields are hidden when moving here) takes the whole line */
#prod-binding-row:only-child, .ns-grid:not(:has(> label:not([hidden]):not(#prod-binding-row))) > #prod-binding-row { grid-column: 1 / -1; }

/* A user sees only what they may use: the server's tools and settings are an administrator's */
body[data-role="user"] .admin-only, body[data-role="user"] .admin-only-block, body[data-role="user"] #btn-settings,
body[data-role="user"] #settings-menu, body[data-role="user"] #btn-multi, body[data-role="user"] #btn-check-updates { display: none !important; }
/* ---- Users */
#dlg-users { width: min(640px, 94vw); }
#dlg-user { width: min(760px, 96vw); max-height: 92vh; overflow-y: auto; }
.users-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.users-list { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.users-empty { padding: 24px 4px; text-align: center; }
.user-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); text-align: left; cursor: pointer; }
.user-row:hover, .user-row:focus-visible { border-color: rgba(88, 166, 255, .45); background: rgba(88, 166, 255, .06); outline: none; }
.user-row.disabled { opacity: .6; }
.user-row .ico { width: 15px; height: 15px; margin: 0; color: var(--muted); }
.user-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; font-weight: 700; background: linear-gradient(135deg, #58a6ff, #a371f7); }
.user-text { display: grid; gap: 2px; min-width: 0; }
.user-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-text small { color: var(--muted); font-size: 12px; }
.badge.user-admin { color: #fff; background: rgba(163, 113, 247, .35); }
.badge.user-user { color: var(--text); background: var(--hover); }
.user-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.user-disabled { margin: 4px 0 8px; }
.grant-section { display: flex; align-items: center; }
.grant-switch { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.grant-switch input, .grant-flag input, .grant-chip input, .grant-head input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.grant-area { display: grid; gap: 10px; margin-bottom: 8px; }
.grant-flag { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 13px; cursor: pointer; }
.grant-flag.small { font-size: 12.5px; color: var(--muted); }
.grant-list { display: grid; gap: 6px; }
.grant-site { border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); transition: border-color .15s; }
.grant-site.granted { border-color: rgba(88, 166, 255, .45); background: linear-gradient(135deg, rgba(88, 166, 255, .06), transparent 60%), var(--panel2); }
.grant-head { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; }
.grant-head label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.grant-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grant-head .muted { font-size: 12px; white-space: nowrap; }
.grant-toggle { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.grant-toggle:hover { color: var(--text); background: var(--hover); }
.grant-toggle .ico { width: 15px; height: 15px; margin: 0; transition: transform .15s; }
.grant-toggle[aria-expanded="true"] .ico { transform: rotate(90deg); }
.grant-body { display: grid; gap: 8px; padding: 2px 12px 12px 38px; }
.grant-label { color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.grant-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.grant-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0, 0, 0, .15); font-size: 12.5px; cursor: pointer; }
.grant-chip:has(input:checked) { border-color: rgba(88, 166, 255, .5); background: rgba(88, 166, 255, .12); }
.grant-chip.main:has(input:checked) { border-color: rgba(163, 113, 247, .55); background: rgba(163, 113, 247, .14); }
.grant-chip.later { border-style: dashed; color: var(--muted); }
.grant-chip.later:has(input:checked) { border-color: rgba(88, 166, 255, .45); background: transparent; color: var(--text); }
.grant-databases { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.audit-list .audit-row { grid-template-columns: 150px minmax(0, 160px) 1fr; }
@media (max-width: 640px) { .user-roles { grid-template-columns: 1fr; } .grant-body { padding-left: 12px; } }
/* Checkboxes beside their text, not above it as the dialogs' fields are */
#dlg-user .grant-chip, #dlg-user .grant-head label, #dlg-user .grant-flag, #dlg-user .grant-switch { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; text-align: left; }
#dlg-user .grant-chip { display: inline-flex; }
#dlg-user .grant-chip input, #dlg-user .grant-head input, #dlg-user .grant-flag input, #dlg-user .grant-switch input { flex: none; width: 16px; height: 16px; min-height: 0; padding: 0; }
#dlg-user .grant-flag { justify-content: flex-start; font-weight: 400; }
#dlg-user .user-disabled { display: flex; align-items: center; gap: 12px; text-align: left; }
#dlg-user .user-disabled input { flex: none; width: 16px; height: 16px; }
/* The users list has the dialog's own margins */
#dlg-users > .users-toolbar, #dlg-users > .users-list, #dlg-users > menu { margin-left: 24px; margin-right: 24px; }
#dlg-users > .users-toolbar { margin-top: 18px; }

#dlg-user .user-disabled { margin: 8px 0 6px; }
#dlg-user .grant-section { margin-top: 18px; margin-bottom: 8px; }
/* A header directly in the dialog (no form with side padding around it, as in Users) keeps within the edges */
dialog.newsite > .ns-head { margin: 0 0 4px; }
/* Profile: who you are at the top, then the name, a new password, and the current one to save */
.profile-card { display: flex; align-items: center; gap: 14px; margin: 4px 0 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, rgba(88, 166, 255, .08), rgba(163, 113, 247, .06)), var(--panel2); }
.profile-avatar { width: 44px; height: 44px; font-size: 18px; }
.profile-card .user-text strong { font-size: 15px; }
.ns-section-note { margin-left: 6px; color: var(--muted); font-weight: 500; letter-spacing: 0; text-transform: none; }
.profile-confirm { margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(210, 153, 34, .35); border-radius: 10px; background: rgba(210, 153, 34, .06); }
.profile-confirm label { margin: 0; }
.grant-database-list { max-height: 180px; overflow-y: auto; padding: 2px; }
.grant-database-list[hidden] { display: none; }
/* Every dialog keeps its buttons at the bottom and, with a header, that at the top: only what is between scrolls.
   The footer reaches the dialog's edges, on its own background, so nothing shows through it. */
dialog.newsite > menu, dialog.newsite > form > menu { position: sticky; bottom: 0; z-index: 3; background: var(--panel); }
dialog.newsite > form > menu { margin: 16px -24px -20px; padding: 14px 24px 20px; }
dialog.newsite > menu { margin: 16px 0 0; padding: 14px 24px 20px; }
#dlg-users > menu { margin: 16px 0 0; }
dialog.newsite > form > .ns-head, dialog.newsite > .ns-head { position: sticky; top: 0; z-index: 3;
	background: linear-gradient(135deg, rgba(88,101,242,.35), rgba(139,92,246,.22)), var(--panel); }
/* The small dialogs (confirmations, encoding) keep their buttons at the bottom too, when a long text makes them scroll.
   The buttons stay where they are; a shadow in the dialog's colour covers what scrolls beneath them. */
#dlg-prompt > form > menu, #dlg-prompt > menu, #dlg-encoding > form > menu { position: sticky; bottom: 0; z-index: 3; background: var(--panel); box-shadow: 0 22px 0 22px var(--panel); }
#dlg-prompt, #dlg-encoding { max-height: 86vh; max-height: 86dvh; overflow-y: auto; }
/* Room between the text and the buttons, with a line as in the large dialogs */
#dlg-prompt > form > menu, #dlg-prompt > menu, #dlg-encoding > form > menu { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.layout-toggle[hidden] { display: none; }
/* Web Server and SQL Server in the user editor: a card each, with a switch */
#dlg-user .grant-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 16px 0 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); cursor: pointer; transition: border-color .15s, background .15s; }
#dlg-user .grant-card:hover { border-color: rgba(88, 166, 255, .35); }
#dlg-user .grant-card:has(.switch:checked) { border-color: rgba(88, 166, 255, .5); background: linear-gradient(135deg, rgba(88, 166, 255, .1), rgba(163, 113, 247, .07)), var(--panel2); }
.grant-card-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #b9d8ff; background: linear-gradient(135deg, rgba(88, 166, 255, .2), rgba(163, 113, 247, .2)); }
.grant-card-icon.sql { color: #c9b6ff; }
.grant-card-icon .ico { width: 19px; height: 19px; margin: 0; }
.grant-card-text { display: grid; gap: 2px; min-width: 0; }
.grant-card-text strong { font-size: 14px; }
.grant-card-text small { color: var(--muted); font-size: 12px; }
/* A switch from a checkbox */
#dlg-user .switch { appearance: none; -webkit-appearance: none; position: relative; width: 42px; height: 24px; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .08); cursor: pointer; transition: background .2s, border-color .2s; }
#dlg-user .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #c9d1d9; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .2s, background .2s; }
#dlg-user .switch:checked { border-color: var(--blue); background: var(--blue); }
#dlg-user .switch:checked::after { transform: translateX(18px); background: #fff; }
#dlg-user .switch:focus-visible { outline: 2px solid rgba(88, 166, 255, .6); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { #dlg-user .switch, #dlg-user .switch::after { transition: none; } }
#dlg-user .grant-card-text strong { color: var(--text); font-weight: 600; }
/* An option under a card (May create sites, May add SQL connections) and Locked: a row with an icon, a line and a
   small switch. Under a card it is set in, on a line that joins it to the card. */
#dlg-user .option-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .02); cursor: pointer; transition: border-color .15s, background .15s; }
#dlg-user .option-row:hover { border-color: rgba(88, 166, 255, .3); }
#dlg-user .grant-area > .option-row { position: relative; margin: -2px 0 4px 26px; }
#dlg-user .grant-area > .option-row::before { content: ""; position: absolute; left: -17px; top: -12px; width: 12px; height: 32px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); border-bottom-left-radius: 8px; }
/* SFTP is the user's, for all their sites: a row of its own after the list, not hanging on its last site */
#dlg-user .grant-area > .option-row.sftp-row { margin: 12px 0 0; }
#dlg-user .grant-area > .option-row.sftp-row::before { content: none; }
#dlg-user .option-row:has(.switch:checked) { border-color: rgba(88, 166, 255, .45); background: rgba(88, 166, 255, .07); }
#dlg-user .user-locked { margin: 12px 0 2px; }
#dlg-user .user-locked:has(.switch:checked) { border-color: rgba(248, 81, 73, .5); background: rgba(248, 81, 73, .08); }
.option-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #b9d8ff; background: rgba(88, 166, 255, .14); }
.option-icon.sql { color: #c9b6ff; background: rgba(163, 113, 247, .14); }
.option-icon.lock { color: #ffa198; background: rgba(248, 81, 73, .14); }
.option-icon .ico { width: 15px; height: 15px; margin: 0; }
.option-text { display: grid; gap: 1px; min-width: 0; }
#dlg-user .option-text strong { color: var(--text); font-size: 13px; font-weight: 600; }
.option-text small { color: var(--muted); font-size: 12px; }
#dlg-user .switch.small { width: 34px; height: 20px; }
#dlg-user .switch.small::after { width: 14px; height: 14px; }
#dlg-user .switch.small:checked::after { transform: translateX(14px); }
#dlg-user .switch.danger:checked { border-color: var(--red); background: var(--red); }
/* The update screen: the progress in the middle, and when it did not finish, a card with what happened and what to do */
.system-update-card { display: flex; flex-direction: column; align-items: center; width: min(560px, 92vw); }
.update-failed-icon { display: none; place-items: center; width: 64px; height: 64px; border-radius: 18px; color: #ffa198; background: rgba(248, 81, 73, .14); box-shadow: 0 0 0 1px rgba(248, 81, 73, .3), 0 10px 30px rgba(248, 81, 73, .15); }
.update-failed-icon svg { width: 32px; height: 32px; }
#system-update-overlay.failed .system-update-card { padding: 32px 32px 26px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(160deg, rgba(248, 81, 73, .06), transparent 45%), var(--panel); box-shadow: var(--shadow); }
#system-update-overlay.failed .update-failed-icon { display: grid; }
#system-update-overlay.failed h2 { margin: 18px 0 6px; font-size: 26px; }
#system-update-overlay.failed .system-update-versions-line { margin: 0 0 6px; }
#system-update-overlay.failed #system-update-message { margin: 0; color: var(--text); }
#system-update-overlay.failed .system-update-step { margin-top: 14px; border: 0; padding: 0; font-size: 12px; }
#system-update-overlay.failed .system-update-step::before { content: "At: "; color: var(--muted); }
#system-update-output { width: 100%; max-height: 40vh; overflow: auto; margin: 16px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .3); text-align: left; font-size: 12px; }
.system-update-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.system-update-actions:not(:has(button:not([hidden]))) { display: none; }
#system-update-overlay:focus, #system-update-overlay:focus-visible { outline: none; }
/* DNS help under a binding: the record to make, and whether the name points here */
.dns-card { display: grid; gap: 8px; margin: 10px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, rgba(88, 166, 255, .06), transparent 60%), var(--panel2); }
.dns-card[hidden] { display: none; }
.dns-head { display: flex; align-items: center; gap: 10px; }
.dns-head strong { flex: 1; font-size: 13px; }
.dns-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: #b9d8ff; background: rgba(88, 166, 255, .14); }
.dns-icon .ico { width: 14px; height: 14px; margin: 0; }
.dns-status { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.dns-status.ok { color: var(--green); background: rgba(63, 185, 80, .14); }
.dns-status.ok::before { content: "✓ "; }
.dns-status.warn { color: #d29922; background: rgba(210, 153, 34, .14); }
.dns-status.muted, .dns-status.checking { color: var(--muted); background: rgba(255, 255, 255, .05); }
.dns-records { display: grid; gap: 6px; }
.dns-record { display: grid; grid-template-columns: 58px minmax(0, auto) auto minmax(0, 1fr) 28px; align-items: center; gap: 8px; font-size: 12.5px; }
.dns-type { justify-self: start; padding: 2px 7px; border-radius: 6px; color: var(--muted); background: rgba(255, 255, 255, .06); font: 600 11px ui-monospace, Menlo, monospace; }
.dns-record code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.dns-arrow { color: var(--muted); }
.dns-value { color: var(--text); }
.dns-copy { display: grid; place-items: center; width: 28px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.dns-copy:hover { color: var(--text); border-color: rgba(88, 166, 255, .4); }
.dns-copy.copied { color: var(--green); border-color: rgba(63, 185, 80, .5); }
.dns-copy .ico { width: 13px; height: 13px; margin: 0; }
.dns-note { margin: 0; color: var(--muted); font-size: 12px; }
.dns-note.warn { color: #d29922; }
.dns-card { margin-bottom: 16px; }
/* Pointing here already: only the status, a little larger, on a green card. While checking, the records wait. */
.dns-card.checking .dns-records, .dns-card.checking .dns-note, .dns-card.here .dns-records, .dns-card.here .dns-note { display: none; }
.dns-card.here { border-color: rgba(63, 185, 80, .4); background: rgba(63, 185, 80, .06); }
.dns-card.here .dns-status { padding: 6px 14px; font-size: 13.5px; }
/* Issue certificate: one row per name of the certificate, shown when not all point here */
.dns-check-rows { display: grid; gap: 6px; }
.dns-check-name { display: grid; gap: 6px; }
.dns-check-name + .dns-check-name, .dns-check-name + .dns-check-row, .dns-check-row + .dns-check-name { padding-top: 8px; border-top: 1px solid var(--line); }
.dns-card.checking .dns-check-rows, .dns-card.here .dns-check-rows { display: none; }
.dns-check-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.dns-check-row code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dns-note:empty { display: none; }
/* Remove package: the project's packages to choose from */
.package-pick { display: grid; gap: 10px; }
.package-pick[hidden] { display: none; }
.package-pick-list { display: grid; gap: 6px; max-height: min(420px, 55vh); overflow-y: auto; padding: 2px; }
.package-pick-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.package-pick-row[hidden] { display: none; }
.package-pick-row:hover { border-color: rgba(163, 113, 247, .4); }
.package-pick-row[aria-checked="true"] { border-color: rgba(248, 81, 73, .55); background: linear-gradient(135deg, rgba(248, 81, 73, .1), transparent 70%), var(--panel2); }
.package-pick-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #c9b6ff; background: rgba(163, 113, 247, .14); }
.package-pick-icon .ico { width: 15px; height: 15px; margin: 0; }
.package-pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.package-pick-version { padding: 3px 9px; border: 1px solid rgba(88, 166, 255, .35); border-radius: 7px; color: var(--blue); font: 600 12px ui-monospace, Menlo, monospace; }
button.primary.danger-primary { border-color: var(--red); background: #da3633; }
button.primary.danger-primary:disabled { opacity: .5; }
/* A picked package carries a tick, so several picked read as a list to remove */
.package-pick-row { grid-template-columns: 30px minmax(0, 1fr) auto 20px; }
.package-pick-row::after { content: ""; width: 18px; height: 18px; border: 1.5px solid var(--line); border-radius: 5px; }
.package-pick-row[aria-checked="true"]::after { border-color: var(--red); background: var(--red) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 12px no-repeat; }

/* ---- Phone: the header's controls on one line with the search below, and only the everyday buttons.
   Placed last, so it wins over the desktop sizes above (the search's min-width made the page wider than the screen). */
@media (max-width: 800px) {
	.desktop-only { display: none !important; }
	.page-header { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
	.page-header > .spacer, .page-header:has(#search:not([hidden])) > .spacer { display: block; flex: 1; }
	.brand .logo { width: 32px; height: 32px; border-radius: 8px; }
	.page-header .view-switch { margin-left: 0; }
	.page-header .search-box { order: 10; flex: 1 1 100%; width: auto; min-width: 0; margin: 0; }
	.page-header .search-box #search { height: 36px; }
	.page-header .btn-label { display: none; }
	#btn-dock, #btn-settings { padding: 6px 10px; }
	/* An update is a dot on the gear, not a label */
	#system-update-badge:not([hidden]) { display: inline-block; width: 8px; height: 8px; padding: 0; margin-left: 2px; border-radius: 50%; background: var(--orange); font-size: 0; vertical-align: top; }
	main { padding: 12px; }
	#view-sites > .toolbar .stats { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
	#view-sites > .toolbar .stats::-webkit-scrollbar { display: none; }
	.chip { flex: none; padding: 5px 10px; }
	#site-layout-toggle, #btn-multi, #btn-multi-all, #btn-multi-action, #btn-multi-cancel, .site-targets-head .layout-toggle { display: none !important; }
	/* Cards are as tall as their content, not as the tallest in the grid */
	.cards { grid-auto-rows: auto; gap: 12px; }
	.site { padding: 14px; gap: 14px; }
	.detail-title h2 { font-size: 21px; }
}
/* Several names: the rows stay visible when all point here, so each name shows its tick */
.dns-card.several.here .dns-records, .dns-card.several.here .dns-check-rows { display: grid; }
.dns-card.several.here .dns-check-row .dns-status { padding: 3px 10px; font-size: 11.5px; }
.dns-card.several .dns-records > .dns-check-rows { padding-top: 2px; }
/* Below the aliases too, the card keeps room from the field above it */
.prompt-extra-row + #prompt-dns .dns-card { margin-top: 14px; }

/* Migrate or copy a site: what goes to the new server and what stays */
.move-site-list { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.move-site-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 9px 14px; font-size: 13px; }
.move-site-list li + li { border-top: 1px solid var(--line); }
.move-site-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.move-site-where { min-width: 84px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; text-align: center; }
.move-site-list .goes .move-site-where { color: var(--green); background: rgba(63, 185, 80, .12); }
.move-site-list .stays .move-site-where { color: var(--muted); background: rgba(139, 148, 158, .12); }
.move-site-list .stays .move-site-name { color: var(--muted); }
.move-site-http { padding: 9px 12px; border: 1px solid rgba(210, 153, 34, .35); border-radius: 8px; background: rgba(210, 153, 34, .08); }
.move-site-http strong { color: #d29922; }
@media (max-width: 560px) {
	.move-site-list li { grid-template-columns: minmax(0, 1fr) auto; }
	.move-site-where { grid-column: 1 / -1; justify-self: start; }
}

/* Copy site: this server or another, and its choices as option cards */
.copy-destination-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .copy-destination-cards { grid-template-columns: 1fr; } .copy-option-nested { margin-left: 20px; } }
.type-card.disabled { opacity: .45; cursor: not-allowed; }
.type-card.disabled:hover { border-color: var(--line); }
.copy-section { min-width: 0; margin: 0; padding: 0; border: 0; }
.copy-section[hidden] { display: none; }
.copy-options { display: grid; gap: 10px; margin: 14px 0 12px; }
/* An option block whose options are all hidden takes no room */
.copy-options:not(:has(> :not([hidden]))) { display: none; }
.copy-option.sql { --option-tone: var(--purple); }
.copy-option.move { --option-tone: var(--orange); }
.copy-option.delete { --option-tone: var(--red); }
.copy-option.stop { --option-tone: var(--blue); }
.copy-option-nested { margin-left: 46px; }
.copy-option .sync-option-text { flex: 1; }
.copy-option::after { content: ""; flex: none; width: 18px; height: 18px; border: 1.5px solid var(--line); border-radius: 5px; transition: background .15s, border-color .15s; }
.copy-option:has(input:checked)::after { content: ""; position: static; color: transparent; border-color: var(--option-tone); background: var(--option-tone) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d1117' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.copy-option:has(input:focus-visible) { outline: 2px solid var(--option-tone); outline-offset: 2px; }
dialog label.copy-option { flex-direction: row; align-items: center; justify-content: flex-start; margin: 0; text-align: left; font-size: inherit; color: inherit; }
dialog label.copy-option[hidden] { display: none; }
dialog label.copy-option-nested { margin-left: 46px; }
@media (max-width: 560px) { dialog label.copy-option-nested { margin-left: 20px; } }
#prod-copy-options, #prod-move-options { display: grid; gap: 10px; }
#prod-copy-options[hidden], #prod-move-options[hidden] { display: none; }
#prod-copy-options > .copy-option:first-child { margin-top: 4px; }
#prod-remove-options { margin-bottom: 4px; }

/* The server's addresses in the header: a click copies one */
.server-ips { display: flex; align-items: stretch; gap: 2px; padding: 2px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 9px; background: rgba(13, 17, 23, .14); }
.server-ips[hidden] { display: none; }
.page-header .server-ip { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; padding: 3px 10px; border: 0; border-radius: 7px; background: transparent; color: #fff; line-height: 1.1; cursor: pointer; transition: background .15s; }
.page-header .server-ip:hover { background: rgba(255, 255, 255, .14); }
.page-header .server-ip:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: 1px; }
.page-header .server-ip + .server-ip { box-shadow: -2px 0 0 -1px rgba(255, 255, 255, .16); }
.server-ip-label { color: rgba(255, 255, 255, .62); font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; transition: color .15s; }
.server-ip-value { font: 500 13px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.server-ip.copied .server-ip-label { color: #8ff0b4; }
@media (max-width: 1000px) { .server-ips { display: none; } }
.copy-option.secure { --option-tone: var(--green); }
.move-site-http.secure { border-color: rgba(63, 185, 80, .35); background: rgba(63, 185, 80, .08); }
.move-site-http.secure strong { color: var(--green); }
#copy-server-dns, #prod-dns { margin: 0 0 12px; }
#copy-server-dns[hidden], #prod-dns[hidden] { display: none; }
.copy-option.disabled { opacity: .55; cursor: not-allowed; }
.copy-option.disabled:hover { border-color: var(--line); }
.https-choice { margin: 2px 0 14px; }

/* An action's window: its steps, and its output only when something went wrong or is asked for */
dialog.task-dialog { width: min(560px, calc(100vw - 32px)); }
.task-dialog .ns-head .ns-icon { transition: background .25s; }
.task-dialog[data-state="done"] .ns-icon { background: linear-gradient(135deg, #2ea043, #3fb950); }
.task-dialog[data-state="warning"] .ns-icon { background: linear-gradient(135deg, #bb8009, #d29922); }
.task-dialog[data-state="failed"] .ns-icon { background: linear-gradient(135deg, #b62324, #f85149); }
.task-state .ico { width: 22px; height: 22px; margin: 0; stroke-width: 2.6; }
.task-spinner { width: 20px; height: 20px; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: update-spin .8s linear infinite; }
#task-status { font-variant-numeric: tabular-nums; }
.task-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 2px; max-height: 40vh; overflow-y: auto; }
.task-steps[hidden] { display: none; }
.task-step { display: flex; align-items: flex-start; gap: 10px; padding: 6px 2px; font-size: 13.5px; color: var(--muted); }
.task-step.active { color: var(--text); font-weight: 600; }
.task-step.failed { color: var(--red); font-weight: 600; }
.task-step.warning { color: #d29922; }
.task-step-mark { flex: none; position: relative; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--line); }
.task-step.done .task-step-mark { border-color: var(--green); background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d1117' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 10px no-repeat; }
.task-step.active .task-step-mark { border-color: var(--blue); border-top-color: transparent; animation: update-spin .8s linear infinite; }
.task-step.failed .task-step-mark { border-color: var(--red); background: var(--red); }
.task-step.warning .task-step-mark { border-color: #d29922; background: #d29922; }
.task-current { margin: 2px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); color: var(--muted); font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-current[hidden] { display: none; }
.task-details { height: min(46vh, 420px); margin: 0 0 12px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #000; overflow: hidden; }
.task-details[hidden] { display: none; }
.task-details .pane { position: static; height: 100%; display: block; }
.task-dialog menu { align-items: center; }
.task-dialog menu .spacer { flex: 1; }
.task-toggle { font-size: 13px; }
@media (max-width: 560px) { .task-details { height: 50vh; } }
/* A finished window that closes by itself: a line runs out under its header */
.task-dialog .ns-head { position: relative; }
.task-dialog .ns-head::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--green); opacity: 0; }
.task-dialog.closing .ns-head::after { opacity: 1; animation: task-closing 1s linear forwards; }
@keyframes task-closing { from { width: 100%; } to { width: 0; } }
@media (prefers-reduced-motion: reduce) { .task-dialog.closing .ns-head::after { animation: none; width: 100%; } }

/* Check service: the state of a site's service */
dialog.service-dialog { width: min(620px, calc(100vw - 32px)); }
.service-dialog .ns-head > div { flex: 1; }
.service-pill { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(139, 148, 158, .16); color: var(--muted); }
.service-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.service-pill.ok { color: var(--green); background: rgba(63, 185, 80, .14); }
.service-pill.ok::before { box-shadow: 0 0 0 3px rgba(63, 185, 80, .22); }
.service-pill.bad { color: var(--red); background: rgba(248, 81, 73, .14); }
.service-pill.busy { color: var(--blue); background: rgba(88, 166, 255, .14); }
.service-pill.busy::before { animation: service-pulse 1s ease-in-out infinite alternate; }
@keyframes service-pulse { from { opacity: .35; } to { opacity: 1; } }
.service-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); transition: opacity .15s; }
.service-dialog.loading .service-facts { opacity: .5; }
.service-fact { display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; background: var(--panel2); min-width: 0; }
.service-fact-label { color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.service-fact-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-note { margin: -4px 0 12px; }
.service-dialog[data-tone="bad"] .service-note { color: var(--red); }
.service-log-panel[hidden] { display: none; }
.service-log { max-height: 34vh; overflow: auto; margin: 0 0 14px; padding: 8px 0; border: 1px solid var(--line); border-radius: 8px; background: #05070a; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.service-log-line { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 1px 12px; color: #c9d1d9; white-space: pre-wrap; overflow-wrap: anywhere; }
.service-log-line.problem { color: #ffa198; background: rgba(248, 81, 73, .08); }
.service-log-time { color: #6e7681; font-variant-numeric: tabular-nums; }
.service-log-empty { padding: 4px 12px; color: var(--muted); }
.service-dialog menu { align-items: center; }
.service-dialog menu .spacer { flex: 1; }
@media (max-width: 560px) { .service-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Processes in the header: actions that run, or ended with a problem; a click opens their window again */
.processes { position: relative; }
#btn-processes { display: inline-flex; align-items: center; gap: 7px; }
#btn-processes[hidden] { display: none; }
.process-indicator { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
#btn-processes.running .process-indicator { width: 12px; height: 12px; background: none; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: update-spin .8s linear infinite; }
#btn-processes.problem:not(.running) .process-indicator { background: #ff7b72; box-shadow: 0 0 0 3px rgba(255, 123, 114, .25); }
.processes-menu { width: min(360px, calc(100vw - 24px)); padding: 6px; }
.processes-menu .menu-group-title { padding: 6px 10px 4px; }
.process-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 60vh; overflow-y: auto; }
.menu .process-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; text-align: left; }
.process-state { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); }
.process-item.running .process-state { border-color: var(--blue); border-top-color: transparent; animation: update-spin .8s linear infinite; }
.process-item.done .process-state { border-color: var(--green); background: var(--green); }
.process-item.failed .process-state { border-color: var(--red); background: var(--red); }
.process-item.warning .process-state { border-color: #d29922; background: #d29922; }
.process-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.process-title { color: var(--text); font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.process-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.process-item.failed .process-sub { color: var(--red); }

/* Environment as four choices in its colours, in place of a select */
.ns-grid > .wide { grid-column: 1 / -1; }
.choice-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.choice-field[hidden] { display: none; }
.choice-label { color: var(--muted); font-size: 12.5px; }
.env-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
dialog label.env-choice { --env-tone: var(--blue); position: relative; flex-direction: row; align-items: center; justify-content: center; gap: 8px; height: 40px; margin: 0; padding: 0 10px;
	border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
dialog label.env-choice.env-test { --env-tone: #d29922; }
dialog label.env-choice.env-staging { --env-tone: var(--purple); }
dialog label.env-choice.env-production { --env-tone: var(--red); }
.env-choice::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--env-tone); opacity: .55; transition: opacity .15s; }
.env-choice input { position: absolute; opacity: 0; pointer-events: none; }
dialog label.env-choice:hover { border-color: color-mix(in srgb, var(--env-tone) 55%, var(--line)); }
dialog label.env-choice:has(input:checked) { border-color: var(--env-tone); background: color-mix(in srgb, var(--env-tone) 13%, var(--panel2)); box-shadow: 0 0 0 1px var(--env-tone) inset; }
.env-choice:has(input:checked)::before { opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--env-tone) 25%, transparent); }
.env-choice:has(input:focus-visible) { outline: 2px solid var(--env-tone); outline-offset: 2px; }
@media (max-width: 560px) { .env-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Each environment in its own colour: the top edge of its card, the left edge of its row in the list */
.env.tone-development { --env-tone: var(--blue); }
.env.tone-test { --env-tone: #d29922; }
.env.tone-staging { --env-tone: var(--purple); }
.env.tone-production { --env-tone: var(--red); }
.env[class*="tone-"] { border-top-color: var(--env-tone); }
.env-row-more-wrap { position: relative; }
.env-row .env-row-more, .env-col-actions .env-row-more { min-width: 30px; padding-left: 8px; padding-right: 8px; font-weight: 700; letter-spacing: .05em; }
.env-row-more-menu { right: 0; top: calc(100% + 6px); min-width: 180px; }
.env-row-more-menu[hidden] { display: none; }
/* The row's menu opens over the rows below it */
.env-targets.list > .env-listed, .env-targets.list > .env-listed > .env-head { overflow: visible; }
.env-targets.list > .env-listed:has(.env-row-more-menu:not([hidden])) { position: relative; z-index: 5; }
.env-row-more-menu { z-index: 30; }
/* The file manager's .list scrolls sideways; the list of environments is not that, and its row menus open over it */
.env-targets.list { overflow: visible; }

/* ---- Server tools: a card per part of the server, its state and what can be done with it */
dialog.server-tools-dialog { width: min(880px, 96vw); }
.server-tools-dialog > .server-tools, .server-tools-dialog > menu { margin-left: 24px; margin-right: 24px; }
.server-tools-dialog > menu { margin: 16px 0 0; }
.server-tools-dialog > menu .cancel-link { margin-right: auto; }
.server-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; min-height: 120px; }
.server-tools-loading { grid-column: 1 / -1; display: grid; place-items: center; padding: 48px 0; color: var(--muted); }
.tool-card { --tone: var(--blue); display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 14px 16px 14px; border: 1px solid var(--line); border-radius: 12px;
	background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 9%, transparent), transparent 55%), var(--panel2); }
.tool-card.tone-purple { --tone: var(--purple); } .tool-card.tone-teal { --tone: #39c5bb; } .tool-card.tone-amber { --tone: #d29922; }
.tool-card.tone-green { --tone: var(--green); } .tool-card.tone-pink { --tone: #db61a2; } .tool-card.tone-blue { --tone: var(--blue); }
.tool-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tool-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--tone);
	background: color-mix(in srgb, var(--tone) 16%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent); }
.tool-icon .ico { width: 18px; height: 18px; margin: 0; }
.tool-title { display: grid; gap: 1px; flex: 1; min-width: 0; }
.tool-title strong { font-size: 14.5px; }
.tool-title small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tool-state { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
	color: var(--muted); background: var(--hover); }
.tool-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tool-state.ok { color: var(--green); background: rgba(63, 185, 80, .12); }
.tool-state.warn { color: #d29922; background: rgba(210, 153, 34, .13); }
.tool-state.bad { color: var(--red); background: rgba(248, 81, 73, .12); }
.tool-text { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.tool-rows { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tool-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 10px; border-radius: 8px; background: rgba(0, 0, 0, .18); font-size: 12.5px; }
.tool-row .tool-row-name { font-weight: 600; white-space: nowrap; }
.tool-row .tool-row-detail { flex: 1; min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tool-row code { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.tool-row .tool-row-action { flex: none; padding: 3px 9px; font-size: 12px; }
.tool-row .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tool-row .dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(63, 185, 80, .15); }
.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 2px; }
.tool-actions button { font-size: 12.5px; padding: 6px 12px; }
.tool-actions .tool-danger { color: var(--red); border-color: rgba(248, 81, 73, .35); }
.tool-actions .tool-danger:hover { background: rgba(248, 81, 73, .1); border-color: rgba(248, 81, 73, .4); }
.server-action-fields { display: grid; gap: 4px; }
.server-action-fields .type-card { cursor: pointer; }
.server-editions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 8px; padding: 0; border: 0; }
.server-editions legend { margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.server-action-danger { margin-top: 10px; padding: 12px 14px; border: 1px solid rgba(248, 81, 73, .35); border-radius: 10px; background: rgba(248, 81, 73, .06); font-size: 13px; }
@media (max-width: 720px) { .server-tools, .server-editions { grid-template-columns: 1fr; } }
/* SFTP in the user editor: where to connect, the password and the keys */
.sftp-area { display: grid; gap: 4px; margin: -4px 0 4px 26px; padding: 12px 14px; border: 1px solid var(--line); border-left: 2px solid rgba(88, 166, 255, .45); border-radius: 0 10px 10px 0; background: var(--panel2); }
.sftp-area[hidden] { display: none; }
.sftp-address { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.sftp-address code { padding: 3px 8px; border-radius: 6px; background: rgba(0, 0, 0, .25); color: var(--blue); font-size: 12px; overflow-wrap: anywhere; }
.sftp-area textarea { min-height: 64px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; resize: vertical; }
.sftp-area .hint { margin-top: 2px; }

/* Options in the action dialogs (Server tools, Servers): the option cards of Sync data, beside the dialog's own label
   layout, which stacks a label's contents */
dialog.newsite label.sync-option.action-option { flex-direction: row; align-items: center; justify-content: flex-start; margin: 0 0 10px; text-align: left; font-size: inherit; color: inherit; }
.action-option.tone-blue { --option-tone: var(--blue); }
.action-option.tone-amber { --option-tone: #d29922; }
.action-option.tone-red { --option-tone: var(--red); }
.action-option.tone-green { --option-tone: var(--green); }
.action-option.tone-red .sync-option-icon, .action-option.tone-amber .sync-option-icon { color: color-mix(in srgb, var(--option-tone) 70%, var(--muted)); }
.action-option:has(input:disabled) { opacity: .45; cursor: default; }
.action-option:has(input:disabled):hover { border-color: var(--line); }
.server-action-fields .action-option:first-child { margin-top: 2px; }
/* Servers: its toolbar as in Users, within the dialog's margins */
.server-tools-dialog > .servers-toolbar { margin: 18px 24px 0; }
.server-tools-dialog > .servers-toolbar + .server-tools { margin-top: 12px; }
/* Add server: the address wide, its SSH port beside it */
dialog.newsite .server-address-row { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
@media (max-width: 560px) { dialog.newsite .server-address-row { grid-template-columns: 1fr; } }

/* The terminal's scrollbar, thin and dim on its dark background (not the light default) */
.xterm .xterm-viewport { scrollbar-width: thin; scrollbar-color: rgba(139, 148, 158, .35) transparent; }
.xterm .xterm-viewport::-webkit-scrollbar { width: 10px; background: transparent; }
.xterm .xterm-viewport::-webkit-scrollbar-track { background: transparent; }
.xterm .xterm-viewport::-webkit-scrollbar-thumb { background: rgba(139, 148, 158, .3); border: 3px solid transparent; border-radius: 10px; background-clip: padding-box; }
.xterm .xterm-viewport::-webkit-scrollbar-thumb:hover { background-color: rgba(139, 148, 158, .55); }

/* Server tools: Update and Remove side by side on a .NET row; a note the SQL install dialog shows */
.tool-row .tool-row-actions { display: inline-flex; flex: none; gap: 6px; margin-left: auto; }
.server-action-note { margin: 0 0 14px; padding: 10px 12px; border: 1px solid rgba(210, 153, 34, .4); border-radius: 9px; background: rgba(210, 153, 34, .08); color: #e3c27a; font-size: 13px; line-height: 1.5; }

/* Scheduled jobs (root's crontab) */
.crontab-dialog .crontab-list, .crontab-dialog .crontab-form { margin: 12px 24px 0; }
.crontab-list { display: grid; gap: 8px; min-height: 80px; padding: 0; list-style: none; }
.crontab-row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.crontab-icon { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: rgba(57, 197, 187, .12); color: #39c5bb; }
.crontab-icon svg { width: 18px; height: 18px; }
.crontab-text { display: grid; flex: 1; gap: 4px; min-width: 0; }
.crontab-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crontab-when strong { font-size: 14px; }
.crontab-when code { color: var(--muted); font-size: 12px; }
.crontab-command { overflow: hidden; color: var(--text); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.crontab-actions { display: flex; flex: none; gap: 6px; }
.crontab-actions button { padding: 4px 10px; font-size: 12.5px; }
.crontab-form { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.crontab-form h3 { margin: 0 0 4px; font-size: 15px; }
.crontab-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.crontab-form input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--text); }
.crontab-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.crontab-presets .chip { padding: 4px 10px; font-size: 12px; }
.crontab-said { margin: 0; color: #8ff0b4; }
.crontab-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 4px; }
.crontab-form-actions .cancel-link { margin-right: auto; }
@media (max-width: 720px) { .crontab-row { flex-wrap: wrap; } .crontab-actions { width: 100%; justify-content: flex-end; } }

/* A tool that cannot be used yet (the backups without SQL Server and the SQL tools): dimmed, its buttons still there */
.tool-card.unavailable .tool-head, .tool-card.unavailable .tool-rows { opacity: .5; }
.tool-card.unavailable .tool-text { color: var(--muted); }
.server-action-confirm { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.server-action-confirm .confirmation-copy { color: var(--text); font-weight: 700; text-decoration: underline dotted; cursor: pointer; }

/* Server tools: one column of groups, each with its buttons beside its state and its rows the full width */
#server-tools-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
#server-tools-list .tool-card { gap: 10px; padding: 12px 14px; }
#server-tools-list .tool-head { flex-wrap: wrap; row-gap: 8px; }
#server-tools-list .tool-head .tool-actions { flex: none; margin: 0; padding: 0; }
#server-tools-list .tool-text { margin-left: 48px; }
#server-tools-list .tool-rows { margin-left: 48px; }
#server-tools-list .tool-row { padding: 8px 12px; }
#server-tools-list .tool-row .tool-row-detail { white-space: normal; }
#server-tools-list .tool-row .tool-row-action.tool-danger { color: var(--red); border-color: rgba(248, 81, 73, .35); }
@media (max-width: 720px) { #server-tools-list .tool-text, #server-tools-list .tool-rows { margin-left: 0; } }

/* Import from Windows: a row per folder in the share, and a filter above them */
.windows-list-button { justify-content: flex-end; }
.windows-list-button button { width: 100%; }
.windows-filter { display: grid; gap: 8px; margin-bottom: 10px; }
.windows-filter-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.windows-filter-kind { padding: 3px 10px; border-radius: 999px; font-size: 12px; background: rgba(255, 255, 255, .03); }
.windows-filter-kind.on { border-color: var(--blue); background: rgba(88, 166, 255, .15); color: var(--text); }
.windows-filter-kind .count { color: var(--muted); }
.windows-sites { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; margin-bottom: 12px; padding: 2px 4px 4px 0; }
.windows-site { position: relative; flex: none; display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 240px); align-items: center; gap: 14px;
	box-sizing: border-box; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .02);
	cursor: pointer; transition: border-color .15s, background .15s; }
.windows-site:hover { border-color: rgba(88, 166, 255, .45); }
.windows-site.chosen { border-color: var(--blue); background: rgba(88, 166, 255, .07); }
.windows-site[hidden] { display: none; }
.windows-site.off { opacity: .55; cursor: default; }
.windows-site.off:hover { border-color: var(--line); }
/* A checkbox of its own: rounded, blue with a white tick when chosen */
dialog .windows-check { appearance: none; -webkit-appearance: none; display: grid; place-content: center; width: 22px; height: 22px; min-height: 0;
	margin: 0; padding: 0; border: 1.5px solid var(--muted); border-radius: 7px; background: transparent; cursor: pointer; transition: background .15s, border-color .15s; }
dialog .windows-check::before { content: ""; width: 11px; height: 11px; transform: scale(0); transition: transform .12s;
	clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); background: #fff; }
dialog .windows-check:checked { border-color: var(--blue); background: var(--blue); }
dialog .windows-check:checked::before { transform: scale(1); }
dialog .windows-check:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
dialog .windows-check:disabled { border-color: var(--line); cursor: default; }
.windows-site-text { display: grid; gap: 5px; min-width: 0; }
.windows-site-text strong { overflow-wrap: anywhere; font-size: 14px; }
.windows-site-meta { color: var(--muted); font-size: 12px; }
.windows-site-kind { position: absolute; top: 7px; right: 10px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 600;
	letter-spacing: .02em; white-space: nowrap; background: rgba(255, 255, 255, .06); color: var(--muted); pointer-events: none; }
.windows-site { padding-top: 14px; }
.windows-site-kind.project { background: rgba(88, 166, 255, .15); color: var(--blue); }
.windows-site-kind.build { background: rgba(163, 113, 247, .15); color: var(--purple); }
.windows-site-kind.html { background: rgba(63, 185, 80, .15); color: var(--green); }
.windows-site-kind.framework { background: rgba(210, 153, 34, .15); color: #d29922; }
.windows-site-fields { display: grid; gap: 6px; cursor: default; }
dialog .windows-field { display: grid; gap: 2px; margin: 0; font-size: 11px; color: var(--muted); }
dialog .windows-field input, dialog .windows-field select { width: 100%; min-height: 0; padding: 5px 8px; font-size: 13px; }
@media (max-width: 700px) { .windows-site { grid-template-columns: 22px minmax(0, 1fr); } .windows-site-fields { grid-column: 2; } }
.windows-imported { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 10px 12px;
	border: 1px solid var(--line); border-radius: 10px; }
.windows-imported-text { display: grid; gap: 2px; font-size: 13px; min-width: 0; }

.windows-list { width: 100%; margin: 4px 0 6px; }
#windows-login-fields[hidden], .server-kind-fields[hidden] { display: none; }
.tool-icon.os-icon svg { width: 22px; height: 22px; }

/* A server chosen from Servers: its fields are hidden */
#prod-remote-fields[hidden], #prod-windows-fields[hidden], #copy-server-fields[hidden] { display: none; }
.server-picker-row { margin-bottom: 10px; }
/* The server picker at the top of Add environment, under the kind of server */
.server-pick { margin: 14px 0 22px; }
.server-pick[hidden], .ns-section[hidden] { display: none; }
.server-pick .server-picker-row { margin-bottom: 0; }
/* Copy and Import from Windows: the alias and its explanation come before the list, with room under them */
#form-windows-move .hint + .ns-section, #windows-sites-section > label + .ns-section { margin-top: 18px; }
/* What is copied or imported and not taken over yet: at the top of the dialog, before anything is chosen */
#windows-move-moved, #windows-imported { margin: 0 0 16px; }
/* A long step (a share's path) is cut with an ellipsis, never scrolled sideways */
.processes-menu { overflow-x: hidden; }
.menu .process-item { box-sizing: border-box; min-width: 0; max-width: 100%; }
.process-text { flex: 1 1 auto; overflow: hidden; }
