/* Mountaintop web console. Palette and type from the Mountaintop Software
   brand sheet (v1): Summit Navy #1B2A4A, Glacier Teal #2BB3A3, Snowline White;
   Montserrat and IBM Plex Mono (self-hosted, SIL OFL; see fonts/). */

@font-face { font-family: "Montserrat"; src: url(fonts/montserrat-latin-wght.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/ibm-plex-mono-latin-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/ibm-plex-mono-latin-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light;
  --navy: #1B2A4A; --teal: #2BB3A3; --night: #14203A;
  --bg: #F3F5F8; --surface: #FFFFFF; --ink: #1B2A4A; --muted: #5A6781; --line: #DCE2EB;
  --accent: #1E8A7D;            /* teal dark enough for text on light */
  --btn: #1B2A4A; --btn-ink: #FFFFFF;
  --ok: #1E8A7D; --warn: #9A6700; --bad: #B3261E;
  --logo-shade: #1B2A4A; --logo-snow: #FFFFFF; --logo-name: #1B2A4A;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0E1628; --surface: #16213A; --ink: #E8EEF6; --muted: #9AA7BF; --line: #26324D;
    --accent: #4FCBBB; --btn: #4FCBBB; --btn-ink: #0E1628;
    --ok: #4FCBBB; --warn: #E0B04F; --bad: #F08B83;
    --logo-shade: #E8EEF6; --logo-snow: #0E1628; --logo-name: #E8EEF6;
  }
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 15px/1.55 Montserrat, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: .15em; }
code, pre { font-family: var(--mono); font-size: .9em; }

/* Logo: colors from variables so one SVG fits every background. */
svg.logo { display: block; height: 100%; width: auto; }
.logo-shade { fill: var(--logo-shade); }
.logo-sun { fill: var(--teal); }
.logo-snow { stroke: var(--logo-snow); }
.logo-name { fill: var(--logo-name); font-family: Montserrat, "Helvetica Neue", Arial, sans-serif; }
.logo-sub { fill: var(--teal); font-family: Montserrat, "Helvetica Neue", Arial, sans-serif; }

