: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; }
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 .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-logo { display: block; width: 128px; height: auto; aspect-ratio: 3507 / 2480; object-fit: contain; margin-bottom: 18px; }
.login-brand-name { margin-bottom: 10px; font-size: 10px; font-weight: 700; letter-spacing: .18em; 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 { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 11px; }
.login-footer span { margin: 0 8px; opacity: .5; }
@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 .logo { display: block; flex: none; width: 64px; height: auto; aspect-ratio: 3507 / 2480; object-fit: contain; }
.brand h1 { font-size: 17px; line-height: 1.1; }
.brand .host { display: block; font-size: 12px; }
.page-header #search { min-width: 280px; background: rgba(0, 0, 0, .25); border-color: rgba(255, 255, 255, .25); color: #fff; border-radius: 18px; padding-left: 16px; }
.page-header #search::placeholder { color: rgba(255, 255, 255, .65); }
.page-header #search:focus { background: rgba(0, 0, 0, .4); border-color: rgba(255, 255, 255, .5); }
.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; }
.toolbar .stats { margin: 0; }
.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; }
.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 { 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 */
.site-targets-head .targets-search { flex: 0 1 340px; min-width: 180px; height: 36px; margin-left: auto; padding: 0 16px; border-radius: 18px; background: rgba(0, 0, 0, .25); }
.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: 14px; }

#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 { 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-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 > button.push-right { margin-left: auto; }
.actions > button.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; }
.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: 7px; height: 26px; display: flex; align-items: center; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.env > .actions:last-child:not(.quick)[data-group]::before { top: 13px; }
@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; }
.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: 12px; }
.env > .actions:not(.quick):has(+ .actions:last-child:not(.quick))[data-group]::before { top: 13px; }
.env > .actions:not(.quick) + .actions:last-child:not(.quick) { margin-top: 14px; padding-top: 12px; }
.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; }