/* Top bar: always navy, with the dark-background logo. */
header.top { display: flex; align-items: center; gap: 2rem; padding: 0 1.5rem; height: 5rem;
  background: var(--night); color: #E8EEF6; flex-wrap: wrap;
  --logo-shade: #E8EEF6; --logo-snow: var(--night); --logo-name: #E8EEF6; }
header.top .brand { height: 3.8rem; display: block; }
header.top nav { display: flex; gap: 1.5rem; flex: 1; align-self: stretch; }
header.top nav a { color: #9AA7BF; text-decoration: none; font-weight: 600; font-size: 1rem;
  display: flex; align-items: center; border-bottom: 3px solid transparent; padding-top: 3px; }
header.top nav a:hover { color: #E8EEF6; }
header.top nav a.on { color: #FFFFFF; border-bottom-color: var(--teal); }
header.top .who { color: #9AA7BF; font-size: .85rem; display: flex; gap: 1rem; align-items: center; }
header.top .who button.link { color: #9AA7BF; }
header.top .who button.link:hover { color: #FFFFFF; }

main { max-width: 76rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
main.narrow { max-width: 26rem; padding-top: 10vh; }
.brand-stacked { height: 8.5rem; margin: 0 auto 1.75rem; display: flex; justify-content: center; }

h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: .01em; margin: 0 0 .35rem; }
h1 + p.muted { margin-top: 0; margin-bottom: 1.5rem; }
h2 { font-size: .75rem; font-family: var(--mono); font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 2.5rem 0 .75rem; }
.muted { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; }
.stack > * + * { margin-top: 1rem; }
.stack > h1 + * { margin-top: .5rem; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: .75rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { white-space: nowrap; font: 500 .7rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--bg); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--teal) 5%, transparent); }
td:first-child { font-weight: 600; }
.empty { padding: 2rem; text-align: center; color: var(--muted); font-weight: 400 !important; }
td.actions { white-space: nowrap; text-align: right; }
td { white-space: nowrap; }
td.actions form { display: inline-block; margin-left: .4rem; }

form.inline { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
input, select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: .5rem .7rem; min-width: 14rem; width: 100%; }
form.inline input, form.inline select { width: auto; }
input:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: transparent; }
button { font: 600 .9rem Montserrat, sans-serif; border: 0; border-radius: 6px; padding: .6rem 1.1rem;
  background: var(--btn); color: var(--btn-ink); cursor: pointer; }
button:hover { filter: brightness(1.15); }
button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.stack > form > button, .card form button { width: 100%; padding: .7rem; }
button.link { background: none; color: var(--muted); padding: 0; font-weight: 500; text-decoration: underline; width: auto !important; }
button.danger { background: none; color: var(--bad); border: 1px solid var(--line); padding: .3rem .7rem; font-size: .8rem; width: auto !important; }
button.danger:hover { border-color: var(--bad); filter: none; }

.pill { white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; font: 500 .75rem/1 var(--mono);
  padding: .3rem .6rem; border-radius: 999px; background: color-mix(in srgb, currentColor 12%, transparent); }
.pill::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); } .pill.muted { color: var(--muted); }

.flash { padding: 1rem 1.25rem; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid var(--teal);
  background: var(--surface); margin-bottom: 1.5rem; }
.flash.error { border-left-color: var(--bad); color: var(--bad); }
.flash p { margin: 0; }
details.howto { margin: 0 0 1rem; }
details.howto > summary { display: inline-block; cursor: pointer; font: 600 .8rem Montserrat, sans-serif; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; padding: .35rem .8rem; list-style: none; }
details.howto > summary::-webkit-details-marker { display: none; }
details.howto > summary::before { content: "▸ "; }
details.howto[open] > summary::before { content: "▾ "; }
details.howto > summary:hover { border-color: var(--ink); }
details.howto > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
details.howto pre.secret { margin-bottom: .5rem; }
pre.secret { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .8rem 1rem;
  overflow-x: auto; user-select: all; white-space: pre-wrap; word-break: break-all; margin: 0; }

@media (max-width: 720px) {
  header.top { height: auto; padding: .75rem 1rem; gap: .75rem; }
  header.top nav { order: 3; width: 100%; flex: none; gap: 1.1rem; }
  header.top nav a { padding: .4rem 0; }
  main { padding: 1.25rem 1rem 3rem; }
  table { font-size: .9rem; } th, td { padding: .6rem .7rem; }
  header.top .brand { height: 3rem; }
  form.inline input, form.inline select { width: 100%; }
  form.inline > div, form.inline > button { flex: 1 1 100%; }
}

/* Slice 2: sources and migrations. */
.small { font-size: .8rem; }
td .small { font-weight: 400; margin-top: .15rem; }
.wrap { white-space: normal; min-width: 10rem; max-width: 14rem; }
a.btn { display: inline-block; font: 600 .8rem Montserrat, sans-serif; text-decoration: none; background: var(--btn); color: var(--btn-ink);
  border-radius: 6px; padding: .3rem .75rem; margin-left: .4rem; vertical-align: middle; }
a.btn:hover { filter: brightness(1.15); }
button.quiet { color: var(--ink); }
button.quiet:hover { border-color: var(--ink); }
button.primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
button.primary:hover { filter: brightness(1.15); border-color: var(--btn); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .35rem; }
.licenses { padding: .25rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; white-space: nowrap; }
form.card > button, form.stack > button { width: auto !important; align-self: flex-start; }
form.stack.card { max-width: 40rem; }
form.stack.card select, form.stack.card input { max-width: 100%; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .9rem 1.5rem; }
.facts > div > span:first-child { display: block; font: 500 .68rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .15rem; }
.facts .bad { color: var(--bad); grid-column: 1 / -1; }
.facts ul.platforms { margin: 0; padding-left: 1.1rem; }
.facts ul.platforms li + li { margin-top: .1rem; }
.actions-row { margin-top: 1rem; display: flex; gap: .5rem; }
.actions-row form { margin: 0; }
.actions-row button { font-size: .9rem; padding: .5rem 1rem; }
pre.log { background: var(--night); color: #E8EEF6; border-radius: 10px; padding: 1rem 1.25rem; max-height: 32rem; overflow: auto;
  font-size: .8rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; margin: 0 0 1rem; }

/* UAT test copies. */
.tag { font: 500 .7rem/1 var(--mono); padding: .25rem .45rem; border-radius: 4px; border: 1px solid var(--teal); color: var(--accent); margin-left: .25rem; }
.wrap-text { max-width: 44rem; margin-top: .6rem; }

/* The migrated VM's network (static IPs and ACLs). Fields show and hide with
   :has(), so the form needs no script. */
fieldset.net { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem 1.25rem; margin: 0; }
fieldset.net > * + * { margin-top: .9rem; }
fieldset.net legend { font: 600 .8rem Montserrat, sans-serif; padding: 0 .4rem; }
fieldset.sizes { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem 1.25rem; margin: 0; }
fieldset.sizes legend { font: 600 .8rem Montserrat, sans-serif; padding: 0 .4rem; }
fieldset.sizes > * + * { margin-top: .5rem; }
#appliance-setup input[aria-invalid=true] { border-color: var(--bad); }
.choices { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; }
.choices-label { font-size: .8rem; font-weight: 600; color: var(--muted); }
label.choice { display: flex; align-items: center; gap: .45rem; margin: 0; font-size: .9rem; font-weight: 500; color: var(--ink); }
label.choice + label.choice { margin-top: .35rem; }
.choices label.choice + label.choice { margin-top: 0; }
label.choice input { width: auto; min-width: 0; margin: 0; accent-color: var(--teal); }
label.choice input:disabled + * , label.choice:has(input:disabled) { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .9rem 1.25rem; }
.mono { font-family: var(--mono); font-size: .85em; }
.when-static, .when-fixed, .when-source, .when-acls { display: none; }
fieldset.net:has(input[name=ipv4][value=static]:checked) .when-static { display: grid; }
fieldset.net:has(input[name=ipv4][value=static]:checked) p.when-static,
fieldset.net:has(input[name=ipv4][value=source]:checked) p.when-source { display: block; }
fieldset.net:has(input[name=ipv4][value=static]:checked) .when-fixed,
fieldset.net:has(input[name=ipv4][value=source]:checked) .when-fixed { display: grid; }
fieldset.net:has(input[name=acl_mode][value=some]:checked) .when-acls { display: block; }
table.rules { border: 1px solid var(--line); border-radius: 6px; }
table.rules th, table.rules td { padding: .4rem .5rem; }
table.rules input, table.rules select { min-width: 5rem; padding: .35rem .5rem; }
details.new-acl button { width: auto !important; }
@media (max-width: 720px) { table.rules { display: block; overflow-x: auto; } }
form.cutover { display: inline-flex; align-items: center; gap: .6rem; }
form.cutover label.choice { white-space: nowrap; color: var(--muted); }

/* Sources: inventory by move group. */
.add-sources { margin: 1rem 0 1.5rem; }
.add-sources form.inline + details { margin-top: .75rem; }
details.group { margin-top: 1.25rem; }
details.group > summary { cursor: pointer; display: flex; align-items: center; gap: .75rem; padding: .4rem 0; list-style: none; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::before { content: "▸"; color: var(--muted); }
details.group[open] > summary::before { content: "▾"; }
details.group > summary .group-name { font: 600 1rem Montserrat, sans-serif; }
details.group > summary form.group-delete { margin-left: auto; }
details.group > .table-wrap { margin-top: .5rem; }
form.row-pick { display: inline-flex !important; align-items: center; gap: .3rem; }
form.row-pick select { min-width: 0; width: auto; padding: .3rem .5rem; font-size: .8rem; }
form.row-pick button.primary { font-size: .8rem; padding: .3rem .75rem; width: auto !important; border: 1px solid var(--btn); border-radius: 6px; }

/* Move groups screen. */
form.add-group { margin: 1rem 0 .5rem; }
details.group .group-body { margin-top: .5rem; }
form.inline-mini { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
form.inline-mini input { min-width: 12rem; width: auto; padding: .35rem .6rem; }

/* Wide pages (Sources, Move groups, Migrations): tables use the window, and a
   row's actions wrap instead of forcing a horizontal scroll. */
main.wide { max-width: 140rem; }
td.actions:has(.row-actions) { white-space: normal; width: 1%; min-width: 22rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; align-items: center; }
.row-actions form { margin: 0 !important; }
.agent-old { color: var(--bad); font-weight: 600; }

/* Support page. */
td.wrap-cell { white-space: normal; min-width: 20rem; }
.support-facts { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }

/* Sync schedule: the date picker. */
fieldset.dates { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .35rem .9rem; border: 1px solid var(--line); border-radius: 6px; padding: .6rem .8rem; }
fieldset.dates legend { padding: 0 .3rem; }
.actions-row a.btn { margin-left: 0; padding: .5rem 1rem; font-size: .9rem; }
fieldset.dates label.choice + label.choice { margin-top: 0; }

/* Release notes (Support). */
.release-item h2 { margin: 0 0 .4rem; font-family: inherit; font-size: 1.1rem; font-weight: 700; letter-spacing: 0; text-transform: none; }
.release-item h2 a { text-decoration: none; }
.release-item p { margin: 0; }
.release-notes { max-width: 52rem; line-height: 1.6; }
.release-notes h2 { margin: 2.25rem 0 .5rem; font-family: inherit; font-size: 1.2rem; font-weight: 700; line-height: 1.3;
  letter-spacing: 0; text-transform: none; color: var(--ink); }
.release-notes table { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin: 1rem 0; }
.release-notes td { white-space: normal; vertical-align: top; }
.release-notes li + li { margin-top: .35rem; }
@media print {
  :root { --bg: #FFFFFF; --surface: #FFFFFF; --ink: #000000; --muted: #333333; --line: #BBBBBB; }
  header.top, .no-print { display: none !important; }
  body { background: #FFFFFF; color: #000000; }
  main { padding: 0; max-width: none; }
  .release-notes { max-width: none; }
  .release-notes h2 { break-after: avoid; }
  .release-notes table, .release-notes tr { break-inside: avoid; }
  a { color: inherit; }
}

/* Appliance upgrade offer (Appliances page). */
form.inline-form { display: inline; margin-left: .4rem; }
button.small-btn { padding: .15rem .6rem; font-size: .75rem; }
